diff options
| author | Markus Reiter | 2017-02-25 06:59:24 +0100 |
|---|---|---|
| committer | GitHub | 2017-02-25 06:59:24 +0100 |
| commit | 9ca7b351e9a550492c7a2a59fd204074536d5d0a (patch) | |
| tree | 9d0ec38fd8e59a0a88f8321e2bd3abc6ba6598a0 /Library/Homebrew/test/cmd | |
| parent | 3470edd61507b6af0271a4a70ad45ea3efda3742 (diff) | |
| parent | c37dbb79b669fc0c4088415d7269a6618f1ccb3c (diff) | |
| download | brew-9ca7b351e9a550492c7a2a59fd204074536d5d0a.tar.bz2 | |
Merge pull request #2131 from reitermarkus/spec-help
Convert `brew help` test to spec.
Diffstat (limited to 'Library/Homebrew/test/cmd')
| -rw-r--r-- | Library/Homebrew/test/cmd/help_spec.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cmd/help_spec.rb b/Library/Homebrew/test/cmd/help_spec.rb new file mode 100644 index 000000000..6d94d7444 --- /dev/null +++ b/Library/Homebrew/test/cmd/help_spec.rb @@ -0,0 +1,47 @@ +describe "brew", :integration_test do + it "prints help when no argument is given" do + expect { brew } + .to output(/Example usage:\n/).to_stderr + .and be_a_failure + end + + describe "help" do + it "prints help" do + expect { brew "help" } + .to output(/Example usage:\n/).to_stdout + .and be_a_success + end + + it "prints help for a documented Ruby command" do + expect { brew "help", "cat" } + .to output(/^brew cat/).to_stdout + .and be_a_success + end + + it "prints help for a documented shell command" do + expect { brew "help", "update" } + .to output(/^brew update/).to_stdout + .and be_a_success + end + + it "prints help for a documented Ruby developer command" do + expect { brew "help", "update-test" } + .to output(/^brew update-test/).to_stdout + .and be_a_success + end + + it "fails when given an unknown command" do + expect { brew "help", "command-that-does-not-exist" } + .to output(/Unknown command: command-that-does-not-exist/).to_stderr + .and be_a_failure + end + end + + describe "cat" do + it "prints help when no argument is given" do + expect { brew "cat" } + .to output(/^brew cat/).to_stderr + .and be_a_failure + end + end +end |
