diff options
Diffstat (limited to 'spec/functional/event_loggers/windows_eventlog_spec.rb')
-rw-r--r-- | spec/functional/event_loggers/windows_eventlog_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb index 9da9f60fa9..4e383dd429 100644 --- a/spec/functional/event_loggers/windows_eventlog_spec.rb +++ b/spec/functional/event_loggers/windows_eventlog_spec.rb @@ -19,12 +19,12 @@ require 'spec_helper' require 'securerandom' require 'chef/event_loggers/windows_eventlog' -if Chef::Platform.windows? +if Chef::Platform.windows? and not Chef::Platform::windows_server_2003? require 'win32/eventlog' include Win32 end -describe Chef::EventLoggers::WindowsEventLogger, :windows_only do +describe Chef::EventLoggers::WindowsEventLogger, :windows_only, :not_supported_on_win2k3 do let(:run_id) { SecureRandom.uuid } let(:version) { SecureRandom.uuid } let(:elapsed_time) { SecureRandom.random_number(100) } @@ -37,31 +37,31 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do let(:mock_exception) { double('Exception', {message: SecureRandom.uuid, backtrace:[SecureRandom.uuid, SecureRandom.uuid]})} it 'is available' do - Chef::EventLoggers::WindowsEventLogger.available?.should be_true + expect(Chef::EventLoggers::WindowsEventLogger.available?).to be_truthy end it 'writes run_start event with event_id 10000 and contains version' do logger.run_start(version) - expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10000 && - e.string_inserts[0].include?(version)}).to be_true + expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10000 && + e.string_inserts[0].include?(version)}).to be_truthy end it 'writes run_started event with event_id 10001 and contains the run_id' do logger.run_started(run_status) - expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10001 && - e.string_inserts[0].include?(run_id)}).to be_true + expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10001 && + e.string_inserts[0].include?(run_id)}).to be_truthy end it 'writes run_completed event with event_id 10002 and contains the run_id and elapsed time' do logger.run_started(run_status) logger.run_completed(node) - expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10002 && + expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10002 && e.string_inserts[0].include?(run_id) && e.string_inserts[1].include?(elapsed_time.to_s) - }).to be_true + }).to be_truthy end it 'writes run_failed event with event_id 10003 and contains the run_id, elapsed time, and exception info' do @@ -76,7 +76,7 @@ describe Chef::EventLoggers::WindowsEventLogger, :windows_only do e.string_inserts[3].include?(mock_exception.message) && e.string_inserts[4].include?(mock_exception.backtrace[0]) && e.string_inserts[4].include?(mock_exception.backtrace[1]) - end).to be_true + end).to be_truthy end end |