summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/io/ungetbyte_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/ruby/core/io/ungetbyte_spec.rb b/spec/ruby/core/io/ungetbyte_spec.rb
index 2639d24c45..2e51fb0298 100644
--- a/spec/ruby/core/io/ungetbyte_spec.rb
+++ b/spec/ruby/core/io/ungetbyte_spec.rb
@@ -49,7 +49,7 @@ describe "IO#ungetbyte" do
end
end
- ruby_version_is '2.6' do
+ ruby_version_is '2.6'...'2.7' do
it "is an RangeError if the integer is not in 8bit" do
for i in [4095, 0x4f7574206f6620636861722072616e6765] do
lambda { @io.ungetbyte(i) }.should raise_error(RangeError)
@@ -57,6 +57,14 @@ describe "IO#ungetbyte" do
end
end
+ ruby_version_is '2.7' do
+ it "never raises RangeError" do
+ for i in [4095, 0x4f7574206f6620636861722072616e6765] do
+ lambda { @io.ungetbyte(i) }.should_not raise_error
+ end
+ end
+ end
+
it "raises an IOError if the IO is closed" do
@io.close
lambda { @io.ungetbyte(42) }.should raise_error(IOError)