diff --git a/Library/Homebrew/cask/test/cask/cli/install_test.rb b/Library/Homebrew/cask/test/cask/cli/install_test.rb
index c778d0d3c578e8258f7e90f9bbca586df0495278..c774f1fb58ee647e680717e17d6c8a9009937906 100644
--- a/Library/Homebrew/cask/test/cask/cli/install_test.rb
+++ b/Library/Homebrew/cask/test/cask/cli/install_test.rb
@@ -63,16 +63,20 @@ describe Hbc::CLI::Install do
     lambda {
       begin
         Hbc::CLI::Install.run("googlechrome")
-      rescue Hbc::CaskError; end
-    }.must_output nil, /No available Cask for googlechrome\. Did you mean:\ngoogle-chrome/
+      rescue Hbc::CaskError
+        nil
+      end
+    }.must_output(nil, /No available Cask for googlechrome\. Did you mean:\ngoogle-chrome/)
   end
 
   it "returns multiple suggestions for a Cask fragment" do
     lambda {
       begin
         Hbc::CLI::Install.run("google")
-      rescue Hbc::CaskError; end
-    }.must_output nil, /No available Cask for google\. Did you mean one of:\ngoogle/
+      rescue Hbc::CaskError
+        nil
+      end
+    }.must_output(nil, /No available Cask for google\. Did you mean one of:\ngoogle/)
   end
 
   describe "when no Cask is specified" do