diff options
| author | Markus Reiter | 2017-02-23 06:03:08 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-23 21:25:02 +0100 |
| commit | a7f1dde24afaeacd2684c3746980111580d9fb26 (patch) | |
| tree | f0c51c42fdc0dfd6ecdcca20b373c8d5a8936ad7 /Library/Homebrew/test/dev-cmd/tap_spec.rb | |
| parent | c7121f6be50e44784e3e29114617c29715bd9c0f (diff) | |
| download | brew-a7f1dde24afaeacd2684c3746980111580d9fb26.tar.bz2 | |
Convert `brew tap` test to spec.
Diffstat (limited to 'Library/Homebrew/test/dev-cmd/tap_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/dev-cmd/tap_spec.rb | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/Library/Homebrew/test/dev-cmd/tap_spec.rb b/Library/Homebrew/test/dev-cmd/tap_spec.rb new file mode 100644 index 000000000..a24c67aae --- /dev/null +++ b/Library/Homebrew/test/dev-cmd/tap_spec.rb @@ -0,0 +1,75 @@ +describe "brew tap", :integration_test do + it "taps a given Tap" do + path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo" + path.mkpath + path.cd do + shutup 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 + end + + expect { brew "tap" } + .to output(%r{homebrew/foo}).to_stdout + .and not_to_output.to_stderr + .and be_a_success + + expect { brew "tap", "--list-official" } + .to output(%r{homebrew/science}).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", "homebrew/bar", path/".git", "-q", "--full" } + .to be_a_success + .and not_to_output.to_stdout + .and not_to_output.to_stderr + + expect { brew "untap", "homebrew/bar" } + .to output(/Untapped/).to_stdout + .and not_to_output.to_stderr + .and be_a_success + end +end |
