From 5776fe4e33b5bb3399a2e72d76faeffb2bba1f4e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Sat, 7 Nov 2009 15:53:22 -0600 Subject: Cleaning up the Log initialization code. Signed-off-by: Luke Kanies --- spec/unit/util/log.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/unit') diff --git a/spec/unit/util/log.rb b/spec/unit/util/log.rb index 97fb2f297..7aaa580c5 100755 --- a/spec/unit/util/log.rb +++ b/spec/unit/util/log.rb @@ -114,6 +114,13 @@ describe Puppet::Util::Log do Puppet::Util::Log.new(:level => "notice", :message => :foo, :source => "foo") end + [:file, :line, :version].each do |attr| + it "should use #{attr} if provided" do + Puppet::Util::Log.any_instance.expects(attr.to_s + "=").with "foo" + Puppet::Util::Log.new(:level => "notice", :message => :foo, attr => "foo") + end + end + it "should default to 'Puppet' as its source" do Puppet::Util::Log.new(:level => "notice", :message => :foo).source.should == "Puppet" end -- cgit