charlierudolph / cucumber_lint

A linter and formatter for cucumber features
MIT License
8 stars 4 forks source link

Crashes on Nucleus unit tests #16

Open kevgo opened 8 years ago

kevgo commented 8 years ago
/Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_empty_lines_linter.rb:31:in `element_end': undefined method `last' for nil:NilClass (NoMethodError)
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_empty_lines_linter.rb:86:in `block in lint_elements'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_empty_lines_linter.rb:83:in `each'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_empty_lines_linter.rb:83:in `lint_elements'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_empty_lines_linter.rb:15:in `lint'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_linter.rb:59:in `lint_feature_empty_lines'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_linter.rb:17:in `block in lint'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_linter.rb:16:in `each'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/linter/feature_linter.rb:16:in `lint'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/cli.rb:49:in `lint_feature'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/cli.rb:26:in `block in execute!'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/cli.rb:25:in `each'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/cli.rb:25:in `execute!'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/lib/cucumber_lint/cli.rb:11:in `execute'
    from /Users/kevin/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cucumber_lint-0.1.2/bin/cucumber_lint:7:in `<top (required)>'
    from /Users/kevin/.rbenv/versions/2.2.2/bin/cucumber_lint:23:in `load'
    from /Users/kevin/.rbenv/versions/2.2.2/bin/cucumber_lint:23:in `<main>'

The offending code (to reproduce this) is at https://github.com/Originate/nucleus-2/tree/kg-cucumber-hours-entries

charlierudolph commented 8 years ago

Sorry for the late response but that link is no longer valid. Any idea what caused this?

kevgo commented 8 years ago

Just running cucumber_lint on https://github.com/Originate/nucleus-2 causes the error as well.

Its hard to triangulate the issue since cucumber_lint doesn't allow to run on subsets of the features files. Is it possible to add command-line support for this?

cucumber_lint features/admin would only verify the cucumber files in the given directory.