diff options
| author | Jacob Helwig <jacob@puppetlabs.com> | 2011-02-03 19:14:23 -0800 |
|---|---|---|
| committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-02-03 19:14:23 -0800 |
| commit | ec4254dec20c8cc8ab9ef3065f4325ed52b9eacd (patch) | |
| tree | 1d847e457af83163dadd933632ab3af1eeedbddd /spec/unit/util | |
| parent | 876d0503dd93329a73e7f335c10a47330d745293 (diff) | |
| parent | e10ba1ab720cb62b39b430104a55a987f4c37f31 (diff) | |
Merge branch '2.6.next' into 2.6.x
* 2.6.next:
(#6018) Nick F's --help text for puppet inspect.
(#5823) document the not-an-API status of set_run_mode
(#5823) run mode can now be set dynamically...
(6114) Update the audit metaparameter for 2.6.5.
Fix for #5755 -- making zaml serialization robust over projected objects
(#4139) hook log autoflush into global defaults
Diffstat (limited to 'spec/unit/util')
| -rwxr-xr-x | spec/unit/util/log/destinations_spec.rb | 13 | ||||
| -rwxr-xr-x | spec/unit/util/log_spec.rb | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/unit/util/log/destinations_spec.rb b/spec/unit/util/log/destinations_spec.rb index 6596c0664..710a51725 100755 --- a/spec/unit/util/log/destinations_spec.rb +++ b/spec/unit/util/log/destinations_spec.rb @@ -22,3 +22,16 @@ describe Puppet::Util::Log.desttypes[:report] do dest.handle "my log" end end + + +describe Puppet::Util::Log.desttypes[:file] do + before do + File.stubs(:open) # prevent actually creating the file + @class = Puppet::Util::Log.desttypes[:file] + end + + it "should default to autoflush false" do + @class.new('/tmp/log').autoflush.should == false + end +end + diff --git a/spec/unit/util/log_spec.rb b/spec/unit/util/log_spec.rb index f3fd1b051..4a30d5086 100755 --- a/spec/unit/util/log_spec.rb +++ b/spec/unit/util/log_spec.rb @@ -136,6 +136,11 @@ describe Puppet::Util::Log do Puppet::Util::Log.new(:level => "notice", :message => :foo) end + it "should update Log autoflush when Puppet[:autoflush] is set" do + Puppet::Util::Log.expects(:autoflush=).once.with(true) + Puppet[:autoflush] = true + end + it "should have a method for determining if a tag is present" do Puppet::Util::Log.new(:level => "notice", :message => :foo).should respond_to(:tagged?) end |
