Separate tap tests into separate, correct files.
This commit is contained in:
parent
aa44509be9
commit
1e5cfcc028
21
Library/Homebrew/test/cmd/tap-info_spec.rb
Normal file
21
Library/Homebrew/test/cmd/tap-info_spec.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
require "cmd/shared_examples/args_parse"
|
||||||
|
|
||||||
|
describe "Homebrew.tap_info_args" do
|
||||||
|
it_behaves_like "parseable arguments"
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "brew tap-info", :integration_test do
|
||||||
|
it "gets information for a given Tap" do
|
||||||
|
setup_test_tap
|
||||||
|
|
||||||
|
expect { brew "tap-info", "homebrew/foo" }
|
||||||
|
.to output(%r{https://github\.com/Homebrew/homebrew-foo}).to_stdout
|
||||||
|
.and not_to_output.to_stderr
|
||||||
|
.and be_a_success
|
||||||
|
|
||||||
|
expect { brew "tap-info", "--json=v1", "--installed" }
|
||||||
|
.to output(%r{https://github\.com/Homebrew/homebrew-foo}).to_stdout
|
||||||
|
.and not_to_output.to_stderr
|
||||||
|
.and be_a_success
|
||||||
|
end
|
||||||
|
end
|
||||||
16
Library/Homebrew/test/cmd/tap_spec.rb
Normal file
16
Library/Homebrew/test/cmd/tap_spec.rb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
require "cmd/shared_examples/args_parse"
|
||||||
|
|
||||||
|
describe "Homebrew.tap_args" do
|
||||||
|
it_behaves_like "parseable arguments"
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "brew tap", :integration_test do
|
||||||
|
it "taps a given Tap" do
|
||||||
|
path = setup_test_tap
|
||||||
|
|
||||||
|
expect { brew "tap", "--force-auto-update", "--full", "homebrew/bar", path/".git" }
|
||||||
|
.to output(/Tapped/).to_stdout
|
||||||
|
.and output(/Cloning/).to_stderr
|
||||||
|
.and be_a_success
|
||||||
|
end
|
||||||
|
end
|
||||||
16
Library/Homebrew/test/cmd/untap_spec.rb
Normal file
16
Library/Homebrew/test/cmd/untap_spec.rb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
require "cmd/shared_examples/args_parse"
|
||||||
|
|
||||||
|
describe "Homebrew.untap_args" do
|
||||||
|
it_behaves_like "parseable arguments"
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "brew untap", :integration_test do
|
||||||
|
it "untaps a given Tap" do
|
||||||
|
setup_test_tap
|
||||||
|
|
||||||
|
expect { brew "untap", "homebrew/foo" }
|
||||||
|
.to output(/Untapped/).to_stdout
|
||||||
|
.and not_to_output.to_stderr
|
||||||
|
.and be_a_success
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,79 +0,0 @@
|
|||||||
require "cmd/shared_examples/args_parse"
|
|
||||||
|
|
||||||
describe "Homebrew.tap_args" do
|
|
||||||
it_behaves_like "parseable arguments"
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "brew tap", :integration_test do
|
|
||||||
it "taps a given Tap" do
|
|
||||||
path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
|
|
||||||
path.mkpath
|
|
||||||
path.cd do
|
|
||||||
system "git", "init"
|
|
||||||
system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo"
|
|
||||||
FileUtils.touch "readme"
|
|
||||||
system "git", "add", "--all"
|
|
||||||
system "git", "commit", "-m", "init"
|
|
||||||
end
|
|
||||||
|
|
||||||
expect { brew "tap" }
|
|
||||||
.to output(%r{homebrew/foo}).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap-info" }
|
|
||||||
.to output(/2 taps/).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap-info", "homebrew/foo" }
|
|
||||||
.to output(%r{https://github\.com/Homebrew/homebrew-foo}).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap-info", "--json=v1", "--installed" }
|
|
||||||
.to output(%r{https://github\.com/Homebrew/homebrew-foo}).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap-pin", "homebrew/foo" }
|
|
||||||
.to output(%r{Pinned homebrew/foo}).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap", "--list-pinned" }
|
|
||||||
.to output(%r{homebrew/foo}).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap-unpin", "homebrew/foo" }
|
|
||||||
.to output(%r{Unpinned homebrew/foo}).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap", "homebrew/bar", path/".git" }
|
|
||||||
.to output(/Tapped/).to_stdout
|
|
||||||
.and output(/Cloning/).to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "untap", "homebrew/bar" }
|
|
||||||
.to output(/Untapped/).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap", "--force-auto-update", "homebrew/bar", path/".git" }
|
|
||||||
.to output(/Tapped/).to_stdout
|
|
||||||
.and output(/Cloning/).to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "untap", "homebrew/bar" }
|
|
||||||
.to output(/Untapped/).to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
.and be_a_success
|
|
||||||
|
|
||||||
expect { brew "tap", "homebrew/bar", path/".git", "-q", "--full" }
|
|
||||||
.to be_a_success
|
|
||||||
.and not_to_output.to_stdout
|
|
||||||
.and not_to_output.to_stderr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@ -184,6 +184,19 @@ RSpec.shared_context "integration test" do
|
|||||||
fi.finish
|
fi.finish
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def setup_test_tap
|
||||||
|
path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
|
||||||
|
path.mkpath
|
||||||
|
path.cd do
|
||||||
|
system "git", "init"
|
||||||
|
system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo"
|
||||||
|
FileUtils.touch "readme"
|
||||||
|
system "git", "add", "--all"
|
||||||
|
system "git", "commit", "-m", "init"
|
||||||
|
end
|
||||||
|
path
|
||||||
|
end
|
||||||
|
|
||||||
def setup_remote_tap(name)
|
def setup_remote_tap(name)
|
||||||
Tap.fetch(name).tap do |tap|
|
Tap.fetch(name).tap do |tap|
|
||||||
next if tap.installed?
|
next if tap.installed?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user