Cucumber crashes in IDE with "uninitialized constant Term (NameError)"

If I run a feature from the command line, I get the expected results, but if I run it in debug mode in the IDE, an exception is raised.

The following statement in a step definition works fine if the step passes, but if the number of items in the expected array and the found array are different, there's a problem:

expected.diff!(found)

[Where 'expected' is a Cucumber::Ast::Table and 'found' is a ruby array.]

This is what is output:

/Users/username/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/username/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-ide-0.4.17.beta9/bin/rdebug-ide --port 49441 -- /Users/username/RubymineProjects/project/script/cucumber /Users/username/RubymineProjects/project/features/importing.feature --format Teamcity::Cucumber::Formatter --expand --name "Record\ reimported\ with\ no\ change" --color -r features
Testing started at 3:47 PM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta9, ruby-debug-base 0.11.30.pre10) listens on 127.0.0.1:49441
Using the default profile...
uninitialized constant Term (NameError)
/Applications/RubyMine.app/rb/testing/patch/bdd/teamcity/cucumber/common.rb:580:in `block (2 levels) in print_diff_table'
/Applications/RubyMine.app/rb/testing/patch/bdd/teamcity/cucumber/common.rb:569:in `times'
/Applications/RubyMine.app/rb/testing/patch/bdd/teamcity/cucumber/common.rb:569:in `block in print_diff_table'
/Users/username/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.2.0/lib/cucumber/ast/table.rb:177:in `each'
etc...

What I think is curious is why part of cucumber is being used from /Applications/RubyMine.app/rb/testing/patch/bdd/teamcity/cucumber/. It seems like it should just be using the cucumber in the gem that I've specified in the gemfile, shouldn't it?

Anyway, do I have something out of date or misconfigured on my computer?

3 comments
Comment actions Permalink

Hi Paul,

/Applications/RubyMine.app/rb/testing/patch/bdd/teamcity/cucumber/ contains implementation of Cucumber's formatter we need to use to show running/passes/failed tests.
The problem you describe looks like a bug for me.  But to be able to reproduce it we need some test example which demonstates it.  Also could you please double check
that the problem is reproducible without debugger i.e. when you just run the test(s) from RM.  And by the way what RM's version do you use?

With best regards, Oleg

0
Comment actions Permalink

1) Yes, the problem happens when I click "run" as well as "debug".

2) RM 4.0.3 117.230 April 18, 2012

3) Here's a fairly short demonstration:

    Scenario: example

        Then this table crashes:
            | type | key |
            | pending | FO-1 |
            | pending | FO-2 |
            | pending | FO-3 |
            | pending | FO-4 |

Then /^this table crashes:$/ do |table|
    # table is a Cucumber::Ast::Table
    found = [ { 'type' => 'pending', 'key' => 'FO-1' }]
    table.diff!(found)
end

0

Please sign in to leave a comment.