spec/grape/dsl/inside_route_spec.rb in grape-1.7.1 vs spec/grape/dsl/inside_route_spec.rb in grape-1.8.0

- old
+ new

@@ -201,20 +201,16 @@ expect(subject.body).to be_nil end end describe '#file' do - before do - allow(subject).to receive(:warn) - end - describe 'set' do context 'as file path' do let(:file_path) { '/some/file/path' } it 'emits a warning that this method is deprecated' do - expect(subject).to receive(:warn).with(/Use sendfile or stream/) + expect(ActiveSupport::Deprecation).to receive(:warn).with(/Use sendfile or stream/) subject.file file_path end it 'forwards the call to sendfile' do @@ -226,11 +222,11 @@ context 'as object (backward compatibility)' do let(:file_object) { double('StreamerObject', each: nil) } it 'emits a warning that this method is deprecated' do - expect(subject).to receive(:warn).with(/Use stream to use a Stream object/) + expect(ActiveSupport::Deprecation).to receive(:warn).with(/Use stream to use a Stream object/) subject.file file_object end it 'forwards the call to stream' do @@ -241,11 +237,11 @@ end end describe 'get' do it 'emits a warning that this method is deprecated' do - expect(subject).to receive(:warn).with(/Use sendfile or stream/) + expect(ActiveSupport::Deprecation).to receive(:warn).with(/Use sendfile or stream/) subject.file end it 'fowards call to sendfile' do @@ -271,11 +267,11 @@ subject.header 'Content-Length', 123 subject.header 'Transfer-Encoding', 'base64' end it 'sends no deprecation warnings' do - expect(subject).not_to receive(:warn) + expect(ActiveSupport::Deprecation).not_to receive(:warn) subject.sendfile file_path end it 'returns value wrapped in StreamResponse' do @@ -332,11 +328,11 @@ subject.header 'Content-Length', 123 subject.header 'Transfer-Encoding', 'base64' end it 'emits no deprecation warnings' do - expect(subject).not_to receive(:warn) + expect(ActiveSupport::Deprecation).not_to receive(:warn) subject.stream file_path end it 'returns file body wrapped in StreamResponse' do @@ -382,10 +378,10 @@ subject.header 'Content-Length', 123 subject.header 'Transfer-Encoding', 'base64' end it 'emits no deprecation warnings' do - expect(subject).not_to receive(:warn) + expect(ActiveSupport::Deprecation).not_to receive(:warn) subject.stream stream_object end it 'returns value wrapped in StreamResponse' do