mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #20040 from Homebrew/brew_sh_tests
test/cmd: add more shell tests.
This commit is contained in:
commit
21e3621132
9
Library/Homebrew/test/cmd/casks_spec.rb
Normal file
9
Library/Homebrew/test/cmd/casks_spec.rb
Normal file
@ -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
|
9
Library/Homebrew/test/cmd/formulae_spec.rb
Normal file
9
Library/Homebrew/test/cmd/formulae_spec.rb
Normal file
@ -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
|
@ -8,7 +8,7 @@ RSpec.describe Homebrew::Cmd::List do
|
|||||||
|
|
||||||
it_behaves_like "parseable arguments"
|
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|
|
formulae.each do |f|
|
||||||
(HOMEBREW_CELLAR/f/"1.0/somedir").mkpath
|
(HOMEBREW_CELLAR/f/"1.0/somedir").mkpath
|
||||||
end
|
end
|
||||||
@ -19,5 +19,9 @@ RSpec.describe Homebrew::Cmd::List do
|
|||||||
.and be_a_success
|
.and be_a_success
|
||||||
end
|
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
|
end
|
||||||
|
10
Library/Homebrew/test/cmd/setup-ruby_spec.rb
Normal file
10
Library/Homebrew/test/cmd/setup-ruby_spec.rb
Normal file
@ -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
|
10
Library/Homebrew/test/cmd/shellenv_spec.rb
Normal file
10
Library/Homebrew/test/cmd/shellenv_spec.rb
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user