summaryrefslogtreecommitdiff
path: root/spec/unit/monologger_spec.rb
diff options
context:
space:
mode:
authorNikhil Benesch <nikhil.benesch@gmail.com>2014-01-13 01:52:14 -0500
committerdanielsdeleo <dan@opscode.com>2014-01-20 16:58:41 -0800
commitb7d801cae217216b74df0bcfcb04518e15319a9c (patch)
tree218b73ba3b3c0bb1bf41322ec193c82c6c4b5941 /spec/unit/monologger_spec.rb
parent6a4b9a7849f4c60fdd2b016b288e01f2a6fd03f2 (diff)
downloadchef-b7d801cae217216b74df0bcfcb04518e15319a9c.tar.gz
CHEF-4725: Disable buffering on all log streams
Centralize handling of log buffering to ensure it's always disabled. Previously, an unconfigured 'log_location' setting would erroneously fall back to a default STDOUT stream with output buffering enabled.
Diffstat (limited to 'spec/unit/monologger_spec.rb')
-rw-r--r--spec/unit/monologger_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/monologger_spec.rb b/spec/unit/monologger_spec.rb
index 38b23f22c6..3babc29218 100644
--- a/spec/unit/monologger_spec.rb
+++ b/spec/unit/monologger_spec.rb
@@ -20,6 +20,12 @@ require 'tempfile'
require 'spec_helper'
describe MonoLogger do
+ it "should disable buffering when passed an IO stream" do
+ STDOUT.sync = false
+ MonoLogger.new(STDOUT)
+ STDOUT.sync.should == true
+ end
+
describe "when given an object that responds to write and close e.g. IO" do
it "should use the object directly" do
stream = StringIO.new