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

@ -6,7 +6,7 @@ describe :dir_open, shared: true do
end
it "raises a SystemCallError if the directory does not exist" do
lambda do
-> do
Dir.send @method, DirSpecs.nonexistent
end.should raise_error(SystemCallError)
end
@ -21,20 +21,20 @@ describe :dir_open, shared: true do
it "closes the Dir instance when the block exits if given a block" do
closed_dir = Dir.send(@method, DirSpecs.mock_dir) { |dir| dir }
lambda { closed_dir.read }.should raise_error(IOError)
-> { closed_dir.read }.should raise_error(IOError)
end
it "closes the Dir instance when the block exits the block even due to an exception" do
closed_dir = nil
lambda do
-> do
Dir.send(@method, DirSpecs.mock_dir) do |dir|
closed_dir = dir
raise "dir specs"
end
end.should raise_error(RuntimeError, "dir specs")
lambda { closed_dir.read }.should raise_error(IOError)
-> { closed_dir.read }.should raise_error(IOError)
end
it "calls #to_path on non-String arguments" do