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

Test failure: $ LANG=C rspec spec/shell/basic_spec.rb #278

Open
voxik opened this issue Nov 13, 2012 · 0 comments
Open

Test failure: $ LANG=C rspec spec/shell/basic_spec.rb #278

voxik opened this issue Nov 13, 2012 · 0 comments

Comments

@voxik
Copy link

voxik commented Nov 13, 2012

Running the test suite, I observe following error.

$ LANG=C rspec spec/shell/basic_spec.rb 
...................F.............

Failures:

  1) Thor::Shell::Basic#print_table uses maximum terminal width
     Failure/Error: TABLE
     ArgumentError:
       invalid byte sequence in US-ASCII
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/expectations/fail_with.rb:47:in `block in any_multiline_strings?'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/expectations/fail_with.rb:47:in `each'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/expectations/fail_with.rb:47:in `any?'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/expectations/fail_with.rb:47:in `any_multiline_strings?'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/expectations/fail_with.rb:24:in `fail_with'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/matchers/operator_matcher.rb:47:in `fail_with_message'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/matchers/operator_matcher.rb:69:in `__delegate_operator'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/matchers/operator_matcher.rb:59:in `eval_match'
     # /usr/share/gems/gems/rspec-expectations-2.11.3/lib/rspec/matchers/operator_matcher.rb:28:in `block in use_custom_matcher_or_delegate'
     # /builddir/build/BUILD/rubygem-thor-0.16.0/usr/share/gems/gems/thor-0.16.0/spec/shell/basic_spec.rb:172:in `block (3 levels) in <top (required)>'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in `instance_eval'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `block in run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `map'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `block in run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
     # /usr/share/gems/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'

Finished in 0.03561 seconds
33 examples, 1 failure

Failed examples:

rspec ./spec/shell/basic_spec.rb:161 # Thor::Shell::Basic#print_table uses maximum terminal width

Randomized with seed 53972


The problem is, that the STDOUT has US-ASCII encoding and you output UTF-8 string into it. Something like content.force_encoding "UTF-8" fixes this issue, nevertheless, is that right to output UTF-8 encoded string into US-ASCII encoded STDOUT?

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

No branches or pull requests

1 participant