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

Html formatter failing with undefined steps #336

Merged
merged 1 commit into from
Feb 23, 2013
Merged

Html formatter failing with undefined steps #336

merged 1 commit into from
Feb 23, 2013

Conversation

robertodecurnex
Copy link
Contributor

Having an scenario outline with undefined steps, and using the --expand option cause the html formatter to fail.

undefined method `actual_keyword' for #<Cucumber::Ast::Step:0x96985e4> (NoMethodError)

Turns out that after_step_result is called for every Cucumber::Ast::StepInvocationand every Cucumber::Ast::Step. While the former support the actual_keyword method the later does not.

The change will make use of the actual_keyword, only of the step class supports it, and default to the keyword, that comes as a param, if not.


 Feature:

    Scenario Outline:
      Given an undefined step

    Examples:
      |foo|
      |bar|

$ cucumber --format html --expand

undefined method actual_keyword' for #Cucumber::Ast::Step:0x8b29f78 (NoMethodError)`

@mattwynne
Copy link
Member

Thanks for your contribution! Could you please add a test for this behaviour?

The specs for the HTML formatter are good, it should be pretty easy to reproduce this bug in there.

@robertodecurnex
Copy link
Contributor Author

Yup, sorry, I'm already working on them.
It took me some time to find how to activate the expand flag from there :p

…only if the step type supports it.

Adding cuke to check the behavior
@robertodecurnex
Copy link
Contributor Author

A cuke has been added.

Specs, like the rest of the html formatter tests, can not be added since the formatter doesn't handle the --expand option.

The specs for the HTML formatter do not cover options at all actually.

@os97673
Copy link
Member

os97673 commented Feb 23, 2013

I think you do not have to test option in spec you could just test that after_step_result() doesn't raise
an exception been called with a step which doesn't support actual_keyword.

os97673 added a commit that referenced this pull request Feb 23, 2013
Html formatter failing with undefined steps
@os97673 os97673 merged commit f14980f into cucumber:master Feb 23, 2013
@ghost ghost assigned os97673 Feb 23, 2013
@os97673
Copy link
Member

os97673 commented Feb 23, 2013

I've merged the PR as is, though spec for the problem is always welcome (btw it would be nice to have such spec for all formatters)

os97673 added a commit that referenced this pull request Feb 23, 2013
os97673 added a commit that referenced this pull request Feb 23, 2013
remove duplicate step definition.
@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