New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid showing "@ rb_sysopen" noise for Ruby 2.4. #1080
Avoid showing "@ rb_sysopen" noise for Ruby 2.4. #1080
Conversation
lib/cucumber/runtime.rb
Outdated
include FixRuby21Bug9285 if Cucumber::RUBY_2_1 || Cucumber::RUBY_2_2 || Cucumber::RUBY_2_3 | ||
class FeatureFolderNotFoundException < Exception | ||
attr :path | ||
def initialize(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a getter for path
variable here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nodo I thought previously FeatureFolderNotFoundException had the getter for path
variable, because it had extended FileException
. But as we do not use the getter right now, removing it might be better. I am going to remove it.
lib/cucumber/runtime.rb
Outdated
attr :path | ||
def initialize(path) | ||
super('No such file or directory - features') | ||
@path = path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of calling super
, I would suggest to override message
method and output the path related to the error. E.g. "Feature folder not found at #{@path}"
or similar. If we follow this path I would also use File.expand_path(path)
for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nodo ok I will follow your way.
lib/cucumber/platform.rb
Outdated
@@ -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/ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these constants at all? /cc @mattwynne @brasmusson
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR removes the only usage, so I'd say we can remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mattwynne 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nodo ok I will remove them 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR removes the only usage,
I am still not sure above point. actually this PR can remove these constants?
or this PR should not touch these constants?
The constants RUBY_2_* are used in gem_tasks/cucumber.rake
.
$ grep -r RUBY_2_ *
gem_tasks/cucumber.rake: elsif Cucumber::RUBY_2_0
gem_tasks/cucumber.rake: elsif Cucumber::RUBY_2_1
lib/cucumber/runtime.rb: include FixRuby21Bug9285 if Cucumber::RUBY_2_1 || Cucumber::RUBY_2_2 || Cucumber::RUBY_2_3
lib/cucumber/platform.rb: RUBY_2_2 = RUBY_VERSION =~ /^2\.2/
lib/cucumber/platform.rb: RUBY_2_1 = RUBY_VERSION =~ /^2\.1/
lib/cucumber/platform.rb: RUBY_2_3 = RUBY_VERSION =~ /^2\.3/
Thanks @junaruga - just added a couple of comments. |
@nodo ok, let me check your coments later. Thanks. |
@nodo wait a moment. I will check it today or tomorrow as right now I am busy. |
@junaruga no problem at all. Thanks for working on this! |
a0b1484
to
a0ce155
Compare
@nodo I modified my code and did rebase after review. |
a0ce155
to
c323c79
Compare
@@ -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 | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this message should be more detailed. Some possible solutions:
- Use
Aruba.config.root_directory
and somehow use it in the string - Change the exception to report a relative path and not a absolute path (so that here we can write
tmp/features
- Change the exception to not report the path
Sorry for this, I haven't notice this test before. However, I think it's important to keep it as informative as possible.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nodo I like kind of 2. "kind of 2" means when I removed "File.expand_path", I did not need to add `tmp/features' to features/docs/getting_started.feature. Check my additional commit, I am going to push it right now.
I prefer File.expand_path
.
But I like you would add File.expand_path
by yourself later, if you need it.
Because right now I want to pass all the tests on Ruby 2.4.0.
The error message "Feature folder not found at features.", which is default output with this patch applied, is more confusing then helpful IMO. It is hardly obvious that the "features" refers to folder. If there was the dash as there used to be, that would be a bit better probably .... |
40b6b10
to
6f4be0a
Compare
@nodo I changed and did rebase of my code. I do not change the message by myself on this PR. I like you will merge this, and ask you to improve the message by yourself after this PR as you like. |
@nodo I can tell you other options too.
It does not matter for me. You can make a choice. |
@nodo Thank you!! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This fixes #1071.
Details
This issue happens for only Ruby 2.4.0.
Motivation and Context
Want to pass tests.
How Has This Been Tested?
There are still failed tests. But they will be fixed by #1079 .
The
rb_sysopen
message was disappeared.Screenshots (if appropriate):
Types of changes
Checklist: