diff options
Diffstat (limited to 'spec/ruby/library/timeout/timeout_spec.rb')
-rw-r--r-- | spec/ruby/library/timeout/timeout_spec.rb | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/spec/ruby/library/timeout/timeout_spec.rb b/spec/ruby/library/timeout/timeout_spec.rb index ac0580ec13..fc957dc36f 100644 --- a/spec/ruby/library/timeout/timeout_spec.rb +++ b/spec/ruby/library/timeout/timeout_spec.rb @@ -5,7 +5,7 @@ describe "Timeout.timeout" do it "raises Timeout::Error when it times out with no specified error type" do lambda { Timeout.timeout(1) do - sleep 3 + sleep end }.should raise_error(Timeout::Error) end @@ -13,22 +13,11 @@ describe "Timeout.timeout" do it "raises specified error type when it times out" do lambda do Timeout.timeout(1, StandardError) do - sleep 3 + sleep end end.should raise_error(StandardError) end - it "does not wait too long" do - before_time = Time.now - lambda do - Timeout.timeout(1, StandardError) do - sleep 3 - end - end.should raise_error(StandardError) - - (Time.now - before_time).should be_close(1.0, 0.8) - end - it "returns back the last value in the block" do Timeout.timeout(1) do 42 |