aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMike McQuaid2016-09-24 19:51:31 +0100
committerGitHub2016-09-24 19:51:31 +0100
commit67a7417a6869dc4624ecdada0b96253470f3a2ed (patch)
tree2c20af9635aa4e058f718ff25099a892b6cd3a75 /Library/Homebrew/test
parent210de2916b090cf7d5828cadbaab58e42a36a073 (diff)
parentd5b403b1e9462a569cde2d0af6e5974c96a37e66 (diff)
downloadbrew-67a7417a6869dc4624ecdada0b96253470f3a2ed.tar.bz2
Merge pull request #1122 from MikeMcQuaid/test-bot-tap
test-bot: move to tap.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_cmd_testbot.rb98
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb4
2 files changed, 2 insertions, 100 deletions
diff --git a/Library/Homebrew/test/test_cmd_testbot.rb b/Library/Homebrew/test/test_cmd_testbot.rb
deleted file mode 100644
index 239fa7a37..000000000
--- a/Library/Homebrew/test/test_cmd_testbot.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-require "pathname"
-
-require "testing_env"
-require "dev-cmd/test-bot"
-
-class TestbotCommandTests < Homebrew::TestCase
- def test_resolve_test_tap
- tap = Homebrew.resolve_test_tap
- assert_nil tap, "Should return nil if no tap slug provided"
-
- slug = "spam/homebrew-eggs"
- url = "https://github.com/#{slug}.git"
- environments = [
- { "TRAVIS_REPO_SLUG" => slug },
- { "UPSTREAM_BOT_PARAMS" => "--tap=#{slug}" },
- { "UPSTREAM_BOT_PARAMS" => "--tap=spam/eggs" },
- { "UPSTREAM_GIT_URL" => url },
- { "GIT_URL" => url },
- ]
-
- predicate = proc do |message|
- tap = Homebrew.resolve_test_tap
- assert_kind_of Tap, tap, message
- assert_equal tap.user, "spam", message
- assert_equal tap.repo, "eggs", message
- end
-
- environments.each do |pair|
- with_environment(pair) do
- predicate.call pair.to_s
- end
- end
-
- ARGV.expects(:value).with("tap").returns(slug)
- predicate.call "ARGV"
- end
-end
-
-class TestbotStepTests < Homebrew::TestCase
- def run
- [nil, "1"].each do |travis|
- with_environment("TRAVIS" => travis) { super }
- end
- self
- end
-
- def teardown
- return if passed?
- raise "INFO: Previous test failed with ENV['TRAVIS'] = #{ENV["TRAVIS"].inspect}"
- end
-
- def stub_test_instance
- stub(
- category: "stub",
- log_root: Pathname.pwd
- )
- end
-
- def test_step_run_measures_execution_time
- step = Homebrew::Step.new stub_test_instance, %w[sleep 0.1]
- shutup do
- step.run
- end
- assert_operator step.time, :>, 0.1
- assert_operator step.time, :<, 1
- assert_equal step.passed?, true
- end
-
- def test_step_run_observes_failure
- step = Homebrew::Step.new stub_test_instance, ["false", ""]
- shutup do
- step.run
- end
- assert_equal step.passed?, false
- assert_equal step.failed?, true
- end
-
- def test_step_dry_run_is_dry_and_always_succeeds
- step = Homebrew::Step.new stub_test_instance, ["false", ""]
- ARGV.expects(:include?).with("--dry-run").returns(true)
- step.stubs(:fork).raises("Dry run isn't dry!")
- shutup do
- step.run
- end
- assert_equal step.passed?, true
- end
-
- def test_step_fail_fast_exits_on_failure
- step = Homebrew::Step.new stub_test_instance, ["false", ""]
- ARGV.stubs(:include?).returns(false)
- ARGV.expects(:include?).with("--fail-fast").returns(true)
- step.expects(:exit).with(1).returns(nil)
- shutup do
- step.run
- end
- assert_equal step.passed?, false
- end
-end
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index 379e8d90d..35ad04e7a 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -273,8 +273,8 @@ class IntegrationCommandTests < Homebrew::TestCase
cmd("help", "cat")) # Internal command (documented, Ruby).
assert_match(/^brew update /,
cmd("help", "update")) # Internal command (documented, Shell).
- assert_match(/^brew test-bot /,
- cmd("help", "test-bot")) # Internal developer command (documented, Ruby).
+ assert_match(/^brew update-test /,
+ cmd("help", "update-test")) # Internal developer command (documented, Ruby).
end
def test_config