aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/cask/cli
diff options
context:
space:
mode:
authorAlexey Alekhin2017-08-26 02:01:08 +0200
committerAlexey Alekhin2017-08-26 02:01:08 +0200
commit68c837f0412f0958817ee2d827b770f26d51bad6 (patch)
treeeaa69bcc09b7e90ec768cab10d45ac0914e9bcb5 /Library/Homebrew/test/cask/cli
parent3b7e0d8dbe3d9652b6d9a81f01bc3e68479b17bc (diff)
downloadbrew-68c837f0412f0958817ee2d827b770f26d51bad6.tar.bz2
Unified tests formatting for multiline output matching
Diffstat (limited to 'Library/Homebrew/test/cask/cli')
-rw-r--r--Library/Homebrew/test/cask/cli/search_spec.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/Library/Homebrew/test/cask/cli/search_spec.rb b/Library/Homebrew/test/cask/cli/search_spec.rb
index e7065404d..f3b693d99 100644
--- a/Library/Homebrew/test/cask/cli/search_spec.rb
+++ b/Library/Homebrew/test/cask/cli/search_spec.rb
@@ -36,7 +36,9 @@ describe Hbc::CLI::Search, :cask do
it "shows that there are no Casks matching a search term that did not result in anything" do
expect {
Hbc::CLI::Search.run("foo-bar-baz")
- }.to output("No Cask found for \"foo-bar-baz\".\n").to_stdout.as_tty
+ }.to output(<<-EOS.undent).to_stdout.as_tty
+ No Cask found for "foo-bar-baz".
+ EOS
end
it "lists all Casks available offline with no search term" do
@@ -68,19 +70,29 @@ describe Hbc::CLI::Search, :cask do
it "accepts a regexp argument" do
expect {
Hbc::CLI::Search.run("/^local-c[a-z]ffeine$/")
- }.to output("==> Regexp Matches\nlocal-caffeine\n").to_stdout.as_tty
+ }.to output(<<-EOS.undent).to_stdout.as_tty
+ ==> Regexp Matches
+ local-caffeine
+ EOS
end
- it "Returns both exact and partial matches" do
+ it "returns both exact and partial matches" do
expect {
Hbc::CLI::Search.run("test-opera")
- }.to output(/^==> Exact Match\ntest-opera\n==> Partial Matches\ntest-opera-mail/).to_stdout.as_tty
+ }.to output(<<-EOS.undent).to_stdout.as_tty
+ ==> Exact Match
+ test-opera
+ ==> Partial Matches
+ test-opera-mail
+ EOS
end
it "does not search the Tap name" do
expect {
Hbc::CLI::Search.run("caskroom")
- }.to output(/^No Cask found for "caskroom"\.\n/).to_stdout.as_tty
+ }.to output(<<-EOS.undent).to_stdout.as_tty
+ No Cask found for "caskroom".
+ EOS
end
it "doesn't highlight packages that aren't installed" do