diff --git a/Library/Homebrew/test/cmd/casks_spec.rb b/Library/Homebrew/test/cmd/casks_spec.rb new file mode 100644 index 0000000000..d70b5daf34 --- /dev/null +++ b/Library/Homebrew/test/cmd/casks_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +RSpec.describe "brew casks", type: :system do + it "prints all installed Casks", :integration_test do + expect { brew_sh "casks" } + .to be_a_success + .and not_to_output.to_stderr + end +end diff --git a/Library/Homebrew/test/cmd/formulae_spec.rb b/Library/Homebrew/test/cmd/formulae_spec.rb new file mode 100644 index 0000000000..714238aefa --- /dev/null +++ b/Library/Homebrew/test/cmd/formulae_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +RSpec.describe "brew formulae", type: :system do + it "prints all installed Formulae", :integration_test do + expect { brew_sh "formulae" } + .to be_a_success + .and not_to_output.to_stderr + end +end diff --git a/Library/Homebrew/test/cmd/list_spec.rb b/Library/Homebrew/test/cmd/list_spec.rb index 97a6f1466a..62ff3c8004 100644 --- a/Library/Homebrew/test/cmd/list_spec.rb +++ b/Library/Homebrew/test/cmd/list_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Homebrew::Cmd::List do it_behaves_like "parseable arguments" - it "prints all installed Formulae", :integration_test do + it "prints all installed formulae", :integration_test do formulae.each do |f| (HOMEBREW_CELLAR/f/"1.0/somedir").mkpath end @@ -19,5 +19,9 @@ RSpec.describe Homebrew::Cmd::List do .and be_a_success end - # TODO: add a test for the shell fast-path (`brew_sh`) + it "prints all installed formulae and casks", :integration_test do + expect { brew_sh "list" } + .to be_a_success + .and not_to_output.to_stderr + end end diff --git a/Library/Homebrew/test/cmd/setup-ruby_spec.rb b/Library/Homebrew/test/cmd/setup-ruby_spec.rb new file mode 100644 index 0000000000..7bff28754e --- /dev/null +++ b/Library/Homebrew/test/cmd/setup-ruby_spec.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +RSpec.describe "brew setup-ruby", type: :system do + it "installs and configures Homebrew's Ruby", :integration_test do + expect { brew_sh "setup-ruby" } + .to output("").to_stdout + .and not_to_output.to_stderr + .and be_a_success + end +end diff --git a/Library/Homebrew/test/cmd/shellenv_spec.rb b/Library/Homebrew/test/cmd/shellenv_spec.rb new file mode 100644 index 0000000000..2a241b2270 --- /dev/null +++ b/Library/Homebrew/test/cmd/shellenv_spec.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +RSpec.describe "brew shellenv", type: :system do + it "prints export statements", :integration_test do + expect { brew_sh "shellenv" } + .to output(/.*/).to_stdout + .and not_to_output.to_stderr + .and be_a_success + end +end