spec/adhearsion/events_spec.rb in adhearsion-2.3.0 vs spec/adhearsion/events_spec.rb in adhearsion-2.3.1
- old
+ new
@@ -19,11 +19,11 @@
it "should allow adding events to the queue and handle them appropriately" do
t = nil
o = nil
latch = CountDownLatch.new 1
- flexmock(Events.instance).should_receive(:handle_message).and_return do |message|
+ Events.instance.should_receive(:handle_message).and_return do |message|
t = message.type
o = message.object
latch.countdown!
end
@@ -36,11 +36,11 @@
it "should allow executing events immediately" do
t = nil
o = nil
- flexmock(Events.instance).should_receive(:handle_message).and_return do |message|
+ Events.instance.should_receive(:handle_message).and_return do |message|
sleep 0.25
t = message.type
o = message.object
end
@@ -63,10 +63,10 @@
Events.clear_handlers :event, EventClass
end
it "should handle exceptions in event processing by raising the exception as an event" do
- flexmock(Events.instance).should_receive(:trigger).with(:exception, ExceptionClass).once
+ Events.instance.should_receive(:trigger).with(:exception, kind_of(ExceptionClass)).once
Events.register_handler :event, EventClass do |event|
raise ExceptionClass
end