spec/shared/safe_deferrable_behaviour.rb in ably-0.8.7 vs spec/shared/safe_deferrable_behaviour.rb in ably-0.8.8

- old
+ new

@@ -14,11 +14,11 @@ context '#errback' do it 'adds a callback that is called when #fail is called' do subject.errback do |*args| expect(args).to eql(arguments) end - subject.fail *arguments + 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}/) subject.errback do @@ -32,22 +32,22 @@ it 'calls the callbacks defined with #errback, but not the ones added for success #callback' do 3.times do subject.errback { errback_calls << true } subject.callback { success_calls << true } end - subject.fail *arguments + subject.fail(*arguments) expect(errback_calls.count).to eql(3) expect(success_calls.count).to eql(0) end end context '#callback' do it 'adds a callback that is called when #succed is called' do subject.callback do |*args| expect(args).to eql(arguments) end - subject.succeed *arguments + 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}/) subject.callback do @@ -61,10 +61,10 @@ it 'calls the callbacks defined with #callback, but not the ones added for #errback' do 3.times do subject.errback { errback_calls << true } subject.callback { success_calls << true } end - subject.succeed *arguments + subject.succeed(*arguments) expect(success_calls.count).to eql(3) expect(errback_calls.count).to eql(0) end end end