spec/unit/models/paginated_resource_spec.rb in ably-0.7.2 vs spec/unit/models/paginated_resource_spec.rb in ably-0.7.4

- old
+ new

@@ -3,11 +3,11 @@ describe Ably::Models::PaginatedResource do let(:paginated_resource_class) { Ably::Models::PaginatedResource } let(:headers) { Hash.new } let(:client) do - instance_double('Ably::Rest::Client').tap do |client| + instance_double('Ably::Rest::Client', logger: true).tap do |client| allow(client).to receive(:get).and_return(http_response) end end let(:body) do [ @@ -88,11 +88,11 @@ '<./history?index=1>; rel="next"' ].join(', ') } end let(:paged_client) do - instance_double('Ably::Rest::Client').tap do |client| + instance_double('Ably::Rest::Client', logger: true).tap do |client| allow(client).to receive(:get).and_return(http_response_page2) end end let(:body_page2) do [ @@ -135,12 +135,12 @@ subject do paginated_resource_class.new(http_response, full_url, paged_client, async_blocking_operations: true) end context '#next_page' do - it 'returns a deferrable object' do + it 'returns a SafeDeferrable that catches exceptions in callbacks and logs them' do run_reactor do - expect(subject.next_page).to be_a(EventMachine::Deferrable) + expect(subject.next_page).to be_a(Ably::Util::SafeDeferrable) stop_reactor end end it 'allows a success callback block to be added' do