Updated mcollective.init according to OSCI-658
[packages/precise/mcollective.git] / spec / unit / aggregate / result / numeric_result_spec.rb
diff --git a/spec/unit/aggregate/result/numeric_result_spec.rb b/spec/unit/aggregate/result/numeric_result_spec.rb
new file mode 100644 (file)
index 0000000..4c92d91
--- /dev/null
@@ -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