From 7f82c8cd470b5e262749c455f6e0cef055b365bb Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 4 Apr 2020 01:02:53 +0200 Subject: Update to ruby/spec@7289ea3 --- spec/ruby/core/file/lchmod_spec.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'spec/ruby/core') 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 -- cgit v1.2.3