Metadata raises CompatibilityError when I try to inspect it

Hi.

When I try to inspect example metadata, for some reason it raises the
encoding compatibility exception.

describe RSpec::Core::Metadata do
  describe '#inspect' do
    it 'raises Encoding::CompatibilityError' do
      expect {
        example.metadata.inspect
      }.to raise_error(Encoding::CompatibilityError)
    end
  end

  describe '#to_s' do
    it 'raises Encoding::CompatibilityError' do
      expect {
        example.metadata.to_s
      }.to raise_error(Encoding::CompatibilityError)
    end
  end
end
$ rspec metadata_spec.rb
..

Finished in 0.00128 seconds
2 examples, 0 failures

It raises nothing if I use the $ ruby ... instead of $ rspec ...
command.

What is the reason of this bug? How can I fix it?

Thanks.

Debian GNU/Linux 6.0.1;
Ruby 1.9.2p0;
RSpec 2.5.1.

On Wed, Apr 6, 2011 at 12:53 AM, Shamaoke [email protected] wrote:

   example.metadata.inspect

end


rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Hello, I think this might be a bug in your Ruby 1.9.2 patch version. I’m
using 1.9.2-p180 and cannot reproduce this.

I installed Ruby 1.9.2-p180 from the sources. Unfortunatelly, the bug
still exists:

http://dl.dropbox.com/u/20481401/compatability_error.png

I tackled the problem.

If you use the Unicode characters in the path to a spec directory the
bug appears. If not to use them, all goes without any problems.

So, using the path /home/username/разработка/ruby/my_application/ spec will raise the exception, but /home/username/development/ruby/ my_application/spec will not.