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