Skip to content

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

@kowal

Description

@kowal

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'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions