diff --git a/core/bignum/bignum_spec.rb b/core/bignum/bignum_spec.rb index cf99bb4937..3df43aec2d 100644 --- a/core/bignum/bignum_spec.rb +++ b/core/bignum/bignum_spec.rb @@ -16,4 +16,16 @@ Bignum.new end.should raise_error(NoMethodError) end + + ruby_version_is '2.4' do + it "unified into Integer" do + Bignum.should equal(Integer) + end + + it "is deprecated" do + -> { + Bignum + }.should complain(/constant ::Bignum is deprecated/) + end + end end diff --git a/core/fixnum/fixnum_spec.rb b/core/fixnum/fixnum_spec.rb index 8a050fd25e..7f72f95e94 100644 --- a/core/fixnum/fixnum_spec.rb +++ b/core/fixnum/fixnum_spec.rb @@ -16,4 +16,16 @@ Fixnum.new end.should raise_error(NoMethodError) end + + ruby_version_is '2.4' do + it "is unified into Integer" do + Fixnum.should equal(Integer) + end + + it "is deprecated" do + -> { + Fixnum + }.should complain(/constant ::Fixnum is deprecated/) + end + end end diff --git a/core/integer/integer_spec.rb b/core/integer/integer_spec.rb index a6f406cba0..393f072563 100644 --- a/core/integer/integer_spec.rb +++ b/core/integer/integer_spec.rb @@ -4,6 +4,13 @@ it "includes Comparable" do Integer.include?(Comparable).should == true end + + ruby_version_is "2.4" do + it "is the class of both small and large integers" do + 42.class.should equal(Integer) + bignum_value.class.should equal(Integer) + end + end end describe "Integer#integer?" do