diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2022-12-08 18:19:53 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-08 18:19:53 +1300 |
commit | 6fd5d2dc003bda5ce0685abd2b975d7ac7079d46 (patch) | |
tree | a7cffd3b1b2f40b76511d785b5c00f3d35245ee6 /spec/ruby/core/file | |
parent | b2764752b2bccb8e4574891d380d0f0a3d67add0 (diff) |
Introduce `IO.new(..., path:)` and promote `File#path` to `IO#path`. (#6867)
Notes
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'spec/ruby/core/file')
-rw-r--r-- | spec/ruby/core/file/shared/path.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/ruby/core/file/shared/path.rb b/spec/ruby/core/file/shared/path.rb index 0a5abe33f0..ee8109ba05 100644 --- a/spec/ruby/core/file/shared/path.rb +++ b/spec/ruby/core/file/shared/path.rb @@ -78,13 +78,15 @@ describe :file_path, shared: true do rm_r @dir end - it "raises IOError if file was opened with File::TMPFILE" do - begin - File.open(@dir, File::RDWR | File::TMPFILE) do |f| - -> { f.send(@method) }.should raise_error(IOError) + ruby_version_is ""..."3.1" do + it "raises IOError if file was opened with File::TMPFILE" do + begin + File.open(@dir, File::RDWR | File::TMPFILE) do |f| + -> { f.send(@method) }.should raise_error(IOError) + end + rescue Errno::EOPNOTSUPP, Errno::EINVAL, Errno::EISDIR + skip "no support from the filesystem" end - rescue Errno::EOPNOTSUPP, Errno::EINVAL, Errno::EISDIR - skip "no support from the filesystem" end end end |