From 36d36b5334abc978157cddf599615893ebb44d74 Mon Sep 17 00:00:00 2001 From: Markus Reiter <me@reitermark.us> Date: Thu, 23 Feb 2017 06:01:23 +0100 Subject: [PATCH] Convert `brew command` test to spec. --- Library/Homebrew/test/cmd/command_spec.rb | 13 +++++++++++++ Library/Homebrew/test/command_test.rb | 11 ----------- 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 Library/Homebrew/test/cmd/command_spec.rb delete mode 100644 Library/Homebrew/test/command_test.rb diff --git a/Library/Homebrew/test/cmd/command_spec.rb b/Library/Homebrew/test/cmd/command_spec.rb new file mode 100644 index 0000000000..5d6a67b707 --- /dev/null +++ b/Library/Homebrew/test/cmd/command_spec.rb @@ -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 diff --git a/Library/Homebrew/test/command_test.rb b/Library/Homebrew/test/command_test.rb deleted file mode 100644 index d5c7aaa88c..0000000000 --- a/Library/Homebrew/test/command_test.rb +++ /dev/null @@ -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 -- GitLab