Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use spies + expectations correctly

  • Loading branch information...
commit 6652197e761004f78e15a8122dbe1804e7a13c2d 1 parent d854184
@joshuaclayton joshuaclayton authored
View
4 spec/kumade/base_spec.rb
@@ -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
@@ -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
View
2  spec/kumade/cli_spec.rb
@@ -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"
View
2  spec/kumade/deployer_spec.rb
@@ -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
View
2  spec/kumade/heroku_spec.rb
@@ -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

0 comments on commit 6652197

Please sign in to comment.
Something went wrong with that request. Please try again.