Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Be more explicit about what we're expecting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Oct 15, 2011
1 parent e419061 commit dc25839
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/kumade/cli_spec.rb
Expand Up @@ -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)
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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

0 comments on commit dc25839

Please sign in to comment.