diff options
| -rw-r--r-- | lib/puppet/application/apply.rb | 1 | ||||
| -rwxr-xr-x | spec/unit/application/apply_spec.rb | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb index 59a95d35a..ed1331d63 100644 --- a/lib/puppet/application/apply.rb +++ b/lib/puppet/application/apply.rb @@ -139,6 +139,7 @@ class Puppet::Application::Apply < Puppet::Application configurer.send_report(report, transaction) else transaction.generate_report + configurer.save_last_run_summary(transaction.report) end exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? transaction.report.exit_status : 0 ) diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb index edb41b5c3..9dcfd5f2f 100755 --- a/spec/unit/application/apply_spec.rb +++ b/spec/unit/application/apply_spec.rb @@ -316,6 +316,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) |
