1376 Commits

Author SHA1 Message Date
Markus Reiter
f717831a03 Move Cask fixtures to test/support/fixtures. 2017-01-25 13:33:12 +01:00
Alyssa Ross
5480a84114 tests: give e helper in UtilTests a better name 2017-01-24 11:25:26 +00:00
Alyssa Ross
65dde58057 tests: add some emoji tests 💯 2017-01-24 11:25:24 +00:00
Alyssa Ross
62a0c3a6f5 tests: remove env helper 2017-01-23 13:39:33 +00:00
Markus Reiter
7d131de57d tests: slightly stricter match in tab test
Suggested by @reitermarkus in
https://github.com/Homebrew/brew/pull/1890#discussion_r97234536, and
then I added the \A and \Z.
2017-01-23 12:31:02 +00:00
Alyssa Ross
19e61355b3 tests: remove with_git_env method
A common git environment is now used in all tests, so this is no longer
required.
2017-01-22 20:54:37 +00:00
Alyssa Ross
b53ce62ffb tests: use more recent git committer date
This will allow the `brew bundle` test to use the default git
environment.
2017-01-22 20:45:15 +00:00
Alyssa Ross
9c3d01c682 tests: remove unnecessary comment
See https://github.com/Homebrew/brew/pull/1890#discussion_r97229473.
2017-01-22 19:59:13 +00:00
Markus Reiter
cbc9e5dd3b tests: re-use with_environment in using_git_env
Proposed by @reitermarkus in
https://github.com/Homebrew/brew/pull/1890#discussion_r97210285.

I made one slight adjustment of preserving the previous date string in
case anything was relying on it.
2017-01-22 19:53:58 +00:00
Alyssa Ross
1e1de8c111 tests: remove remainder of ARGV stubs
I was waiting for confirmation that there wasn't a good reason for these
to be stubbed before I removed them.
2017-01-22 19:53:58 +00:00
Alyssa Ross
a736c7e317 tests: set verbose in ENV instead of stubbing ARGV 2017-01-22 19:53:58 +00:00
Alyssa Ross
0c1d665568 tests: set developer in ENV rather than stubbing 2017-01-22 19:53:58 +00:00
Alyssa Ross
116ed3ec80 tests: automatically restore ENV in teardown 2017-01-22 19:53:58 +00:00
Alyssa Ross
6e0f1366b0 tests: extract a common using_git_env method 2017-01-22 19:52:34 +00:00
Alyssa Ross
6861451f87 tests: remove more per-test file system cleanup
These locations are now all automatically cleaned up after every test.
2017-01-22 11:15:18 +00:00
Alyssa Ross
1aee7c6945 tests: remove explicit tmpdir deletions
These are no longer necessary.
2017-01-22 11:15:18 +00:00
Alyssa Ross
d7b8420aaa tests: clean up file system for all tests
(No longer just integration tests.)
2017-01-22 11:15:18 +00:00
Alyssa Ross
d86342a251 tests: reset ARGV in teardown 2017-01-21 15:08:20 +00:00
Alyssa Ross
2d550b5008 tests: clear tab cache in global teardown 2017-01-21 14:24:19 +00:00
Alyssa Ross
70a381a00f tests: enforce super in lifecycle hooks
This will allow us to have global setup and teardown for tests.

For example, we can automatically clear caches after each test, to avoid
annoying intermittent failures like #1879 and #1886.
2017-01-21 11:34:52 +00:00
Alyssa Ross
366ee0b267 tests: revert modification to ARGV at end of test
Similar to 6fc1747e0550545b4fe80f5a1854d16dd2b08afe. I hadn't seen any
test failures caused by this, but I noticed it in the process of
trackign that down and it's an accident waiting to happen.
2017-01-19 13:21:39 +00:00
Alyssa Ross
6fc1747e05 tests: add a missing Tab cache clear
This was responsible for the sporadic failures I encountered in #1878.
2017-01-19 13:16:08 +00:00
Mike McQuaid
4d2201b8be integration_command_test_case: improve fail output
Instead of `puts`ing when the failure occurs save it until the error
message and print a prose description of what the failure was and the
output from the command. This makes the output from failing tests
significantly easier to read.
2017-01-18 08:36:36 +00:00
Mike McQuaid
ffa5ebde53 Merge pull request #1863 from alyssais/uses_ignore_untapped
uses: properly handle untapped formulae in recursive dependency expansion (again!)
2017-01-17 19:58:52 +00:00
Mike McQuaid
3d37e3b67f Merge pull request #1849 from alyssais/requirement_tests
tests: test Formula#recursive_requirements
2017-01-17 09:12:47 +00:00
Alyssa Ross
0b216798bb Revert "Revert "uses: properly handle untapped fo…
…rmulae in recursive dependency expansion""

