spec/shared_examples/interface.rb in fozzie-1.0.1 vs spec/shared_examples/interface.rb in fozzie-1.0.2
- old
+ new
@@ -70,40 +70,40 @@
subject.should_receive(:increment).with(["event.increment", "fail"], 1)
subject.increment_on('event.increment', false).should == false
end
it "simply questions the passed val with if" do
- a = mock
+ a = double
a.should_receive(:save).and_return({})
subject.should_receive(:increment).with(["event.increment", "success"], 1)
subject.increment_on('event.increment', a.save).should == {}
end
it "registers fail on nil return" do
- a = mock
+ a = double
a.should_receive(:save).and_return(nil)
subject.should_receive(:increment).with(["event.increment", "fail"], 1)
subject.increment_on('event.increment', a.save).should == nil
end
describe "performing actions" do
it "registers success" do
- a = mock
+ a = double
a.should_receive(:save).and_return(true)
subject.should_receive(:increment).with(["event.increment", "success"], 1)
subject.increment_on('event.increment', a.save).should == true
end
it "registers failure" do
- a = mock
+ a = double
a.should_receive(:save).and_return(false)
subject.should_receive(:increment).with(["event.increment", "fail"], 1)
subject.increment_on('event.increment', a.save).should == false
end
it "registers positive even when nested" do
- a = mock
+ a = double
a.should_receive(:save).and_return(true)
subject.should_receive(:timing).with('event.run', anything, anything)
subject.should_receive(:increment).with(["event.increment", "success"], 1)
res = subject.time_to_do "event.run" do
@@ -111,10 +111,10 @@
end
res.should == true
end
it "registers negative even when nested" do
- a = mock
+ a = double
a.should_receive(:save).and_return(false)
subject.should_receive(:timing).with('event.run', anything, anything)
subject.should_receive(:increment).with(["event.increment", "fail"], 1)
res = subject.time_to_do "event.run" do
\ No newline at end of file