spec/lib/logstasher/railtie_spec.rb in md-logstasher-1.5.0 vs spec/lib/logstasher/railtie_spec.rb in md-logstasher-1.6.0

- old
+ new

@@ -16,9 +16,27 @@ end describe ::LogStasher::Railtie do let(:config) { described_class.config.logstasher } + describe 'logstasher should touch log file to prevent creation message by default' do + it 'should configure LogStasher' do + expect(::FileUtils).to receive(:touch) + ActiveSupport.run_load_hooks(:before_initialize) + end + end + + describe 'logstasher should NOT touch log file if silence disabled' do + before { config.silence_creation_message = false } + after { config.silence_creation_message = true } + + it 'should configure LogStasher' do + expect(::FileUtils).not_to receive(:touch) + ActiveSupport.run_load_hooks(:before_initialize) + end + end + + describe 'logstasher.configure' do it 'should configure LogStasher' do config.logger = ::Logger.new('/dev/null') config.log_level = "log_level" config.enabled = "enabled"