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

Commit

Permalink
Use spies + expectations correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Sep 20, 2011
1 parent d854184 commit 6652197
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions spec/kumade/base_spec.rb
Expand Up @@ -33,7 +33,7 @@
it "does not run the command" do
subject.run_or_error("dummy command", "dummy error message")

subject.should_not have_received(:run)
subject.should have_received(:run).never
STDOUT.should have_received(:puts).with(regexp_matches(/#{command}/))
end
end
Expand All @@ -47,7 +47,7 @@
it "does not print an error" do
subject.run_or_error(command, error_message)

STDOUT.should_not have_received(:puts).with(regexp_matches(/#{error_message}/))
STDOUT.should have_received(:puts).with(regexp_matches(/#{error_message}/)).never
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/kumade/cli_spec.rb
Expand Up @@ -82,7 +82,7 @@
$stdout.puts "Hello, you can't see me."
end

stdout.should_not have_received(:print)
stdout.should have_received(:print).never

output.rewind
output.read.should == "Hello, you can't see me.\n"
Expand Down
2 changes: 1 addition & 1 deletion spec/kumade/deployer_spec.rb
Expand Up @@ -73,7 +73,7 @@
it "does not print an error" do
subject.ensure_heroku_remote_exists

STDOUT.should_not have_received(:puts).with(regexp_matches(/==> !/))
STDOUT.should have_received(:puts).with(regexp_matches(/==> !/)).never
end

it "prints a success message" do
Expand Down
2 changes: 1 addition & 1 deletion spec/kumade/heroku_spec.rb
Expand Up @@ -47,7 +47,7 @@
it "does not run the command" do
subject.migrate_database

subject.should_not have_received(:heroku)
subject.should have_received(:heroku).never
end

it "prints a message" do
Expand Down

0 comments on commit 6652197

Please sign in to comment.