Forum: JRuby Issue with jruby and cucumber step with 4 parameters

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D86508251e48b986057d34bf9ae3b6b3?d=identicon&s=25 Kornelis Sietsma (korny)
on 2009-05-20 05:53
(Received via mailing list)
Hi - sorry for the cross-list post, but this issue happens only with
cucumber and jruby, and I'm not 100% sure which has the problem. It
doesn't happen with non-j ruby though.
Versions:
  cucumber 0.2.3
  jruby 1.2.0 on Ubuntu amd64

When I have a cucumber feature with a "Then" step: (well, really it's
an "And" step):
  And the association between "oh" and "apf" has an active adpoint
named "ap" with id "7890"
which translates to the ruby code:
       Then /^the association between "(.*)" and "(.*)" has an active
adpoint named "(.*)" with id "(.*)"$/ do |arg1,arg2, arg3, arg4|
           # nothing needed here to cause the problem...
       end

In JRuby (with --backtrace enabled), I get:
    And the association between "oh" and "apf" has an active adpoint
named "ap" with id "7890" #
test/features/step_definitions/migration_steps.rb:122
      wrong # of arguments(4 for 3) (ArgumentError)
      /home/yellow/Projects/cmt_workspace/cmtapps/jruby/lib/ruby/gems/1.8/gems/cucumber-0.3.5/bin/../lib/cucumber/core_ext/instance_exec.rb:20:in
`cucumber_instance_exec'
      /home/yellow/Projects/cmt_workspace/cmtapps/jruby/lib/ruby/gems/1.8/gems/cucumber-0.3.5/bin/../lib/cucumber/core_ext/instance_exec.rb:38:in
`cucumber_run_with_backtrace_filtering'
      /home/yellow/Projects/cmt_workspace/cmtapps/jruby/lib/ruby/gems/1.8/gems/cucumber-0.3.5/bin/../lib/cucumber/core_ext/instance_exec.rb:10:in
`cucumber_instance_exec'
      /home/yellow/Projects/cmt_workspace/cmtapps/jruby/lib/ruby/gems/1.8/gems/cucumber-0.3.5/bin/../lib/cucumber/step_definition.rb:105:in
`invoke'
... rest of stack trace elided

In the normal ruby version of cucumber, this works fine.

I looked at the specific code line, but it's just a call to:
   instance_exec(*args, &block)

Does JRuby have a problem with large numbers of regexp capture groups?
 Or is there something else going on here?

- Korny
--
Kornelis Sietsma  korny at my surname dot com
"Every jumbled pile of person has a thinking part
that wonders what the part that isn't thinking
isn't thinking of"
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-05-20 09:04
(Received via mailing list)
This topic is locked and can not be replied to.