diff options
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/fixtures/updater_fixture.yaml | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_update_report.rb | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/Library/Homebrew/test/fixtures/updater_fixture.yaml b/Library/Homebrew/test/fixtures/updater_fixture.yaml index b978bf5d6..06a6a0c7f 100644 --- a/Library/Homebrew/test/fixtures/updater_fixture.yaml +++ b/Library/Homebrew/test/fixtures/updater_fixture.yaml @@ -45,6 +45,8 @@ update_git_diff_output_with_formula_rename: | update_git_diff_output_with_restructured_tap: | R100 git.rb Formula/git.rb R100 lua.rb Formula/lua.rb +update_git_diff_output_with_formula_rename_and_restructuring: | + R100 xchat.rb Formula/xchat2.rb update_git_diff_simulate_homebrew_php_restructuring: | R100 Formula/git.rb Abstract/git.rb R100 Formula/lua.rb Abstract/lua.rb diff --git a/Library/Homebrew/test/test_update_report.rb b/Library/Homebrew/test/test_update_report.rb index b7cdb454b..2686e85ce 100644 --- a/Library/Homebrew/test/test_update_report.rb +++ b/Library/Homebrew/test/test_update_report.rb @@ -85,8 +85,23 @@ class ReportTests < Homebrew::TestCase tap.path.join("Formula").mkpath perform_update("update_git_diff_output_with_restructured_tap") - assert_equal %w[foo/bar/git foo/bar/lua], @hub.select_formula(:A) + assert_empty @hub.select_formula(:A) + assert_empty @hub.select_formula(:D) + assert_empty @hub.select_formula(:R) + ensure + tap.path.parent.rmtree + end + + def test_update_homebrew_with_formula_rename_and_restructuring + tap = Tap.new("foo", "bar") + @reporter = ReporterMock.new(tap) + tap.path.join("Formula").mkpath + tap.stubs(:formula_renames).returns("xchat" => "xchat2") + + perform_update("update_git_diff_output_with_formula_rename_and_restructuring") + assert_empty @hub.select_formula(:A) assert_empty @hub.select_formula(:D) + assert_equal [%w[foo/bar/xchat foo/bar/xchat2]], @hub.select_formula(:R) ensure tap.path.parent.rmtree end @@ -98,7 +113,8 @@ class ReportTests < Homebrew::TestCase perform_update("update_git_diff_simulate_homebrew_php_restructuring") assert_empty @hub.select_formula(:A) - assert_equal %w[foo/bar/git foo/bar/lua], @hub.select_formula(:D) + assert_empty @hub.select_formula(:D) + assert_empty @hub.select_formula(:R) ensure tap.path.parent.rmtree end |
