Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Stubs work, sort of.

I'm getting warnings each time now, which is annoying.
  • Loading branch information...
commit 14f01b061077e1cad0f15fe707366db78e0298aa 1 parent 118fadb
@steveklabnik authored
Showing with 9 additions and 8 deletions.
  1. +1 −0  lib/pomodoro.rb
  2. +8 −8 spec/pomodoro_spec.rb
View
1  lib/pomodoro.rb
@@ -22,3 +22,4 @@ class PomodoroServer < Sinatra::Base
end
end
+
View
16 spec/pomodoro_spec.rb
@@ -5,10 +5,10 @@
describe Pomodoro do
- before :all do
- #rspec2 hates me, and won't stub properly
- #Noprocrast.stub(:activate!)
- #Noprocrast.stub(:deactivate!)
+ before :each do
+ Noprocrast = double(Noprocrast)
+ Noprocrast.stub(:activate!)
+ Noprocrast.stub(:deactivate!)
end
describe "#start!" do
@@ -19,10 +19,10 @@
end
it "saves its start time" do
- Noprocrast.should_receive(:activate!)
- Timecop.freeze
- Pomodoro.start!
- Pomodoro.instance_variable_get(:@start_time).should == Time.now
+ Timecop.freeze do
+ Pomodoro.start!
+ Pomodoro.instance_variable_get(:@start_time).should == Time.now
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.