summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io
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/core/io
parentfb8f011422c645ebe29e94c3fb2079af73d1d35f (diff)
Use Integer instead of Fixnum/Bignum
Diffstat (limited to 'spec/ruby/core/io')
-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
6 files changed, 14 insertions, 14 deletions
diff --git a/spec/ruby/core/io/initialize_spec.rb b/spec/ruby/core/io/initialize_spec.rb
index c0d84765a8..ba5bc117b7 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 75c532053f..f2a0970a40 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 0b4d1e13b3..d83a6c6692 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 339684a5d4..8e4a73bb98 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 4607d13687..7ad379df3a 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 9d189f8abb..1e2ec77e1f 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)