rspec / rspec-support

Common code needed by the other RSpec gems. Not intended for direct use.
https://rspec.info
MIT License
99 stars 102 forks source link

Test failure - RSpec::Support::Differ#diff copes with encoded strings #255

Closed liam-m closed 8 years ago

liam-m commented 8 years ago

While trying to set up my system to implement #252, I encountered a test failure:

Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 20932
........................*..........................................................................................................................................................F..........................................................................................................................................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) RSpec::Support::ShellOut can shell out to ruby with the current load path
     # Need to investigate why this is failing -- see https://travis-ci.org/rspec/rspec-core/jobs/60327106 and https://travis-ci.org/rspec/rspec-support/jobs/60296920 for examples
     # ./spec/rspec/support/spec/shell_out_spec.rb:22

Failures:

  1) RSpec::Support::Differ#diff copes with encoded strings
     Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }

       expected
       "" (UTF-8) to be identical to
       "\n@@ -1,2 +1,2 @@\n-Tu avec carte {count} item has\n+Tu avec cart\u00E9 {count} it\u00E9m has\n" (UTF-16LE)
       The exact bytes are printed below for more detail:
       []
       [10, 0, 64, 0, 64, 0, 32, 0, 45, 0, 49, 0, 44, 0, 50, 0, 32, 0, 43, 0, 49, 0, 44, 0, 50, 0, 32, 0, 64, 0, 64, 0, 10, 0, 45, 0, 84, 0, 117, 0, 32, 0, 97, 0, 118, 0, 101, 0, 99, 0, 32, 0, 99, 0, 97, 0, 114, 0, 116, 0, 101, 0, 32, 0, 123, 0, 99, 0, 111, 0, 117, 0, 110, 0, 116, 0, 125, 0, 32, 0, 105, 0, 116, 0, 101, 0, 109, 0, 32, 0, 104, 0, 97, 0, 115, 0, 10, 0, 43, 0, 84, 0, 117, 0, 32, 0, 97, 0, 118, 0, 101, 0, 99, 0, 32, 0, 99, 0, 97, 0, 114, 0, 116, 0, 233, 0, 32, 0, 123, 0, 99, 0, 111, 0, 117, 0, 110, 0, 116, 0, 125, 0, 32, 0, 105, 0, 116, 0, 233, 0, 109, 0, 32, 0, 104, 0, 97, 0, 115, 0, 10, 0]
     # ./spec/rspec/support/differ_spec.rb:103:in `block (3 levels) in <module:Support>'

Finished in 3.95 seconds (files took 0.27248 seconds to load)
318 examples, 1 failure, 1 pending

Failed examples:

rspec ./spec/rspec/support/differ_spec.rb:92 # RSpec::Support::Differ#diff copes with encoded strings

Randomized with seed 20932

This occurred after cloning this repo and running rake, as well as when following the steps in rspec-dev:

git clone git://github.com/rspec/rspec-dev.git
cd rspec-dev
bundle install --binstubs
bin/rake setup
bin/rake # runs tests in every repository

This is on OS X 10.11.2 with Ruby 2.1.7 (using rvm)

JonRowe commented 8 years ago

We'll need some more details to replicate this, as it works locally for the rest of us (and on travis), whats your locale etc?

liam-m commented 8 years ago

I'm happy to provide any information I can but I'm not sure what would help. How can I find the locale? This is my Language & Region:

screen shot 2015-12-10 at 13 12 31
JonRowe commented 8 years ago

can you gist your environment? (You can find this with printenv)

liam-m commented 8 years ago

https://gist.github.com/liam-m/044a2fa7646dac38cf80

I removed some things that I thought may be sensitive but I don't think it was anything relevant

fables-tales commented 8 years ago

My totally unfounded reckon is that this is an RVM bug. I've seen untraceable issues like this with my install before and it's one of the main reasons that I switched to chruby. Unless anyone else reports this I think we should close as it doesn't seem to be a widespread issue. Thoughts?

JonRowe commented 8 years ago

I use rvm without issues but I've not yet had a chance to try @liam-m's env...

liam-m commented 8 years ago

I tried running the tests with my system Ruby and all tests passed, so it's looking increasingly likely it's an RVM bug. Feel free to close if you don't want to do any extra investigation