38 Commits

Author SHA1 Message Date
Jack Nagel
3f3b7746dd Fix another filesystem leak in updater tests 2015-02-15 12:54:03 -05:00
Jack Nagel
b160cc9bb6 Handle tap file renames that remove a file from the formula directory 2014-07-31 15:58:03 -05:00
Jack Nagel
5b8e564d70 Add test for reporting tap updates 2014-07-26 20:11:53 -05:00
Jack Nagel
908d7bdecf Clean up updater tests 2014-07-26 20:11:53 -05:00
Jack Nagel
2b90995c3e Only populate the report with formula paths 2014-07-26 20:11:53 -05:00
Jack Nagel
802775078c Separate reading and parsing the diff 2014-07-26 20:11:53 -05:00
Jack Nagel
6baf357f8c update: remove unused rename detection
Right now this code only produces false positives. When we have real
support for renames, we can implement it more carefully.

Closes Homebrew/homebrew#31126.
2014-07-25 12:28:05 -05:00
Jack Nagel
2cf116464d update: simplify diff parsing 2014-07-25 12:25:58 -05:00
Jack Nagel
191e017d56 Add inspect to mock updater so test failures are readable 2014-07-03 12:57:16 -05:00
Jack Nagel
7cd31377a4 Convert update report to use composition 2014-06-27 21:58:15 -05:00
Jack Nagel
3dbcba0c03 Call original backtick using super 2014-06-23 18:50:55 -05:00
Jack Nagel
8d12684efe Pass repository path into the updater 2014-06-23 18:41:50 -05:00
Jack Nagel
58a75b0f71 Use assert_predicate 2014-06-18 20:34:09 -05:00
Jack Nagel
982e9239b8 Use a custom test class so we can avoid monkeypatching 2014-06-18 20:32:51 -05:00
Jack Nagel
ddc615366c Use assert_empty 2014-06-11 12:22:29 -05:00
Jack Nagel
0505582507 Rename TEST_FOLDER to TEST_DIRECTORY 2014-06-10 21:49:41 -05:00
Jack Nagel
dbe82909a3 Remove ABS__FILE constant from test environment 2014-06-10 21:46:29 -05:00
Jack Nagel
df7756aeb9 Pull mock initialization code into initialize 2014-06-10 20:04:51 -05:00
Jack Nagel
65673d60c1 Move updater mock into test class namespace 2014-06-10 20:03:37 -05:00
Jack Nagel
b40a3413e3 Pass around only absolute paths when dealing with taps 2014-04-25 18:36:31 -05:00
Tsukasa OMOTO
54004a4759 Make the on-disk representation of taps unambiguous
This commit supports "-" and "_" in names of user and repository.

Closes Homebrew/homebrew#28203.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-04-24 17:10:41 -05:00
Jack Nagel
07b7abdc7a Add some missing test cases for brew update 2013-11-14 11:10:43 -06:00
Jack Nagel
9b51f986c8 Remove duplication in updater tests 2013-07-09 22:12:08 -05:00
phinze
9a94a77fa3 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 Homebrew/homebrew#19743.
Closes Homebrew/homebrew#21087.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-07-09 20:52:51 -05:00
Jack Nagel
c8f2d41fe4 Remove extra require 2013-04-13 20:07:14 -05:00
Jack Nagel
0d45c3c0f2 Suppress uninitialized instance variable warnings 2013-03-28 17:37:29 -05:00
Jack Nagel
93f8c71e21 tests: clean up whitespace
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
90dbb8a141 Prune some requires from test files
testing_env already requires utils; set up the ARGV and ENV extensions
there as well.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-04 22:47:34 -05:00
Jack Nagel
5d84df0210 tests: bring brew update tests up to date
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-04-14 00:00:04 -05:00
Jack Nagel
19a0aa51a1 Adjust updater tests for git config calls
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-05 12:35:55 -06:00
Jack Nagel
dec66e951a update: correct failing tests
Commit dec4b73aa0 ("Allow `brew update --rebase`") changed the format of
the `git pull` command slightly, introducing an extra space (to allow
for the --rebase option), so let's update the test expectations for this.

We still need to write tests for '--rebase', but in the meantime they
once again pass for the normal case.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-21 17:37:36 -05:00
Jack Nagel
c8d4af5611 update: bring tests up-to-date
The tests for update have been neglected during the last few rounds of
changes, so fix them up.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-02 00:55:20 -05:00
Mislav Marohnić
8c521ca3d0 refactor update command to use git diff instead of parsing pull output
This fixes reporting of which formulae changed in git versions where `pull`
output is not compatible.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-06-14 14:47:39 -07:00
Mislav Marohnić
5fdb145e76 enable updater tests to be run on their own
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-06-14 14:47:33 -07:00
Max Howell
768910283a Refactor the brew command into one file per command
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.

But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.

If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.

Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
2011-03-12 11:55:02 -08:00
David Porter
4da905b7fb Fix the update tests
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-05-12 09:20:15 -07:00
Adam Vandenberg
9d127ac3d5 Move updater tests to separate file. 2010-04-06 08:27:10 -07:00
Adam Vandenberg
a309403d8a Update test suite.
* Break single test case class into several test cases.
* Fix broken arch test.
* Make update tests optional (seem to only work for mxcl).
* Add more tests.
* Move fixtures to separate folder.
2010-02-02 09:08:10 -08:00