diff options
| author | Luke Kanies <luke@madstop.com> | 2009-11-01 14:47:53 -0500 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 9a78beee0e4dadeaaff0c7b6a5f659f147f108c8 (patch) | |
| tree | 08a9bc41d4b2d705ad89447f0df8af231e21bbb3 /spec | |
| parent | f2ed655d5e5a9b7c61b29cda229b63db2d73064e (diff) | |
Adding tests for the 'report' log destination
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/util/log/destinations.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/unit/util/log/destinations.rb b/spec/unit/util/log/destinations.rb new file mode 100755 index 000000000..0bc416e74 --- /dev/null +++ b/spec/unit/util/log/destinations.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../../spec_helper' + +require 'puppet/util/log' + +describe Puppet::Util::Log.desttypes[:report] do + before do + @dest = Puppet::Util::Log.desttypes[:report] + end + + it "should require a report at initialization" do + @dest.new("foo").report.should == "foo" + end + + it "should send new messages to the report" do + report = mock 'report' + dest = @dest.new(report) + + report.expects(:newlog).with("my log") + + dest.handle "my log" + end +end |
