9d05b933c2cd3608f30d77f7c429e6ca600f817b
[packages/precise/mcollective.git] / spec / unit / aggregate / result / base_spec.rb
1 #!/usr/bin/env rspec
2
3 require 'spec_helper'
4
5 module MCollective
6   class Aggregate
7     module Result
8       describe Base do
9         describe "#initialize" do
10           it "should raise an exception if neither the ddl or the aggregate function defines a format" do
11             expect{
12               base = Base.new(:structure, nil, :action)
13             }.to raise_error(RuntimeError, "No aggregate_format defined in ddl or aggregate function")
14           end
15         end
16
17         describe "#to_s" do
18           it "should raise an exception if the to_s method isn't implemented" do
19             base = Base.new(:structure, :aggregate_format, :action)
20             expect{
21               base.to_s
22             }.to raise_error(RuntimeError, "'to_s' method not implemented for result class 'MCollective::Aggregate::Result::Base'")
23           end
24         end
25       end
26     end
27   end
28 end