aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2017-09-10 22:53:53 +0200
committerGitHub2017-09-10 22:53:53 +0200
commit8f8f0f0a9efb7e73d2d12c05f5086f65fabe579d (patch)
treeda4a5d6288ea452b944e812a685a8d85c324213b
parent455ec4c9b02930c091d260a0141270440321e4b8 (diff)
parent194a2c2adebdcd585fcff781841725b13a91d28a (diff)
downloadbrew-8f8f0f0a9efb7e73d2d12c05f5086f65fabe579d.tar.bz2
Merge pull request #3145 from reitermarkus/cask-search
Make `brew cask search` spec deterministic.
-rw-r--r--Library/Homebrew/test/cask/cli/search_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb
index 6dc980590..3d58e6a15 100644
--- a/Library/Homebrew/test/cask/cli/search_spec.rb
+++ b/Library/Homebrew/test/cask/cli/search_spec.rb
@@ -4,6 +4,8 @@ describe Hbc::CLI::Search, :cask do
end
it "lists the available Casks that match the search term" do
+ allow(GitHub).to receive(:search_code).and_return([])
+
expect {
Hbc::CLI::Search.run("local")
}.to output(<<-EOS.undent).to_stdout.as_tty
@@ -14,6 +16,8 @@ describe Hbc::CLI::Search, :cask do
end
it "outputs a plain list when stdout is not a TTY" do
+ allow(GitHub).to receive(:search_code).and_return([])
+
expect {
Hbc::CLI::Search.run("local")
}.to output(<<-EOS.undent).to_stdout
@@ -24,6 +28,7 @@ describe Hbc::CLI::Search, :cask do
it "returns matches even when online search failed" do
allow(GitHub).to receive(:search_code).and_raise(GitHub::Error.new("reason"))
+
expect {
Hbc::CLI::Search.run("local")
}.to output(<<-EOS.undent).to_stdout