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 18, 2017
1 parent 9c6ee33 commit c323c79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion features/docs/getting_started.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Getting started
When I run `cucumber`
Then it should fail with:
"""
No such file or directory - features. You can use `cucumber --init` to get started.
Feature folder not found at
"""

Scenario: Accidentally run Cucumber in a folder with Ruby files in it.
Expand Down
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
"Feature folder not found at #{@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(File.expand_path(path))
end
end

Expand Down

0 comments on commit c323c79

Please sign in to comment.