add core/float/{<, <=, >, >=} specs

This commit is contained in:
Laurent Sansonetti
2014-04-20 20:43:31 +02:00
parent 006a5419bd
commit c537374a75
4 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
describe "Float#>" do
it "returns true if self is greater than other" do
(1.5 > 1).should == true
(2.5 > 3).should == false
(45.91 > bignum_value).should == false
end
end

View File

@@ -0,0 +1,7 @@
describe "Float#>=" do
it "returns true if self is greater than or equal to other" do
(5.2 >= 5.2).should == true
(9.71 >= 1).should == true
(5.55382 >= 0xfabdafbafcab).should == false
end
end

View File

@@ -0,0 +1,7 @@
describe "Float#<" do
it "returns true if self is less than other" do
(71.3 < 91.8).should == true
(192.6 < -500).should == false
(-0.12 < 0x4fffffff).should == true
end
end

View File

@@ -0,0 +1,8 @@
describe "Float#<=" do
it "returns true if self is less than or equal to other" do
(2.0 <= 3.14159).should == true
(-2.7183 <= -24).should == false
(0.0 <= 0.0).should == true
(9_235.9 <= bignum_value).should == true
end
end