Sha256: 5e72d8c89a0fd7cdd50d288b332cd1dfd1f65449a3c181d358fd37d781d0652b
Contents?: true
Size: 590 Bytes
Versions: 9
Compression:
Stored size: 590 Bytes
Contents
require 'spec_helper' module Alf class Aggregator describe Stddev do let(:rel){[ {:qty => 10}, {:qty => 20}, {:qty => 30}, {:qty => 40} ]} let(:expected) { Math.sqrt(Variance.new{qty}.aggregate(rel)) } it 'should work when used standalone' do Stddev.new{ qty }.aggregate(rel).should eq(expected) end it 'should install factory methods' do Aggregator.stddev{ qty }.should be_a(Stddev) Aggregator.stddev{ qty }.aggregate(rel).should eq(expected) end end end end
Version data entries
9 entries across 9 versions & 2 rubygems