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

InvalidByteSequence Error when using inline method #78

Open
snowe2010 opened this issue Apr 24, 2015 · 3 comments
Open

InvalidByteSequence Error when using inline method #78

snowe2010 opened this issue Apr 24, 2015 · 3 comments
Labels

Comments

@snowe2010
Copy link

I'm getting an InvalidByteSequenceError when attempting to use cuke_sniffer inline. I've got these lines in my env.rb file

# Start cuke_sniffer to analyze all code only on Jenkins
if ENV['JENKINS_HOME']
  cuke_sniffer = CukeSniffer::CLI.new
end
...
if ENV['JENKINS_HOME']
  cuke_sniffer.output_html('t.html')
end

When I run cucumber I get this error when it tries to write the file.

Assessing Score:
"\xE2" on US-ASCII (Encoding::InvalidByteSequenceError)
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cuke_sniffer-0.0.8/lib/cuke_sniffer/formatter.rb:59:in `write'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cuke_sniffer-0.0.8/lib/cuke_sniffer/formatter.rb:59:in `block in output_html'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cuke_sniffer-0.0.8/lib/cuke_sniffer/formatter.rb:58:in `open'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cuke_sniffer-0.0.8/lib/cuke_sniffer/formatter.rb:58:in `output_html'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cuke_sniffer-0.0.8/lib/cuke_sniffer/cli.rb:130:in `output_html'
C:/Users/tyler.thrailkill/Documents/recondo/tools/watir2_0/trunk/features/support/env.rb:56:in `<top (required)>'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/rb_support/rb_language.rb:94:in `load'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/rb_support/rb_language.rb:94:in `load_code_file'

C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:237:in `load_file'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:97:in `block in load_files!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:96:in `each'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:96:in `load_files!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime.rb:242:in `load_step_definitions'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime.rb:65:in `run!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/cli/main.rb:38:in `execute!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/bin/cucumber:9:in `<top (required)>'
C:/tools/ruby193/bin/cucumber:23:in `load'
C:/tools/ruby193/bin/cucumber:23:in `<main>'
@r-cochran
Copy link
Owner

At a glance this looks like a character issue, most likely in a feature/scenario name or step definition matcher. If you can, hunt down the offending file and identify any unicode character that might have been introduced. If this is a recent issue I'd start with the latest code submitted. I'll try and follow up on this in the next week.

Another option is to open the formatter class in the gem and print out the output before the failure and post it here and I can pick through it, if you don't feel comfortable doing that I more than understand.

@snowe2010
Copy link
Author

Yeah that's the thing, it only happens when I run it inline. I can run through the command line with output as html and it works perfectly fine.

I did find some unicode characters, took a while though. It was opening and closing double quotes instead of straight quotes. I don't understand why it worked running through the command line though, writing to the same output.

It does work now btw.

@vaughncm vaughncm added the bug label Jun 7, 2015
@vaughncm
Copy link
Collaborator

vaughncm commented Jun 7, 2015

Marking this as a bug so that we can revisit it. If you could provide us the offending source file that caused the issue that would be lovely. Otherwise replication may not be possible at time of analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants