From 552c6e668345a027be088e0be8336739c342225a Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 8 Feb 2017 18:10:50 +0100 Subject: [PATCH] Avoid showing "@ rb_sysopen" noise for Ruby 2.4. This fixes #1071. --- lib/cucumber/runtime.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/cucumber/runtime.rb b/lib/cucumber/runtime.rb index cf5dfc6fd4..6132d4ffb7 100644 --- a/lib/cucumber/runtime.rb +++ b/lib/cucumber/runtime.rb @@ -30,8 +30,14 @@ def initialize(original_exception, path) class FileNotFoundException < FileException end - class FeatureFolderNotFoundException < FileException - include FixRuby21Bug9285 if Cucumber::RUBY_2_1 || Cucumber::RUBY_2_2 || Cucumber::RUBY_2_3 + class FeatureFolderNotFoundException < Exception + def initialize(path) + @path = path + end + + def message + "No such file or directory - #{@path}" + end end require 'cucumber/core' @@ -141,8 +147,8 @@ def initialize(path) set_encoding rescue Errno::EACCES => e raise FileNotFoundException.new(e, File.expand_path(path)) - rescue Errno::ENOENT => e - raise FeatureFolderNotFoundException.new(e, path) + rescue Errno::ENOENT + raise FeatureFolderNotFoundException.new(path) end end