Sha256: 9d6f8667bbfaa35df6c14ac48dff293ef0c6a91d7751cdd04d09bd109b90e028

Contents?: true

Size: 622 Bytes

Versions: 36

Compression:

Stored size: 622 Bytes

Contents

require 'liquid/ext/enumerable'

describe Enumerable do

  it "should support the sum for a list of numbers" do
    [1,2,3,4,5].sum.should == 15
  end

  it "should support the mean for a list of numbers" do
    [1,2,3,4,5].mean.should == 3.0
  end

  it "should support the variance for a list of numbers" do
    [9,8,7,6,5].variance.should == 2.5
  end

  it "should support the standard deviation for a list of numbers" do
    [9,8,7,6,5].stdev.should == 1.5811388300841898
  end

  it "should support a percentile method for a list of numbers" do
    [9,1,8,2,7,3,6,4,5,4,3,2,1].percentile(0.9).should == 8
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
liquid-ext-3.0.0 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-2.0.3 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-2.0.2 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-2.0.1 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-2.0.0 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.2.6 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.2.5 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.2.4 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.2.2 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.2.1 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.2.0 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.1.1 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.1.0 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.0.2 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.0.1 spec/lib/liquid/ext/enumerable_spec.rb
liquid-ext-1.0.0 spec/lib/liquid/ext/enumerable_spec.rb