Sha256: 286381aa4b0f0bab31c1314bf5e95226b89d793d1192da465a89c99e044a58e6
Contents?: true
Size: 656 Bytes
Versions: 18
Compression:
Stored size: 656 Bytes
Contents
require File.dirname(__FILE__) + '/spec_helper.rb' module ArrayMath describe "ArrayMath" do context "Sum" do it "sums an array" do array = [1,2,3,4,5] array.asum.should == 15 end it "can not sum an array of strings" do array = ["hello", "goodbye"] array.asum.should == nil end end context "average" do it "averages an array of integers and returns a float" do array = [2,3,4,3,2] array.aaverage.should == 2.8 end it "averages an array of floats" do array = [1.5,2.5,3.5,2.5,1.5] array.aaverage.should == 2.3 end end end end
Version data entries
18 entries across 18 versions & 2 rubygems