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@63768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-06-27 12:30:05 +00:00
parent fc1f3f14d3
commit 9dc121cc57
143 changed files with 328 additions and 146 deletions

View file

@ -9,4 +9,3 @@ end
describe "IO#pos=" do
it_behaves_like :io_set_pos, :pos=
end

View file

@ -51,4 +51,3 @@ describe IO, "#print" do
lambda { IOSpecs.closed_io.print("stuff") }.should raise_error(IOError)
end
end

View file

@ -69,4 +69,25 @@ describe :io_write, shared: true do
lambda { IOSpecs.closed_io.send(@method, "hello") }.should raise_error(IOError)
end
describe "on a pipe" do
before :each do
@r, @w = IO.pipe
end
after :each do
@r.close
@w.close
end
it "writes the given String to the pipe" do
@w.send(@method, "foo")
@w.close
@r.read.should == "foo"
end
it "raises Errno::EPIPE if the read end is closed" do
@r.close
-> { @w.send(@method, "foo") }.should raise_error(Errno::EPIPE, "Broken pipe")
end
end
end