Skip to content

Commit

Permalink
Cleanup guards for Dir.fchdir spec
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed May 1, 2023
1 parent 7f6ca5b commit b5498bf
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions core/dir/fchdir_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
require_relative 'fixtures/common'

ruby_version_is '3.3' do
has_fchdir = begin
dir = Dir.new('.')
Dir.fchdir(dir.fileno)
true
rescue NotImplementedError, NoMethodError
false
ensure
dir.close
end

guard -> { has_fchdir } do
guard -> { Dir.respond_to? :fchdir } do
describe "Dir.fchdir" do
before :all do
DirSpecs.create_mock_dirs
Expand Down Expand Up @@ -67,7 +57,7 @@
end
end

guard_not -> { has_fchdir } do
guard_not -> { Dir.respond_to? :fchdir } do
describe "Dir.fchdir" do
it "raises NotImplementedError" do
-> { Dir.fchdir 1 }.should raise_error(NotImplementedError)
Expand Down

0 comments on commit b5498bf

Please sign in to comment.