Sha256: aac24c16a91d4bdc85a8ab88e7f95645582e6800a53f4af54892e52f2ae07d4f
Contents?: true
Size: 891 Bytes
Versions: 1
Compression:
Stored size: 891 Bytes
Contents
require 'spec_helper' module Alf describe Summarization, "coerce" do subject{ Summarization.coerce(arg) } describe "from a Summarization" do let(:arg){ Summarization.new(:s => Aggregator.sum{ qty }) } it{ should eq(arg) } end describe "from a Hash" do let(:arg){ { :s => Aggregator.sum{ qty }, :m => Aggregator.max{ size } } } it{ should be_a(Summarization) } specify{ subject.to_hash.keys.to_set.should eq([:s, :m].to_set) subject.to_hash.values.all?{|v| v.should be_a(Aggregator) } } end describe "from an Array" do let(:arg){ ["s", Aggregator.sum{ qty }, "m", Aggregator.max{ size }] } it{ should be_a(Summarization) } specify{ subject.to_hash.keys.to_set.should eq([:s, :m].to_set) subject.to_hash.values.all?{|v| v.should be_a(Aggregator) } } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
alf-core-0.15.0 | spec/unit/alf-types/summarization/test_coerce.rb |