diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-04-04 01:02:53 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-04-04 01:02:53 +0200 |
commit | 7f82c8cd470b5e262749c455f6e0cef055b365bb (patch) | |
tree | a32deaf9b1bd2e06adb5484f5b09825705cf1984 /spec/ruby/core/file | |
parent | da5a128991e8c3c2fbd6c100653f4277f47e54a0 (diff) | |
download | ruby-7f82c8cd470b5e262749c455f6e0cef055b365bb.tar.gz |
Update to ruby/spec@7289ea3
Diffstat (limited to 'spec/ruby/core/file')
-rw-r--r-- | spec/ruby/core/file/lchmod_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/ruby/core/file/lchmod_spec.rb b/spec/ruby/core/file/lchmod_spec.rb index 6a28bdc16d..bab362980a 100644 --- a/spec/ruby/core/file/lchmod_spec.rb +++ b/spec/ruby/core/file/lchmod_spec.rb @@ -1,7 +1,7 @@ require_relative '../../spec_helper' describe "File.lchmod" do - guard -> { File.respond_to?(:lchmod) } do + platform_is_not :linux, :windows, :openbsd, :solaris, :aix do before :each do @fname = tmp('file_chmod_test') @lname = @fname + '.lnk' @@ -30,9 +30,21 @@ describe "File.lchmod" do end end - guard_not -> { File.respond_to?(:lchmod) } do + platform_is :openbsd, :aix do + it "returns false from #respond_to?" do + File.respond_to?(:lchmod).should be_false + end + it "raises a NotImplementedError when called" do -> { File.lchmod 0, "foo" }.should raise_error(NotImplementedError) end end + + platform_is :linux do + it "raises a NotImplementedError or Errno::ENOTSUP when called" do + -> { File.lchmod 0, "foo" }.should raise_error(Exception) { |e| + [NotImplementedError, Errno::ENOTSUP].should include(e.class) + } + end + end end |