spec/routemaster/api_client_spec.rb in routemaster-drain-2.5.4 vs spec/routemaster/api_client_spec.rb in routemaster-drain-3.0.0
- old
+ new
@@ -208,34 +208,6 @@
it 'GETs from the URL' do
subject.discover('https://example.com')
expect(@req).to have_been_requested
end
end
-
- describe '#with_response' do
- before { stub_request(:any, //).to_return(status: 200) }
-
- class DummyResponseA
- def initialize(res, client: nil); end
- def dummy_a; true; end
- end
-
- class DummyResponseB
- def initialize(res, client: nil); end
- def dummy_b; true; end
- end
-
- subject { described_class.new(response_class: DummyResponseA) }
- let(:response) { subject.get('https://example.com') }
-
- it 'changes the response wrapper during the block' do
- subject.with_response(DummyResponseB) do
- expect(response).to respond_to(:dummy_b)
- end
- end
-
- it 'restores the original response wrapper after the block' do
- subject.with_response(DummyResponseB) {}
- expect(response).to respond_to(:dummy_a)
- end
- end
end