Cuporter fails because of UTF-8 Byte Order Mark at beginning of feature file #1

Closed
alisterscott opened this Issue Jul 4, 2011 · 5 comments

Projects

None yet

2 participants

@alisterscott

Gem: 0.3.11

Example:

run cuporter when a feature file exists that doesn't have a tag in it

Expected result: list features at bottom of html report that don't contain any tags (these can be followed up if need be)

Actual Result:

/Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/feature_parser/tag_nodes_parser.rb:35:in new_example_line': undefined method[]' for nil:NilClass (NoMethodError)
from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/feature_parser/parser_base.rb:58:in block in parse_feature' from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/feature_parser/parser_base.rb:26:ineach'
from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/feature_parser/parser_base.rb:26:in parse_feature' from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/feature_parser.rb:14:intag_nodes'
from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/report/tag_report.rb:7:in block in build_report_node' from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/report/tag_report.rb:6:ineach'
from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/report/tag_report.rb:6:in build_report_node' from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/lib/cuporter/report/tag_report.rb:25:inbuild'
from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/bin/cuporter:45:in block in run' from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/bin/cuporter:37:ineach'
from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/bin/cuporter:37:in run' from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/gems/cuporter-0.3.11/bin/cuporter:77:in<top (required)>'
from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/bin/cuporter:19:in load' from /Users/alscott/.rvm/gems/ruby-1.9.2-p0@watir-webdriver/bin/cuporter:19:in

'

@twcamper twcamper was assigned Jul 4, 2011
@twcamper
Owner
twcamper commented Jul 4, 2011

Alister, sorry to've broken your build!

I need some help reproducing this. I have features with no tags in my test fixtures, and I get the behavior I expect when I hit those files in either 1.8.7-p302 or 1.9.2-p180/p0: silence if those are the only files in the tag report, or they're ignored if other tagged files were included.

Stepping through, the only way I could see this happening is with a feature file that gherkin would refuse to parse so cucumber wouldn't run anyway. Specifically, you'd have to have an "Examples:" line with a table of pipe-delimited rows, but be missing either a "Scenario Outline|Template:" line or a "Feature:" line. I'd really like to see your input, if you can determine which of your feature files is having trouble. Even if it turns out to be bad gherkin on your end, I'd like to know as handling unfinished feature files and even just free-form notes in *.txt files is on the near term road-map.

I've yanked gem 3.11, and will put up 3.12 later with a more helpful error dump.

As for showing un-tagged features in the tag report, that would be a new feature. It's a very good idea and it shouldn't be hard but I may not be able to get to it immediately.

@alisterscott

Hi Tim,
Thanks for your response.
After further investigation, this is not because my files don't have tags, but rather there is a UTF-8 byte order mark (http://en.wikipedia.org/wiki/Byte_order_mark) on the same line as Feature. This is reproducible by putting any character before the term Feature in a feature file.
If you were after my feature files to reproduce this, these are on github: https://github.com/alisterscott/EtsyWatirWebDriver

Cheers!
Alister

@twcamper
Owner
twcamper commented Jul 7, 2011

re: BOM, will zap it or match it in a few days.

@twcamper
Owner

Let me know how 0.3.14 (9e9fd6d) treats you. Should be fixed in 1.9 and 1.8 now.

@alisterscott

Awesome! Works perfectly.

Untagged Features
Feature: Etsy Advanced Search Functionality #features/EtsyAdvancedSearch.feature
Feature: Etsy Browse Functionality #features/EtsyBrowse.feature
Feature: Etsy Cart Functionality #features/EtsyShoppingCart.feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment