-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow absolute formatter output paths. Fixes #900. #906
Allow absolute formatter output paths. Fixes #900. #906
Conversation
features/formatter_paths.feature
Outdated
""" | ||
|
||
Scenario: Absolute path | ||
When I run cucumber.js with `-f summary:{this.tmpDir}/summary.txt` |
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.
Thoughts on using https://github.com/janl/mustache.js/ for the templating?
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.
Yeah...if there were only templating libraries that already handled string replacements 😄. I'll look into this afternoon.
features/formatter_paths.feature
Outdated
""" | ||
|
||
Scenario: Absolute path | ||
When I run cucumber.js with `-f summary:{{{tmpDir}}}/summary.txt` |
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.
Why are there three curly braces? In the mustache documentation it appears you only need two.
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.
mustache html escapes by default which was escaping the /
. Triple {
returns the raw value.
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.
Cool. Thanks for the explanation
features/formatter_paths.feature
Outdated
|
||
Scenario: Absolute path | ||
When I run cucumber.js with `-f summary:{{{tmpDir}}}/summary.txt` | ||
Then the file "{{{tmpDir}}}/summary.txt" is absolute |
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 don't like this step. It appears to only be testing that we are using mustache templates correctly. If we remove this step, does the test still fail if we revert the source code change?
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.
My thinking there was that I don't have any control over what tmpDir
is. It could be relative to the working directory for all I know so it was just some extra assurance that we are really fixing the problem.
Yes, the test will still fail if it's removed...as long as tmpDir
is and always continues to be an absolute path.
I can remove it if you want.
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.
Okay. That sounds like an important precondition. Thoughts on using a 'Given' step instead? Maybe one that says: 'Given "{{{tmpDir}}}" is an absolute 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.
Sounds reasonable
Hi @darrinholst, Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾 In return for this generous offer we hope you will:
On behalf of the Cucumber core team, |
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. |
I needed this fix to get protractor support for cucumber 3.
multiple_formattters.feature
to a newformatter_paths.feature
so all the path related scenarios were together.Added a newreplaceContextVariables
helper so that I could get the actual temp dir into the feature itself. It felt kind of hacky, but I didn't know of another way besides duplicating step definitions to deal with absolute paths explicitly.