summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2020-12-27 17:35:32 +0100
committerBenoit Daloze <[email protected]>2020-12-27 17:35:32 +0100
commit727c97da1977544c91b9b3677811da3a44af7d53 (patch)
tree4f027117edad10789db57ff4b83242753a89e39d /spec/ruby/library/stringio
parent267bed0cd91711e2a8c79219e97431ba22137b01 (diff)
Update to ruby/spec@4ce9f41
Diffstat (limited to 'spec/ruby/library/stringio')
-rw-r--r--spec/ruby/library/stringio/bytes_spec.rb16
-rw-r--r--spec/ruby/library/stringio/chars_spec.rb16
-rw-r--r--spec/ruby/library/stringio/codepoints_spec.rb9
-rw-r--r--spec/ruby/library/stringio/lines_spec.rb32
4 files changed, 72 insertions, 1 deletions
diff --git a/spec/ruby/library/stringio/bytes_spec.rb b/spec/ruby/library/stringio/bytes_spec.rb
index 1c0607db6e..4ef7a490a5 100644
--- a/spec/ruby/library/stringio/bytes_spec.rb
+++ b/spec/ruby/library/stringio/bytes_spec.rb
@@ -4,10 +4,26 @@ require_relative 'shared/each_byte'
ruby_version_is ''...'3.0' do
describe "StringIO#bytes" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_byte, :bytes
end
describe "StringIO#bytes when self is not readable" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_byte_not_readable, :bytes
end
end
diff --git a/spec/ruby/library/stringio/chars_spec.rb b/spec/ruby/library/stringio/chars_spec.rb
index 3383dcfc57..58cba77634 100644
--- a/spec/ruby/library/stringio/chars_spec.rb
+++ b/spec/ruby/library/stringio/chars_spec.rb
@@ -4,10 +4,26 @@ require_relative 'shared/each_char'
ruby_version_is ''...'3.0' do
describe "StringIO#chars" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_char, :chars
end
describe "StringIO#chars when self is not readable" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_char_not_readable, :chars
end
end
diff --git a/spec/ruby/library/stringio/codepoints_spec.rb b/spec/ruby/library/stringio/codepoints_spec.rb
index 0dfaac2a29..ceaadefc32 100644
--- a/spec/ruby/library/stringio/codepoints_spec.rb
+++ b/spec/ruby/library/stringio/codepoints_spec.rb
@@ -4,9 +4,16 @@ require_relative 'fixtures/classes'
require_relative 'shared/codepoints'
ruby_version_is ''...'3.0' do
-
# See redmine #1667
describe "StringIO#codepoints" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_codepoints, :codepoints
end
end
diff --git a/spec/ruby/library/stringio/lines_spec.rb b/spec/ruby/library/stringio/lines_spec.rb
index 4a2aeac37e..42d11772ae 100644
--- a/spec/ruby/library/stringio/lines_spec.rb
+++ b/spec/ruby/library/stringio/lines_spec.rb
@@ -4,18 +4,50 @@ require_relative 'shared/each'
ruby_version_is ''...'3.0' do
describe "StringIO#lines when passed a separator" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_separator, :lines
end
describe "StringIO#lines when passed no arguments" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_no_arguments, :lines
end
describe "StringIO#lines when self is not readable" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_not_readable, :lines
end
describe "StringIO#lines when passed chomp" do
+ before :each do
+ @verbose, $VERBOSE = $VERBOSE, nil
+ end
+
+ after :each do
+ $VERBOSE = @verbose
+ end
+
it_behaves_like :stringio_each_chomp, :lines
end
end