Sha256: dc27b3f4bb48020ea08f324dc1d6b13f9ec6f05c626edd96925635e4f97bfc72

Contents?: true

Size: 437 Bytes

Versions: 9

Compression:

Stored size: 437 Bytes

Contents

require 'spec_helper'
module Alf
  class Aggregator
    describe Avg do

      let(:rel){[
        {:qty => 10}, 
        {:qty => 1}
      ]}

      it 'should work when used standalone' do
        Avg.new{ qty }.aggregate(rel).should eq(5.5)
      end

      it 'should install factory methods' do
        Aggregator.avg{ qty }.should be_a(Avg)
        Aggregator.avg{ qty }.aggregate(rel).should eq(5.5)
      end

    end
  end
end 

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-aggregator/test_avg.rb
alf-core-0.14.0 spec/unit/alf-aggregator/test_avg.rb
alf-core-0.13.1 spec/unit/alf-aggregator/test_avg.rb
alf-core-0.13.0 spec/unit/alf-aggregator/test_avg.rb
alf-0.12.2 spec/unit/alf-core/aggregator/test_avg.rb
alf-0.12.1 spec/unit/alf-core/aggregator/test_avg.rb
alf-0.12.0 spec/unit/alf-core/aggregator/test_avg.rb
alf-0.11.1 spec/unit/alf-core/aggregator/test_avg.rb
alf-0.11.0 spec/unit/alf-core/aggregator/test_avg.rb