From cbf08f6fa381181fe7064d6600deaf67d489b63a Mon Sep 17 00:00:00 2001
From: Jim Deville <jdeville@microsoft.com>
Date: Tue, 8 Jul 2008 14:03:04 -0700
Subject: [PATCH] added guards for ironruby to bignum specs, converted specs with string float comparisons to direct comparisons with be_close

---
 1.8/core/bignum/coerce_spec.rb   |    4 ++--
 1.8/core/bignum/exponent_spec.rb |    2 +-
 1.8/core/bignum/minus_spec.rb    |    4 ++--
 1.8/core/bignum/plus_spec.rb     |    5 +++--
 1.8/core/bignum/size_spec.rb     |    2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/1.8/core/bignum/coerce_spec.rb b/1.8/core/bignum/coerce_spec.rb
index 6eb5bf9..cdd273e 100644
--- a/1.8/core/bignum/coerce_spec.rb
+++ b/1.8/core/bignum/coerce_spec.rb
@@ -19,9 +19,9 @@ describe "Bignum#coerce when given a non Fixnum/Bignum" do
     lambda { a.coerce(1..4) }.should raise_error(TypeError)
     lambda { a.coerce(:test) }.should raise_error(TypeError)
 
-    compliant_on :ruby do
+    compliant_on :ruby, :ir do
       lambda { a.coerce(12.3) }.should raise_error(TypeError)
       lambda { a.coerce("123") }.should raise_error(TypeError)
     end
   end
-end
\ No newline at end of file
+end
diff --git a/1.8/core/bignum/exponent_spec.rb b/1.8/core/bignum/exponent_spec.rb
index f4d3d94..a575f8d 100644
--- a/1.8/core/bignum/exponent_spec.rb
+++ b/1.8/core/bignum/exponent_spec.rb
@@ -7,7 +7,7 @@ describe "Bignum#**" do
   
   it "returns self raised to other power" do
     (@bignum ** 4).should == 7237005577332262361485077344629993318496048279512298547155833600056910050625
-    (@bignum ** 5.2).inspect.should == "4.14406519833189e+98"
+    (@bignum ** 1.2).should be_close(57262152889751597425762.57804, TOLERANCE)
   end
 
   it "raises a TypeError when given a non-Integer" do
diff --git a/1.8/core/bignum/minus_spec.rb b/1.8/core/bignum/minus_spec.rb
index c2b3339..b4ef587 100644
--- a/1.8/core/bignum/minus_spec.rb
+++ b/1.8/core/bignum/minus_spec.rb
@@ -7,7 +7,7 @@ describe "Bignum#-" do
   
   it "returns self minus the given Integer" do
     (@bignum - 9).should == 9223372036854776113
-    (@bignum - 12.57).to_s.should == "9.22337203685478e+18"
+    (@bignum - 12.57).should be_close(9223372036854776109.43, TOLERANCE)
     (@bignum - bignum_value(42)).should == 272
   end
 
@@ -16,4 +16,4 @@ describe "Bignum#-" do
     lambda { @bignum - "10" }.should raise_error(TypeError)
     lambda { @bignum - :symbol }.should raise_error(TypeError)
   end
-end
\ No newline at end of file
+end
diff --git a/1.8/core/bignum/plus_spec.rb b/1.8/core/bignum/plus_spec.rb
index 729f7d2..bcc79c8 100644
--- a/1.8/core/bignum/plus_spec.rb
+++ b/1.8/core/bignum/plus_spec.rb
@@ -7,7 +7,8 @@ describe "Bignum#+" do
   
   it "returns self plus the given Integer" do
     (@bignum + 4).should == 9223372036854775888
-    (@bignum + 4.2).to_s.should == "9.22337203685478e+18"
+    (@bignum + 4.2).should be_close(9223372036854775888.2, TOLERANCE)
+
     (@bignum + bignum_value(3)).should == 18446744073709551695
   end
 
@@ -16,4 +17,4 @@ describe "Bignum#+" do
     lambda { @bignum + "10" }.should raise_error(TypeError)
     lambda { @bignum + :symbol}.should raise_error(TypeError)
   end
-end
\ No newline at end of file
+end
diff --git a/1.8/core/bignum/size_spec.rb b/1.8/core/bignum/size_spec.rb
index fbf8290..9628253 100644
--- a/1.8/core/bignum/size_spec.rb
+++ b/1.8/core/bignum/size_spec.rb
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
 
 describe "Bignum#size" do
   it "returns the number of bytes in the machine representation of self" do
-    compliant_on(:ruby) do
+    compliant_on(:ruby,:ir) do
       (256**7).size.should == 8
       (256**8).size.should == 12
       (256**9).size.should == 12
-- 
1.5.5.1015.g9d258

