Guest User

perf_test01

a guest
Jun 23rd, 2014
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.32 KB | None | 0 0
  1.   it "takes about 0 seconds to run an empty block" do
  2.     elapsed_time = measure do
  3.     end
  4.     elapsed_time.should be_within(0.1).of(0)
  5.   end
  6.  
  7.   it "takes exactly 0 seconds to run an empty block (with stubs)" do
  8.     Time.stub(:now) { @eleven_am }
  9.     elapsed_time = measure do
  10.     end
  11.     elapsed_time.should == 0
  12.   end
Advertisement
Add Comment
Please, Sign In to add comment