summaryrefslogtreecommitdiffstats
path: root/spec/unit/application
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2010-11-13 11:41:18 +0100
committerJacob Helwig <jacob@puppetlabs.com>2011-04-05 15:27:03 -0700
commit5d1cb02cd1ee509647a6dbe157152bd74d5e24ae (patch)
tree8202a113ebd70efe2f50479d1e542a53c362537d /spec/unit/application
parent306aa3032a3770c0d668907ae08042be88ec725e (diff)
downloadpuppet-5d1cb02cd1ee509647a6dbe157152bd74d5e24ae.tar.gz
puppet-5d1cb02cd1ee509647a6dbe157152bd74d5e24ae.tar.xz
puppet-5d1cb02cd1ee509647a6dbe157152bd74d5e24ae.zip
Fix #4339 - Locally save the last report to $lastrunreport
Using the cache terminus system, when --report is on, we are now caching the last report as a yaml file in the $lastrunreport file (which by default is $statedir/last_run_report.yaml). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/unit/application')
-rwxr-xr-xspec/unit/application/agent_spec.rb7
-rwxr-xr-xspec/unit/application/apply_spec.rb6
2 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb
index 8f498d4ba..c9d9a4509 100755
--- a/spec/unit/application/agent_spec.rb
+++ b/spec/unit/application/agent_spec.rb
@@ -179,6 +179,7 @@ describe Puppet::Application::Agent do
Puppet.settings.stubs(:print_config)
Puppet::SSL::Host.stubs(:ca_location=)
Puppet::Transaction::Report.stubs(:terminus_class=)
+ Puppet::Transaction::Report.stubs(:cache_class=)
Puppet::Resource::Catalog.stubs(:terminus_class=)
Puppet::Resource::Catalog.stubs(:cache_class=)
Puppet::Node::Facts.stubs(:terminus_class=)
@@ -309,6 +310,12 @@ describe Puppet::Application::Agent do
@puppetd.setup
end
+ it "should tell the report handler to cache locally as yaml" do
+ Puppet::Transaction::Report.expects(:cache_class=).with(:yaml)
+
+ @puppetd.setup
+ end
+
it "should change the catalog_terminus setting to 'rest'" do
Puppet.expects(:[]=).with(:catalog_terminus, :rest)
@puppetd.setup
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb
index d4f39abe0..67edd4ed7 100755
--- a/spec/unit/application/apply_spec.rb
+++ b/spec/unit/application/apply_spec.rb
@@ -56,6 +56,7 @@ describe Puppet::Application::Apply do
Puppet.stubs(:parse_config)
Puppet::FileBucket::Dipper.stubs(:new)
STDIN.stubs(:read)
+ Puppet::Transaction::Report.stubs(:cache_class=)
@apply.options.stubs(:[]).with(any_parameters)
end
@@ -113,6 +114,11 @@ describe Puppet::Application::Apply do
lambda { @apply.setup }.should raise_error(SystemExit)
end
+ it "should tell the report handler to cache locally as yaml" do
+ Puppet::Transaction::Report.expects(:cache_class=).with(:yaml)
+
+ @apply.setup
+ end
end
describe "when executing" do