diff --git a/lib/cucumber/platform.rb b/lib/cucumber/platform.rb index fcfe60b319..e0fd2a71ad 100644 --- a/lib/cucumber/platform.rb +++ b/lib/cucumber/platform.rb @@ -14,6 +14,7 @@ module Cucumber RUBY_2_2 = RUBY_VERSION =~ /^2\.2/ RUBY_2_1 = RUBY_VERSION =~ /^2\.1/ RUBY_2_3 = RUBY_VERSION =~ /^2\.3/ + RUBY_2_4 = RUBY_VERSION =~ /^2\.4/ class << self attr_accessor :use_full_backtrace diff --git a/lib/cucumber/runtime.rb b/lib/cucumber/runtime.rb index cf5dfc6fd4..ed9370f2e1 100644 --- a/lib/cucumber/runtime.rb +++ b/lib/cucumber/runtime.rb @@ -30,8 +30,12 @@ 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 + attr :path + def initialize(path) + super('No such file or directory - features') + @path = path + end end require 'cucumber/core' @@ -141,8 +145,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