diff options
| author | phinze | 2013-07-08 19:56:43 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2013-07-09 20:52:51 -0500 | 
| commit | 90e3fd0f4350d291c28b8551ba10bedaf54315d5 (patch) | |
| tree | 3e55acf44382a29acdce68dedcd2826b39fab6f9 /Library/Homebrew/test/test_updater.rb | |
| parent | 39520822ccb835553513ae1b5324fb5f580c6b2b (diff) | |
| download | homebrew-90e3fd0f4350d291c28b8551ba10bedaf54315d5.tar.bz2 | |
Properly define tapped formulae in update
A tapped formula is a ruby file present:
  - in the root of the tap
  - in directory of the tap called Formula
  - in a directory of the tap called HomebrewFormula
And nowhere else. This corrects an overzealous definition of tapped
formula in the updater. (the correct definition has been in Pathname
since e613cbe5783cea2abb8100b56c22126a1ab6b9f2)
Refs #19743.
Closes #21087.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/test/test_updater.rb')
| -rw-r--r-- | Library/Homebrew/test/test_updater.rb | 24 | 
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_updater.rb b/Library/Homebrew/test/test_updater.rb index 20aba015a..1464e1084 100644 --- a/Library/Homebrew/test/test_updater.rb +++ b/Library/Homebrew/test/test_updater.rb @@ -102,4 +102,28 @@ class UpdaterTests < Test::Unit::TestCase        assert_equal %w{ shapelib }, report.select_formula(:R)      end    end + +  def test_update_homebrew_with_tapped_formula_changes +    diff_output = fixture('update_git_diff_output_with_tapped_formulae_changes') +    HOMEBREW_REPOSITORY.cd do +      updater = UpdaterMock.new +      updater.in_repo_expect("git checkout -q master") +      updater.in_repo_expect("git rev-parse -q --verify HEAD", "1234abcd") +      updater.in_repo_expect("git config core.autocrlf false") +      updater.in_repo_expect("git pull -q origin refs/heads/master:refs/remotes/origin/master") +      updater.in_repo_expect("git rev-parse -q --verify HEAD", "3456cdef") +      updater.in_repo_expect("git diff-tree -r --raw -M85% 1234abcd 3456cdef", diff_output) +      updater.pull! +      report = Report.new +      report.merge!(updater.report) + +      assert updater.expectations_met? +      assert_equal [ +        Pathname('someuser-sometap/Formula/antiword.rb'), +        Pathname('someuser-sometap/HomebrewFormula/lua.rb'), +        Pathname('someuser-sometap/custom-formula.rb'), +      ], report.tapped_formula_for(:A) +    end + +  end  end  | 
