Merge pull request #2154 from reitermarkus/spec-command

Convert `brew command` test to spec.
This commit is contained in:
Markus Reiter 2017-02-24 17:16:36 +01:00 committed by GitHub
commit e7fcc39c21
2 changed files with 13 additions and 11 deletions

View File

@ -0,0 +1,13 @@
describe "brew command", :integration_test do
it "returns the file for a given command" do
expect { brew "command", "info" }
.to output(%r{#{Regexp.escape(HOMEBREW_LIBRARY_PATH)}/cmd/info.rb}).to_stdout
.and be_a_success
end
it "fails when the given command is unknown" do
expect { brew "command", "does-not-exist" }
.to output(/Unknown command/).to_stderr
.and be_a_failure
end
end

View File

@ -1,11 +0,0 @@
require "testing_env"
class IntegrationCommandTestCommand < IntegrationCommandTestCase
def test_command
assert_equal "#{HOMEBREW_LIBRARY_PATH}/cmd/info.rb",
cmd("command", "info")
assert_match "Unknown command",
cmd_fail("command", "I-don't-exist")
end
end