Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make brew cask search spec deterministic. #3145

Merged
merged 1 commit into from
Sep 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Library/Homebrew/test/cask/cli/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
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
Expand All @@ -14,6 +16,8 @@
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
Expand All @@ -24,6 +28,7 @@

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
Expand Down