diff options
| author | Paul Berry <paul@puppetlabs.com> | 2010-11-22 11:56:41 -0800 |
|---|---|---|
| committer | Paul Berry <paul@puppetlabs.com> | 2010-11-22 11:56:41 -0800 |
| commit | 9ed1235c295995b61373b11aa4ae0cc6bb320527 (patch) | |
| tree | 6464dee8324bef52b1f6847fb2f7605978eaa3a3 /spec/unit/application | |
| parent | a10deae8913f12935726da6944cad627e3277c52 (diff) | |
| parent | ccc944f21a259f0216b0bfd4873c98d89127a753 (diff) | |
Merge remote branch 'masterzen/feature/master/4339' into next
Manually resolved conflicts:
spec/unit/configurer_spec.rb
Diffstat (limited to 'spec/unit/application')
| -rwxr-xr-x | spec/unit/application/agent_spec.rb | 7 | ||||
| -rwxr-xr-x | spec/unit/application/apply_spec.rb | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb index 8fc98b8c1..50ef00c57 100755 --- a/spec/unit/application/agent_spec.rb +++ b/spec/unit/application/agent_spec.rb @@ -180,6 +180,7 @@ describe Puppet::Application::Agent do Puppet[:libdir] = "/dev/null/lib" 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=) @@ -311,6 +312,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[:catalog_terminus] = :foo @puppetd.setup diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb index 22ac471cd..8b20aa907 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 @@ -316,6 +322,17 @@ describe Puppet::Application::Apply do @apply.main end + it "should save the last run summary" do + configurer = stub_everything 'configurer' + Puppet::Configurer.expects(:new).returns configurer + Puppet.stubs(:[]).with(:noop).returns(false) + report = stub 'report' + @transaction.stubs(:report).returns(report) + + configurer.expects(:save_last_run_summary).with(report) + @apply.main + end + describe "with detailed_exitcodes" do it "should exit with report's computed exit status" do Puppet.stubs(:[]).with(:noop).returns(false) |
