spec/unit/modules/async_wrapper_spec.rb in ably-0.8.15 vs spec/unit/modules/async_wrapper_spec.rb in ably-1.0.0
- old
+ new
@@ -57,10 +57,11 @@
it 'catches exceptions in the provided block and logs them to logger' do
run_reactor do
subject.operation do |result|
raise 'Intentional exception'
end
- expect(subject.logger).to receive(:error).with(/Intentional exception/) do
+ expect(subject.logger).to receive(:error) do |*args, &block|
+ expect(args.concat([block ? block.call : nil]).join(',')).to match(/Intentional exception/)
stop_reactor
end
end
end