From dc2583902a86f3947464f66751c3beaf51d709d2 Mon Sep 17 00:00:00 2001 From: Gabe Berke-Williams Date: Sat, 15 Oct 2011 17:23:32 -0400 Subject: [PATCH] Be more explicit about what we're expecting. --- spec/kumade/cli_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/kumade/cli_spec.rb b/spec/kumade/cli_spec.rb index 5f16106..b82244d 100644 --- a/spec/kumade/cli_spec.rb +++ b/spec/kumade/cli_spec.rb @@ -70,8 +70,8 @@ end describe Kumade::CLI, ".swapping_stdout_for" do - let(:stdout) { $stdout } - let(:output) { StringIO.new } + let!(:stdout) { $stdout } + let(:output) { StringIO.new } before do stdout.stubs(:print => nil, :puts => nil) @@ -83,6 +83,7 @@ end stdout.should have_received(:print).never + stdout.should have_received(:puts).never output.rewind output.read.should == "Hello, you can't see me.\n" @@ -94,7 +95,7 @@ raise Kumade::DeploymentError.new("error") end - stdout.should have_received(:print) + stdout.should have_received(:print).with("Hello, you can see me!\n") end context "in print output mode" do @@ -103,7 +104,7 @@ $stdout.puts "Hello, you can see me!" end - stdout.should have_received(:puts) + stdout.should have_received(:puts).with("Hello, you can see me!") end end end