spec/support/mailbox_examples.rb in celluloid-0.11.0 vs spec/support/mailbox_examples.rb in celluloid-0.11.1
- old
+ new
@@ -1,6 +1,9 @@
shared_context "a Celluloid Mailbox" do
+ # Level of timer accuracy enforced by the tests (50ms)
+ Q = 0.05
+
class TestEvent < Celluloid::SystemEvent; end
it "receives messages" do
message = :ohai
@@ -45,8 +48,8 @@
it "waits for a given timeout interval" do
interval = 0.1
started_at = Time.now
subject.receive(interval) { false }
- (Time.now - started_at).should be_within(Celluloid::Timer::QUANTUM).of interval
+ (Time.now - started_at).should be_within(Q).of interval
end
end