Skip to content

Commit

Permalink
test_formula: improve test_migration_needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vladshablinsky committed Jul 1, 2016
1 parent edaf430 commit de576ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Library/Homebrew/test/test_formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def test_migration_needed
f.instance_variable_set(:@tap, CoreTap.instance)

oldname_prefix = HOMEBREW_CELLAR/"oldname/2.20"
newname_prefix = HOMEBREW_CELLAR/"newname/2.10"
oldname_prefix.mkpath
oldname_tab = Tab.empty
oldname_tab.tabfile = oldname_prefix.join("INSTALL_RECEIPT.json")
Expand All @@ -58,8 +59,13 @@ def test_migration_needed
oldname_tab.write

assert_predicate f, :migration_needed?

newname_prefix.mkpath

refute_predicate f, :migration_needed?
ensure
oldname_prefix.parent.rmtree
newname_prefix.parent.rmtree
end

def test_installed?
Expand Down

0 comments on commit de576ed

Please sign in to comment.