Permalink
Browse files

Don't stub the SUT

  • Loading branch information...
1 parent be5de51 commit 7c147ae4402691e70fc7abe6a8b404483e2dc1b3 Gabe Berke-Williams committed Sep 11, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 spec/kumade/base_spec.rb
View
@@ -13,7 +13,7 @@
it "prints its message and raises its message" do
subject.should_receive(:say).with("==> ! I'm an error!", :red)
- lambda{ subject.error("I'm an error!") }.should raise_error(Kumade::DeploymentError)
+ lambda { subject.error("I'm an error!") }.should raise_error(Kumade::DeploymentError)
end
end
@@ -22,7 +22,7 @@
let(:error_message) { "dummy error message" }
before do
- subject.should_receive(:say_status).with(:run, command)
+ STDOUT.should_receive(:puts).with(/#{command}/)
end
context "when pretending" do
@@ -49,6 +49,7 @@
it "should call CommandLine.run and error with error_message" do
subject.should_receive(:run).and_return(false)
subject.should_receive(:error).with(error_message)
+
subject.run_or_error(command, error_message)
end
end

0 comments on commit 7c147ae

Please sign in to comment.