2018-03-04 15:09:32 +00:00
|
|
|
require_relative '../../spec_helper'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
|
|
|
describe "Integer" do
|
|
|
|
it "includes Comparable" do
|
|
|
|
Integer.include?(Comparable).should == true
|
|
|
|
end
|
2017-10-28 15:15:48 +00:00
|
|
|
|
2019-04-27 18:53:23 +02:00
|
|
|
it "is the class of both small and large integers" do
|
|
|
|
42.class.should equal(Integer)
|
|
|
|
bignum_value.class.should equal(Integer)
|
2017-10-28 15:15:48 +00:00
|
|
|
end
|
2017-05-07 12:04:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "Integer#integer?" do
|
|
|
|
it "returns true for Integers" do
|
2020-05-03 12:28:29 +02:00
|
|
|
0.should.integer?
|
|
|
|
-1.should.integer?
|
|
|
|
bignum_value.should.integer?
|
2017-05-07 12:04:49 +00:00
|
|
|
end
|
|
|
|
end
|