X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Funit%2Faggregate%2Fresult%2Fbase_spec.rb;fp=spec%2Funit%2Faggregate%2Fresult%2Fbase_spec.rb;h=9d05b933c2cd3608f30d77f7c429e6ca600f817b;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/spec/unit/aggregate/result/base_spec.rb b/spec/unit/aggregate/result/base_spec.rb new file mode 100644 index 0000000..9d05b93 --- /dev/null +++ b/spec/unit/aggregate/result/base_spec.rb @@ -0,0 +1,28 @@ +#!/usr/bin/env rspec + +require 'spec_helper' + +module MCollective + class Aggregate + module Result + describe Base do + describe "#initialize" do + it "should raise an exception if neither the ddl or the aggregate function defines a format" do + expect{ + base = Base.new(:structure, nil, :action) + }.to raise_error(RuntimeError, "No aggregate_format defined in ddl or aggregate function") + end + end + + describe "#to_s" do + it "should raise an exception if the to_s method isn't implemented" do + base = Base.new(:structure, :aggregate_format, :action) + expect{ + base.to_s + }.to raise_error(RuntimeError, "'to_s' method not implemented for result class 'MCollective::Aggregate::Result::Base'") + end + end + end + end + end +end