-
-
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
Consistent backtrace accross MRI versions #383
Conversation
@dchelimsky this fails for me as you described on 1.8.7, but it's passing in both 1.9.3 and 2.0.0. Do you have 2.0.0p0? Can you see anything significanly different in my example to yours?
I've just been taking a look at this, as I've seen differences in backtraces reported between different versions of ruby while working on #399. Travis output for #399 shows different ruby implementations reporting different line locations for the same exception. I think this is also the case here. I've made a quick change to @dchelimsky's repo to force an error without running cucumber, and show the backtrace. git clone https://github.com/tooky/cucumber-output-example.git
cd cucumber-output-example
rvm 1.8.7@cucumber-output-example --create
bundle
ruby bin/codebreaker
rvm 1.9.3@cucumber-output-example --create
bundle
ruby bin/codebreaker
rvm 2.0.0@cucumber-output-example --create
bundle
ruby bin/codebreaker
rvm jruby-1.8.7@cucumber-output-example --create
bundle
ruby bin/codebreaker Here is the output
@mattwynne - not sure we'll be able to work around this? |
Conflicts: cucumber.yml
So @tooky are you saying that this is Ruby, rather than Cucumber behaviour? @dchelimsky what motivated you to notice / report this in the first place? Was it just a curiosity or is there something you're trying to achieve that we could maybe work around some other way? |
I'm working on an update to The RSpec Book to bring it up to date with the latest versions of Ruby and assorted gems. The important thing is not getting identical, character by character output but that we get a pointer to the place we can fix the failure. Here's the output from my original example:
The error is due to ./features/step_definitions/codebreaker_steps.rb:21 invoking the method on ./lib/codebreaker/game.rb:7 incorrectly. The information provided in Ruby 1.8.7 and 1.9.3, though different from each other, provides at least one pointer to ./features/step_definitions/codebreaker_steps.rb:21, which is the call site - the point where the problem can be fixed. In Ruby 2.0.0 there is no reference to that line, so the user is left reasoning about how to get from features/codebreaker_submits_guess.feature:12 to lib/codebreaker/game.rb:7. I'm less concerned with having two references to ./features/step_definitions/codebreaker_steps.rb:21 in Ruby 1.8.7 than I am with no references in Ruby 2.0.0. Make sense? |
@dchelimsky I'm not able to reproduce that on ruby 2.0 here. I'm getting
Which matches 1.9.3. @mattwynne - should we set up a ruby 2.0.0 build on travis? The feature in this PR passes for me on 2.0.0. |
On 26 Mar 2013, at 13:09, Steve Tooke notifications@github.com wrote:
|
I think this has been fixed, somehow, in a recent version of Cucumber. I seem to be able to get the step definition line to appear in the backtrace in Ruby 2.0.0 by using master, or 1.2.3. @dchelimsky can you try again using cucumber version 1.2.3 please? |
Yeah in fact looking at History.md we didn't even support Ruby 2.0.0 until Cucumber 1.2.2 - that might have had something to do with it! |
Works as I expect with 1.2.3. Looks like 1.2.2 (which also works as I expect) came out the day after I filed this issue :) |
Happy days! |
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. |
No description provided.