Korny Sietsma
2009-May-20 03:29 UTC
[rspec-users] Issue with jruby and cucumber step with 4 parameters
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"
aslak hellesoy
2009-May-20 06:47 UTC
[rspec-users] Issue with jruby and cucumber step with 4 parameters
The Cucumber list has moved: http://www.nabble.com/-Cucumber--ANN%3A-New-Google-Group-for-Cucumber-td23602831.html On Wed, May 20, 2009 at 5:29 AM, Korny Sietsma <korny at sietsma.com> wrote:> 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" > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >