Testing Logger Configuration Implementation in grape
This test suite examines the logger functionality in the Grape DSL module, specifically focusing on the Logger component. It verifies the proper implementation of logger setting and retrieval operations within Grape applications. The tests ensure reliable logging behavior for debugging and monitoring purposes.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
ruby-grape/grape
spec/grape/dsl/logger_spec.rb
# frozen_string_literal: true
describe Grape::DSL::Logger do
subject { Class.new(dummy_logger) }
let(:dummy_logger) do
Class.new do
extend Grape::DSL::Logger
end
end
let(:logger) { instance_double(Logger) }
describe '.logger' do
it 'sets a logger' do
subject.logger logger
expect(subject.logger).to eq logger
end
it 'returns a logger' do
expect(subject.logger(logger)).to eq logger
end
end
end