Convert brew command test to spec.

This commit is contained in:
Markus Reiter 2017-02-23 06:01:23 +01:00
parent a0dca79f01
commit 36d36b5334
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