diff options
| author | Mike McQuaid | 2016-07-04 16:08:53 +0100 |
|---|---|---|
| committer | GitHub | 2016-07-04 16:08:53 +0100 |
| commit | 252c701c59227c385ef6178fe99523cca8c843bb (patch) | |
| tree | ed2bbef375b61cc579438371b76db8f66a9b76d8 /Library/Homebrew/test/test_integration_cmds.rb | |
| parent | 037729351fbb6d6baf7d044eb81544da3848a876 (diff) | |
| download | brew-252c701c59227c385ef6178fe99523cca8c843bb.tar.bz2 | |
Test officially supported cmd taps. (#390)
All of these taps use Homebrew internal APIs (or will shortly) and we
autoinstall them all from `brew $CMD`. We should adjust our CI to ensure
that we never accidentally break these taps when making changes to core
code so that these taps can rely more on this core code rather than
having to e.g. vendor equivalent code that never changes on our end.
Diffstat (limited to 'Library/Homebrew/test/test_integration_cmds.rb')
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb index cc8f3b458..9b37fa545 100644 --- a/Library/Homebrew/test/test_integration_cmds.rb +++ b/Library/Homebrew/test/test_integration_cmds.rb @@ -17,6 +17,12 @@ class IntegrationCommandTests < Homebrew::TestCase @formula_files.each(&:unlink) end + def needs_test_cmd_taps + unless ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"] + skip "HOMEBREW_TEST_OFFICIAL_CMD_TAPS is not set" + end + end + def cmd_id_from_args(args) args_pretty = args.join(" ").gsub(TEST_TMPDIR, "@TMPDIR@") test_pretty = "#{self.class.name}\##{name}.#{@cmd_id_index += 1}" @@ -668,4 +674,35 @@ class IntegrationCommandTests < Homebrew::TestCase ensure desc_cache.unlink end + + def test_bundle + needs_test_cmd_taps + HOMEBREW_REPOSITORY.cd do + shutup do + system "git", "init" + system "git", "commit", "--allow-empty", "-m", "This is a test commit" + end + end + + mktmpdir do |path| + FileUtils.touch "#{path}/Brewfile" + Dir.chdir path do + assert_equal "The Brewfile's dependencies are satisfied.", + cmd("bundle", "check") + end + end + ensure + FileUtils.rm_rf HOMEBREW_REPOSITORY/".git" + end + + def test_cask + needs_test_cmd_taps + assert_equal "Warning: nothing to list", cmd("cask", "list") + end + + def test_services + needs_test_cmd_taps + assert_equal "Warning: No services available to control with `brew services`", + cmd("services", "list") + end end |
