X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Funit%2Faggregate%2Fresult%2Fnumeric_result_spec.rb;fp=spec%2Funit%2Faggregate%2Fresult%2Fnumeric_result_spec.rb;h=4c92d91feff908236a181e17f11bdd44323d0e1b;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/spec/unit/aggregate/result/numeric_result_spec.rb b/spec/unit/aggregate/result/numeric_result_spec.rb new file mode 100644 index 0000000..4c92d91 --- /dev/null +++ b/spec/unit/aggregate/result/numeric_result_spec.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env rspec + +require 'spec_helper' + +module MCollective + class Aggregate + module Result + describe NumericResult do + describe "#to_s" do + it "should return empty string when no results were computed" do + NumericResult.new({}, "test %d", :action).to_s.should == "" + end + + it "should return the correctly formatted string" do + num = NumericResult.new({:value => 1}, "test %d", :action).to_s + num.should == "test 1" + end + end + end + end + end +end