brew/Library/Homebrew/test/cmd/help_spec.rb

27 lines
659 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2024-03-29 18:31:39 -07:00
require "cmd/help"
2024-03-29 18:34:33 -07:00
require "cmd/shared_examples/args_parse"
2024-03-29 18:31:39 -07:00
RSpec.describe Homebrew::Cmd::HelpCmd, :integration_test do
2024-03-29 18:34:33 -07:00
it_behaves_like "parseable arguments"
2017-02-23 06:05:26 +01:00
describe "help" do
it "prints help for a documented Ruby command" do
expect { brew "help", "cat" }
2019-01-18 22:17:46 +05:30
.to output(/^Usage: brew cat/).to_stdout
2020-11-29 18:38:05 +01:00
.and not_to_output.to_stderr
2017-02-23 06:05:26 +01:00
.and be_a_success
end
end
describe "cat" do
it "prints help when no argument is given" do
expect { brew "cat" }
2019-01-18 22:17:46 +05:30
.to output(/^Usage: brew cat/).to_stderr
.and not_to_output.to_stdout
2017-02-23 06:05:26 +01:00
.and be_a_failure
end
end
end