spec/shared/safe_deferrable_behaviour.rb in ably-0.8.15 vs spec/shared/safe_deferrable_behaviour.rb in ably-1.0.0

- old
+ new

@@ -18,11 +18,13 @@ end subject.fail(*arguments) end it 'catches exceptions in the callback and logs the error to the logger' do - expect(subject.send(:logger)).to receive(:error).with(/#{exception.message}/) + expect(subject.send(:logger)).to receive(:error) do |*args, &block| + expect(args.concat([block ? block.call : nil]).join(',')).to match(/#{exception.message}/) + end subject.errback do raise exception end subject.fail end @@ -47,10 +49,12 @@ end subject.succeed(*arguments) end it 'catches exceptions in the callback and logs the error to the logger' do - expect(subject.send(:logger)).to receive(:error).with(/#{exception.message}/) + expect(subject.send(:logger)).to receive(:error) do |*args, &block| + expect(args.concat([block ? block.call : nil]).join(',')).to match(/#{exception.message}/) + end subject.callback do raise exception end subject.succeed end