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 8, 2017
1 parent 344d030 commit 9e139b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/cucumber/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions lib/cucumber/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 9e139b9

Please sign in to comment.