spec/chrono/trigger_spec.rb in chrono-0.1.0 vs spec/chrono/trigger_spec.rb in chrono-0.2.0

- old
+ new

@@ -13,28 +13,28 @@ -> {} end describe "#once" do it "waits till scheduled time and then triggers a given job only once" do - block.should_receive(:call) - trigger.should_receive(:sleep) + expect(block).to receive(:call) + expect(trigger).to receive(:sleep) trigger.once end end # Stub Trigger#loop behavior to avoid blocking main process. describe "#run" do before do - trigger.stub(:loop) do |&block| + allow(trigger).to receive(:loop) do |&block| 2.times do block.call end end end it "waits till scheduled time and then triggers a given job periodically" do - block.should_receive(:call).twice - trigger.should_receive(:sleep).twice + expect(block).to receive(:call).twice + expect(trigger).to receive(:sleep).twice trigger.run end end end