spec/enumerable/mean_spec.rb in simple_stats-1.0.0 vs spec/enumerable/mean_spec.rb in simple_stats-1.1.0
- old
+ new
@@ -22,7 +22,13 @@
mean = data.mean
mean.should == expected
mean.class.should == expected.class
end
end
+
+ it "calls map first if a block is given" do
+ f = Struct.new(:x)
+ data = [f.new(4), f.new(1), f.new(6)]
+ data.mean(&:x).should == 11 / 3.0
+ end
end
end
\ No newline at end of file