mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@a454137
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fc1f3f14d3
commit
9dc121cc57
143 changed files with 328 additions and 146 deletions
|
@ -9,4 +9,3 @@ end
|
|||
describe "IO#pos=" do
|
||||
it_behaves_like :io_set_pos, :pos=
|
||||
end
|
||||
|
||||
|
|
|
@ -51,4 +51,3 @@ describe IO, "#print" do
|
|||
lambda { IOSpecs.closed_io.print("stuff") }.should raise_error(IOError)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue