Add test for reporting tap updates

This commit is contained in:
Jack Nagel 2014-07-26 20:11:53 -05:00
parent 908d7bdecf
commit 5b8e564d70
2 changed files with 30 additions and 0 deletions

View File

@ -43,3 +43,15 @@ update_git_diff_output_with_changed_filetype: |
update_git_diff_output_with_restructured_tap: | update_git_diff_output_with_restructured_tap: |
R100 git.rb Formula/git.rb R100 git.rb Formula/git.rb
R100 lua.rb Formula/lua.rb R100 lua.rb Formula/lua.rb
update_git_diff_output_with_tap_formulae_changes: |
M Rakefile
M README.md
M Requirements/some_requirement.rb
D another_ruby_file.rb
A a_ruby_file.rb
A CONTRIBUTING.md
M Formula/git.rb
A Formula/lua.rb
M lib/not_a_formula.rb
A lib/not_a_formula2.rb
D lib/not_a_formula3.rb

View File

@ -100,4 +100,22 @@ class UpdaterTests < Homebrew::TestCase
assert_equal %w{foo/bar/git foo/bar/lua}, @report.select_formula(:A) assert_equal %w{foo/bar/git foo/bar/lua}, @report.select_formula(:A)
assert_equal %w{foo/bar/git foo/bar/lua}, @report.select_formula(:D) assert_equal %w{foo/bar/git foo/bar/lua}, @report.select_formula(:D)
end end
def test_update_homebrew_with_tap_formulae_changes
repo = HOMEBREW_LIBRARY.join("Taps", "foo", "bar")
@updater = UpdaterMock.new(repo)
repo.join("Formula").mkpath
perform_update("update_git_diff_output_with_tap_formulae_changes")
assert_equal %w{foo/bar/lua}, @report.select_formula(:A)
assert_equal %w{foo/bar/git}, @report.select_formula(:M)
assert_empty @report.select_formula(:D)
assert_empty @report.removed_tapped_formula
assert_equal [repo.join("Formula", "lua.rb")],
@report.new_tapped_formula
assert_equal [repo.join("Formula", "git.rb")],
@report.tapped_formula_for(:M)
end
end end