summaryrefslogtreecommitdiffstats
path: root/spec/unit/indirector/report
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-07-19 14:11:37 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-07-25 12:54:27 -0700
commitf484851b7528c0fcf1254d25a022e9cb7ef9b3bd (patch)
tree8613895f643fa39e96ad59d7c5070cf34f9644d7 /spec/unit/indirector/report
parent790e947e5581fc51e7002c81c3848fb7048bb6ac (diff)
downloadpuppet-f484851b7528c0fcf1254d25a022e9cb7ef9b3bd.tar.gz
puppet-f484851b7528c0fcf1254d25a022e9cb7ef9b3bd.tar.xz
puppet-f484851b7528c0fcf1254d25a022e9cb7ef9b3bd.zip
maint: Add debug logging when the master receives a report
It's always bothered me that when running puppet inspect (or any application that produces a report really) the master gives no indication that anything happened when it processes the report. Reviewed-by: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'spec/unit/indirector/report')
-rwxr-xr-xspec/unit/indirector/report/processor_spec.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/unit/indirector/report/processor_spec.rb b/spec/unit/indirector/report/processor_spec.rb
index 5602a271f..ac3162886 100755
--- a/spec/unit/indirector/report/processor_spec.rb
+++ b/spec/unit/indirector/report/processor_spec.rb
@@ -25,9 +25,11 @@ describe Puppet::Transaction::Report::Processor, " when saving a report" do
it "should not process the report if reports are set to 'none'" do
Puppet::Reports.expects(:report).never
- Puppet.settings.expects(:value).with(:reports).returns("none")
+ Puppet[:reports] = 'none'
- request = stub 'request', :instance => mock("report")
+ request = Puppet::Indirector::Request.new(:indirection_name, :head, "key")
+ report = Puppet::Transaction::Report.new('apply')
+ request.instance = report
@reporter.save(request)
end
@@ -40,14 +42,14 @@ end
describe Puppet::Transaction::Report::Processor, " when processing a report" do
before do
- Puppet.settings.stubs(:value).with(:reports).returns("one")
+ Puppet[:reports] = "one"
Puppet.settings.stubs(:use)
@reporter = Puppet::Transaction::Report::Processor.new
@report_type = mock 'one'
@dup_report = mock 'dupe report'
@dup_report.stubs(:process)
- @report = mock 'report'
+ @report = Puppet::Transaction::Report.new('apply')
@report.expects(:dup).returns(@dup_report)
@request = stub 'request', :instance => @report
@@ -74,7 +76,7 @@ describe Puppet::Transaction::Report::Processor, " when processing a report" do
end
it "should not raise exceptions" do
- Puppet.settings.stubs(:value).with(:trace).returns(false)
+ Puppet[:trace] = false
@dup_report.expects(:process).raises(ArgumentError)
proc { @reporter.save(@request) }.should_not raise_error
end