Skip to content

Commit

Permalink
Merge pull request Homebrew#367 from colindean/colindean/intermittent…
Browse files Browse the repository at this point in the history
…-test-failures

Fixes flakey tests

First merge as a maintainer!
  • Loading branch information
colindean authored Sep 10, 2018
2 parents bc97597 + 56fd665 commit bebdc64
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/bundle/brew_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def reset!
Bundle::BrewServices.reset!
@formulae = nil
@formula_aliases = nil
@formula_oldnames = nil
end

def formulae
Expand Down
7 changes: 5 additions & 2 deletions spec/brew_dumper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@
end

context "#formula_oldnames" do
it "works" do
before do
Bundle::BrewDumper.reset!
formula_info = [{
name: "a",
full_name: "homebrew/versions/a",
Expand All @@ -640,8 +641,10 @@
pinned?: false,
outdated?: false,
}]
Bundle::BrewDumper.reset!
allow(Bundle::BrewDumper).to receive(:formulae_info).and_return(formula_info)
end

it "works" do
expect(Bundle::BrewDumper.formula_oldnames["aold"]).to eql "homebrew/versions/a"
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/brew_installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def do_install
context ".formula_installed_and_up_to_date?" do
before do
Bundle::BrewDumper.reset!
Bundle::BrewInstaller.reset!
allow(Bundle::BrewInstaller).to receive(:outdated_formulae).and_return(%w[bar])
allow(Bundle::BrewDumper).to receive(:formulae).and_return [
{
Expand Down
2 changes: 1 addition & 1 deletion spec/cleanup_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
allow(Bundle::Commands::Cleanup).to receive(:taps_to_untap).and_return([])
expect(Bundle::Commands::Cleanup).to receive(:system_output_no_stderr).and_return("")
allow(ARGV).to receive(:force?).and_return(true)
ARGV << "--zap"
allow(ARGV).to receive(:include?).with("--zap").and_return(true)
end

it "uninstalls casks" do
Expand Down

0 comments on commit bebdc64

Please sign in to comment.