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

Splat arguments to NoStepMatch#format_args to avoid "wrong number of arguments (0 for 1) (ArgumentError)" #581

Closed

Conversation

jshraibman-mdsol
Copy link
Contributor

I ran into this: mdsol/bilgerat#1

The problem is that the second argument to step_name() can be a a StepMatch or a NoStepMatch. If it is a StepMatch I don't want to pass any arguments and just rely on the default format. The problem is that if I don't pass any arguments to NoStepMatch#format_args I get an ArgumentError. This patch splats the arguments to NoStepMatch#format_args to avoid ArgumentErrors.

Test regression

[jshraibman@Joseph-Shraibmans-MacBook-Pro fix/bilgerat/issue_1 ~/work/cucumber]$ ber cov
/Users/jshraibman/.rvm/rubies/ruby-1.9.3-p374/bin/ruby -S rspec ./spec/cucumber/ast/background_spec.rb ./spec/cucumber/ast/doc_string_spec.rb ./spec/cucumber/ast/feature_spec.rb ./spec/cucumber/ast/features_spec.rb ./spec/cucumber/ast/outline_table_spec.rb ./spec/cucumber/ast/scenario_outline_spec.rb ./spec/cucumber/ast/step_invocation_spec.rb ./spec/cucumber/ast/step_spec.rb ./spec/cucumber/ast/table_spec.rb ./spec/cucumber/ast/tree_walker_spec.rb ./spec/cucumber/cli/configuration_spec.rb ./spec/cucumber/cli/main_spec.rb ./spec/cucumber/cli/options_spec.rb ./spec/cucumber/cli/profile_loader_spec.rb ./spec/cucumber/configuration_spec.rb ./spec/cucumber/constantize_spec.rb ./spec/cucumber/core_ext/proc_spec.rb ./spec/cucumber/formatter/ansicolor_spec.rb ./spec/cucumber/formatter/duration_spec.rb ./spec/cucumber/formatter/html_spec.rb ./spec/cucumber/formatter/interceptor_spec.rb ./spec/cucumber/formatter/junit_spec.rb ./spec/cucumber/formatter/pretty_spec.rb ./spec/cucumber/formatter/progress_spec.rb ./spec/cucumber/rake/forked_spec.rb ./spec/cucumber/rb_support/rb_language_spec.rb ./spec/cucumber/rb_support/rb_step_definition_spec.rb ./spec/cucumber/rb_support/rb_transform_spec.rb ./spec/cucumber/rb_support/regexp_argument_matcher_spec.rb ./spec/cucumber/rb_support/snippet_spec.rb ./spec/cucumber/runtime/for_programming_languages_spec.rb ./spec/cucumber/runtime/results_spec.rb ./spec/cucumber/runtime/support_code_spec.rb ./spec/cucumber/runtime_spec.rb ./spec/cucumber/step_match_spec.rb ./spec/cucumber/wire_support/configuration_spec.rb ./spec/cucumber/wire_support/connection_spec.rb ./spec/cucumber/wire_support/wire_exception_spec.rb ./spec/cucumber/wire_support/wire_language_spec.rb ./spec/cucumber/wire_support/wire_packet_spec.rb ./spec/cucumber/wire_support/wire_step_definition_spec.rb ./spec/cucumber/world/pending_spec.rb
..............................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 2.52 seconds
414 examples, 0 failures
Coverage report generated for rspec to /Users/jshraibman/work/cucumber/coverage. 5686 / 6273 LOC (90.64%) covered.
/Users/jshraibman/.rvm/rubies/ruby-1.9.3-p374/bin/ruby -S bundle exec cucumber  --profile ruby_1_9
Using the ruby_1_9 profile...
.............................................................................................................................................................................................................................................................................................................................----...........................................................................................................................................................................................................................................................................................................................................................................................................---................---........................................................................................................................................................................................................................................................

167 scenarios (167 passed)
943 steps (943 passed)
2m10.708s
Coverage report generated for features, rspec to /Users/jshraibman/work/cucumber/coverage. 6300 / 6689 LOC (94.18%) covered.

@mattwynne
Copy link
Member

Do you want this released soon? If so it would be better to pull against the 1.3.x-bugfix branch.

@os97673
Copy link
Member

os97673 commented Nov 6, 2013

I've merged change from #587 from v1.3.x-bugfix to master thus I'm closing the PR.

@os97673 os97673 closed this Nov 6, 2013
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants