diff options
author | sawanoboly <sawanoboriyu@higanworks.com> | 2015-04-25 17:29:48 +0900 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-05-06 15:09:44 -0700 |
commit | 113c7cf873049dfc2387d5276ad11f16a1427f2a (patch) | |
tree | 12016ff3a415c3c8a1a10ca41a24a845d81b6c99 | |
parent | ef30733797e3990ed33b9ca537f8ce86cba37486 (diff) | |
download | chef-113c7cf873049dfc2387d5276ad11f16a1427f2a.tar.gz |
avoid platfomr matched /mswin|mingw|windows/
-rw-r--r-- | lib/chef/log.rb | 2 | ||||
-rw-r--r-- | spec/unit/log_spec.rb | 28 |
2 files changed, 16 insertions, 14 deletions
diff --git a/lib/chef/log.rb b/lib/chef/log.rb index 84d71c4f9c..a47002a2fc 100644 --- a/lib/chef/log.rb +++ b/lib/chef/log.rb @@ -21,7 +21,7 @@ require 'logger' require 'chef/monologger' require 'chef/exceptions' require 'mixlib/log' -require 'chef/log/syslog' +require 'chef/log/syslog' unless (RUBY_PLATFORM =~ /mswin|mingw|windows/) class Chef class Log diff --git a/spec/unit/log_spec.rb b/spec/unit/log_spec.rb index 931d0adf11..84627494be 100644 --- a/spec/unit/log_spec.rb +++ b/spec/unit/log_spec.rb @@ -23,21 +23,23 @@ require 'spec_helper' describe Chef::Log do end -describe Chef::Log::Syslog do - let(:logger) { Chef::Log::Syslog.new } +unless Chef::Platform.windows? + describe Chef::Log::Syslog do + let(:logger) { Chef::Log::Syslog.new } - it "should send message with severity info to syslog." do - expect_any_instance_of(Logger::Syslog).to receive(:info).with("*** Chef 12.4.0.dev.0 ***") - logger.write("[2015-04-23T15:16:23+09:00] INFO: *** Chef 12.4.0.dev.0 ***") - end + it "should send message with severity info to syslog." do + expect_any_instance_of(Logger::Syslog).to receive(:info).with("*** Chef 12.4.0.dev.0 ***") + logger.write("[2015-04-23T15:16:23+09:00] INFO: *** Chef 12.4.0.dev.0 ***") + end - it "should send message with severity warning to syslog." do - expect_any_instance_of(Logger::Syslog).to receive(:warn).with("No config file found or specified on command line, using command line options.") - logger.write("[2015-04-23T15:16:20+09:00] WARN: No config file found or specified on command line, using command line options.") - end + it "should send message with severity warning to syslog." do + expect_any_instance_of(Logger::Syslog).to receive(:warn).with("No config file found or specified on command line, using command line options.") + logger.write("[2015-04-23T15:16:20+09:00] WARN: No config file found or specified on command line, using command line options.") + end - it "should fallback into send message with severity info to syslog when wrong format." do - expect_any_instance_of(Logger::Syslog).to receive(:info).with("chef message") - logger.write("chef message") + it "should fallback into send message with severity info to syslog when wrong format." do + expect_any_instance_of(Logger::Syslog).to receive(:info).with("chef message") + logger.write("chef message") + end end end |