spec/timer_spec.rb in shelltastic-0.2.5 vs spec/timer_spec.rb in shelltastic-0.3.0
- old
+ new
@@ -1,22 +1,23 @@
require 'spec_helper'
describe ShellTastic::Timer do
it "should report start time" do
- start = ShellTastic::Timer.start
+ start = ShellTastic::Timer.new.start
start.class.should eq(Time)
end
it "should report stop time" do
- stop = ShellTastic::Timer.stop
+ stop = ShellTastic::Timer.new.stop
stop.class.should eq(Time)
end
it "should report total time" do
- start = ShellTastic::Timer.start
+ timer = ShellTastic::Timer.new
+ start = timer.start
sleep 2
- stop = ShellTastic::Timer.stop
- total = ShellTastic::Timer.total_time
+ stop = timer.stop
+ total = timer.total_time
total.round.should eq(2)
end
end