This reverts commit dc9819b86c60b5c6fd10373ff318d8ef60f97d52.
2017-01-16 23:28:26 +00:00
Alyssa Ross
33b955a3f2 tests: fix style of recursive_requirements tests 2017-01-16 21:58:59 +00:00
Mike McQuaid
133e59724a Merge pull request #1763 from minamijoyo/add-feature-github-release-download-strategy
New feature: Allow download from private GitHub repository
2017-01-16 18:52:47 +00:00
Alyssa Ross
0d9020838f tests: test Formula#recursive_requirements 2017-01-15 19:50:07 +00:00
Masayuki Morita
12b9cb7f4c Fix rubocop style warning of download_strategy 2017-01-08 18:29:20 +09:00
Masayuki Morita
560d5bdd71 Validate a token when initializing GitHubPrivateRepositoryDownloadStrategy 2017-01-08 18:06:57 +09:00
Masayuki Morita
335be35acf Generalize GitHubReleaseDownloadStrategy in order to support archive URL 2017-01-08 16:44:54 +09:00
Mike McQuaid
dc9819b86c Revert "uses: properly handle untapped formulae in recursive dependency expansion" 2017-01-07 13:15:18 +00:00
Alyssa Ross
4c061fc183 dependency: TapDependency#tap returns a Tap
Previously, this returned a String, but a Tap instance seems much more
sensible.

I couldn't find anywhere this method was actually used, so the change
shouldn't break anything.
2017-01-05 00:22:56 +00:00
Alyssa Ross
56d6695bf3 tab: set homebrew_version in Tab.empty 2017-01-04 00:56:06 +00:00
Alyssa Ross
b7e10ba239 tests: remove temp tab homebrew_version override
This had to be added in #1750 to work around special-casing for tabs
generated with Homebrew versions < 1.1.6. Now that 1.1.6 is the current
version, we can remove this hack.
2017-01-04 00:46:44 +00:00
Mike McQuaid
cd1579a51a Deprecate Homebrew/versions, Homebrew/devel-only.
Don't use Homebrew/versions in a test and remove them both from the
OFFICIAL_TAPS list (i.e. `brew search`).
2017-01-03 17:50:09 +00:00
Masayuki Morita
a4330f458a Use util/github insted of open-uri in GitHubReleaseDownloadStrategy 2017-01-03 15:12:53 +09:00
Masayuki Morita
b9cc52db45 New feature: GitHubReleaseDownloadStrategy
GitHubReleaseDownloadStrategy downloads tarballs from GitHub Release assets.
To use it, add ":using => GitHubReleaseDownloadStrategy" to the URL section
of your formula. This download strategy uses GitHub access tokens (in the
environment variables GITHUB_TOKEN) to sign the request.
This strategy is suitable for corporate use just like S3DownloadStrategy,
because it lets you use a private GttHub repository for internal distribution.
It works with public one, but in that case simply use CurlDownloadStrategy.
2017-01-02 15:56:55 +09:00
Alyssa Ross
e1d7d44e5a tests: optlink fake kegs in uninstall test 2017-01-01 14:27:24 +00:00
Alyssa Ross
e4856143a6 keg: check installed dependencies iff optlinked 2017-01-01 14:27:24 +00:00
Alyssa Ross
94ead55772 keg: keg_only kegs can have installed dependents 2017-01-01 14:26:28 +00:00
Alyssa Ross
05b85a7bef keg: update installed dependency resolution
Closes #1525. (See there for a motivation for this change.)
2017-01-01 14:26:28 +00:00
Alyssa Ross
524d9ce8f3 keg: test dep fallback with unknown formulae 2016-12-31 17:53:06 +00:00
Alyssa Ross
8b30abe060 keg: handle dependencies of moved/renamed formulae
In #1497 I switched from Keg#to_formula for comparing kegs to formulae
to comparing the name and tap in the keg's tab to the name and tap of
the formula.

However, this fails to match if the name and tap of the formula have
changed since the keg was installed, so it's clearly better to use
Keg#to_formula where possible, and fall back to the information in the
tab when #to_formula can't be used.
2016-12-31 17:53:06 +00:00
Mike McQuaid
33fbf3f32d Merge pull request #1750 from alyssais/fallback_dependencies
keg: fall back for dependencies of buggy tabs
2016-12-31 17:34:55 +00:00
Mike McQuaid
1c9651f04f Merge pull request #1756 from alyssais/nil_dependents
keg: don't return nil dependencies
2016-12-31 17:34:17 +00:00
Mike McQuaid
d85a83c9dc Merge pull request #1752 from alyssais/uninstalling_dependencies
keg: fix fallback dependencies with multiple kegs
2016-12-31 17:33:08 +00:00
Alyssa Ross
fb920668c8 keg: don't return nil dependencies
This is a proper fix to the problem addressed by #1510.

The problem arises when f_kegs is nil, which can happen if the name and
tap used to install a keg don't match the name and tap currently
associated with its formula (i.e. if it's been renamed or moved).
2016-12-31 14:16:38 +00:00
Mike McQuaid
b1e27d689d Merge pull request #1701 from MikeMcQuaid/deprecate-std-superenv-stuff
ENV: deprecate old methods.
2016-12-30 20:43:27 +00:00