diff options
author | Luke Kanies <luke@madstop.com> | 2009-11-07 15:53:22 -0600 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 5776fe4e33b5bb3399a2e72d76faeffb2bba1f4e (patch) | |
tree | 087b90dcbb7cee435cfa8169e4f336256f0e1286 /spec/unit | |
parent | 2292b768c93a1ccba91cfe92d60c65ed936dd45c (diff) | |
download | puppet-5776fe4e33b5bb3399a2e72d76faeffb2bba1f4e.tar.gz puppet-5776fe4e33b5bb3399a2e72d76faeffb2bba1f4e.tar.xz puppet-5776fe4e33b5bb3399a2e72d76faeffb2bba1f4e.zip |
Cleaning up the Log initialization code.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/util/log.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |