Merge pull request #2154 from reitermarkus/spec-command
Convert `brew command` test to spec.
This commit is contained in:
commit
e7fcc39c21
13
Library/Homebrew/test/cmd/command_spec.rb
Normal file
13
Library/Homebrew/test/cmd/command_spec.rb
Normal 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
|
||||
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user