summaryrefslogtreecommitdiffstats
path: root/spec/unit/transaction
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-12-29 14:09:57 -0800
committerPaul Berry <paul@puppetlabs.com>2010-12-30 11:50:51 -0800
commita4e40f4dd5990df4dc6b2be065e82a142a31b6fc (patch)
tree30e7c792f7e1997d34efd79bc1c81f81e70afcfc /spec/unit/transaction
parent15dda94c7d1e117273928f094b46a81b3f842c1f (diff)
downloadpuppet-a4e40f4dd5990df4dc6b2be065e82a142a31b6fc.tar.gz
puppet-a4e40f4dd5990df4dc6b2be065e82a142a31b6fc.tar.xz
puppet-a4e40f4dd5990df4dc6b2be065e82a142a31b6fc.zip
(#5715) Refactor in preparation for adding a status attribute to reports.
Renamed Puppet::Transaction::Report#calculate_metrics to finalize_report, in preparation for adding more functionality to this method. Removed Puppet::Transaction#send_report and Puppet::Transaction#generate_report. The former was never used, and the latter was unnecessary.
Diffstat (limited to 'spec/unit/transaction')
-rwxr-xr-xspec/unit/transaction/report_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/transaction/report_spec.rb b/spec/unit/transaction/report_spec.rb
index 8c4ed8afe..98be28755 100755
--- a/spec/unit/transaction/report_spec.rb
+++ b/spec/unit/transaction/report_spec.rb
@@ -145,7 +145,7 @@ describe Puppet::Transaction::Report do
[:time, :resources, :changes, :events].each do |type|
it "should add #{type} metrics" do
- @report.calculate_metrics
+ @report.finalize_report
@report.metrics[type.to_s].should be_instance_of(Puppet::Transaction::Metric)
end
end
@@ -154,7 +154,7 @@ describe Puppet::Transaction::Report do
it "should provide the total number of resources" do
add_statuses(3)
- @report.calculate_metrics
+ @report.finalize_report
metric(:resources, :total).should == 3
end
@@ -162,7 +162,7 @@ describe Puppet::Transaction::Report do
it "should provide the number of #{state} resources as determined by the status objects" do
add_statuses(3) { |status| status.send(state.to_s + "=", true) }
- @report.calculate_metrics
+ @report.finalize_report
metric(:resources, state).should == 3
end
end
@@ -171,7 +171,7 @@ describe Puppet::Transaction::Report do
describe "for changes" do
it "should provide the number of changes from the resource statuses" do
add_statuses(3) { |status| 3.times { status << Puppet::Transaction::Event.new(:status => 'success') } }
- @report.calculate_metrics
+ @report.finalize_report
metric(:changes, :total).should == 9
end
end
@@ -188,7 +188,7 @@ describe Puppet::Transaction::Report do
status.evaluation_time = 3
end
- @report.calculate_metrics
+ @report.finalize_report
metric(:time, "file").should == 3
metric(:time, "exec").should == 6
@@ -197,7 +197,7 @@ describe Puppet::Transaction::Report do
it "should add any provided times from external sources" do
@report.add_times :foobar, 50
- @report.calculate_metrics
+ @report.finalize_report
metric(:time, "foobar").should == 50
end
@@ -206,7 +206,7 @@ describe Puppet::Transaction::Report do
status.evaluation_time = 1.25
end
@report.add_times :config_retrieval, 0.5
- @report.calculate_metrics
+ @report.finalize_report
metric(:time, "total").should == 4.25
end
end
@@ -216,7 +216,7 @@ describe Puppet::Transaction::Report do
add_statuses(3) do |status|
3.times { |i| status.add_event(Puppet::Transaction::Event.new) }
end
- @report.calculate_metrics
+ @report.finalize_report
metric(:events, :total).should == 9
end
@@ -230,7 +230,7 @@ describe Puppet::Transaction::Report do
end
end
- @report.calculate_metrics
+ @report.finalize_report
metric(:events, status_name).should == 9
end
end
@@ -245,7 +245,7 @@ describe Puppet::Transaction::Report do
trans = catalog.apply
@report = trans.report
- @report.calculate_metrics
+ @report.finalize_report
end
%w{Changes Total Resources}.each do |main|