ruby-changes:46590
From: usa <ko1@a...>
Date: Sun, 14 May 2017 00:23:44 +0900 (JST)
Subject: [ruby-changes:46590] usa:r58706 (trunk): The exception raised when exec/spawn unexecutable file on Windows is various
usa 2017-05-14 00:23:38 +0900 (Sun, 14 May 2017) New Revision: 58706 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58706 Log: The exception raised when exec/spawn unexecutable file on Windows is various It seems that depend on OS version or filesystem Modified files: trunk/spec/rubyspec/core/process/exec_spec.rb trunk/spec/rubyspec/core/process/spawn_spec.rb Index: spec/rubyspec/core/process/exec_spec.rb =================================================================== --- spec/rubyspec/core/process/exec_spec.rb (revision 58705) +++ spec/rubyspec/core/process/exec_spec.rb (revision 58706) @@ -21,8 +21,8 @@ describe "Process.exec" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/process/exec_spec.rb#L21 end platform_is :windows do - it "raises Errno::ENOEXEC when the file is not an executable file" do - lambda { Process.exec __FILE__ }.should raise_error(Errno::ENOEXEC) + it "raises Errno::EACCES or Errno::ENOEXEC when the file is not an executable file" do + lambda { Process.exec __FILE__ }.should raise_error(->(e){[Errno::EACCES, Errno::ENOEXEC].find{|exc| exc === e}}) end end end Index: spec/rubyspec/core/process/spawn_spec.rb =================================================================== --- spec/rubyspec/core/process/spawn_spec.rb (revision 58705) +++ spec/rubyspec/core/process/spawn_spec.rb (revision 58706) @@ -575,8 +575,8 @@ describe "Process.spawn" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/process/spawn_spec.rb#L575 end platform_is :windows do - it "raises Errno::ENOEXEC when the file is not an executable file" do - lambda { Process.spawn __FILE__ }.should raise_error(Errno::ENOEXEC) + it "raises Errno::EACCES or Errno::ENOEXEC when the file is not an executable file" do + lambda { Process.spawn __FILE__ }.should raise_error(->(e){[Errno::EACCES, Errno::ENOEXEC].find{|exc| exc === e}}) end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/