spec/lib/http_log_spec.rb in httplog-1.0.3 vs spec/lib/http_log_spec.rb in httplog-1.1.0
- old
+ new
@@ -40,11 +40,11 @@
expect(log).to_not include(HttpLog::LOG_PREFIX + 'Header:')
expect(log).to include(HttpLog::LOG_PREFIX + 'Status: 200')
expect(log).to include(HttpLog::LOG_PREFIX + 'Benchmark: ')
expect(log).to include(HttpLog::LOG_PREFIX + "Response:#{adapter.expected_response_body}")
- expect(log.colorized?).to be_falsey
+ expect(log).to_not include("\e[0")
expect(res).to be_a adapter.response if adapter.respond_to? :response
end
context 'with gzip encoding' do
@@ -98,11 +98,10 @@
expect(log).to include(HttpLog::LOG_PREFIX + 'Data: foo=bar&bar=foo')
expect(log).to_not include(HttpLog::LOG_PREFIX + 'Header:')
expect(log).to include(HttpLog::LOG_PREFIX + 'Status: 200')
expect(log).to include(HttpLog::LOG_PREFIX + 'Benchmark: ')
expect(log).to include(HttpLog::LOG_PREFIX + "Response:#{adapter.expected_response_body}")
- expect(log.colorized?).to be_falsey
expect(res).to be_a adapter.response if adapter.respond_to? :response
end
context 'with non-UTF request data' do
@@ -203,11 +202,11 @@
end
it 'should colorized output' do
HttpLog.configure { |c| c.color = :red }
adapter.send_get_request
- expect(log.colorized?).to be_truthy
+ expect(log).to include("\e[0")
end
it 'should log with custom string prefix' do
HttpLog.configure { |c| c.prefix = '[my logger]' }
adapter.send_get_request
@@ -256,15 +255,9 @@
it 'should not log the benchmark if disabled' do
HttpLog.configure { |c| c.log_benchmark = false }
adapter.send_post_request
expect(log).to_not include(HttpLog::LOG_PREFIX + 'Benchmark:')
- end
-
- it 'should colorized output' do
- HttpLog.configure { |c| c.color = :red }
- adapter.send_post_request
- expect(log.colorized?).to be_truthy
end
end
end
context 'POST form data requests' do