1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-04-28 19:50:06 +00:00
parent b864bd05bf
commit 4fbb9aa3cb
145 changed files with 2847 additions and 2596 deletions

View file

@ -26,11 +26,6 @@ describe "StringIO#close_read" do
io = StringIO.new("example")
io.close_read
ruby_version_is ''...'2.3' do
lambda { io.close_read }.should raise_error(IOError)
end
ruby_version_is '2.3' do
io.close_read.should == nil
end
io.close_read.should == nil
end
end

View file

@ -16,17 +16,8 @@ describe "StringIO#close" do
lambda { @io.write('x') }.should raise_error(IOError)
end
ruby_version_is ''...'2.3' do
it "raises an IOError when self was already closed" do
@io.close
lambda { @io.close }.should raise_error(IOError)
end
end
ruby_version_is "2.3" do
it "does not raise anything when self was already closed" do
@io.close
lambda { @io.close }.should_not raise_error(IOError)
end
it "does not raise anything when self was already closed" do
@io.close
lambda { @io.close }.should_not raise_error(IOError)
end
end

View file

@ -26,11 +26,6 @@ describe "StringIO#close_write" do
io = StringIO.new("example")
io.close_write
ruby_version_is ''...'2.3' do
lambda { io.close_write }.should raise_error(IOError)
end
ruby_version_is '2.3' do
io.close_write.should == nil
end
io.close_write.should == nil
end
end

View file

@ -8,14 +8,12 @@ describe "StringIO#external_encoding" do
io.external_encoding.should == Encoding::EUC_JP
end
ruby_version_is "2.3" do
it "does not set the encoding of its buffer string if the string is frozen" do
str = "foo".freeze
enc = str.encoding
io = StringIO.new(str)
io.set_encoding Encoding::EUC_JP
io.external_encoding.should == Encoding::EUC_JP
str.encoding.should == enc
end
it "does not set the encoding of its buffer string if the string is frozen" do
str = "foo".freeze
enc = str.encoding
io = StringIO.new(str)
io.set_encoding Encoding::EUC_JP
io.external_encoding.should == Encoding::EUC_JP
str.encoding.should == enc
end
end

View file

@ -18,3 +18,12 @@ end
describe "StringIO#read_nonblock when passed length" do
it_behaves_like :stringio_sysread_length, :read_nonblock
end
describe "StringIO#read_nonblock" do
it "accepts an exception option" do
stringio = StringIO.new('foo')
stringio.read_nonblock(3, exception: false).should == 'foo'
end
end