summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-21 01:16:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-21 01:19:55 +0900
commit9c73c756244fa27ffa99d81dcc73a4ad14198002 (patch)
tree14b0ea9059b8c31e276531a1df712ead4e158cdb /spec/ruby
parentfb8f011422c645ebe29e94c3fb2079af73d1d35f (diff)
Use Integer instead of Fixnum/Bignum
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/CONTRIBUTING.md8
-rw-r--r--spec/ruby/command_line/dash_e_spec.rb2
-rw-r--r--spec/ruby/core/argf/shared/fileno.rb2
-rw-r--r--spec/ruby/core/array/bsearch_index_spec.rb2
-rw-r--r--spec/ruby/core/array/first_spec.rb2
-rw-r--r--spec/ruby/core/array/fixtures/classes.rb2
-rw-r--r--spec/ruby/core/array/hash_spec.rb2
-rw-r--r--spec/ruby/core/array/sample_spec.rb8
-rw-r--r--spec/ruby/core/array/shared/slice.rb4
-rw-r--r--spec/ruby/core/array/shared/union.rb2
-rw-r--r--spec/ruby/core/array/sort_spec.rb8
-rw-r--r--spec/ruby/core/basicobject/instance_eval_spec.rb8
-rw-r--r--spec/ruby/core/basicobject/instance_exec_spec.rb8
-rw-r--r--spec/ruby/core/builtin_constants/builtin_constants_spec.rb6
-rw-r--r--spec/ruby/core/class/initialize_spec.rb2
-rw-r--r--spec/ruby/core/class/superclass_spec.rb2
-rw-r--r--spec/ruby/core/complex/coerce_spec.rb2
-rw-r--r--spec/ruby/core/complex/equal_value_spec.rb2
-rw-r--r--spec/ruby/core/complex/exponent_spec.rb2
-rw-r--r--spec/ruby/core/complex/shared/divide.rb4
-rw-r--r--spec/ruby/core/complex/to_f_spec.rb2
-rw-r--r--spec/ruby/core/complex/to_i_spec.rb2
-rw-r--r--spec/ruby/core/complex/to_r_spec.rb2
-rw-r--r--spec/ruby/core/dir/fileno_spec.rb2
-rw-r--r--spec/ruby/core/encoding/converter/constants_spec.rb52
-rw-r--r--spec/ruby/core/encoding/converter/new_spec.rb4
-rw-r--r--spec/ruby/core/enumerable/first_spec.rb2
-rw-r--r--spec/ruby/core/enumerable/fixtures/classes.rb2
-rw-r--r--spec/ruby/core/enumerable/sort_spec.rb2
-rw-r--r--spec/ruby/core/enumerator/initialize_spec.rb2
-rw-r--r--spec/ruby/core/enumerator/lazy/initialize_spec.rb2
-rw-r--r--spec/ruby/core/exception/system_call_error_spec.rb2
-rw-r--r--spec/ruby/core/file/size_spec.rb4
-rw-r--r--spec/ruby/core/file/umask_spec.rb4
-rw-r--r--spec/ruby/core/float/comparison_spec.rb2
-rw-r--r--spec/ruby/core/float/shared/quo.rb4
-rw-r--r--spec/ruby/core/hash/shared/store.rb2
-rw-r--r--spec/ruby/core/integer/coerce_spec.rb20
-rw-r--r--spec/ruby/core/integer/comparison_spec.rb8
-rw-r--r--spec/ruby/core/integer/constants_spec.rb32
-rw-r--r--spec/ruby/core/integer/denominator_spec.rb2
-rw-r--r--spec/ruby/core/integer/div_spec.rb2
-rw-r--r--spec/ruby/core/integer/downto_spec.rb2
-rw-r--r--spec/ruby/core/integer/element_reference_spec.rb4
-rw-r--r--spec/ruby/core/integer/even_spec.rb4
-rw-r--r--spec/ruby/core/integer/gcd_spec.rb8
-rw-r--r--spec/ruby/core/integer/gcdlcm_spec.rb8
-rw-r--r--spec/ruby/core/integer/lcm_spec.rb8
-rw-r--r--spec/ruby/core/integer/left_shift_spec.rb20
-rw-r--r--spec/ruby/core/integer/right_shift_spec.rb18
-rw-r--r--spec/ruby/core/integer/shared/equal.rb2
-rw-r--r--spec/ruby/core/integer/shared/next.rb12
-rw-r--r--spec/ruby/core/integer/to_r_spec.rb4
-rw-r--r--spec/ruby/core/integer/uminus_spec.rb2
-rw-r--r--spec/ruby/core/integer/upto_spec.rb2
-rw-r--r--spec/ruby/core/io/initialize_spec.rb2
-rw-r--r--spec/ruby/core/io/shared/new.rb4
-rw-r--r--spec/ruby/core/io/shared/pos.rb2
-rw-r--r--spec/ruby/core/io/shared/readlines.rb12
-rw-r--r--spec/ruby/core/io/sysopen_spec.rb4
-rw-r--r--spec/ruby/core/io/ungetbyte_spec.rb4
-rw-r--r--spec/ruby/core/kernel/Float_spec.rb4
-rw-r--r--spec/ruby/core/kernel/Integer_spec.rb14
-rw-r--r--spec/ruby/core/kernel/class_spec.rb2
-rw-r--r--spec/ruby/core/kernel/instance_variable_get_spec.rb2
-rw-r--r--spec/ruby/core/kernel/instance_variable_set_spec.rb2
-rw-r--r--spec/ruby/core/kernel/shared/require.rb2
-rw-r--r--spec/ruby/core/kernel/singleton_class_spec.rb2
-rw-r--r--spec/ruby/core/kernel/sleep_spec.rb2
-rw-r--r--spec/ruby/core/kernel/srand_spec.rb2
-rw-r--r--spec/ruby/core/kernel/taint_spec.rb2
-rw-r--r--spec/ruby/core/marshal/dump_spec.rb14
-rw-r--r--spec/ruby/core/marshal/fixtures/marshal_data.rb60
-rw-r--r--spec/ruby/core/marshal/shared/load.rb16
-rw-r--r--spec/ruby/core/method/source_location_spec.rb4
-rw-r--r--spec/ruby/core/module/attr_accessor_spec.rb10
-rw-r--r--spec/ruby/core/module/constants_spec.rb4
-rw-r--r--spec/ruby/core/module/private_method_defined_spec.rb2
-rw-r--r--spec/ruby/core/module/protected_method_defined_spec.rb2
-rw-r--r--spec/ruby/core/module/public_method_defined_spec.rb2
-rw-r--r--spec/ruby/core/nil/to_i_spec.rb2
-rw-r--r--spec/ruby/core/numeric/denominator_spec.rb2
-rw-r--r--spec/ruby/core/numeric/quo_spec.rb2
-rw-r--r--spec/ruby/core/numeric/real_spec.rb2
-rw-r--r--spec/ruby/core/numeric/shared/imag.rb2
-rw-r--r--spec/ruby/core/numeric/shared/rect.rb2
-rw-r--r--spec/ruby/core/numeric/shared/step.rb16
-rw-r--r--spec/ruby/core/objectspace/_id2ref_spec.rb2
-rw-r--r--spec/ruby/core/proc/hash_spec.rb2
-rw-r--r--spec/ruby/core/proc/source_location_spec.rb10
-rw-r--r--spec/ruby/core/process/euid_spec.rb2
-rw-r--r--spec/ruby/core/process/getpriority_spec.rb8
-rw-r--r--spec/ruby/core/process/kill_spec.rb2
-rw-r--r--spec/ruby/core/process/maxgroups_spec.rb2
-rw-r--r--spec/ruby/core/process/pid_spec.rb2
-rw-r--r--spec/ruby/core/process/spawn_spec.rb8
-rw-r--r--spec/ruby/core/random/new_seed_spec.rb4
-rw-r--r--spec/ruby/core/random/new_spec.rb2
-rw-r--r--spec/ruby/core/random/rand_spec.rb20
-rw-r--r--spec/ruby/core/range/hash_spec.rb10
-rw-r--r--spec/ruby/core/regexp/last_match_spec.rb2
-rw-r--r--spec/ruby/core/regexp/new_spec.rb2
-rw-r--r--spec/ruby/core/regexp/options_spec.rb6
-rw-r--r--spec/ruby/core/regexp/shared/new.rb6
-rw-r--r--spec/ruby/core/string/bytes_spec.rb6
-rw-r--r--spec/ruby/core/string/element_set_spec.rb10
-rw-r--r--spec/ruby/core/string/index_spec.rb2
-rw-r--r--spec/ruby/core/string/ord_spec.rb4
-rw-r--r--spec/ruby/core/string/rindex_spec.rb2
-rw-r--r--spec/ruby/core/string/shared/codepoints.rb4
-rw-r--r--spec/ruby/core/string/to_i_spec.rb18
-rw-r--r--spec/ruby/core/struct/hash_spec.rb4
-rw-r--r--spec/ruby/core/symbol/casecmp_spec.rb2
-rw-r--r--spec/ruby/core/symbol/comparison_spec.rb2
-rw-r--r--spec/ruby/core/time/hash_spec.rb4
-rw-r--r--spec/ruby/core/time/subsec_spec.rb2
-rw-r--r--spec/ruby/core/unboundmethod/source_location_spec.rb4
-rw-r--r--spec/ruby/language/README2
-rw-r--r--spec/ruby/language/alias_spec.rb2
-rw-r--r--spec/ruby/language/defined_spec.rb4
-rw-r--r--spec/ruby/language/module_spec.rb2
-rw-r--r--spec/ruby/language/predefined_spec.rb8
-rw-r--r--spec/ruby/language/singleton_class_spec.rb4
-rw-r--r--spec/ruby/library/bigdecimal/add_spec.rb4
-rw-r--r--spec/ruby/library/bigdecimal/exponent_spec.rb2
-rw-r--r--spec/ruby/library/bigdecimal/shared/to_int.rb2
-rw-r--r--spec/ruby/library/digest/bubblebabble_spec.rb2
-rw-r--r--spec/ruby/library/digest/hexencode_spec.rb2
-rw-r--r--spec/ruby/library/matrix/coerce_spec.rb2
-rw-r--r--spec/ruby/library/matrix/divide_spec.rb4
-rw-r--r--spec/ruby/library/matrix/hash_spec.rb4
-rw-r--r--spec/ruby/library/matrix/multiply_spec.rb4
-rw-r--r--spec/ruby/library/securerandom/random_number_spec.rb2
-rw-r--r--spec/ruby/library/stringscanner/append_spec.rb2
-rw-r--r--spec/ruby/library/stringscanner/concat_spec.rb2
-rw-r--r--spec/ruby/library/stringscanner/shared/peek.rb2
-rw-r--r--spec/ruby/library/zlib/adler32_spec.rb2
-rw-r--r--spec/ruby/library/zlib/crc32_spec.rb2
-rw-r--r--spec/ruby/shared/file/world_readable.rb10
-rw-r--r--spec/ruby/shared/file/world_writable.rb10
-rw-r--r--spec/ruby/shared/io/putc.rb2
-rw-r--r--spec/ruby/shared/kernel/object_id.rb8
-rw-r--r--spec/ruby/shared/rational/exponent.rb2
-rw-r--r--spec/ruby/shared/string/times.rb2
144 files changed, 391 insertions, 389 deletions
diff --git a/spec/ruby/CONTRIBUTING.md b/spec/ruby/CONTRIBUTING.md
index 9a2a341ae78..56e12736fce 100644
--- a/spec/ruby/CONTRIBUTING.md
+++ b/spec/ruby/CONTRIBUTING.md
@@ -8,7 +8,7 @@ Spec are grouped in 5 separate top-level groups:
* `command_line`: for the ruby executable command-line flags (`-v`, `-e`, etc)
* `language`: for the language keywords and syntax constructs (`if`, `def`, `A::B`, etc)
-* `core`: for the core methods (`Fixnum#+`, `String#upcase`, no need to require anything)
+* `core`: for the core methods (`Integer#+`, `String#upcase`, no need to require anything)
* `library`: for the standard libraries methods (`CSV.new`, `YAML.parse`, need to require the stdlib)
* `optional/capi`: for functions available to the Ruby C-extension API
@@ -89,7 +89,7 @@ File.should.equal?(File) # Calls #equal? (tests identity)
Numeric.should be_ancestor_of(Float) # Float.ancestors.include?(Numeric)
3.14.should.respond_to?(:to_i)
-Fixnum.should have_instance_method(:+)
+Integer.should have_instance_method(:+)
Array.should have_method(:new)
```
@@ -124,8 +124,8 @@ If an exception is raised, it will fail the example anyway.
```ruby
-> {
- Fixnum
-}.should complain(/constant ::Fixnum is deprecated/) # Expect a warning
+ Integer
+}.should complain(/constant ::Integer is deprecated/) # Expect a warning
```
### Guards
diff --git a/spec/ruby/command_line/dash_e_spec.rb b/spec/ruby/command_line/dash_e_spec.rb
index 9f600eb414a..24ed34376dc 100644
--- a/spec/ruby/command_line/dash_e_spec.rb
+++ b/spec/ruby/command_line/dash_e_spec.rb
@@ -23,7 +23,7 @@ describe "The -e command line option" do
#needs to test return => LocalJumpError
- describe "with -n and a Fixnum range" do
+ describe "with -n and an Integer range" do
before :each do
@script = "-ne 'print if %s' #{fixture(__FILE__, "conditional_range.txt")}"
end
diff --git a/spec/ruby/core/argf/shared/fileno.rb b/spec/ruby/core/argf/shared/fileno.rb
index 5d674048e25..4350d437478 100644
--- a/spec/ruby/core/argf/shared/fileno.rb
+++ b/spec/ruby/core/argf/shared/fileno.rb
@@ -11,7 +11,7 @@ describe :argf_fileno, shared: true do
# returns first current file even when not yet open
result << @argf.send(@method) while @argf.gets
# returns last current file even when closed
- result.map { |d| d.class }.should == [Fixnum, Fixnum, Fixnum, Fixnum]
+ result.map { |d| d.class }.should == [Integer, Integer, Integer, Integer]
end
end
diff --git a/spec/ruby/core/array/bsearch_index_spec.rb b/spec/ruby/core/array/bsearch_index_spec.rb
index aafded178df..df2c7c098e2 100644
--- a/spec/ruby/core/array/bsearch_index_spec.rb
+++ b/spec/ruby/core/array/bsearch_index_spec.rb
@@ -77,7 +77,7 @@ describe "Array#bsearch_index" do
@array.bsearch_index { |x| (-1) * (2**100) }.should be_nil
end
- it "handles values from Bignum#coerce" do
+ it "handles values from Integer#coerce" do
[1, 2].should include(@array.bsearch_index { |x| (2**100).coerce((1 - x / 4) * (2**100)).first })
end
end
diff --git a/spec/ruby/core/array/first_spec.rb b/spec/ruby/core/array/first_spec.rb
index 66eeba65653..463da829a29 100644
--- a/spec/ruby/core/array/first_spec.rb
+++ b/spec/ruby/core/array/first_spec.rb
@@ -33,7 +33,7 @@ describe "Array#first" do
-> { [1, 2].first(-1) }.should raise_error(ArgumentError)
end
- it "raises a RangeError when count is a Bignum" do
+ it "raises a RangeError when count is an Integer" do
-> { [].first(bignum_value) }.should raise_error(RangeError)
end
diff --git a/spec/ruby/core/array/fixtures/classes.rb b/spec/ruby/core/array/fixtures/classes.rb
index 2791a2eb5df..affb3b49e60 100644
--- a/spec/ruby/core/array/fixtures/classes.rb
+++ b/spec/ruby/core/array/fixtures/classes.rb
@@ -126,7 +126,7 @@ module ArraySpecs
attr_accessor :order
end
- class ComparableWithFixnum
+ class ComparableWithInteger
include Comparable
def initialize(num)
@num = num
diff --git a/spec/ruby/core/array/hash_spec.rb b/spec/ruby/core/array/hash_spec.rb
index 8392253ae4c..f3bcc83fce8 100644
--- a/spec/ruby/core/array/hash_spec.rb
+++ b/spec/ruby/core/array/hash_spec.rb
@@ -7,7 +7,7 @@ describe "Array#hash" do
[[], [1, 2, 3]].each do |ary|
ary.hash.should == ary.dup.hash
- ary.hash.should be_an_instance_of(Fixnum)
+ ary.hash.should be_an_instance_of(Integer)
end
end
diff --git a/spec/ruby/core/array/sample_spec.rb b/spec/ruby/core/array/sample_spec.rb
index 73b6bdf4807..565d7ff7f91 100644
--- a/spec/ruby/core/array/sample_spec.rb
+++ b/spec/ruby/core/array/sample_spec.rb
@@ -69,7 +69,7 @@ describe "Array#sample" do
obj = mock("array_sample_random")
obj.should_receive(:rand).and_return(0.5)
- [1, 2].sample(random: obj).should be_an_instance_of(Fixnum)
+ [1, 2].sample(random: obj).should be_an_instance_of(Integer)
end
it "raises a NoMethodError if an object passed for the RNG does not define #rand" do
@@ -78,8 +78,8 @@ describe "Array#sample" do
-> { [1, 2].sample(random: obj) }.should raise_error(NoMethodError)
end
- describe "when the object returned by #rand is a Fixnum" do
- it "uses the fixnum as index" do
+ describe "when the object returned by #rand is an Integer" do
+ it "uses the integer as index" do
random = mock("array_sample_random_ret")
random.should_receive(:rand).and_return(0)
@@ -107,7 +107,7 @@ describe "Array#sample" do
end
end
- describe "when the object returned by #rand is not a Fixnum but responds to #to_int" do
+ describe "when the object returned by #rand is not an Integer but responds to #to_int" do
it "calls #to_int on the Object" do
value = mock("array_sample_random_value")
value.should_receive(:to_int).and_return(1)
diff --git a/spec/ruby/core/array/shared/slice.rb b/spec/ruby/core/array/shared/slice.rb
index 845be768c67..820047cdb24 100644
--- a/spec/ruby/core/array/shared/slice.rb
+++ b/spec/ruby/core/array/shared/slice.rb
@@ -486,7 +486,7 @@ describe :array_slice, shared: true do
end
end
- it "raises a RangeError when the start index is out of range of Fixnum" do
+ it "raises a RangeError when the start index is out of range of Integer" do
array = [1, 2, 3, 4, 5, 6]
obj = mock('large value')
obj.should_receive(:to_int).and_return(bignum_value)
@@ -502,7 +502,7 @@ describe :array_slice, shared: true do
array.send(@method, max_long.to_f.prev_float).should == nil
end
- it "raises a RangeError when the length is out of range of Fixnum" do
+ it "raises a RangeError when the length is out of range of Integer" do
array = [1, 2, 3, 4, 5, 6]
obj = mock('large value')
obj.should_receive(:to_int).and_return(bignum_value)
diff --git a/spec/ruby/core/array/shared/union.rb b/spec/ruby/core/array/shared/union.rb
index 12a98cc9fe4..0b60df9ca4d 100644
--- a/spec/ruby/core/array/shared/union.rb
+++ b/spec/ruby/core/array/shared/union.rb
@@ -31,7 +31,7 @@ describe :array_binary_union, shared: true do
[0].send(@method, obj).should == ([0] | [1, 2, 3])
end
- # MRI follows hashing semantics here, so doesn't actually call eql?/hash for Fixnum/Symbol
+ # MRI follows hashing semantics here, so doesn't actually call eql?/hash for Integer/Symbol
it "acts as if using an intermediate hash to collect values" do
not_supported_on :opal do
[5.0, 4.0].send(@method, [5, 4]).should == [5.0, 4.0, 5, 4]
diff --git a/spec/ruby/core/array/sort_spec.rb b/spec/ruby/core/array/sort_spec.rb
index 0c5ecdcbbf6..e20b6505164 100644
--- a/spec/ruby/core/array/sort_spec.rb
+++ b/spec/ruby/core/array/sort_spec.rb
@@ -111,10 +111,10 @@ describe "Array#sort" do
[1, 2, 3].sort{ break :a }.should == :a
end
- it "uses the sign of Bignum block results as the sort result" do
+ it "uses the sign of Integer block results as the sort result" do
a = [1, 2, 5, 10, 7, -4, 12]
begin
- class Bignum;
+ class Integer
alias old_spaceship <=>
def <=>(other)
raise
@@ -122,7 +122,7 @@ describe "Array#sort" do
end
a.sort {|n, m| (n - m) * (2 ** 200)}.should == [-4, 1, 2, 5, 7, 10, 12]
ensure
- class Bignum
+ class Integer
alias <=> old_spaceship
end
end
@@ -132,7 +132,7 @@ describe "Array#sort" do
a = [1, 2, 5, 10, 7, -4, 12]
a.sort { |n, m| n - m }.should == [-4, 1, 2, 5, 7, 10, 12]
a.sort { |n, m|
- ArraySpecs::ComparableWithFixnum.new(n-m)
+ ArraySpecs::ComparableWithInteger.new(n-m)
}.should == [-4, 1, 2, 5, 7, 10, 12]
-> {
a.sort { |n, m| (n - m).to_s }
diff --git a/spec/ruby/core/basicobject/instance_eval_spec.rb b/spec/ruby/core/basicobject/instance_eval_spec.rb
index d3dd05b7453..b6a146095d8 100644
--- a/spec/ruby/core/basicobject/instance_eval_spec.rb
+++ b/spec/ruby/core/basicobject/instance_eval_spec.rb
@@ -131,14 +131,14 @@ describe "BasicObject#instance_eval" do
end
quarantine! do # Not clean, leaves cvars lying around to break other specs
- it "scopes class var accesses in the caller when called on a Fixnum" do
- # Fixnum can take instance vars
- Fixnum.class_eval "@@__tmp_instance_eval_spec = 1"
+ it "scopes class var accesses in the caller when called on an Integer" do
+ # Integer can take instance vars
+ Integer.class_eval "@@__tmp_instance_eval_spec = 1"
(defined? @@__tmp_instance_eval_spec).should be_nil
@@__tmp_instance_eval_spec = 2
1.instance_eval { @@__tmp_instance_eval_spec }.should == 2
- Fixnum.__send__(:remove_class_variable, :@@__tmp_instance_eval_spec)
+ Integer.__send__(:remove_class_variable, :@@__tmp_instance_eval_spec)
end
end
diff --git a/spec/ruby/core/basicobject/instance_exec_spec.rb b/spec/ruby/core/basicobject/instance_exec_spec.rb
index e25482d58ad..289fdd889b5 100644
--- a/spec/ruby/core/basicobject/instance_exec_spec.rb
+++ b/spec/ruby/core/basicobject/instance_exec_spec.rb
@@ -85,14 +85,14 @@ describe "BasicObject#instance_exec" do
end
quarantine! do # Not clean, leaves cvars lying around to break other specs
- it "scopes class var accesses in the caller when called on a Fixnum" do
- # Fixnum can take instance vars
- Fixnum.class_eval "@@__tmp_instance_exec_spec = 1"
+ it "scopes class var accesses in the caller when called on an Integer" do
+ # Integer can take instance vars
+ Integer.class_eval "@@__tmp_instance_exec_spec = 1"
(defined? @@__tmp_instance_exec_spec).should == nil
@@__tmp_instance_exec_spec = 2
1.instance_exec { @@__tmp_instance_exec_spec }.should == 2
- Fixnum.__send__(:remove_class_variable, :@@__tmp_instance_exec_spec)
+ Integer.__send__(:remove_class_variable, :@@__tmp_instance_exec_spec)
end
end
diff --git a/spec/ruby/core/builtin_constants/builtin_constants_spec.rb b/spec/ruby/core/builtin_constants/builtin_constants_spec.rb
index 21102bee9f5..7c87a970d78 100644
--- a/spec/ruby/core/builtin_constants/builtin_constants_spec.rb
+++ b/spec/ruby/core/builtin_constants/builtin_constants_spec.rb
@@ -7,8 +7,8 @@ describe "RUBY_VERSION" do
end
describe "RUBY_PATCHLEVEL" do
- it "is a Fixnum" do
- RUBY_PATCHLEVEL.should be_kind_of(Fixnum)
+ it "is an Integer" do
+ RUBY_PATCHLEVEL.should be_kind_of(Integer)
end
end
@@ -51,7 +51,7 @@ end
describe "RUBY_REVISION" do
ruby_version_is ""..."2.7" do
it "is an Integer" do
- RUBY_REVISION.should be_kind_of(Fixnum)
+ RUBY_REVISION.should be_kind_of(Integer)
end
end
diff --git a/spec/ruby/core/class/initialize_spec.rb b/spec/ruby/core/class/initialize_spec.rb
index 9678d7b3734..63487584857 100644
--- a/spec/ruby/core/class/initialize_spec.rb
+++ b/spec/ruby/core/class/initialize_spec.rb
@@ -7,7 +7,7 @@ describe "Class#initialize" do
it "raises a TypeError when called on already initialized classes" do
->{
- Fixnum.send :initialize
+ Integer.send :initialize
}.should raise_error(TypeError)
->{
diff --git a/spec/ruby/core/class/superclass_spec.rb b/spec/ruby/core/class/superclass_spec.rb
index deb5a453362..00579238a6e 100644
--- a/spec/ruby/core/class/superclass_spec.rb
+++ b/spec/ruby/core/class/superclass_spec.rb
@@ -8,7 +8,7 @@ describe "Class#superclass" do
Class.superclass.should == Module
Class.new.superclass.should == Object
Class.new(String).superclass.should == String
- Class.new(Fixnum).superclass.should == Fixnum
+ Class.new(Integer).superclass.should == Integer
end
# redmine:567
diff --git a/spec/ruby/core/complex/coerce_spec.rb b/spec/ruby/core/complex/coerce_spec.rb
index a30a6c1d5f7..9023234e73e 100644
--- a/spec/ruby/core/complex/coerce_spec.rb
+++ b/spec/ruby/core/complex/coerce_spec.rb
@@ -19,7 +19,7 @@ describe "Complex#coerce" do
result.last.should be_kind_of(Complex)
end
- it "returns an array containing other and self as Complex when other is a Bignum" do
+ it "returns an array containing other and self as Complex when other is an Integer" do
result = @one.coerce(4294967296)
result.should == [4294967296, 1]
result.first.should be_kind_of(Complex)
diff --git a/spec/ruby/core/complex/equal_value_spec.rb b/spec/ruby/core/complex/equal_value_spec.rb
index b1e4f9cfcdb..ad7236b1bd5 100644
--- a/spec/ruby/core/complex/equal_value_spec.rb
+++ b/spec/ruby/core/complex/equal_value_spec.rb
@@ -53,7 +53,7 @@ describe "Complex#==" do
end
describe "with Object" do
- # Fixnum#==, Float#== and Bignum#== only return booleans - Bug?
+ # Integer#== and Float#== only return booleans - Bug?
it "calls other#== with self" do
value = Complex(3, 0)
diff --git a/spec/ruby/core/complex/exponent_spec.rb b/spec/ruby/core/complex/exponent_spec.rb
index bf07c900382..86f827aece9 100644
--- a/spec/ruby/core/complex/exponent_spec.rb
+++ b/spec/ruby/core/complex/exponent_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'
describe "Complex#**" do
- describe "with Fixnum 0" do
+ describe "with Integer 0" do
it "returns Complex(1)" do
(Complex(3, 4) ** 0).should eql(Complex(1))
end
diff --git a/spec/ruby/core/complex/shared/divide.rb b/spec/ruby/core/complex/shared/divide.rb
index a60802c74cb..dc1b870cffe 100644
--- a/spec/ruby/core/complex/shared/divide.rb
+++ b/spec/ruby/core/complex/shared/divide.rb
@@ -12,7 +12,7 @@ describe :complex_divide, shared: true do
end
end
- describe "with Fixnum" do
+ describe "with Integer" do
it "divides both parts of the Complex number" do
Complex(20, 40).send(@method, 2).should == Complex(10, 20)
Complex(30, 30).send(@method, 10).should == Complex(3, 3)
@@ -27,7 +27,7 @@ describe :complex_divide, shared: true do
end
end
- describe "with Bignum" do
+ describe "with Integer" do
it "divides both parts of the Complex number" do
Complex(20, 40).send(@method, 2).should == Complex(10, 20)
Complex(15, 16).send(@method, 2.0).should be_close(Complex(7.5, 8), TOLERANCE)
diff --git a/spec/ruby/core/complex/to_f_spec.rb b/spec/ruby/core/complex/to_f_spec.rb
index 78e65264917..b53471c1fcc 100644
--- a/spec/ruby/core/complex/to_f_spec.rb
+++ b/spec/ruby/core/complex/to_f_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'
describe "Complex#to_f" do
- describe "when the imaginary part is Fixnum 0" do
+ describe "when the imaginary part is Integer 0" do
it "returns the result of sending #to_f to the real part" do
real = mock_numeric('real')
real.should_receive(:to_f).and_return(:f)
diff --git a/spec/ruby/core/complex/to_i_spec.rb b/spec/ruby/core/complex/to_i_spec.rb
index 23134705ba1..1e78f5ec0e6 100644
--- a/spec/ruby/core/complex/to_i_spec.rb
+++ b/spec/ruby/core/complex/to_i_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'
describe "Complex#to_i" do
- describe "when the imaginary part is Fixnum 0" do
+ describe "when the imaginary part is Integer 0" do
it "returns the result of sending #to_i to the real part" do
real = mock_numeric('real')
real.should_receive(:to_i).and_return(:i)
diff --git a/spec/ruby/core/complex/to_r_spec.rb b/spec/ruby/core/complex/to_r_spec.rb
index 76a69a0b935..45599214925 100644
--- a/spec/ruby/core/complex/to_r_spec.rb
+++ b/spec/ruby/core/complex/to_r_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'
describe "Complex#to_r" do
- describe "when the imaginary part is Fixnum 0" do
+ describe "when the imaginary part is Integer 0" do
it "returns the result of sending #to_r to the real part" do
real = mock_numeric('real')
real.should_receive(:to_r).and_return(:r)
diff --git a/spec/ruby/core/dir/fileno_spec.rb b/spec/ruby/core/dir/fileno_spec.rb
index 504e36d44b8..bb84ef5378f 100644
--- a/spec/ruby/core/dir/fileno_spec.rb
+++ b/spec/ruby/core/dir/fileno_spec.rb
@@ -27,7 +27,7 @@ describe "Dir#fileno" do
if has_dir_fileno
it "returns the file descriptor of the dir" do
- @dir.fileno.should be_kind_of(Fixnum)
+ @dir.fileno.should be_kind_of(Integer)
end
else
it "raises an error when not implemented on the platform" do
diff --git a/spec/ruby/core/encoding/converter/constants_spec.rb b/spec/ruby/core/encoding/converter/constants_spec.rb
index 57b6a4d4e79..7d29bdb2785 100644
--- a/spec/ruby/core/encoding/converter/constants_spec.rb
+++ b/spec/ruby/core/encoding/converter/constants_spec.rb
@@ -5,8 +5,8 @@ describe "Encoding::Converter::INVALID_MASK" do
Encoding::Converter.should have_constant(:INVALID_MASK)
end
- it "has a Fixnum value" do
- Encoding::Converter::INVALID_MASK.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::INVALID_MASK.should be_an_instance_of(Integer)
end
end
@@ -15,8 +15,8 @@ describe "Encoding::Converter::INVALID_REPLACE" do
Encoding::Converter.should have_constant(:INVALID_REPLACE)
end
- it "has a Fixnum value" do
- Encoding::Converter::INVALID_REPLACE.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::INVALID_REPLACE.should be_an_instance_of(Integer)
end
end
@@ -25,8 +25,8 @@ describe "Encoding::Converter::UNDEF_MASK" do
Encoding::Converter.should have_constant(:UNDEF_MASK)
end
- it "has a Fixnum value" do
- Encoding::Converter::UNDEF_MASK.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::UNDEF_MASK.should be_an_instance_of(Integer)
end
end
@@ -35,8 +35,8 @@ describe "Encoding::Converter::UNDEF_REPLACE" do
Encoding::Converter.should have_constant(:UNDEF_REPLACE)
end
- it "has a Fixnum value" do
- Encoding::Converter::UNDEF_REPLACE.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::UNDEF_REPLACE.should be_an_instance_of(Integer)
end
end
@@ -45,8 +45,8 @@ describe "Encoding::Converter::UNDEF_HEX_CHARREF" do
Encoding::Converter.should have_constant(:UNDEF_HEX_CHARREF)
end
- it "has a Fixnum value" do
- Encoding::Converter::UNDEF_HEX_CHARREF.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::UNDEF_HEX_CHARREF.should be_an_instance_of(Integer)
end
end
@@ -55,8 +55,8 @@ describe "Encoding::Converter::PARTIAL_INPUT" do
Encoding::Converter.should have_constant(:PARTIAL_INPUT)
end
- it "has a Fixnum value" do
- Encoding::Converter::PARTIAL_INPUT.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::PARTIAL_INPUT.should be_an_instance_of(Integer)
end
end
@@ -65,8 +65,8 @@ describe "Encoding::Converter::AFTER_OUTPUT" do
Encoding::Converter.should have_constant(:AFTER_OUTPUT)
end
- it "has a Fixnum value" do
- Encoding::Converter::AFTER_OUTPUT.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::AFTER_OUTPUT.should be_an_instance_of(Integer)
end
end
@@ -75,8 +75,8 @@ describe "Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR" do
Encoding::Converter.should have_constant(:UNIVERSAL_NEWLINE_DECORATOR)
end
- it "has a Fixnum value" do
- Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR.should be_an_instance_of(Integer)
end
end
@@ -85,8 +85,8 @@ describe "Encoding::Converter::CRLF_NEWLINE_DECORATOR" do
Encoding::Converter.should have_constant(:CRLF_NEWLINE_DECORATOR)
end
- it "has a Fixnum value" do
- Encoding::Converter::CRLF_NEWLINE_DECORATOR.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::CRLF_NEWLINE_DECORATOR.should be_an_instance_of(Integer)
end
end
@@ -95,8 +95,8 @@ describe "Encoding::Converter::CR_NEWLINE_DECORATOR" do
Encoding::Converter.should have_constant(:CR_NEWLINE_DECORATOR)
end
- it "has a Fixnum value" do
- Encoding::Converter::CR_NEWLINE_DECORATOR.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::CR_NEWLINE_DECORATOR.should be_an_instance_of(Integer)
end
end
@@ -105,8 +105,8 @@ describe "Encoding::Converter::XML_TEXT_DECORATOR" do
Encoding::Converter.should have_constant(:XML_TEXT_DECORATOR)
end
- it "has a Fixnum value" do
- Encoding::Converter::XML_TEXT_DECORATOR.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::XML_TEXT_DECORATOR.should be_an_instance_of(Integer)
end
end
@@ -115,8 +115,8 @@ describe "Encoding::Converter::XML_ATTR_CONTENT_DECORATOR" do
Encoding::Converter.should have_constant(:XML_ATTR_CONTENT_DECORATOR)
end
- it "has a Fixnum value" do
- Encoding::Converter::XML_ATTR_CONTENT_DECORATOR.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::XML_ATTR_CONTENT_DECORATOR.should be_an_instance_of(Integer)
end
end
@@ -125,7 +125,7 @@ describe "Encoding::Converter::XML_ATTR_QUOTE_DECORATOR" do
Encoding::Converter.should have_constant(:XML_ATTR_QUOTE_DECORATOR)
end
- it "has a Fixnum value" do
- Encoding::Converter::XML_ATTR_QUOTE_DECORATOR.should be_an_instance_of(Fixnum)
+ it "has an Integer value" do
+ Encoding::Converter::XML_ATTR_QUOTE_DECORATOR.should be_an_instance_of(Integer)
end
end
diff --git a/spec/ruby/core/encoding/converter/new_spec.rb b/spec/ruby/core/encoding/converter/new_spec.rb
index 9fc97263fe5..1f7affc72b8 100644
--- a/spec/ruby/core/encoding/converter/new_spec.rb
+++ b/spec/ruby/core/encoding/converter/new_spec.rb
@@ -47,7 +47,7 @@ describe "Encoding::Converter.new" do
conv.replacement.should == "fubar"
end
- it "calls #to_hash to convert the options argument to a Hash if not a Fixnum" do
+ it "calls #to_hash to convert the options argument to a Hash if not an Integer" do
opts = mock("encoding converter options")
opts.should_receive(:to_hash).and_return({ replace: "fubar" })
conv = Encoding::Converter.new("us-ascii", "utf-8", **opts)
@@ -82,7 +82,7 @@ describe "Encoding::Converter.new" do
end.should raise_error(TypeError)
end
- it "raises a TypeError if passed a Fixnum for the replacement object" do
+ it "raises a TypeError if passed an Integer for the replacement object" do
-> do
Encoding::Converter.new("us-ascii", "utf-8", replace: 1)
end.should raise_error(TypeError)
diff --git a/spec/ruby/core/enumerable/first_spec.rb b/spec/ruby/core/enumerable/first_spec.rb
index ed1ba599b49..1398807fa7d 100644
--- a/spec/ruby/core/enumerable/first_spec.rb
+++ b/spec/ruby/core/enumerable/first_spec.rb
@@ -17,7 +17,7 @@ describe "Enumerable#first" do
EnumerableSpecs::YieldsMixed2.new.to_enum.first.should == nil
end
- it "raises a RangeError when passed a Bignum" do
+ it "raises a RangeError when passed an Integer" do
enum = EnumerableSpecs::Empty.new
-> { enum.first(bignum_value) }.should raise_error(RangeError)
end
diff --git a/spec/ruby/core/enumerable/fixtures/classes.rb b/spec/ruby/core/enumerable/fixtures/classes.rb
index 5051196742f..fb4951c6e62 100644
--- a/spec/ruby/core/enumerable/fixtures/classes.rb
+++ b/spec/ruby/core/enumerable/fixtures/classes.rb
@@ -251,7 +251,7 @@ module EnumerableSpecs
end
end
- class ComparableWithFixnum
+ class ComparableWithInteger
include Comparable
def initialize(num)
@num = num
diff --git a/spec/ruby/core/enumerable/sort_spec.rb b/spec/ruby/core/enumerable/sort_spec.rb
index cff1a599860..6fc64f325e4 100644
--- a/spec/ruby/core/enumerable/sort_spec.rb
+++ b/spec/ruby/core/enumerable/sort_spec.rb
@@ -31,7 +31,7 @@ describe "Enumerable#sort" do
it "compare values returned by block with 0" do
EnumerableSpecs::Numerous.new.sort { |n, m| -(n+m) * (n <=> m) }.should == [6, 5, 4, 3, 2, 1]
EnumerableSpecs::Numerous.new.sort { |n, m|
- EnumerableSpecs::ComparableWithFixnum.new(-(n+m) * (n <=> m))
+ EnumerableSpecs::ComparableWithInteger.new(-(n+m) * (n <=> m))
}.should == [6, 5, 4, 3, 2, 1]
-> {
EnumerableSpecs::Numerous.new.sort { |n, m| (n <=> m).to_s }
diff --git a/spec/ruby/core/enumerator/initialize_spec.rb b/spec/ruby/core/enumerator/initialize_spec.rb
index 53bf5d4ef24..45bd650d7fd 100644
--- a/spec/ruby/core/enumerator/initialize_spec.rb
+++ b/spec/ruby/core/enumerator/initialize_spec.rb
@@ -43,7 +43,7 @@ describe "Enumerator#initialize" do
@uninitialized.send(:initialize, Float::INFINITY) {}.size.should equal(Float::INFINITY)
end
- it "sets size to the given size if the given size is a Fixnum" do
+ it "sets size to the given size if the given size is an Integer" do
@uninitialized.send(:initialize, 100) {}.size.should == 100
end
diff --git a/spec/ruby/core/enumerator/lazy/initialize_spec.rb b/spec/ruby/core/enumerator/lazy/initialize_spec.rb
index 88c66530b9e..f23018d010d 100644
--- a/spec/ruby/core/enumerator/lazy/initialize_spec.rb
+++ b/spec/ruby/core/enumerator/lazy/initialize_spec.rb
@@ -43,7 +43,7 @@ describe "Enumerator::Lazy#initialize" do
@uninitialized.send(:initialize, @receiver, Float::INFINITY) {}.size.should equal(Float::INFINITY)
end
- it "sets given size to own size if the given size is a Fixnum" do
+ it "sets given size to own size if the given size is an Integer" do
@uninitialized.send(:initialize, @receiver, 100) {}.size.should == 100
end
diff --git a/spec/ruby/core/exception/system_call_error_spec.rb b/spec/ruby/core/exception/system_call_error_spec.rb
index f27977a547e..73167bc2889 100644
--- a/spec/ruby/core/exception/system_call_error_spec.rb
+++ b/spec/ruby/core/exception/system_call_error_spec.rb
@@ -31,7 +31,7 @@ describe "SystemCallError.new" do
-> { SystemCallError.new }.should raise_error(ArgumentError)
end
- it "accepts single Fixnum argument as errno" do
+ it "accepts single Integer argument as errno" do
SystemCallError.new(-2**24).errno.should == -2**24
SystemCallError.new(-1).errno.should == -1
SystemCallError.new(0).errno.should == 0
diff --git a/spec/ruby/core/file/size_spec.rb b/spec/ruby/core/file/size_spec.rb
index a2bf408da18..11d20cbacbb 100644
--- a/spec/ruby/core/file/size_spec.rb
+++ b/spec/ruby/core/file/size_spec.rb
@@ -59,8 +59,8 @@ describe "File#size" do
@file.respond_to?(:size).should be_true
end
- it "returns the file's size as a Fixnum" do
- @file.size.should be_an_instance_of(Fixnum)
+ it "returns the file's size as an Integer" do
+ @file.size.should be_an_instance_of(Integer)
end
it "returns the file's size in bytes" do
diff --git a/spec/ruby/core/file/umask_spec.rb b/spec/ruby/core/file/umask_spec.rb
index 2640e3c3160..7f7e40abbc5 100644
--- a/spec/ruby/core/file/umask_spec.rb
+++ b/spec/ruby/core/file/umask_spec.rb
@@ -12,8 +12,8 @@ describe "File.umask" do
File.umask(@orig_umask)
end
- it "returns a Fixnum" do
- File.umask.should be_kind_of(Fixnum)
+ it "returns an Integer" do
+ File.umask.should be_kind_of(Integer)
end
platform_is_not :windows do
diff --git a/spec/ruby/core/float/comparison_spec.rb b/spec/ruby/core/float/comparison_spec.rb
index 51bb5a52db9..cbab3a0fa1c 100644
--- a/spec/ruby/core/float/comparison_spec.rb
+++ b/spec/ruby/core/float/comparison_spec.rb
@@ -48,7 +48,7 @@ describe "Float#<=>" do
# The 4 tests below are taken from matz's revision 23730 for Ruby trunk
#
- it "returns 1 when self is Infinity and other is a Bignum" do
+ it "returns 1 when self is Infinity and other is an Integer" do
(infinity_value <=> Float::MAX.to_i*2).should == 1
end
diff --git a/spec/ruby/core/float/shared/quo.rb b/spec/ruby/core/float/shared/quo.rb
index 3487824f70a..0c90171b87d 100644
--- a/spec/ruby/core/float/shared/quo.rb
+++ b/spec/ruby/core/float/shared/quo.rb
@@ -1,9 +1,9 @@
describe :float_quo, shared: true do
- it "performs floating-point division between self and a Fixnum" do
+ it "performs floating-point division between self and an Integer" do
8.9.send(@method, 7).should == 1.2714285714285716
end
- it "performs floating-point division between self and a Bignum" do
+ it "performs floating-point division between self and an Integer" do
8.9.send(@method, 9999999999999**9).should == 8.900000000008011e-117
end
diff --git a/spec/ruby/core/hash/shared/store.rb b/spec/ruby/core/hash/shared/store.rb
index eca0e5a8e8e..b823ea45ca6 100644
--- a/spec/ruby/core/hash/shared/store.rb
+++ b/spec/ruby/core/hash/shared/store.rb
@@ -36,7 +36,7 @@ describe :hash_store, shared: true do
h[key].should == "foo"
end
- it " accepts keys with a Bignum hash" do
+ it " accepts keys with an Integer hash" do
o = mock(hash: 1 << 100)
h = {}
h[o] = 1
diff --git a/spec/ruby/core/integer/coerce_spec.rb b/spec/ruby/core/integer/coerce_spec.rb
index 9a19baf2ead..4d540bfb878 100644
--- a/spec/ruby/core/integer/coerce_spec.rb
+++ b/spec/ruby/core/integer/coerce_spec.rb
@@ -4,10 +4,10 @@ require 'bigdecimal'
describe "Integer#coerce" do
context "fixnum" do
- describe "when given a Fixnum" do
- it "returns an array containing two Fixnums" do
+ describe "when given an Integer" do
+ it "returns an array containing two Integers" do
1.coerce(2).should == [2, 1]
- 1.coerce(2).map { |i| i.class }.should == [Fixnum, Fixnum]
+ 1.coerce(2).map { |i| i.class }.should == [Integer, Integer]
end
end
@@ -42,26 +42,26 @@ describe "Integer#coerce" do
end
context "bignum" do
- it "coerces other to a Bignum and returns [other, self] when passed a Fixnum" do
+ it "coerces other to an Integer and returns [other, self] when passed an Integer" do
a = bignum_value
ary = a.coerce(2)
- ary[0].should be_kind_of(Bignum)
- ary[1].should be_kind_of(Bignum)
+ ary[0].should be_kind_of(Integer)
+ ary[1].should be_kind_of(Integer)
ary.should == [2, a]
end
- it "returns [other, self] when passed a Bignum" do
+ it "returns [other, self] when passed an Integer" do
a = bignum_value
b = bignum_value
ary = a.coerce(b)
- ary[0].should be_kind_of(Bignum)
- ary[1].should be_kind_of(Bignum)
+ ary[0].should be_kind_of(Integer)
+ ary[1].should be_kind_of(Integer)
ary.should == [b, a]
end
- it "raises a TypeError when not passed a Fixnum or Bignum" do
+ it "raises a TypeError when not passed an Integer" do
a = bignum_value
-> { a.coerce(nil) }.should raise_error(TypeError)
diff --git a/spec/ruby/core/integer/comparison_spec.rb b/spec/ruby/core/integer/comparison_spec.rb
index db050aa8b9a..a0d8d241199 100644
--- a/spec/ruby/core/integer/comparison_spec.rb
+++ b/spec/ruby/core/integer/comparison_spec.rb
@@ -27,7 +27,7 @@ describe "Integer#<=>" do
end
context "bignum" do
- describe "with a Fixnum" do
+ describe "with an Integer" do
it "returns -1 when other is larger" do
(-bignum_value <=> 2).should == -1
end
@@ -37,7 +37,7 @@ describe "Integer#<=>" do
end
end
- describe "with a Bignum" do
+ describe "with an Integer" do
describe "when other is negative" do
it "returns -1 when self is negative and other is larger" do
(-bignum_value(42) <=> -bignum_value).should == -1
@@ -116,7 +116,7 @@ describe "Integer#<=>" do
describe "with an Object" do
before :each do
@big = bignum_value
- @num = mock("value for Bignum#<=>")
+ @num = mock("value for Integer#<=>")
end
it "calls #coerce on other" do
@@ -158,7 +158,7 @@ describe "Integer#<=>" do
end
# The tests below are taken from matz's revision 23730 for Ruby trunk
- it "returns 1 when self is Infinity and other is a Bignum" do
+ it "returns 1 when self is Infinity and other is an Integer" do
(infinity_value <=> Float::MAX.to_i*2).should == 1
end
diff --git a/spec/ruby/core/integer/constants_spec.rb b/spec/ruby/core/integer/constants_spec.rb
index 3b8b01e330b..35601f82b95 100644
--- a/spec/ruby/core/integer/constants_spec.rb
+++ b/spec/ruby/core/integer/constants_spec.rb
@@ -1,25 +1,27 @@
require_relative '../../spec_helper'
-describe "Fixnum" do
- it "is unified into Integer" do
- suppress_warning do
- Fixnum.should equal(Integer)
+ruby_version_is ""..."3.0" do
+ describe "Fixnum" do
+ it "is unified into Integer" do
+ suppress_warning do
+ Fixnum.should equal(Integer)
+ end
end
- end
- it "is deprecated" do
- -> { Fixnum }.should complain(/constant ::Fixnum is deprecated/)
+ it "is deprecated" do
+ -> { Fixnum }.should complain(/constant ::Fixnum is deprecated/)
+ end
end
-end
-describe "Bignum" do
- it "is unified into Integer" do
- suppress_warning do
- Bignum.should equal(Integer)
+ describe "Bignum" do
+ it "is unified into Integer" do
+ suppress_warning do
+ Bignum.should equal(Integer)
+ end
end
- end
- it "is deprecated" do
- -> { Bignum }.should complain(/constant ::Bignum is deprecated/)
+ it "is deprecated" do
+ -> { Bignum }.should complain(/constant ::Bignum is deprecated/)
+ end
end
end
diff --git a/spec/ruby/core/integer/denominator_spec.rb b/spec/ruby/core/integer/denominator_spec.rb
index c1477d0757d..d19b8175a34 100644
--- a/spec/ruby/core/integer/denominator_spec.rb
+++ b/spec/ruby/core/integer/denominator_spec.rb
@@ -7,7 +7,7 @@ describe "Integer#denominator" do
@numbers = [
20, # Integer
-2709, # Negative Integer
- 99999999**99, # Bignum
+ 99999999**99, # Integer
-99999**621, # Negative BigNum
0,
1
diff --git a/spec/ruby/core/integer/div_spec.rb b/spec/ruby/core/integer/div_spec.rb
index 087d012fe0a..bc1c4363d4b 100644
--- a/spec/ruby/core/integer/div_spec.rb
+++ b/spec/ruby/core/integer/div_spec.rb
@@ -36,7 +36,7 @@ describe "Integer#div" do
10.div(y).should == result
end
- it "coerces self and the given argument to Floats and returns self divided by other as Fixnum" do
+ it "coerces self and the given argument to Floats and returns self divided by other as Integer" do
1.div(0.2).should == 5
1.div(0.16).should == 6
1.div(0.169).should == 5
diff --git a/spec/ruby/core/integer/downto_spec.rb b/spec/ruby/core/integer/downto_spec.rb
index af7a7e36b90..987704b02ea 100644
--- a/spec/ruby/core/integer/downto_spec.rb
+++ b/spec/ruby/core/integer/downto_spec.rb
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'
-describe "Integer#downto [stop] when self and stop are Fixnums" do
+describe "Integer#downto [stop] when self and stop are Integers" do
it "does not yield when stop is greater than self" do
result = []
5.downto(6) { |x| result << x }
diff --git a/spec/ruby/core/integer/element_reference_spec.rb b/spec/ruby/core/integer/element_reference_spec.rb
index 4c236a11e79..6e65c502544 100644
--- a/spec/ruby/core/integer/element_reference_spec.rb
+++ b/spec/ruby/core/integer/element_reference_spec.rb
@@ -68,14 +68,14 @@ describe "Integer#[]" do
-> { 3[obj] }.should raise_error(TypeError)
end
- it "calls #to_int to coerce a String to a Bignum and returns 0" do
+ it "calls #to_int to coerce a String to an Integer and returns 0" do
obj = mock('bignum value')
obj.should_receive(:to_int).and_return(bignum_value)
3[obj].should == 0
end
- it "returns 0 when passed a Float in the range of a Bignum" do
+ it "returns 0 when passed a Float in the range of an Integer" do
3[bignum_value.to_f].should == 0
end
diff --git a/spec/ruby/core/integer/even_spec.rb b/spec/ruby/core/integer/even_spec.rb
index a314cc6b197..a93f54c74e1 100644
--- a/spec/ruby/core/integer/even_spec.rb
+++ b/spec/ruby/core/integer/even_spec.rb
@@ -2,7 +2,7 @@ require_relative '../../spec_helper'
describe "Integer#even?" do
context "fixnum" do
- it "returns true for a Fixnum when it is an even number" do
+ it "returns true for an Integer when it is an even number" do
(-2).even?.should be_true
(-1).even?.should be_false
@@ -11,7 +11,7 @@ describe "Integer#even?" do
2.even?.should be_true
end
- it "returns true for a Bignum when it is an even number" do
+ it "returns true for an Integer when it is an even number" do
bignum_value(0).even?.should be_true
bignum_value(1).even?.should be_false
diff --git a/spec/ruby/core/integer/gcd_spec.rb b/spec/ruby/core/integer/gcd_spec.rb
index 8aa654a16a9..82086d742af 100644
--- a/spec/ruby/core/integer/gcd_spec.rb
+++ b/spec/ruby/core/integer/gcd_spec.rb
@@ -31,15 +31,15 @@ describe "Integer#gcd" do
-100.gcd(-100).should == 100
end
- it "accepts a Bignum argument" do
+ it "accepts an Integer argument" do
bignum = 9999**99
- bignum.should be_kind_of(Bignum)
+ bignum.should be_kind_of(Integer)
99.gcd(bignum).should == 99
end
- it "works if self is a Bignum" do
+ it "works if self is an Integer" do
bignum = 9999**99
- bignum.should be_kind_of(Bignum)
+ bignum.should be_kind_of(Integer)
bignum.gcd(99).should == 99
end
diff --git a/spec/ruby/core/integer/gcdlcm_spec.rb b/spec/ruby/core/integer/gcdlcm_spec.rb
index 5b3669e62a4..2915750f881 100644
--- a/spec/ruby/core/integer/gcdlcm_spec.rb
+++ b/spec/ruby/core/integer/gcdlcm_spec.rb
@@ -26,15 +26,15 @@ describe "Integer#gcdlcm" do
200.gcdlcm(20)[1].should == 200.lcm(20)
end
- it "accepts a Bignum argument" do
+ it "accepts an Integer argument" do
bignum = 91999**99
- bignum.should be_kind_of(Bignum)
+ bignum.should be_kind_of(Integer)
99.gcdlcm(bignum).should == [99.gcd(bignum), 99.lcm(bignum)]
end
- it "works if self is a Bignum" do
+ it "works if self is an Integer" do
bignum = 9999**89
- bignum.should be_kind_of(Bignum)
+ bignum.should be_kind_of(Integer)
bignum.gcdlcm(99).should == [bignum.gcd(99), bignum.lcm(99)]
end
diff --git a/spec/ruby/core/integer/lcm_spec.rb b/spec/ruby/core/integer/lcm_spec.rb
index 77d3ad34888..39976ea4749 100644
--- a/spec/ruby/core/integer/lcm_spec.rb
+++ b/spec/ruby/core/integer/lcm_spec.rb
@@ -31,15 +31,15 @@ describe "Integer#lcm" do
-100.lcm(-100).should == 100
end
- it "accepts a Bignum argument" do
+ it "accepts an Integer argument" do
bignum = 9999**99
- bignum.should be_kind_of(Bignum)
+ bignum.should be_kind_of(Integer)
99.lcm(bignum).should == bignum
end
- it "works if self is a Bignum" do
+ it "works if self is an Integer" do
bignum = 9999**99
- bignum.should be_kind_of(Bignum)
+ bignum.should be_kind_of(Integer)
bignum.lcm(99).should == bignum
end
diff --git a/spec/ruby/core/integer/left_shift_spec.rb b/spec/ruby/core/integer/left_shift_spec.rb
index f9a8c9bbd1b..d2ffe4bbebd 100644
--- a/spec/ruby/core/integer/left_shift_spec.rb
+++ b/spec/ruby/core/integer/left_shift_spec.rb
@@ -52,19 +52,19 @@ describe "Integer#<< (with n << m)" do
(-7 << -64).should == -1
end
- it "returns 0 when m < 0 and m is a Bignum" do
+ it "returns 0 when m < 0 and m is an Integer" do
(3 << -bignum_value).should == 0
end
- it "returns an Bignum == fixnum_max * 2 when fixnum_max << 1 and n > 0" do
+ it "returns an Integer == fixnum_max * 2 when fixnum_max << 1 and n > 0" do
result = fixnum_max << 1
- result.should be_an_instance_of(Bignum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_max * 2
end
- it "returns an Bignum == fixnum_min * 2 when fixnum_min << 1 and n < 0" do
+ it "returns an Integer == fixnum_min * 2 when fixnum_min << 1 and n < 0" do
result = fixnum_min << 1
- result.should be_an_instance_of(Bignum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_min * 2
end
@@ -127,19 +127,19 @@ describe "Integer#<< (with n << m)" do
(@bignum << -68).should == 0
end
- it "returns 0 when m < 0 and m is a Bignum" do
+ it "returns 0 when m < 0 and m is an Integer" do
(@bignum << -bignum_value).should == 0
end
- it "returns a Fixnum == fixnum_max when (fixnum_max * 2) << -1 and n > 0" do
+ it "returns an Integer == fixnum_max when (fixnum_max * 2) << -1 and n > 0" do
result = (fixnum_max * 2) << -1
- result.should be_an_instance_of(Fixnum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_max
end
- it "returns a Fixnum == fixnum_min when (fixnum_min * 2) << -1 and n < 0" do
+ it "returns an Integer == fixnum_min when (fixnum_min * 2) << -1 and n < 0" do
result = (fixnum_min * 2) << -1
- result.should be_an_instance_of(Fixnum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_min
end
diff --git a/spec/ruby/core/integer/right_shift_spec.rb b/spec/ruby/core/integer/right_shift_spec.rb
index 1eac6cb5bc9..62cbe862b97 100644
--- a/spec/ruby/core/integer/right_shift_spec.rb
+++ b/spec/ruby/core/integer/right_shift_spec.rb
@@ -56,15 +56,15 @@ describe "Integer#>> (with n >> m)" do
(3 >> bignum_value).should == 0
end
- it "returns an Bignum == fixnum_max * 2 when fixnum_max >> -1 and n > 0" do
+ it "returns an Integer == fixnum_max * 2 when fixnum_max >> -1 and n > 0" do
result = fixnum_max >> -1
- result.should be_an_instance_of(Bignum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_max * 2
end
- it "returns an Bignum == fixnum_min * 2 when fixnum_min >> -1 and n < 0" do
+ it "returns an Integer == fixnum_min * 2 when fixnum_min >> -1 and n < 0" do
result = fixnum_min >> -1
- result.should be_an_instance_of(Bignum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_min * 2
end
@@ -153,19 +153,19 @@ describe "Integer#>> (with n >> m)" do
(@bignum >> 68).should == 0
end
- it "returns 0 when m is a Bignum" do
+ it "returns 0 when m is an Integer" do
(@bignum >> bignum_value).should == 0
end
- it "returns a Fixnum == fixnum_max when (fixnum_max * 2) >> 1 and n > 0" do
+ it "returns an Integer == fixnum_max when (fixnum_max * 2) >> 1 and n > 0" do
result = (fixnum_max * 2) >> 1
- result.should be_an_instance_of(Fixnum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_max
end
- it "returns a Fixnum == fixnum_min when (fixnum_min * 2) >> 1 and n < 0" do
+ it "returns an Integer == fixnum_min when (fixnum_min * 2) >> 1 and n < 0" do
result = (fixnum_min * 2) >> 1
- result.should be_an_instance_of(Fixnum)
+ result.should be_an_instance_of(Integer)
result.should == fixnum_min
end
diff --git a/spec/ruby/core/integer/shared/equal.rb b/spec/ruby/core/integer/shared/equal.rb
index 4a5a236ffa6..ecee17831c0 100644
--- a/spec/ruby/core/integer/shared/equal.rb
+++ b/spec/ruby/core/integer/shared/equal.rb
@@ -4,7 +4,7 @@ describe :integer_equal, shared: true do
1.send(@method, 1).should == true
9.send(@method, 5).should == false
- # Actually, these call Float#==, Bignum#== etc.
+ # Actually, these call Float#==, Integer#== etc.
9.send(@method, 9.0).should == true
9.send(@method, 9.01).should == false
diff --git a/spec/ruby/core/integer/shared/next.rb b/spec/ruby/core/integer/shared/next.rb
index 85b83d69654..fd983d53ecc 100644
--- a/spec/ruby/core/integer/shared/next.rb
+++ b/spec/ruby/core/integer/shared/next.rb
@@ -1,25 +1,25 @@
describe :integer_next, shared: true do
- it "returns the next larger positive Fixnum" do
+ it "returns the next larger positive Integer" do
2.send(@method).should == 3
end
- it "returns the next larger negative Fixnum" do
+ it "returns the next larger negative Integer" do
(-2).send(@method).should == -1
end
- it "returns the next larger positive Bignum" do
+ it "returns the next larger positive Integer" do
bignum_value.send(@method).should == bignum_value(1)
end
- it "returns the next larger negative Bignum" do
+ it "returns the next larger negative Integer" do
(-bignum_value(1)).send(@method).should == -bignum_value
end
- it "overflows a Fixnum to a Bignum" do
+ it "overflows an Integer to an Integer" do
fixnum_max.send(@method).should == fixnum_max + 1
end
- it "underflows a Bignum to a Fixnum" do
+ it "underflows an Integer to an Integer" do
(fixnum_min - 1).send(@method).should == fixnum_min
end
end
diff --git a/spec/ruby/core/integer/to_r_spec.rb b/spec/ruby/core/integer/to_r_spec.rb
index 4a40575b7f6..ac998e2a30f 100644
--- a/spec/ruby/core/integer/to_r_spec.rb
+++ b/spec/ruby/core/integer/to_r_spec.rb
@@ -13,9 +13,9 @@ describe "Integer#to_r" do
298.to_r.denominator.should == 1
end
- it "works even if self is a Bignum" do
+ it "works even if self is an Integer" do
bignum = 99999**999
- bignum.should be_an_instance_of(Bignum)
+ bignum.should be_an_instance_of(Integer)
bignum.to_r.should == Rational(bignum, 1)
end
diff --git a/spec/ruby/core/integer/uminus_spec.rb b/spec/ruby/core/integer/uminus_spec.rb
index b6b110dec43..efaed1d2a66 100644
--- a/spec/ruby/core/integer/uminus_spec.rb
+++ b/spec/ruby/core/integer/uminus_spec.rb
@@ -10,7 +10,7 @@ describe "Integer#-@" do
-8.send(:-@).should == 8
end
- it "negates self at Fixnum/Bignum boundaries" do
+ it "negates self at Integer/Integer boundaries" do
(-fixnum_max).should == (0 - fixnum_max)
(-fixnum_max).should < 0
(-fixnum_min).should == (0 - fixnum_min)
diff --git a/spec/ruby/core/integer/upto_spec.rb b/spec/ruby/core/integer/upto_spec.rb
index 6049eb173e6..dd6995e94b4 100644
--- a/spec/ruby/core/integer/upto_spec.rb
+++ b/spec/ruby/core/integer/upto_spec.rb
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'
-describe "Integer#upto [stop] when self and stop are Fixnums" do
+describe "Integer#upto [stop] when self and stop are Integers" do
it "does not yield when stop is less than self" do
result = []
5.upto(4) { |x| result << x }
diff --git a/spec/ruby/core/io/initialize_spec.rb b/spec/ruby/core/io/initialize_spec.rb
index c0d84765a87..ba5bc117b7c 100644
--- a/spec/ruby/core/io/initialize_spec.rb
+++ b/spec/ruby/core/io/initialize_spec.rb
@@ -13,7 +13,7 @@ describe "IO#initialize" do
rm_r @name
end
- it "reassociates the IO instance with the new descriptor when passed a Fixnum" do
+ it "reassociates the IO instance with the new descriptor when passed an Integer" do
fd = new_fd @name, "r:utf-8"
@io.send :initialize, fd, 'r'
@io.fileno.should == fd
diff --git a/spec/ruby/core/io/shared/new.rb b/spec/ruby/core/io/shared/new.rb
index 75c532053fd..f2a0970a400 100644
--- a/spec/ruby/core/io/shared/new.rb
+++ b/spec/ruby/core/io/shared/new.rb
@@ -18,7 +18,7 @@ describe :io_new, shared: true do
rm_r @name
end
- it "creates an IO instance from a Fixnum argument" do
+ it "creates an IO instance from an Integer argument" do
@io = IO.send(@method, @fd, "w")
@io.should be_an_instance_of(IO)
end
@@ -55,7 +55,7 @@ describe :io_new, shared: true do
end
end
- it "calls #to_int on an object to convert to a Fixnum" do
+ it "calls #to_int on an object to convert to an Integer" do
obj = mock("file descriptor")
obj.should_receive(:to_int).and_return(@fd)
@io = IO.send(@method, obj, "w")
diff --git a/spec/ruby/core/io/shared/pos.rb b/spec/ruby/core/io/shared/pos.rb
index 0b4d1e13b31..d83a6c66921 100644
--- a/spec/ruby/core/io/shared/pos.rb
+++ b/spec/ruby/core/io/shared/pos.rb
@@ -60,7 +60,7 @@ describe :io_set_pos, shared: true do
end
end
- it "does not accept Bignums that don't fit in a C long" do
+ it "does not accept Integers that don't fit in a C long" do
File.open @fname do |io|
-> { io.send @method, 2**128 }.should raise_error(RangeError)
end
diff --git a/spec/ruby/core/io/shared/readlines.rb b/spec/ruby/core/io/shared/readlines.rb
index 339684a5d4b..8e4a73bb98c 100644
--- a/spec/ruby/core/io/shared/readlines.rb
+++ b/spec/ruby/core/io/shared/readlines.rb
@@ -54,7 +54,7 @@ describe :io_readlines_options_19, shared: true do
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_space_separator
end
- describe "when the object is a Fixnum" do
+ describe "when the object is an Integer" do
before :each do
@sep = $/
end
@@ -69,7 +69,7 @@ describe :io_readlines_options_19, shared: true do
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_space_separator_limit
end
- it "uses the object as a limit if it is a Fixnum" do
+ it "uses the object as a limit if it is an Integer" do
result = IO.send(@method, @name, 10, &@object)
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_limit
end
@@ -96,7 +96,7 @@ describe :io_readlines_options_19, shared: true do
end
describe "when passed name, object, object" do
- describe "when the first object is a Fixnum" do
+ describe "when the first object is an Integer" do
it "uses the second object as an options Hash" do
-> do
IO.send(@method, @filename, 10, mode: "w", &@object)
@@ -113,7 +113,7 @@ describe :io_readlines_options_19, shared: true do
end
describe "when the first object is a String" do
- it "uses the second object as a limit if it is a Fixnum" do
+ it "uses the second object as a limit if it is an Integer" do
result = IO.send(@method, @name, " ", 10, &@object)
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_space_separator_limit
end
@@ -140,7 +140,7 @@ describe :io_readlines_options_19, shared: true do
end
end
- describe "when the first object is not a String or Fixnum" do
+ describe "when the first object is not a String or Integer" do
it "calls #to_str to convert the object to a String" do
sep = mock("io readlines separator")
sep.should_receive(:to_str).at_least(1).and_return(" ")
@@ -148,7 +148,7 @@ describe :io_readlines_options_19, shared: true do
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_space_separator_limit
end
- it "uses the second object as a limit if it is a Fixnum" do
+ it "uses the second object as a limit if it is an Integer" do
result = IO.send(@method, @name, " ", 10, mode: "r", &@object)
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_space_separator_limit
end
diff --git a/spec/ruby/core/io/sysopen_spec.rb b/spec/ruby/core/io/sysopen_spec.rb
index 4607d136876..7ad379df3ab 100644
--- a/spec/ruby/core/io/sysopen_spec.rb
+++ b/spec/ruby/core/io/sysopen_spec.rb
@@ -13,7 +13,7 @@ describe "IO.sysopen" do
it "returns the file descriptor for a given path" do
@fd = IO.sysopen(@filename, "w")
- @fd.should be_kind_of(Fixnum)
+ @fd.should be_kind_of(Integer)
@fd.should_not equal(0)
end
@@ -21,7 +21,7 @@ describe "IO.sysopen" do
platform_is_not :windows do
it "works on directories" do
@fd = IO.sysopen(tmp("")) # /tmp
- @fd.should be_kind_of(Fixnum)
+ @fd.should be_kind_of(Integer)
@fd.should_not equal(0)
end
end
diff --git a/spec/ruby/core/io/ungetbyte_spec.rb b/spec/ruby/core/io/ungetbyte_spec.rb
index 9d189f8abbb..1e2ec77e1f7 100644
--- a/spec/ruby/core/io/ungetbyte_spec.rb
+++ b/spec/ruby/core/io/ungetbyte_spec.rb
@@ -37,12 +37,12 @@ describe "IO#ungetbyte" do
end
ruby_version_is ''...'2.6' do
- it "puts back one byte for a Fixnum argument..." do
+ it "puts back one byte for an Integer argument..." do
@io.ungetbyte(4095).should be_nil
@io.getbyte.should == 255
end
- it "... but not for Bignum argument (eh?)" do
+ it "... but not for Integer argument (eh?)" do
-> {
@io.ungetbyte(0x4f7574206f6620636861722072616e6765)
}.should raise_error(TypeError)
diff --git a/spec/ruby/core/kernel/Float_spec.rb b/spec/ruby/core/kernel/Float_spec.rb
index af64fcbe860..ce224cada98 100644
--- a/spec/ruby/core/kernel/Float_spec.rb
+++ b/spec/ruby/core/kernel/Float_spec.rb
@@ -9,7 +9,7 @@ describe :kernel_float, shared: true do
float2.should equal float
end
- it "returns a Float for Fixnums" do
+ it "returns a Float for Integers" do
@object.send(:Float, 1).should == 1.0
end
@@ -17,7 +17,7 @@ describe :kernel_float, shared: true do
@object.send(:Float, Complex(1)).should == 1.0
end
- it "returns a Float for Bignums" do
+ it "returns a Float for Integers" do
@object.send(:Float, 1000000000000).should == 1000000000000.0
end
diff --git a/spec/ruby/core/kernel/Integer_spec.rb b/spec/ruby/core/kernel/Integer_spec.rb
index 59b41d37e6f..674c7dd185e 100644
--- a/spec/ruby/core/kernel/Integer_spec.rb
+++ b/spec/ruby/core/kernel/Integer_spec.rb
@@ -2,11 +2,11 @@ require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe :kernel_integer, shared: true do
- it "returns a Bignum for a Bignum" do
+ it "returns an Integer for an Integer" do
Integer(2e100).should == 2e100
end
- it "returns a Fixnum for a Fixnum" do
+ it "returns an Integer for an Integer" do
Integer(100).should == 100
end
@@ -39,9 +39,9 @@ describe :kernel_integer, shared: true do
-> { Integer(nil) }.should raise_error(TypeError)
end
- it "returns a Fixnum or Bignum object" do
- Integer(2).should be_an_instance_of(Fixnum)
- Integer(9**99).should be_an_instance_of(Bignum)
+ it "returns an Integer or Integer object" do
+ Integer(2).should be_an_instance_of(Integer)
+ Integer(9**99).should be_an_instance_of(Integer)
end
it "truncates Floats" do
@@ -54,14 +54,14 @@ describe :kernel_integer, shared: true do
Integer(3.quo(2)).should == 1
end
- it "returns the value of to_int if the result is a Fixnum" do
+ it "returns the value of to_int if the result is an Integer" do
obj = mock("object")
obj.should_receive(:to_int).and_return(1)
obj.should_not_receive(:to_i)
Integer(obj).should == 1
end
- it "returns the value of to_int if the result is a Bignum" do
+ it "returns the value of to_int if the result is an Integer" do
obj = mock("object")
obj.should_receive(:to_int).and_return(2 * 10**100)
obj.should_not_receive(:to_i)
diff --git a/spec/ruby/core/kernel/class_spec.rb b/spec/ruby/core/kernel/class_spec.rb
index 4d3b4e549ba..2725bde19b4 100644
--- a/spec/ruby/core/kernel/class_spec.rb
+++ b/spec/ruby/core/kernel/class_spec.rb
@@ -5,7 +5,7 @@ describe "Kernel#class" do
it "returns the class of the object" do
Object.new.class.should equal(Object)
- 1.class.should equal(Fixnum)
+ 1.class.should equal(Integer)
3.14.class.should equal(Float)
:hello.class.should equal(Symbol)
"hello".class.should equal(String)
diff --git a/spec/ruby/core/kernel/instance_variable_get_spec.rb b/spec/ruby/core/kernel/instance_variable_get_spec.rb
index 84d3188f07c..bb6f03d3bf6 100644
--- a/spec/ruby/core/kernel/instance_variable_get_spec.rb
+++ b/spec/ruby/core/kernel/instance_variable_get_spec.rb
@@ -92,7 +92,7 @@ describe "Kernel#instance_variable_get when passed String" do
end
end
-describe "Kernel#instance_variable_get when passed Fixnum" do
+describe "Kernel#instance_variable_get when passed Integer" do
before :each do
@obj = Object.new
@obj.instance_variable_set("@test", :test)
diff --git a/spec/ruby/core/kernel/instance_variable_set_spec.rb b/spec/ruby/core/kernel/instance_variable_set_spec.rb
index 12b2185878a..7fda30f72cf 100644
--- a/spec/ruby/core/kernel/instance_variable_set_spec.rb
+++ b/spec/ruby/core/kernel/instance_variable_set_spec.rb
@@ -31,7 +31,7 @@ describe "Kernel#instance_variable_set" do
-> { dog_at.new.instance_variable_set(:"@", "cat") }.should raise_error(NameError)
end
- it "raises a TypeError if the instance variable name is a Fixnum" do
+ it "raises a TypeError if the instance variable name is an Integer" do
-> { "".instance_variable_set(1, 2) }.should raise_error(TypeError)
end
diff --git a/spec/ruby/core/kernel/shared/require.rb b/spec/ruby/core/kernel/shared/require.rb
index 4e0322025cc..d656b3b2f27 100644
--- a/spec/ruby/core/kernel/shared/require.rb
+++ b/spec/ruby/core/kernel/shared/require.rb
@@ -60,7 +60,7 @@ describe :kernel_require_basic, shared: true do
-> { @object.send(@method, nil) }.should raise_error(TypeError)
end
- it "raises a TypeError if passed a Fixnum" do
+ it "raises a TypeError if passed an Integer" do
-> { @object.send(@method, 42) }.should raise_error(TypeError)
end
diff --git a/spec/ruby/core/kernel/singleton_class_spec.rb b/spec/ruby/core/kernel/singleton_class_spec.rb
index 5dbb4f8c05e..a8bcd916d1d 100644
--- a/spec/ruby/core/kernel/singleton_class_spec.rb
+++ b/spec/ruby/core/kernel/singleton_class_spec.rb
@@ -17,7 +17,7 @@ describe "Kernel#singleton_class" do
false.singleton_class.should == FalseClass
end
- it "raises TypeError for Fixnum" do
+ it "raises TypeError for Integer" do
-> { 123.singleton_class }.should raise_error(TypeError)
end
diff --git a/spec/ruby/core/kernel/sleep_spec.rb b/spec/ruby/core/kernel/sleep_spec.rb
index 387dc4787bd..71a3f24f131 100644
--- a/spec/ruby/core/kernel/sleep_spec.rb
+++ b/spec/ruby/core/kernel/sleep_spec.rb
@@ -14,7 +14,7 @@ describe "Kernel#sleep" do
sleep(0.001).should >= 0
end
- it "accepts a Fixnum" do
+ it "accepts an Integer" do
sleep(0).should >= 0
end
diff --git a/spec/ruby/core/kernel/srand_spec.rb b/spec/ruby/core/kernel/srand_spec.rb
index 0985c76cb09..6774d192847 100644
--- a/spec/ruby/core/kernel/srand_spec.rb
+++ b/spec/ruby/core/kernel/srand_spec.rb
@@ -37,7 +37,7 @@ describe "Kernel.srand" do
srand.should == -17
end
- it "accepts a Bignum as a seed" do
+ it "accepts an Integer as a seed" do
srand(0x12345678901234567890)
srand.should == 0x12345678901234567890
end
diff --git a/spec/ruby/core/kernel/taint_spec.rb b/spec/ruby/core/kernel/taint_spec.rb
index 22b2c4d0a40..8ba9869af23 100644
--- a/spec/ruby/core/kernel/taint_spec.rb
+++ b/spec/ruby/core/kernel/taint_spec.rb
@@ -37,7 +37,7 @@ describe "Kernel#taint" do
v.should_not.tainted?
end
- it "no raises error on fixnum values" do
+ it "no raises error on integer values" do
[1].each do |v|
-> { v.taint }.should_not raise_error(RuntimeError)
v.should_not.tainted?
diff --git a/spec/ruby/core/marshal/dump_spec.rb b/spec/ruby/core/marshal/dump_spec.rb
index 8d6ba245afb..0e50df72277 100644
--- a/spec/ruby/core/marshal/dump_spec.rb
+++ b/spec/ruby/core/marshal/dump_spec.rb
@@ -15,8 +15,8 @@ describe "Marshal.dump" do
Marshal.dump(false).should == "\004\bF"
end
- describe "with a Fixnum" do
- it "dumps a Fixnum" do
+ describe "with an Integer" do
+ it "dumps an Integer" do
[ [Marshal, 0, "\004\bi\000"],
[Marshal, 5, "\004\bi\n"],
[Marshal, 8, "\004\bi\r"],
@@ -38,11 +38,11 @@ describe "Marshal.dump" do
end
platform_is wordsize: 64 do
- it "dumps a positive Fixnum > 31 bits as a Bignum" do
+ it "dumps a positive Integer > 31 bits as an Integer" do
Marshal.dump(2**31 + 1).should == "\x04\bl+\a\x01\x00\x00\x80"
end
- it "dumps a negative Fixnum > 31 bits as a Bignum" do
+ it "dumps a negative Integer > 31 bits as an Integer" do
Marshal.dump(-2**31 - 1).should == "\x04\bl-\a\x01\x00\x00\x80"
end
end
@@ -157,14 +157,14 @@ describe "Marshal.dump" do
end
end
- describe "with a Bignum" do
- it "dumps a Bignum" do
+ describe "with an Integer" do
+ it "dumps an Integer" do
[ [Marshal, -4611686018427387903, "\004\bl-\t\377\377\377\377\377\377\377?"],
[Marshal, -2361183241434822606847, "\004\bl-\n\377\377\377\377\377\377\377\377\177\000"],
].should be_computed_by(:dump)
end
- it "dumps a Bignum" do
+ it "dumps an Integer" do
[ [Marshal, 2**64, "\004\bl+\n\000\000\000\000\000\000\000\000\001\000"],
[Marshal, 2**90, "\004\bl+\v#{"\000" * 11}\004"],
[Marshal, -2**63, "\004\bl-\t\000\000\000\000\000\000\000\200"],
diff --git a/spec/ruby/core/marshal/fixtures/marshal_data.rb b/spec/ruby/core/marshal/fixtures/marshal_data.rb
index 29312782903..bf58f4888db 100644
--- a/spec/ruby/core/marshal/fixtures/marshal_data.rb
+++ b/spec/ruby/core/marshal/fixtures/marshal_data.rb
@@ -227,36 +227,36 @@ module MarshalSpec
"\004\b:\010big"],
"Symbol big" => [('big' * 100).to_sym,
"\004\b:\002,\001#{'big' * 100}"],
- "Bignum -2**64" => [-2**64,
+ "Integer -2**64" => [-2**64,
"\004\bl-\n\000\000\000\000\000\000\000\000\001\000"],
- "Bignum -2**63" => [-2**63,
+ "Integer -2**63" => [-2**63,
"\004\bl-\t\000\000\000\000\000\000\000\200"],
- "Fixnum -2**24" => [-2**24,
+ "Integer -2**24" => [-2**24,
"\004\bi\375\000\000\000"],
- "Fixnum -4516727" => [-4516727,
+ "Integer -4516727" => [-4516727,
"\004\bi\375\211\024\273"],
- "Fixnum -2**16" => [-2**16,
+ "Integer -2**16" => [-2**16,
"\004\bi\376\000\000"],
- "Fixnum -2**8" => [-2**8,
+ "Integer -2**8" => [-2**8,
"\004\bi\377\000"],
- "Fixnum -123" => [-123,
+ "Integer -123" => [-123,
"\004\bi\200"],
- "Fixnum -124" => [-124, "\004\bi\377\204"],
- "Fixnum 0" => [0,
+ "Integer -124" => [-124, "\004\bi\377\204"],
+ "Integer 0" => [0,
"\004\bi\000"],
- "Fixnum 5" => [5,
+ "Integer 5" => [5,
"\004\bi\n"],
- "Fixnum 122" => [122, "\004\bi\177"],
- "Fixnum 123" => [123, "\004\bi\001{"],
- "Fixnum 2**8" => [2**8,
+ "Integer 122" => [122, "\004\bi\177"],
+ "Integer 123" => [123, "\004\bi\001{"],
+ "Integer 2**8" => [2**8,
"\004\bi\002\000\001"],
- "Fixnum 2**16" => [2**16,
+ "Integer 2**16" => [2**16,
"\004\bi\003\000\000\001"],
- "Fixnum 2**24" => [2**24,
+ "Integer 2**24" => [2**24,
"\004\bi\004\000\000\000\001"],
- "Bignum 2**64" => [2**64,
+ "Integer 2**64" => [2**64,
"\004\bl+\n\000\000\000\000\000\000\000\000\001\000"],
- "Bignum 2**90" => [2**90,
+ "Integer 2**90" => [2**90,
"\004\bl+\v#{"\000" * 11}\004"],
"Class String" => [String,
"\004\bc\vString"],
@@ -334,31 +334,31 @@ module MarshalSpec
"\004\b:\010big"],
"Symbol big" => [('big' * 100).to_sym,
"\004\b:\002,\001#{'big' * 100}"],
- "Bignum -2**64" => [-2**64,
+ "Integer -2**64" => [-2**64,
"\004\bl-\n\000\000\000\000\000\000\000\000\001\000"],
- "Bignum -2**63" => [-2**63,
+ "Integer -2**63" => [-2**63,
"\004\bl-\t\000\000\000\000\000\000\000\200"],
- "Fixnum -2**24" => [-2**24,
+ "Integer -2**24" => [-2**24,
"\004\bi\375\000\000\000"],
- "Fixnum -2**16" => [-2**16,
+ "Integer -2**16" => [-2**16,
"\004\bi\376\000\000"],
- "Fixnum -2**8" => [-2**8,
+ "Integer -2**8" => [-2**8,
"\004\bi\377\000"],
- "Fixnum -123" => [-123,
+ "Integer -123" => [-123,
"\004\bi\200"],
- "Fixnum 0" => [0,
+ "Integer 0" => [0,
"\004\bi\000"],
- "Fixnum 5" => [5,
+ "Integer 5" => [5,
"\004\bi\n"],
- "Fixnum 2**8" => [2**8,
+ "Integer 2**8" => [2**8,
"\004\bi\002\000\001"],
- "Fixnum 2**16" => [2**16,
+ "Integer 2**16" => [2**16,
"\004\bi\003\000\000\001"],
- "Fixnum 2**24" => [2**24,
+ "Integer 2**24" => [2**24,
"\004\bi\004\000\000\000\001"],
- "Bignum 2**64" => [2**64,
+ "Integer 2**64" => [2**64,
"\004\bl+\n\000\000\000\000\000\000\000\000\001\000"],
- "Bignum 2**90" => [2**90,
+ "Integer 2**90" => [2**90,
"\004\bl+\v#{"\000" * 11}\004"],
"Class String" => [String,
"\004\bc\vString"],
diff --git a/spec/ruby/core/marshal/shared/load.rb b/spec/ruby/core/marshal/shared/load.rb
index e63fd8adda1..9d42b9df4ae 100644
--- a/spec/ruby/core/marshal/shared/load.rb
+++ b/spec/ruby/core/marshal/shared/load.rb
@@ -211,14 +211,14 @@ describe :marshal_load, shared: true do
y.first.tainted?.should be_false
end
- it "does not taint Fixnums" do
+ it "does not taint Integers" do
x = [1]
y = Marshal.send(@method, Marshal.dump(x).taint)
y.tainted?.should be_true
y.first.tainted?.should be_false
end
- it "does not taint Bignums" do
+ it "does not taint Integers" do
x = [bignum_value]
y = Marshal.send(@method, Marshal.dump(x).taint)
y.tainted?.should be_true
@@ -740,19 +740,19 @@ describe :marshal_load, shared: true do
end
end
- describe "for a Bignum" do
+ describe "for an Integer" do
platform_is wordsize: 64 do
- context "that is Bignum on 32-bit platforms but Fixnum on 64-bit" do
- it "dumps a Fixnum" do
+ context "that is Integer on 32-bit platforms but Integer on 64-bit" do
+ it "dumps an Integer" do
val = Marshal.send(@method, "\004\bl+\ab:wU")
val.should == 1433877090
- val.class.should == Fixnum
+ val.class.should == Integer
end
- it "dumps an array containing multiple references to the Bignum as an array of Fixnum" do
+ it "dumps an array containing multiple references to the Integer as an array of Integer" do
arr = Marshal.send(@method, "\004\b[\al+\a\223BwU@\006")
arr.should == [1433879187, 1433879187]
- arr.each { |v| v.class.should == Fixnum }
+ arr.each { |v| v.class.should == Integer }
end
end
end
diff --git a/spec/ruby/core/method/source_location_spec.rb b/spec/ruby/core/method/source_location_spec.rb
index 051739c57d5..1f476aaa9b8 100644
--- a/spec/ruby/core/method/source_location_spec.rb
+++ b/spec/ruby/core/method/source_location_spec.rb
@@ -16,9 +16,9 @@ describe "Method#source_location" do
file.should == File.realpath('../fixtures/classes.rb', __FILE__)
end
- it "sets the last value to a Fixnum representing the line on which the method was defined" do
+ it "sets the last value to an Integer representing the line on which the method was defined" do
line = @method.source_location.last
- line.should be_an_instance_of(Fixnum)
+ line.should be_an_instance_of(Integer)
line.should == 5
end
diff --git a/spec/ruby/core/module/attr_accessor_spec.rb b/spec/ruby/core/module/attr_accessor_spec.rb
index 290599e631a..a5455e4f5cc 100644
--- a/spec/ruby/core/module/attr_accessor_spec.rb
+++ b/spec/ruby/core/module/attr_accessor_spec.rb
@@ -85,17 +85,17 @@ describe "Module#attr_accessor" do
describe "on immediates" do
before :each do
- class Fixnum
+ class Integer
attr_accessor :foobar
end
end
after :each do
- if Fixnum.method_defined?(:foobar)
- Fixnum.send(:remove_method, :foobar)
+ if Integer.method_defined?(:foobar)
+ Integer.send(:remove_method, :foobar)
end
- if Fixnum.method_defined?(:foobar=)
- Fixnum.send(:remove_method, :foobar=)
+ if Integer.method_defined?(:foobar=)
+ Integer.send(:remove_method, :foobar=)
end
end
diff --git a/spec/ruby/core/module/constants_spec.rb b/spec/ruby/core/module/constants_spec.rb
index beb25c6eaa5..fe951438720 100644
--- a/spec/ruby/core/module/constants_spec.rb
+++ b/spec/ruby/core/module/constants_spec.rb
@@ -13,9 +13,9 @@ describe "Module.constants" do
it "returns an array of Symbol names" do
# This in NOT an exhaustive list
- Module.constants.should include(:Array, :Bignum, :Class, :Comparable, :Dir,
+ Module.constants.should include(:Array, :Class, :Comparable, :Dir,
:Enumerable, :ENV, :Exception, :FalseClass,
- :File, :Fixnum, :Float, :Hash, :Integer, :IO,
+ :File, :Float, :Hash, :Integer, :IO,
:Kernel, :Math, :Method, :Module, :NilClass,
:Numeric, :Object, :Range, :Regexp, :String,
:Symbol, :Thread, :Time, :TrueClass)
diff --git a/spec/ruby/core/module/private_method_defined_spec.rb b/spec/ruby/core/module/private_method_defined_spec.rb
index 515542d9dfb..951f17aaa7c 100644
--- a/spec/ruby/core/module/private_method_defined_spec.rb
+++ b/spec/ruby/core/module/private_method_defined_spec.rb
@@ -31,7 +31,7 @@ describe "Module#private_method_defined?" do
ModuleSpecs::CountsMixin.private_method_defined?(:private_3).should == true
end
- it "raises a TypeError if passed a Fixnum" do
+ it "raises a TypeError if passed an Integer" do
-> do
ModuleSpecs::CountsMixin.private_method_defined?(1)
end.should raise_error(TypeError)
diff --git a/spec/ruby/core/module/protected_method_defined_spec.rb b/spec/ruby/core/module/protected_method_defined_spec.rb
index 7be7bdd3c9e..e022d7c5c4a 100644
--- a/spec/ruby/core/module/protected_method_defined_spec.rb
+++ b/spec/ruby/core/module/protected_method_defined_spec.rb
@@ -31,7 +31,7 @@ describe "Module#protected_method_defined?" do
ModuleSpecs::CountsMixin.protected_method_defined?(:protected_3).should == true
end
- it "raises a TypeError if passed a Fixnum" do
+ it "raises a TypeError if passed an Integer" do
-> do
ModuleSpecs::CountsMixin.protected_method_defined?(1)
end.should raise_error(TypeError)
diff --git a/spec/ruby/core/module/public_method_defined_spec.rb b/spec/ruby/core/module/public_method_defined_spec.rb
index d2fcfd1e721..5c9bdf1ccc6 100644
--- a/spec/ruby/core/module/public_method_defined_spec.rb
+++ b/spec/ruby/core/module/public_method_defined_spec.rb
@@ -31,7 +31,7 @@ describe "Module#public_method_defined?" do
ModuleSpecs::CountsMixin.public_method_defined?(:public_3).should == true
end
- it "raises a TypeError if passed a Fixnum" do
+ it "raises a TypeError if passed an Integer" do
-> do
ModuleSpecs::CountsMixin.public_method_defined?(1)
end.should raise_error(TypeError)
diff --git a/spec/ruby/core/nil/to_i_spec.rb b/spec/ruby/core/nil/to_i_spec.rb
index 099792ef68d..d3d088e9990 100644
--- a/spec/ruby/core/nil/to_i_spec.rb
+++ b/spec/ruby/core/nil/to_i_spec.rb
@@ -5,7 +5,7 @@ describe "NilClass#to_i" do
nil.to_i.should == 0
end
- it "does not cause NilClass to be coerced to Fixnum" do
+ it "does not cause NilClass to be coerced to Integer" do
(0 == nil).should == false
end
end
diff --git a/spec/ruby/core/numeric/denominator_spec.rb b/spec/ruby/core/numeric/denominator_spec.rb
index 34729446a24..d347b280f58 100644
--- a/spec/ruby/core/numeric/denominator_spec.rb
+++ b/spec/ruby/core/numeric/denominator_spec.rb
@@ -6,7 +6,7 @@ describe "Numeric#denominator" do
before :each do
@numbers = [
20, # Integer
- 99999999**99, # Bignum
+ 99999999**99, # Integer
]
end
diff --git a/spec/ruby/core/numeric/quo_spec.rb b/spec/ruby/core/numeric/quo_spec.rb
index 5c952b11a97..33b68a38f05 100644
--- a/spec/ruby/core/numeric/quo_spec.rb
+++ b/spec/ruby/core/numeric/quo_spec.rb
@@ -11,7 +11,7 @@ describe "Numeric#quo" do
2.quo(2.5).should eql(0.8)
end
- it "returns the result of self divided by the given Bignum as a Float" do
+ it "returns the result of self divided by the given Integer as a Float" do
45.quo(bignum_value).should be_close(1.04773789668636e-08, TOLERANCE)
end
diff --git a/spec/ruby/core/numeric/real_spec.rb b/spec/ruby/core/numeric/real_spec.rb
index 2d2499bcce5..8702dcc7c20 100644
--- a/spec/ruby/core/numeric/real_spec.rb
+++ b/spec/ruby/core/numeric/real_spec.rb
@@ -7,7 +7,7 @@ describe "Numeric#real" do
20, # Integer
398.72, # Float
Rational(3, 4), # Rational
- bignum_value, # Bignum
+ bignum_value, # Integer
infinity_value,
nan_value
].map{ |n| [n, -n] }.flatten
diff --git a/spec/ruby/core/numeric/shared/imag.rb b/spec/ruby/core/numeric/shared/imag.rb
index ac2da40a3be..0b46b0020b7 100644
--- a/spec/ruby/core/numeric/shared/imag.rb
+++ b/spec/ruby/core/numeric/shared/imag.rb
@@ -6,7 +6,7 @@ describe :numeric_imag, shared: true do
20, # Integer
398.72, # Float
Rational(3, 4), # Rational
- bignum_value, # Bignum
+ bignum_value, # Integer
infinity_value,
nan_value
].map{|n| [n,-n]}.flatten
diff --git a/spec/ruby/core/numeric/shared/rect.rb b/spec/ruby/core/numeric/shared/rect.rb
index 9cde19a3981..c56f3c48aed 100644
--- a/spec/ruby/core/numeric/shared/rect.rb
+++ b/spec/ruby/core/numeric/shared/rect.rb
@@ -6,7 +6,7 @@ describe :numeric_rect, shared: true do
20, # Integer
398.72, # Float
Rational(3, 4), # Rational
- 99999999**99, # Bignum
+ 99999999**99, # Integer
infinity_value,
nan_value
]
diff --git a/spec/ruby/core/numeric/shared/step.rb b/spec/ruby/core/numeric/shared/step.rb
index 6c47cdeecb9..72f33016d45 100644
--- a/spec/ruby/core/numeric/shared/step.rb
+++ b/spec/ruby/core/numeric/shared/step.rb
@@ -24,9 +24,9 @@ describe :numeric_step, :shared => true do
1.0.step.first(5).should == [1.0, 2.0, 3.0, 4.0, 5.0]
end
- describe "when self, stop and step are Fixnums" do
- it "yields only Fixnums" do
- @step.call(1, 5, 1) { |x| x.should be_an_instance_of(Fixnum) }
+ describe "when self, stop and step are Integers" do
+ it "yields only Integers" do
+ @step.call(1, 5, 1) { |x| x.should be_an_instance_of(Integer) }
end
describe "with a positive step" do
@@ -224,7 +224,7 @@ describe :numeric_step, :shared => true do
end
describe "when step is a String" do
- describe "with self and stop as Fixnums" do
+ describe "with self and stop as Integers" do
it "raises an ArgumentError when step is a numeric representation" do
-> { @step.call(1, 5, "1") {} }.should raise_error(ArgumentError)
-> { @step.call(1, 5, "0.1") {} }.should raise_error(ArgumentError)
@@ -280,7 +280,7 @@ describe :numeric_step, :shared => true do
end
describe "when step is a String" do
- describe "with self and stop as Fixnums" do
+ describe "with self and stop as Integers" do
it "returns an Enumerator" do
@step.call(1, 5, "foo").should be_an_instance_of(Enumerator)
end
@@ -296,7 +296,7 @@ describe :numeric_step, :shared => true do
describe "returned Enumerator" do
describe "size" do
describe "when step is a String" do
- describe "with self and stop as Fixnums" do
+ describe "with self and stop as Integers" do
it "raises an ArgumentError when step is a numeric representation" do
-> { @step.call(1, 5, "1").size }.should raise_error(ArgumentError)
-> { @step.call(1, 5, "0.1").size }.should raise_error(ArgumentError)
@@ -319,7 +319,7 @@ describe :numeric_step, :shared => true do
end
end
- describe "when self, stop and step are Fixnums and step is positive" do
+ describe "when self, stop and step are Integers and step is positive" do
it "returns the difference between self and stop divided by the number of steps" do
@step.call(5, 10, 11).size.should == 1
@step.call(5, 10, 6).size.should == 1
@@ -336,7 +336,7 @@ describe :numeric_step, :shared => true do
end
end
- describe "when self, stop and step are Fixnums and step is negative" do
+ describe "when self, stop and step are Integers and step is negative" do
it "returns the difference between self and stop divided by the number of steps" do
@step.call(10, 5, -11).size.should == 1
@step.call(10, 5, -6).size.should == 1
diff --git a/spec/ruby/core/objectspace/_id2ref_spec.rb b/spec/ruby/core/objectspace/_id2ref_spec.rb
index 1d8ad02deb2..6e8828348e5 100644
--- a/spec/ruby/core/objectspace/_id2ref_spec.rb
+++ b/spec/ruby/core/objectspace/_id2ref_spec.rb
@@ -7,7 +7,7 @@ describe "ObjectSpace._id2ref" do
r.should == s
end
- it "retrieves a Fixnum by object_id" do
+ it "retrieves an Integer by object_id" do
f = 1
r = ObjectSpace._id2ref(f.object_id)
r.should == f
diff --git a/spec/ruby/core/proc/hash_spec.rb b/spec/ruby/core/proc/hash_spec.rb
index d780c1ceb0e..ebe0fde1a0c 100644
--- a/spec/ruby/core/proc/hash_spec.rb
+++ b/spec/ruby/core/proc/hash_spec.rb
@@ -7,7 +7,7 @@ describe "Proc#hash" do
end
it "returns an Integer" do
- proc { 1 + 489 }.hash.should be_kind_of(Fixnum)
+ proc { 1 + 489 }.hash.should be_kind_of(Integer)
end
it "is stable" do
diff --git a/spec/ruby/core/proc/source_location_spec.rb b/spec/ruby/core/proc/source_location_spec.rb
index b5b8178df21..f268499b823 100644
--- a/spec/ruby/core/proc/source_location_spec.rb
+++ b/spec/ruby/core/proc/source_location_spec.rb
@@ -34,21 +34,21 @@ describe "Proc#source_location" do
file.should == File.realpath('../fixtures/source_location.rb', __FILE__)
end
- it "sets the last value to a Fixnum representing the line on which the proc was defined" do
+ it "sets the last value to an Integer representing the line on which the proc was defined" do
line = @proc.source_location.last
- line.should be_an_instance_of(Fixnum)
+ line.should be_an_instance_of(Integer)
line.should == 4
line = @proc_new.source_location.last
- line.should be_an_instance_of(Fixnum)
+ line.should be_an_instance_of(Integer)
line.should == 12
line = @lambda.source_location.last
- line.should be_an_instance_of(Fixnum)
+ line.should be_an_instance_of(Integer)
line.should == 8
line = @method.source_location.last
- line.should be_an_instance_of(Fixnum)
+ line.should be_an_instance_of(Integer)
line.should == 15
end
diff --git a/spec/ruby/core/process/euid_spec.rb b/spec/ruby/core/process/euid_spec.rb
index 7bbacfadfd2..a2f1bbf42e8 100644
--- a/spec/ruby/core/process/euid_spec.rb
+++ b/spec/ruby/core/process/euid_spec.rb
@@ -2,7 +2,7 @@ require_relative '../../spec_helper'
describe "Process.euid" do
it "returns the effective user ID for this process" do
- Process.euid.should be_kind_of(Fixnum)
+ Process.euid.should be_kind_of(Integer)
end
it "also goes by Process::UID.eid" do
diff --git a/spec/ruby/core/process/getpriority_spec.rb b/spec/ruby/core/process/getpriority_spec.rb
index 4b66e186792..a35e5956a58 100644
--- a/spec/ruby/core/process/getpriority_spec.rb
+++ b/spec/ruby/core/process/getpriority_spec.rb
@@ -5,19 +5,19 @@ describe "Process.getpriority" do
it "coerces arguments to Integers" do
ret = Process.getpriority mock_int(Process::PRIO_PROCESS), mock_int(0)
- ret.should be_kind_of(Fixnum)
+ ret.should be_kind_of(Integer)
end
it "gets the scheduling priority for a specified process" do
- Process.getpriority(Process::PRIO_PROCESS, 0).should be_kind_of(Fixnum)
+ Process.getpriority(Process::PRIO_PROCESS, 0).should be_kind_of(Integer)
end
it "gets the scheduling priority for a specified process group" do
- Process.getpriority(Process::PRIO_PGRP, 0).should be_kind_of(Fixnum)
+ Process.getpriority(Process::PRIO_PGRP, 0).should be_kind_of(Integer)
end
it "gets the scheduling priority for a specified user" do
- Process.getpriority(Process::PRIO_USER, 0).should be_kind_of(Fixnum)
+ Process.getpriority(Process::PRIO_USER, 0).should be_kind_of(Integer)
end
end
end
diff --git a/spec/ruby/core/process/kill_spec.rb b/spec/ruby/core/process/kill_spec.rb
index 4bd64a1fe83..af9c9e6debc 100644
--- a/spec/ruby/core/process/kill_spec.rb
+++ b/spec/ruby/core/process/kill_spec.rb
@@ -16,7 +16,7 @@ describe "Process.kill" do
-> { Process.kill("term", @pid) }.should raise_error(ArgumentError)
end
- it "raises an ArgumentError if signal is not a Fixnum or String" do
+ it "raises an ArgumentError if signal is not an Integer or String" do
signal = mock("process kill signal")
signal.should_not_receive(:to_int)
diff --git a/spec/ruby/core/process/maxgroups_spec.rb b/spec/ruby/core/process/maxgroups_spec.rb
index 362f788ab23..2549a7a9718 100644
--- a/spec/ruby/core/process/maxgroups_spec.rb
+++ b/spec/ruby/core/process/maxgroups_spec.rb
@@ -3,7 +3,7 @@ require_relative '../../spec_helper'
platform_is_not :windows do
describe "Process.maxgroups" do
it "returns the maximum number of gids allowed in the supplemental group access list" do
- Process.maxgroups.should be_kind_of(Fixnum)
+ Process.maxgroups.should be_kind_of(Integer)
end
it "sets the maximum number of gids allowed in the supplemental group access list" do
diff --git a/spec/ruby/core/process/pid_spec.rb b/spec/ruby/core/process/pid_spec.rb
index c5947ab50dd..2d008bc4b74 100644
--- a/spec/ruby/core/process/pid_spec.rb
+++ b/spec/ruby/core/process/pid_spec.rb
@@ -3,7 +3,7 @@ require_relative '../../spec_helper'
describe "Process.pid" do
it "returns the process id of this process" do
pid = Process.pid
- pid.should be_kind_of(Fixnum)
+ pid.should be_kind_of(Integer)
Process.pid.should == pid
end
end
diff --git a/spec/ruby/core/process/spawn_spec.rb b/spec/ruby/core/process/spawn_spec.rb
index 40509471ef4..e373d8600c0 100644
--- a/spec/ruby/core/process/spawn_spec.rb
+++ b/spec/ruby/core/process/spawn_spec.rb
@@ -48,10 +48,10 @@ describe "Process.spawn" do
-> { Process.wait Process.spawn("echo spawn") }.should output_to_fd("spawn\n")
end
- it "returns the process ID of the new process as a Fixnum" do
+ it "returns the process ID of the new process as an Integer" do
pid = Process.spawn(*ruby_exe, "-e", "exit")
Process.wait pid
- pid.should be_an_instance_of(Fixnum)
+ pid.should be_an_instance_of(Integer)
end
it "returns immediately" do
@@ -457,7 +457,7 @@ describe "Process.spawn" do
# redirection
- it "redirects STDOUT to the given file descriptor if out: Fixnum" do
+ it "redirects STDOUT to the given file descriptor if out: Integer" do
File.open(@name, 'w') do |file|
-> do
Process.wait Process.spawn("echo glark", out: file.fileno)
@@ -483,7 +483,7 @@ describe "Process.spawn" do
File.read(@name).should == "glark\n"
end
- it "redirects STDERR to the given file descriptor if err: Fixnum" do
+ it "redirects STDERR to the given file descriptor if err: Integer" do
File.open(@name, 'w') do |file|
-> do
Process.wait Process.spawn("echo glark>&2", err: file.fileno)
diff --git a/spec/ruby/core/random/new_seed_spec.rb b/spec/ruby/core/random/new_seed_spec.rb
index 4b34e871a2d..7a93da99aa0 100644
--- a/spec/ruby/core/random/new_seed_spec.rb
+++ b/spec/ruby/core/random/new_seed_spec.rb
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
describe "Random.new_seed" do
- it "returns a Bignum" do
- Random.new_seed.should be_an_instance_of(Bignum)
+ it "returns an Integer" do
+ Random.new_seed.should be_an_instance_of(Integer)
end
it "returns an arbitrary seed value each time" do
diff --git a/spec/ruby/core/random/new_spec.rb b/spec/ruby/core/random/new_spec.rb
index 07d7b439ca3..4280b5b9c30 100644
--- a/spec/ruby/core/random/new_spec.rb
+++ b/spec/ruby/core/random/new_spec.rb
@@ -4,7 +4,7 @@ describe "Random.new" do
end
it "uses a random seed value if none is supplied" do
- Random.new.seed.should be_an_instance_of(Bignum)
+ Random.new.seed.should be_an_instance_of(Integer)
end
it "returns Random instances initialized with different seeds" do
diff --git a/spec/ruby/core/random/rand_spec.rb b/spec/ruby/core/random/rand_spec.rb
index 0e423301f8c..7fd60d55532 100644
--- a/spec/ruby/core/random/rand_spec.rb
+++ b/spec/ruby/core/random/rand_spec.rb
@@ -49,18 +49,18 @@ describe "Random.rand" do
end
end
-describe "Random#rand with Fixnum" do
+describe "Random#rand with Integer" do
it "returns an Integer" do
- Random.new.rand(20).should be_an_instance_of(Fixnum)
+ Random.new.rand(20).should be_an_instance_of(Integer)
end
- it "returns a Fixnum greater than or equal to 0" do
+ it "returns an Integer greater than or equal to 0" do
prng = Random.new
ints = 20.times.map { prng.rand(5) }
ints.min.should >= 0
end
- it "returns a Fixnum less than the argument" do
+ it "returns an Integer less than the argument" do
prng = Random.new
ints = 20.times.map { prng.rand(5) }
ints.max.should <= 4
@@ -92,19 +92,19 @@ describe "Random#rand with Fixnum" do
end
end
-describe "Random#rand with Bignum" do
- it "typically returns a Bignum" do
+describe "Random#rand with Integer" do
+ it "typically returns an Integer" do
rnd = Random.new(1)
- 10.times.map{ rnd.rand(bignum_value*2) }.max.should be_an_instance_of(Bignum)
+ 10.times.map{ rnd.rand(bignum_value*2) }.max.should be_an_instance_of(Integer)
end
- it "returns a Bignum greater than or equal to 0" do
+ it "returns an Integer greater than or equal to 0" do
prng = Random.new
bigs = 20.times.map { prng.rand(bignum_value) }
bigs.min.should >= 0
end
- it "returns a Bignum less than the argument" do
+ it "returns an Integer less than the argument" do
prng = Random.new
bigs = 20.times.map { prng.rand(bignum_value) }
bigs.max.should < bignum_value
@@ -159,7 +159,7 @@ end
describe "Random#rand with Range" do
it "returns an element from the Range" do
- Random.new.rand(20..43).should be_an_instance_of(Fixnum)
+ Random.new.rand(20..43).should be_an_instance_of(Integer)
end
it "supports custom object types" do
diff --git a/spec/ruby/core/range/hash_spec.rb b/spec/ruby/core/range/hash_spec.rb
index 90aeee78907..4f2681e86ed 100644
--- a/spec/ruby/core/range/hash_spec.rb
+++ b/spec/ruby/core/range/hash_spec.rb
@@ -14,11 +14,11 @@ describe "Range#hash" do
(0..10).hash.should_not == (0...10).hash
end
- it "generates a Fixnum for the hash value" do
- (0..0).hash.should be_an_instance_of(Fixnum)
- (0..1).hash.should be_an_instance_of(Fixnum)
- (0...10).hash.should be_an_instance_of(Fixnum)
- (0..10).hash.should be_an_instance_of(Fixnum)
+ it "generates an Integer for the hash value" do
+ (0..0).hash.should be_an_instance_of(Integer)
+ (0..1).hash.should be_an_instance_of(Integer)
+ (0...10).hash.should be_an_instance_of(Integer)
+ (0..10).hash.should be_an_instance_of(Integer)
end
end
diff --git a/spec/ruby/core/regexp/last_match_spec.rb b/spec/ruby/core/regexp/last_match_spec.rb
index ed496b79411..6bd8f2cd908 100644
--- a/spec/ruby/core/regexp/last_match_spec.rb
+++ b/spec/ruby/core/regexp/last_match_spec.rb
@@ -7,7 +7,7 @@ describe "Regexp.last_match" do
Regexp.last_match.should be_kind_of(MatchData)
end
- it "returns the nth field in this MatchData when passed a Fixnum" do
+ it "returns the nth field in this MatchData when passed an Integer" do
/c(.)t/ =~ 'cat'
Regexp.last_match(1).should == 'a'
end
diff --git a/spec/ruby/core/regexp/new_spec.rb b/spec/ruby/core/regexp/new_spec.rb
index d2d867b3d31..ce662b7a4f6 100644
--- a/spec/ruby/core/regexp/new_spec.rb
+++ b/spec/ruby/core/regexp/new_spec.rb
@@ -14,7 +14,7 @@ describe "Regexp.new given a Regexp" do
it_behaves_like :regexp_new_string_binary, :compile
end
-describe "Regexp.new given a Fixnum" do
+describe "Regexp.new given an Integer" do
it "raises a TypeError" do
-> { Regexp.new(1) }.should raise_error(TypeError)
end
diff --git a/spec/ruby/core/regexp/options_spec.rb b/spec/ruby/core/regexp/options_spec.rb
index fb4853a014d..527b51a3b2d 100644
--- a/spec/ruby/core/regexp/options_spec.rb
+++ b/spec/ruby/core/regexp/options_spec.rb
@@ -1,10 +1,10 @@
require_relative '../../spec_helper'
describe "Regexp#options" do
- it "returns a Fixnum bitvector of regexp options for the Regexp object" do
- /cat/.options.should be_kind_of(Fixnum)
+ it "returns an Integer bitvector of regexp options for the Regexp object" do
+ /cat/.options.should be_kind_of(Integer)
not_supported_on :opal do
- /cat/ix.options.should be_kind_of(Fixnum)
+ /cat/ix.options.should be_kind_of(Integer)
end
end
diff --git a/spec/ruby/core/regexp/shared/new.rb b/spec/ruby/core/regexp/shared/new.rb
index bb5df7bc2e5..9cbf89cd8ba 100644
--- a/spec/ruby/core/regexp/shared/new.rb
+++ b/spec/ruby/core/regexp/shared/new.rb
@@ -58,7 +58,7 @@ describe :regexp_new_string, shared: true do
end
end
- it "sets options from second argument if it is one of the Fixnum option constants" do
+ it "sets options from second argument if it is one of the Integer option constants" do
r = Regexp.send(@method, 'Hi', Regexp::IGNORECASE)
(r.options & Regexp::IGNORECASE).should_not == 0
(r.options & Regexp::MULTILINE).should == 0
@@ -81,14 +81,14 @@ describe :regexp_new_string, shared: true do
end
end
- it "accepts a Fixnum of two or more options ORed together as the second argument" do
+ it "accepts an Integer of two or more options ORed together as the second argument" do
r = Regexp.send(@method, 'Hi', Regexp::IGNORECASE | Regexp::EXTENDED)
(r.options & Regexp::IGNORECASE).should_not == 0
(r.options & Regexp::MULTILINE).should == 0
(r.options & Regexp::EXTENDED).should_not == 0
end
- it "treats any non-Fixnum, non-nil, non-false second argument as IGNORECASE" do
+ it "treats any non-Integer, non-nil, non-false second argument as IGNORECASE" do
r = Regexp.send(@method, 'Hi', Object.new)
(r.options & Regexp::IGNORECASE).should_not == 0
(r.options & Regexp::MULTILINE).should == 0
diff --git a/spec/ruby/core/string/bytes_spec.rb b/spec/ruby/core/string/bytes_spec.rb
index 96f1ae9cf2b..859b3465506 100644
--- a/spec/ruby/core/string/bytes_spec.rb
+++ b/spec/ruby/core/string/bytes_spec.rb
@@ -22,9 +22,9 @@ describe "String#bytes" do
@utf8_ascii.bytes.to_a.size.should == @utf8_ascii.bytesize
end
- it "returns bytes as Fixnums" do
- @ascii.bytes.to_a.each {|b| b.should be_an_instance_of(Fixnum)}
- @utf8_ascii.bytes { |b| b.should be_an_instance_of(Fixnum) }
+ it "returns bytes as Integers" do
+ @ascii.bytes.to_a.each {|b| b.should be_an_instance_of(Integer)}
+ @utf8_ascii.bytes { |b| b.should be_an_instance_of(Integer) }
end
it "agrees with #unpack('C*')" do
diff --git a/spec/ruby/core/string/element_set_spec.rb b/spec/ruby/core/string/element_set_spec.rb
index 641d46bc911..c9e02a7381f 100644
--- a/spec/ruby/core/string/element_set_spec.rb
+++ b/spec/ruby/core/string/element_set_spec.rb
@@ -5,7 +5,7 @@ require_relative 'fixtures/classes'
# TODO: Add missing String#[]= specs:
# String#[re, idx] = obj
-describe "String#[]= with Fixnum index" do
+describe "String#[]= with Integer index" do
it "replaces the char at idx with other_str" do
a = "hello"
a[0] = "bam"
@@ -85,7 +85,7 @@ describe "String#[]= with Fixnum index" do
-> { "test"[1] = nil }.should raise_error(TypeError)
end
- it "raises a TypeError if passed a Fixnum replacement" do
+ it "raises a TypeError if passed an Integer replacement" do
-> { "abc"[1] = 65 }.should raise_error(TypeError)
end
@@ -102,7 +102,7 @@ describe "String#[]= with Fixnum index" do
str.should == "あa"
end
- it "raises a TypeError if #to_int does not return an Fixnum" do
+ it "raises a TypeError if #to_int does not return an Integer" do
index = mock("string element set")
index.should_receive(:to_int).and_return('1')
@@ -243,7 +243,7 @@ describe "String#[]= with a Regexp index" do
str.should == "axc"
end
- it "raises a TypeError if #to_int does not return a Fixnum" do
+ it "raises a TypeError if #to_int does not return an Integer" do
ref = mock("string element set regexp ref")
ref.should_receive(:to_int).and_return(nil)
@@ -438,7 +438,7 @@ describe "String#[]= with a Range index" do
end
end
-describe "String#[]= with Fixnum index, count" do
+describe "String#[]= with Integer index, count" do
it "starts at idx and overwrites count characters before inserting the rest of other_str" do
a = "hello"
a[0, 2] = "xx"
diff --git a/spec/ruby/core/string/index_spec.rb b/spec/ruby/core/string/index_spec.rb
index ca62911db0e..8d2c8af193e 100644
--- a/spec/ruby/core/string/index_spec.rb
+++ b/spec/ruby/core/string/index_spec.rb
@@ -27,7 +27,7 @@ describe "String#index" do
"abc".index("c", offset).should == 2
end
- it "raises a TypeError if passed a Fixnum" do
+ it "raises a TypeError if passed an Integer" do
-> { "abc".index 97 }.should raise_error(TypeError)
end
end
diff --git a/spec/ruby/core/string/ord_spec.rb b/spec/ruby/core/string/ord_spec.rb
index 0f5a3f6a37d..cfc630a1249 100644
--- a/spec/ruby/core/string/ord_spec.rb
+++ b/spec/ruby/core/string/ord_spec.rb
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
describe "String#ord" do
- it "returns a Fixnum" do
- 'a'.ord.should be_an_instance_of(Fixnum)
+ it "returns an Integer" do
+ 'a'.ord.should be_an_instance_of(Integer)
end
it "returns the codepoint of the first character in the String" do
diff --git a/spec/ruby/core/string/rindex_spec.rb b/spec/ruby/core/string/rindex_spec.rb
index e021486bc2f..7a6af0c9d04 100644
--- a/spec/ruby/core/string/rindex_spec.rb
+++ b/spec/ruby/core/string/rindex_spec.rb
@@ -4,7 +4,7 @@ require_relative 'fixtures/classes'
require_relative 'fixtures/utf-8-encoding'
describe "String#rindex with object" do
- it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do
+ it "raises a TypeError if obj isn't a String, Integer or Regexp" do
not_supported_on :opal do
-> { "hello".rindex(:sym) }.should raise_error(TypeError)
end
diff --git a/spec/ruby/core/string/shared/codepoints.rb b/spec/ruby/core/string/shared/codepoints.rb
index e94a57f48ed..0b2e078e0a4 100644
--- a/spec/ruby/core/string/shared/codepoints.rb
+++ b/spec/ruby/core/string/shared/codepoints.rb
@@ -26,9 +26,9 @@ describe :string_codepoints, shared: true do
-> { s.send(@method) { } }.should raise_error(ArgumentError)
end
- it "yields codepoints as Fixnums" do
+ it "yields codepoints as Integers" do
"glark\u{20}".send(@method).to_a.each do |codepoint|
- codepoint.should be_an_instance_of(Fixnum)
+ codepoint.should be_an_instance_of(Integer)
end
end
diff --git a/spec/ruby/core/string/to_i_spec.rb b/spec/ruby/core/string/to_i_spec.rb
index a37be477783..e4fa89aab3e 100644
--- a/spec/ruby/core/string/to_i_spec.rb
+++ b/spec/ruby/core/string/to_i_spec.rb
@@ -131,29 +131,29 @@ describe "String#to_i" do
-> { "".to_i(37) }.should raise_error(ArgumentError)
end
- it "returns a Fixnum for long strings with trailing spaces" do
+ it "returns an Integer for long strings with trailing spaces" do
"0 ".to_i.should == 0
- "0 ".to_i.should be_an_instance_of(Fixnum)
+ "0 ".to_i.should be_an_instance_of(Integer)
"10 ".to_i.should == 10
- "10 ".to_i.should be_an_instance_of(Fixnum)
+ "10 ".to_i.should be_an_instance_of(Integer)
"-10 ".to_i.should == -10
- "-10 ".to_i.should be_an_instance_of(Fixnum)
+ "-10 ".to_i.should be_an_instance_of(Integer)
end
- it "returns a Fixnum for long strings with leading spaces" do
+ it "returns an Integer for long strings with leading spaces" do
" 0".to_i.should == 0
- " 0".to_i.should be_an_instance_of(Fixnum)
+ " 0".to_i.should be_an_instance_of(Integer)
" 10".to_i.should == 10
- " 10".to_i.should be_an_instance_of(Fixnum)
+ " 10".to_i.should be_an_instance_of(Integer)
" -10".to_i.should == -10
- " -10".to_i.should be_an_instance_of(Fixnum)
+ " -10".to_i.should be_an_instance_of(Integer)
end
- it "returns the correct Bignum for long strings" do
+ it "returns the correct Integer for long strings" do
"245789127594125924165923648312749312749327482".to_i.should == 245789127594125924165923648312749312749327482
"-245789127594125924165923648312749312749327482".to_i.should == -245789127594125924165923648312749312749327482
end
diff --git a/spec/ruby/core/struct/hash_spec.rb b/spec/ruby/core/struct/hash_spec.rb
index 545929e4028..d3c95fbe564 100644
--- a/spec/ruby/core/struct/hash_spec.rb
+++ b/spec/ruby/core/struct/hash_spec.rb
@@ -4,11 +4,11 @@ require_relative 'shared/accessor'
describe "Struct#hash" do
- it "returns the same fixnum for structs with the same content" do
+ it "returns the same integer for structs with the same content" do
[StructClasses::Ruby.new("1.8.6", "PPC"),
StructClasses::Car.new("Hugo", "Foo", "1972")].each do |stc|
stc.hash.should == stc.dup.hash
- stc.hash.should be_kind_of(Fixnum)
+ stc.hash.should be_kind_of(Integer)
end
end
diff --git a/spec/ruby/core/symbol/casecmp_spec.rb b/spec/ruby/core/symbol/casecmp_spec.rb
index b485101d63d..80ea51e9109 100644
--- a/spec/ruby/core/symbol/casecmp_spec.rb
+++ b/spec/ruby/core/symbol/casecmp_spec.rb
@@ -63,7 +63,7 @@ describe "Symbol#casecmp" do
:abc.casecmp("abc").should be_nil
end
- it "returns nil if other is a Fixnum" do
+ it "returns nil if other is an Integer" do
:abc.casecmp(1).should be_nil
end
diff --git a/spec/ruby/core/symbol/comparison_spec.rb b/spec/ruby/core/symbol/comparison_spec.rb
index 173a7da6252..613177be056 100644
--- a/spec/ruby/core/symbol/comparison_spec.rb
+++ b/spec/ruby/core/symbol/comparison_spec.rb
@@ -40,7 +40,7 @@ describe "Symbol#<=>" do
(:abc <=> "abc").should be_nil
end
- it "returns nil if other is a Fixnum" do
+ it "returns nil if other is an Integer" do
(:abc <=> 1).should be_nil
end
diff --git a/spec/ruby/core/time/hash_spec.rb b/spec/ruby/core/time/hash_spec.rb
index 577aaf9b0a1..4f4d11a2cd8 100644
--- a/spec/ruby/core/time/hash_spec.rb
+++ b/spec/ruby/core/time/hash_spec.rb
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
describe "Time#hash" do
- it "returns a Fixnum" do
- Time.at(100).hash.should be_an_instance_of(Fixnum)
+ it "returns an Integer" do
+ Time.at(100).hash.should be_an_instance_of(Integer)
end
it "is stable" do
diff --git a/spec/ruby/core/time/subsec_spec.rb b/spec/ruby/core/time/subsec_spec.rb
index 583a26412bf..0f2c4eb856a 100644
--- a/spec/ruby/core/time/subsec_spec.rb
+++ b/spec/ruby/core/time/subsec_spec.rb
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'
describe "Time#subsec" do
- it "returns 0 as a Fixnum for a Time with a whole number of seconds" do
+ it "returns 0 as an Integer for a Time with a whole number of seconds" do
Time.at(100).subsec.should eql(0)
end
diff --git a/spec/ruby/core/unboundmethod/source_location_spec.rb b/spec/ruby/core/unboundmethod/source_location_spec.rb
index b5e64138169..96933a5d403 100644
--- a/spec/ruby/core/unboundmethod/source_location_spec.rb
+++ b/spec/ruby/core/unboundmethod/source_location_spec.rb
@@ -12,9 +12,9 @@ describe "UnboundMethod#source_location" do
file.should == File.realpath('../fixtures/classes.rb', __FILE__)
end
- it "sets the last value to a Fixnum representing the line on which the method was defined" do
+ it "sets the last value to an Integer representing the line on which the method was defined" do
line = @method.source_location.last
- line.should be_an_instance_of(Fixnum)
+ line.should be_an_instance_of(Integer)
line.should == 5
end
diff --git a/spec/ruby/language/README b/spec/ruby/language/README
index 74eaf587092..ae08e17fb18 100644
--- a/spec/ruby/language/README
+++ b/spec/ruby/language/README
@@ -4,7 +4,7 @@ words. These words significantly describe major elements of the language,
including flow control constructs like 'for' and 'while', conditional
execution like 'if' and 'unless', exceptional execution control like 'rescue',
etc. There are also literals for the basic "types" like String, Regexp, Array
-and Fixnum.
+and Integer.
Behavioral specifications describe the behavior of concrete entities. Rather
than using concepts of computation to organize these spec files, we use
diff --git a/spec/ruby/language/alias_spec.rb b/spec/ruby/language/alias_spec.rb
index 13f5c49513f..d1d06e3fac3 100644
--- a/spec/ruby/language/alias_spec.rb
+++ b/spec/ruby/language/alias_spec.rb
@@ -218,7 +218,7 @@ describe "The alias keyword" do
subclass.new.test("testing").should == 4
end
- it "is not allowed against Fixnum or String instances" do
+ it "is not allowed against Integer or String instances" do
-> do
1.instance_eval do
alias :foo :to_s
diff --git a/spec/ruby/language/defined_spec.rb b/spec/ruby/language/defined_spec.rb
index f2da8a9293c..4fcf869f91b 100644
--- a/spec/ruby/language/defined_spec.rb
+++ b/spec/ruby/language/defined_spec.rb
@@ -435,11 +435,11 @@ describe "The defined? keyword for an expression" do
end
end
- it "returns 'expression' when passed a Fixnum literal" do
+ it "returns 'expression' when passed an Integer literal" do
defined?(42).should == "expression"
end
- it "returns 'expression' when passed a Bignum literal" do
+ it "returns 'expression' when passed an Integer literal" do
defined?(0xdead_beef_deed_feed).should == "expression"
end
diff --git a/spec/ruby/language/module_spec.rb b/spec/ruby/language/module_spec.rb
index cbc71493593..1a5fcaf46f2 100644
--- a/spec/ruby/language/module_spec.rb
+++ b/spec/ruby/language/module_spec.rb
@@ -43,7 +43,7 @@ describe "The module keyword" do
-> { module ModuleSpecs::Modules::A; end }.should raise_error(TypeError)
end
- it "raises a TypeError if the constant is a Fixnum" do
+ it "raises a TypeError if the constant is an Integer" do
-> { module ModuleSpecs::Modules::B; end }.should raise_error(TypeError)
end
diff --git a/spec/ruby/language/predefined_spec.rb b/spec/ruby/language/predefined_spec.rb
index 65fcb1e2ac9..b1f5d80ad48 100644
--- a/spec/ruby/language/predefined_spec.rb
+++ b/spec/ruby/language/predefined_spec.rb
@@ -518,7 +518,7 @@ $\ String The string appended to the output of every call
Kernel#print and IO#write. The default value is nil.
$, String The separator string output between the parameters to methods such as
Kernel#print and Array#join. Defaults to nil, which adds no text.
-$. Fixnum The number of the last line read from the current input file.
+$. Integer The number of the last line read from the current input file.
$; String The default separator pattern used by String#split. May be set from the
command line using the -F flag.
$< Object An object that provides access to the concatenation of the contents of all
@@ -583,7 +583,7 @@ describe "Predefined global $/" do
-> { $/ = obj }.should raise_error(TypeError)
end
- it "raises a TypeError if assigned a Fixnum" do
+ it "raises a TypeError if assigned an Integer" do
-> { $/ = 1 }.should raise_error(TypeError)
end
@@ -632,7 +632,7 @@ describe "Predefined global $-0" do
-> { $-0 = obj }.should raise_error(TypeError)
end
- it "raises a TypeError if assigned a Fixnum" do
+ it "raises a TypeError if assigned an Integer" do
-> { $-0 = 1 }.should raise_error(TypeError)
end
@@ -781,7 +781,7 @@ $* Array An array of strings containing the command-line
tion of the program. Options used by the Ruby interpreter will have been
removed. [r/o]
$" Array An array containing the filenames of modules loaded by require. [r/o]
-$$ Fixnum The process number of the program being executed. [r/o]
+$$ Integer The process number of the program being executed. [r/o]
$? Process::Status The exit status of the last child process to terminate. [r/o, thread]
$: Array An array of strings, where each string specifies a directory to be searched for
Ruby scripts and binary extensions used by the load and require methods.
diff --git a/spec/ruby/language/singleton_class_spec.rb b/spec/ruby/language/singleton_class_spec.rb
index 705d9f35485..91ce9726d5a 100644
--- a/spec/ruby/language/singleton_class_spec.rb
+++ b/spec/ruby/language/singleton_class_spec.rb
@@ -14,7 +14,7 @@ describe "A singleton class" do
nil.singleton_class.should == NilClass
end
- it "raises a TypeError for Fixnum's" do
+ it "raises a TypeError for Integer's" do
-> { 1.singleton_class }.should raise_error(TypeError)
end
@@ -74,7 +74,7 @@ describe "A singleton class" do
end
it "doesn't have singleton class" do
- -> { bignum_value.singleton_class.superclass.should == Bignum }.should raise_error(TypeError)
+ -> { bignum_value.singleton_class.superclass.should == Integer }.should raise_error(TypeError)
end
end
diff --git a/spec/ruby/library/bigdecimal/add_spec.rb b/spec/ruby/library/bigdecimal/add_spec.rb
index bea8b8f7640..f844ca96faf 100644
--- a/spec/ruby/library/bigdecimal/add_spec.rb
+++ b/spec/ruby/library/bigdecimal/add_spec.rb
@@ -41,14 +41,14 @@ describe "BigDecimal#add" do
@frac_3.add(@frac_4, 6).should == BigDecimal("0.11111E16")
end
- it "returns a + [Fixnum value] with given precision" do
+ it "returns a + [Integer value] with given precision" do
(1..10).each {|precision|
@dot_ones.add(0, precision).should == BigDecimal("0." + "1" * precision)
}
BigDecimal("0.88").add(0, 1).should == BigDecimal("0.9")
end
- it "returns a + [Bignum value] with given precision" do
+ it "returns a + [Integer value] with given precision" do
bignum = 10000000000000000000
(1..20).each {|precision|
@dot_ones.add(bignum, precision).should == BigDecimal("0.1E20")
diff --git a/spec/ruby/library/bigdecimal/exponent_spec.rb b/spec/ruby/library/bigdecimal/exponent_spec.rb
index a349ac093fa..f63c4e5798d 100644
--- a/spec/ruby/library/bigdecimal/exponent_spec.rb
+++ b/spec/ruby/library/bigdecimal/exponent_spec.rb
@@ -22,7 +22,7 @@ describe "BigDecimal#exponent" do
=begin
platform_is wordsize: 32 do
# TODO: write specs for both 32 and 64 bit
- it "returns 0 if exponent can't be represented as Fixnum" do
+ it "returns 0 if exponent can't be represented as Integer" do
BigDecimal("2E1000000000000000").exponent.should == 0
BigDecimal("-5E-999999999999999").exponent.should == 0
end
diff --git a/spec/ruby/library/bigdecimal/shared/to_int.rb b/spec/ruby/library/bigdecimal/shared/to_int.rb
index 02f6092f23a..41dd200b9fa 100644
--- a/spec/ruby/library/bigdecimal/shared/to_int.rb
+++ b/spec/ruby/library/bigdecimal/shared/to_int.rb
@@ -6,7 +6,7 @@ describe :bigdecimal_to_int , shared: true do
-> { BigDecimal("NaN").send(@method) }.should raise_error(FloatDomainError)
end
- it "returns Integer or Bignum otherwise" do
+ it "returns Integer or Integer otherwise" do
BigDecimal("3E-20001").send(@method).should == 0
BigDecimal("2E4000").send(@method).should == 2 * 10 ** 4000
BigDecimal("2").send(@method).should == 2
diff --git a/spec/ruby/library/digest/bubblebabble_spec.rb b/spec/ruby/library/digest/bubblebabble_spec.rb
index e6516711088..bbc11ceec57 100644
--- a/spec/ruby/library/digest/bubblebabble_spec.rb
+++ b/spec/ruby/library/digest/bubblebabble_spec.rb
@@ -23,7 +23,7 @@ describe "Digest.bubblebabble" do
-> { Digest.bubblebabble(nil) }.should raise_error(TypeError)
end
- it "raises a TypeError when passed a Fixnum" do
+ it "raises a TypeError when passed an Integer" do
-> { Digest.bubblebabble(9001) }.should raise_error(TypeError)
end
end
diff --git a/spec/ruby/library/digest/hexencode_spec.rb b/spec/ruby/library/digest/hexencode_spec.rb
index fcbbf4846ab..4b6db6eaff3 100644
--- a/spec/ruby/library/digest/hexencode_spec.rb
+++ b/spec/ruby/library/digest/hexencode_spec.rb
@@ -25,7 +25,7 @@ describe "Digest.hexencode" do
-> { Digest.hexencode(nil) }.should raise_error(TypeError)
end
- it "raises a TypeError when passed a Fixnum" do
+ it "raises a TypeError when passed an Integer" do
-> { Digest.hexencode(9001) }.should raise_error(TypeError)
end
end
diff --git a/spec/ruby/library/matrix/coerce_spec.rb b/spec/ruby/library/matrix/coerce_spec.rb
index 280243d3727..4022f00236a 100644
--- a/spec/ruby/library/matrix/coerce_spec.rb
+++ b/spec/ruby/library/matrix/coerce_spec.rb
@@ -2,7 +2,7 @@ require_relative '../../spec_helper'
require 'matrix'
describe "Matrix#coerce" do
- it "allows the division of fixnum by a Matrix " do
+ it "allows the division of integer by a Matrix " do
(1/Matrix[[0,1],[-1,0]]).should == Matrix[[0,-1],[1,0]]
end
end
diff --git a/spec/ruby/library/matrix/divide_spec.rb b/spec/ruby/library/matrix/divide_spec.rb
index 2e3bb85bf65..84cecff5823 100644
--- a/spec/ruby/library/matrix/divide_spec.rb
+++ b/spec/ruby/library/matrix/divide_spec.rb
@@ -16,11 +16,11 @@ describe "Matrix#/" do
# Guard against the Mathn library
guard -> { !defined?(Math.rsqrt) } do
- it "returns the result of dividing self by a Fixnum" do
+ it "returns the result of dividing self by an Integer" do
(@a / 2).should == Matrix[ [0, 1], [1, 2] ]
end
- it "returns the result of dividing self by a Bignum" do
+ it "returns the result of dividing self by an Integer" do
(@a / bignum_value).should == Matrix[ [0, 0], [0, 0] ]
end
end
diff --git a/spec/ruby/library/matrix/hash_spec.rb b/spec/ruby/library/matrix/hash_spec.rb
index fac9a065270..7dabcd3737c 100644
--- a/spec/ruby/library/matrix/hash_spec.rb
+++ b/spec/ruby/library/matrix/hash_spec.rb
@@ -3,8 +3,8 @@ require 'matrix'
describe "Matrix#hash" do
- it "returns a Fixnum" do
- Matrix[ [1,2] ].hash.should be_an_instance_of(Fixnum)
+ it "returns an Integer" do
+ Matrix[ [1,2] ].hash.should be_an_instance_of(Integer)
end
it "returns the same value for the same matrix" do
diff --git a/spec/ruby/library/matrix/multiply_spec.rb b/spec/ruby/library/matrix/multiply_spec.rb
index 585f2689318..e488bb0f5de 100644
--- a/spec/ruby/library/matrix/multiply_spec.rb
+++ b/spec/ruby/library/matrix/multiply_spec.rb
@@ -16,11 +16,11 @@ describe "Matrix#*" do
(@a * Vector[1,2]).should == Vector[5, 11]
end
- it "returns the result of multiplying the elements of self and a Fixnum" do
+ it "returns the result of multiplying the elements of self and an Integer" do
(@a * 2).should == Matrix[ [2, 4], [6, 8] ]
end
- it "returns the result of multiplying the elements of self and a Bignum" do
+ it "returns the result of multiplying the elements of self and an Integer" do
(@a * bignum_value).should == Matrix[
[9223372036854775808, 18446744073709551616],
[27670116110564327424, 36893488147419103232]
diff --git a/spec/ruby/library/securerandom/random_number_spec.rb b/spec/ruby/library/securerandom/random_number_spec.rb
index 3e1812c6e89..03781f49019 100644
--- a/spec/ruby/library/securerandom/random_number_spec.rb
+++ b/spec/ruby/library/securerandom/random_number_spec.rb
@@ -10,7 +10,7 @@ describe "SecureRandom.random_number" do
it "generates a random positive number smaller then the positive integer argument" do
(1..64).each do |idx|
num = SecureRandom.random_number(idx)
- num.should be_kind_of(Fixnum)
+ num.should be_kind_of(Integer)
(0 <= num).should == true
(num < idx).should == true
end
diff --git a/spec/ruby/library/stringscanner/append_spec.rb b/spec/ruby/library/stringscanner/append_spec.rb
index 378c62e2b16..fef5dcf2bd0 100644
--- a/spec/ruby/library/stringscanner/append_spec.rb
+++ b/spec/ruby/library/stringscanner/append_spec.rb
@@ -6,6 +6,6 @@ describe "StringScanner#<<" do
it_behaves_like :strscan_concat, :<<
end
-describe "StringScanner#<< when passed a Fixnum" do
+describe "StringScanner#<< when passed an Integer" do
it_behaves_like :strscan_concat_fixnum, :<<
end
diff --git a/spec/ruby/library/stringscanner/concat_spec.rb b/spec/ruby/library/stringscanner/concat_spec.rb
index 17a699dd2ea..4f790e25058 100644
--- a/spec/ruby/library/stringscanner/concat_spec.rb
+++ b/spec/ruby/library/stringscanner/concat_spec.rb
@@ -6,6 +6,6 @@ describe "StringScanner#concat" do
it_behaves_like :strscan_concat, :concat
end
-describe "StringScanner#concat when passed a Fixnum" do
+describe "StringScanner#concat when passed an Integer" do
it_behaves_like :strscan_concat_fixnum, :concat
end
diff --git a/spec/ruby/library/stringscanner/shared/peek.rb b/spec/ruby/library/stringscanner/shared/peek.rb
index 4e2e6433536..768f5f2d58f 100644
--- a/spec/ruby/library/stringscanner/shared/peek.rb
+++ b/spec/ruby/library/stringscanner/shared/peek.rb
@@ -22,7 +22,7 @@ describe :strscan_peek, shared: true do
-> { @s.send(@method, -2) }.should raise_error(ArgumentError)
end
- it "raises a RangeError when the passed argument is a Bignum" do
+ it "raises a RangeError when the passed argument is an Integer" do
-> { @s.send(@method, bignum_value) }.should raise_error(RangeError)
end
diff --git a/spec/ruby/library/zlib/adler32_spec.rb b/spec/ruby/library/zlib/adler32_spec.rb
index 62240e2de73..226aa18522c 100644
--- a/spec/ruby/library/zlib/adler32_spec.rb
+++ b/spec/ruby/library/zlib/adler32_spec.rb
@@ -22,7 +22,7 @@ describe "Zlib.adler32" do
-> { Zlib.adler32(test_string, 2**128) }.should raise_error(RangeError)
end
- it "calculates the Adler checksum for string and initial Adler value for Bignums" do
+ it "calculates the Adler checksum for string and initial Adler value for Integers" do
test_string = "This is a test string! How exciting!%?"
Zlib.adler32(test_string, 2**30).should == 1137642779
end
diff --git a/spec/ruby/library/zlib/crc32_spec.rb b/spec/ruby/library/zlib/crc32_spec.rb
index 4c1d6ce2e96..d5f5c199cc0 100644
--- a/spec/ruby/library/zlib/crc32_spec.rb
+++ b/spec/ruby/library/zlib/crc32_spec.rb
@@ -29,7 +29,7 @@ describe "Zlib.crc32" do
-> { Zlib.crc32(test_string, 2**128) }.should raise_error(RangeError)
end
- it "calculates the CRC checksum for string and initial CRC value for Bignums" do
+ it "calculates the CRC checksum for string and initial CRC value for Integers" do
test_string = "This is a test string! How exciting!%?"
# Zlib.crc32(test_string, -2**30).should == 277228695
Zlib.crc32(test_string, 2**30).should == 46597132
diff --git a/spec/ruby/shared/file/world_readable.rb b/spec/ruby/shared/file/world_readable.rb
index c2c62646277..1dce7a580fe 100644
--- a/spec/ruby/shared/file/world_readable.rb
+++ b/spec/ruby/shared/file/world_readable.rb
@@ -28,18 +28,18 @@ describe :file_world_readable, shared: true do
end
end
- # We don't specify what the Fixnum is because it's system dependent
- it "returns a Fixnum if the file is chmod 644" do
+ # We don't specify what the Integer is because it's system dependent
+ it "returns an Integer if the file is chmod 644" do
File.chmod(0644, @file)
- @object.world_readable?(@file).should be_an_instance_of(Fixnum)
+ @object.world_readable?(@file).should be_an_instance_of(Integer)
end
- it "returns a Fixnum if the file is a directory and chmod 644" do
+ it "returns an Integer if the file is a directory and chmod 644" do
dir = tmp(rand().to_s + '-ww')
Dir.mkdir(dir)
Dir.should.exist?(dir)
File.chmod(0644, dir)
- @object.world_readable?(dir).should be_an_instance_of(Fixnum)
+ @object.world_readable?(dir).should be_an_instance_of(Integer)
Dir.rmdir(dir)
end
diff --git a/spec/ruby/shared/file/world_writable.rb b/spec/ruby/shared/file/world_writable.rb
index 84d7deb5d3e..7ed252dcf3c 100644
--- a/spec/ruby/shared/file/world_writable.rb
+++ b/spec/ruby/shared/file/world_writable.rb
@@ -27,18 +27,18 @@ describe :file_world_writable, shared: true do
@object.world_writable?(@file).should be_nil
end
- # We don't specify what the Fixnum is because it's system dependent
- it "returns a Fixnum if the file is chmod 777" do
+ # We don't specify what the Integer is because it's system dependent
+ it "returns an Integer if the file is chmod 777" do
File.chmod(0777, @file)
- @object.world_writable?(@file).should be_an_instance_of(Fixnum)
+ @object.world_writable?(@file).should be_an_instance_of(Integer)
end
- it "returns a Fixnum if the file is a directory and chmod 777" do
+ it "returns an Integer if the file is a directory and chmod 777" do
dir = tmp(rand().to_s + '-ww')
Dir.mkdir(dir)
Dir.should.exist?(dir)
File.chmod(0777, dir)
- @object.world_writable?(dir).should be_an_instance_of(Fixnum)
+ @object.world_writable?(dir).should be_an_instance_of(Integer)
Dir.rmdir(dir)
end
end
diff --git a/spec/ruby/shared/io/putc.rb b/spec/ruby/shared/io/putc.rb
index fac14886eeb..e6012c0098b 100644
--- a/spec/ruby/shared/io/putc.rb
+++ b/spec/ruby/shared/io/putc.rb
@@ -6,7 +6,7 @@ describe :io_putc, shared: true do
rm_r @name
end
- describe "with a Fixnum argument" do
+ describe "with an Integer argument" do
it "writes one character as a String" do
@io.should_receive(:write).with("A")
@io_object.send(@method, 65).should == 65
diff --git a/spec/ruby/shared/kernel/object_id.rb b/spec/ruby/shared/kernel/object_id.rb
index 7acdb27554f..175f3fb7498 100644
--- a/spec/ruby/shared/kernel/object_id.rb
+++ b/spec/ruby/shared/kernel/object_id.rb
@@ -16,7 +16,7 @@ describe :object_id, shared: true do
o1.__send__(@method).should_not == o2.__send__(@method)
end
- it "returns the same value for two Fixnums with the same value" do
+ it "returns the same value for two Integers with the same value" do
o1 = 1
o2 = 1
o1.send(@method).should == o2.send(@method)
@@ -46,7 +46,7 @@ describe :object_id, shared: true do
o1.send(@method).should == o2.send(@method)
end
- it "returns a different value for two Bignum literals" do
+ it "returns a different value for two Integer literals" do
o1 = 2e100.to_i
o2 = 2e100.to_i
o1.send(@method).should_not == o2.send(@method)
@@ -64,14 +64,14 @@ describe :object_id, shared: true do
o1.send(@method).should_not == o2.send(@method)
end
- it "returns a different value for two numbers near the 32 bit Fixnum limit" do
+ it "returns a different value for two numbers near the 32 bit Integer limit" do
o1 = -1
o2 = 2 ** 30 - 1
o1.send(@method).should_not == o2.send(@method)
end
- it "returns a different value for two numbers near the 64 bit Fixnum limit" do
+ it "returns a different value for two numbers near the 64 bit Integer limit" do
o1 = -1
o2 = 2 ** 62 - 1
diff --git a/spec/ruby/shared/rational/exponent.rb b/spec/ruby/shared/rational/exponent.rb
index 1d808177e9a..0f6abcd6341 100644
--- a/spec/ruby/shared/rational/exponent.rb
+++ b/spec/ruby/shared/rational/exponent.rb
@@ -59,7 +59,7 @@ describe :rational_exponent, shared: true do
end
end
- describe "when passed Bignum" do
+ describe "when passed Integer" do
# #5713
it "returns Rational(0) when self is Rational(0) and the exponent is positive" do
(Rational(0) ** bignum_value).should eql(Rational(0))
diff --git a/spec/ruby/shared/string/times.rb b/spec/ruby/shared/string/times.rb
index cd4edf5340c..fcc9d00fd66 100644
--- a/spec/ruby/shared/string/times.rb
+++ b/spec/ruby/shared/string/times.rb
@@ -23,7 +23,7 @@ describe :string_times, shared: true do
-> { @object.call("cool", min_long) }.should raise_error(ArgumentError)
end
- it "raises a RangeError when given integer is a Bignum" do
+ it "raises a RangeError when given integer is an Integer" do
-> { @object.call("cool", 999999999999999999999) }.should raise_error(RangeError)
-> { @object.call("", 999999999999999999999) }.should raise_error(RangeError)
end