2018-03-04 15:09:32 +00:00
|
|
|
require_relative '../../spec_helper'
|
2017-05-07 12:04:49 +00:00
|
|
|
require 'stringio'
|
2018-03-04 15:09:32 +00:00
|
|
|
require_relative 'shared/each_char'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-12-04 16:32:14 +01:00
|
|
|
ruby_version_is ''...'3.0' do
|
2020-07-27 11:15:50 +09:00
|
|
|
describe "StringIO#chars" do
|
2020-12-27 17:35:32 +01:00
|
|
|
before :each do
|
|
|
|
@verbose, $VERBOSE = $VERBOSE, nil
|
|
|
|
end
|
|
|
|
|
|
|
|
after :each do
|
|
|
|
$VERBOSE = @verbose
|
|
|
|
end
|
|
|
|
|
2020-07-27 11:15:50 +09:00
|
|
|
it_behaves_like :stringio_each_char, :chars
|
|
|
|
end
|
2017-05-07 12:04:49 +00:00
|
|
|
|
2020-07-27 11:15:50 +09:00
|
|
|
describe "StringIO#chars when self is not readable" do
|
2020-12-27 17:35:32 +01:00
|
|
|
before :each do
|
|
|
|
@verbose, $VERBOSE = $VERBOSE, nil
|
|
|
|
end
|
|
|
|
|
|
|
|
after :each do
|
|
|
|
$VERBOSE = @verbose
|
|
|
|
end
|
|
|
|
|
2020-07-27 11:15:50 +09:00
|
|
|
it_behaves_like :stringio_each_char_not_readable, :chars
|
|
|
|
end
|
2017-05-07 12:04:49 +00:00
|
|
|
end
|