spec/log-me_spec.rb in log-me-0.0.6 vs spec/log-me_spec.rb in log-me-0.0.7

- old
+ new

@@ -138,11 +138,11 @@ before do subject.configure { |config| config.logger = ::Logger.new(log_stream) } end it "logs formatted request message" do - LogMe::NetHttpFormatter.any_instance.stub(:format_request).with(request, url).and_return("Request message.") + allow_any_instance_of(LogMe::NetHttpFormatter).to receive(:format_request).with(request, url).and_return("Request message.") subject.log_request(request, url) expect(log_stream.string).to include "[#{subject.name}] Request message.\n" end end @@ -153,10 +153,10 @@ before do subject.configure { |config| config.logger = ::Logger.new(log_stream) } end it "logs formatted response message" do - LogMe::NetHttpFormatter.any_instance.stub(:format_response).with(response).and_return("Response message.") + allow_any_instance_of(LogMe::NetHttpFormatter).to receive(:format_response).with(response).and_return("Response message.") subject.log_response response expect(log_stream.string).to include "[#{subject.name}] Response message.\n" end end end