spec/excel_functions_spec.rb in rubyfromexcel-0.0.6 vs spec/excel_functions_spec.rb in rubyfromexcel-0.0.7
- old
+ new
@@ -51,9 +51,17 @@
FunctionTest.rounddown(1.5,0).should == 1.0
FunctionTest.rounddown(1.53,1).should == 1.5
end
end
+describe "mod" do
+ it "should return the remainder of a number" do
+ FunctionTest.mod(10,3).should == 1.0
+ FunctionTest.mod(10,5).should == 0.0
+ FunctionTest.mod(1.1,1).should be_close(0.1,0.01)
+ end
+end
+
describe "sum" do
it "should total areas correctly" do
FunctionTest.sum(1,2,3).should == 6
FunctionTest.sum(FunctionTest.a('a1','a2'),3).should == 113
end
\ No newline at end of file