Skip to content

Commit

Permalink
Avoid showing "@ rb_sysopen" noise for Ruby 2.4.
Browse files Browse the repository at this point in the history
This fixes cucumber#1071.
  • Loading branch information
junaruga committed Feb 23, 2017
1 parent 9c6ee33 commit 6f4be0a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/cucumber/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6f4be0a

Please sign in to comment.