Skip to content
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

JRuby support, undefined method `[]' in turnip_formatter/scenario.rb #36

Open
kowal opened this issue Feb 20, 2014 · 3 comments
Open

JRuby support, undefined method `[]' in turnip_formatter/scenario.rb #36

kowal opened this issue Feb 20, 2014 · 3 comments

Comments

@kowal
Copy link

kowal commented Feb 20, 2014

Is JRuby supposed to be fully supported?

I'm running into several issues. Here's what I've done so far..

$ bundle exec rspec -r turnip_formatter --format RSpecTurnipFormatter --out report.html spec/integration/

Specs are running and at the end I see:

NoMethodError: undefined method `[]' for nil:NilClass
     feature_name at /.rvm/gems/jruby-1.7.10/gems/turnip_formatter-0.2.11/lib/turnip_formatter/scenario.rb:62
        print_out at /.rvm/gems/jruby-1.7.10/gems/turnip_formatter-0.2.11/lib/turnip_formatter/printer/tab_feature_statistics.rb:13
             each at org/jruby/RubyArray.java:1613
         group_by at org/jruby/RubyEnumerable.java:1724
        print_out at /.rvm/gems/jruby-1.7.10/gems/turnip_formatter-0.2.11/lib/turnip_formatter/printer/tab_feature_statistics.rb:13
           result at (erb):53
             eval at org/jruby/RubyKernel.java:1119
           result at /.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/erb.rb:838
  render_template at /.rvm/gems/jruby-1.7.10/gems/turnip_formatter-0.2.11/lib/turnip_formatter/printer.rb:11
....

report.html is not generated.

When I patched TurnipFormatter::Scenario#feature_name to rescue that error and return "Unknown" text in that case, report.html is generated. All tabs looks good besides Steps, which contains various TurnipFormatter::Scenario::NotExistStepsInformationError or NoExistPendingStepInformationError errors rendered in html.

I've cloned repository and run bundle; rspec. I've got 4 errors when running on JRuby 1.7.10:

`Finished in 1.33 seconds
49 examples, 4 failures

Failed examples:

rspec ./spec/turnip_formatter/step/pending_spec.rb:54 # TurnipFormatter::Step::Failure#attention? 
rspec ./spec/turnip_formatter/step/pending_spec.rb:59 # TurnipFormatter::Step::Failure#status 
rspec ./spec/turnip_formatter/step_template/exception_spec.rb:18 # TurnipFormatter::StepTemplate::Exception.build 
rspec ./spec/turnip_formatter/step_template/source_spec.rb:14 # TurnipFormatter::StepTemplate::Source.build should match "require 'turnip_formatter/step_template/source'"
@gongo
Copy link
Owner

gongo commented Feb 20, 2014

Hi @kowal Thank you for reporting.

Please try jruby_set_backtrace branch.

# e.g.
- gem 'turnip_formatter'
+ gem 'turnip_formatter', :git => 'git://github.com/gongo/turnip_formatter.git', :branch => 'jruby_set_backtrace'

If there is no problem in this branch, relase fix version!

@gongo
Copy link
Owner

gongo commented Feb 20, 2014

Sorry, It was not over yet..

@gongo
Copy link
Owner

gongo commented Feb 20, 2014

I understood.

Current turnip_formatter does not support that run _spec.rb (pure rspec) and .feature (turnip tests) at same time. (not only jruby, but also cruby).

If run tests include rspec file, raise error like this.

I will support someday @kowal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants