1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -33,29 +33,29 @@ describe "IO#reopen" do
it "raises an IOError if the object returned by #to_io is closed" do
obj = mock("io")
obj.should_receive(:to_io).and_return(IOSpecs.closed_io)
lambda { @io.reopen obj }.should raise_error(IOError)
-> { @io.reopen obj }.should raise_error(IOError)
end
it "raises a TypeError if #to_io does not return an IO instance" do
obj = mock("io")
obj.should_receive(:to_io).and_return("something else")
lambda { @io.reopen obj }.should raise_error(TypeError)
-> { @io.reopen obj }.should raise_error(TypeError)
end
it "raises an IOError when called on a closed stream with an object" do
@io.close
obj = mock("io")
obj.should_not_receive(:to_io)
lambda { @io.reopen(STDOUT) }.should raise_error(IOError)
-> { @io.reopen(STDOUT) }.should raise_error(IOError)
end
it "raises an IOError if the IO argument is closed" do
lambda { @io.reopen(IOSpecs.closed_io) }.should raise_error(IOError)
-> { @io.reopen(IOSpecs.closed_io) }.should raise_error(IOError)
end
it "raises an IOError when called on a closed stream with an IO" do
@io.close
lambda { @io.reopen(STDOUT) }.should raise_error(IOError)
-> { @io.reopen(STDOUT) }.should raise_error(IOError)
end
end
@ -188,7 +188,7 @@ describe "IO#reopen with a String" do
it "raises an Errno::ENOENT if the file does not exist and the IO is not opened in write mode" do
@io = new_io @name, "r"
lambda { @io.reopen(@other_name) }.should raise_error(Errno::ENOENT)
-> { @io.reopen(@other_name) }.should raise_error(Errno::ENOENT)
end
end