Skip to content

Commit

Permalink
Fixed a few examples in the Bignum comparison spec.
Browse files Browse the repository at this point in the history
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
  • Loading branch information
Patrick Thomson authored and alloy committed Jul 1, 2009
1 parent 554d336 commit f3bfacd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions core/bignum/comparison_spec.rb
Expand Up @@ -5,18 +5,18 @@
@bignum = bignum_value(96)
@inf = 1/0.0
end

it "returns -1 when self is less than the given argument" do
(-@bignum <=> @bignum).should == -1
(-@bignum <=> -1).should == -1
(-@bignum <=> -4.5).should == -1
end

it "returns 0 when self is equal to the given argument" do
(@bignum <=> @bignum).should == 0
(-@bignum <=> -@bignum).should == 0
end

it "returns 1 when self is greater than the given argument" do
(@bignum <=> -@bignum).should == 1
(@bignum <=> 1).should == 1
Expand All @@ -34,18 +34,18 @@
#
it "returns 1 when self is Infinity and other is a Bignum" do
(@inf <=> Float::MAX.to_i*2).should == 1
end
end

it "returns -1 when self is negative and other is Infinty" do
(-Float::MAX.to_i*2 <=> @inf).should == -1
end
it "returns 1 when self is negative and other is -Infinity" do
(-Float::MAX.to_i*2 <=> @inf).should == 1
end

it "returns -1 when self is -Infinity and other is negative" do
(-@inf <=> -Float::MAX.to_i*2).should == -1
end

it "returns -1 when self is -Infinity and other is negative" do
(-@inf <=> -Float::MAX.to_i*2).should == -1
it "returns -1 when self is negative and other is Infinty" do
(-Float::MAX.to_i*2 <=> @inf).should == -1
end
end

Expand All @@ -54,18 +54,18 @@
#
it "returns 1 when self is Infinity and other is a Bignum" do
(@inf <=> Float::MAX.to_i*2).should == 1
end
end

it "returns -1 when self is negative and other is Infinty" do
(-Float::MAX.to_i*2 <=> @inf).should == -1
end
it "returns 1 when self is negative and other is -Infinity" do
(-Float::MAX.to_i*2 <=> -@inf).should == 1
end

it "returns -1 when self is -Infinity and other is negative" do
(-@inf <=> -Float::MAX.to_i*2).should == -1
end

it "returns -1 when self is negative and other is -Infinity" do
(-@inf <=> -Float::MAX.to_i*2).should == -1
it "returns -1 when self is negative and other is Infinty" do
(-Float::MAX.to_i*2 <=> @inf).should == -1
end
end
end

0 comments on commit f3bfacd

Please sign in to comment.