String#rindex should try to convert an argument to a string via to_str
----------------------------------------------------------------------
Key: JRUBY-2539
URL: http://jira.codehaus.org/browse/JRUBY-2539
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1.1
Environment: Latest JRuby 1.1.1+
Reporter: Vladimir Sizikov
Assignee: Thomas E Enebo
It was a bug in MRI 1.8.6 that didn't do that as well. JRuby followed MRI
behavior.
Ruby-core folks (akr) stated that this is a bug, and the spec has been modified
to check for proper behavior.
Hence, we currently fail this updated spec:
{noformat}
mspec -t j 1.8/core/string/rindex_spec.rb
..E.........................
1)
String#rindex with object tries to convert obj to a string via to_str ERROR
TypeError: type mismatch: #<Class:01xf5b2e4> given
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in
`/opt/work/spec/ruby/./1.8/core/string/rindex_spec.rb'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `instance_eval'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `protect'
/opt/work/mspec.git/lib/mspec/runner/state.rb:46:in `each'
/opt/work/mspec.git/lib/mspec/runner/state.rb:46:in `protect'
/opt/work/mspec.git/lib/mspec/runner/state.rb:60:in `process'
/opt/work/mspec.git/lib/mspec/runner/state.rb:56:in `each'
/opt/work/mspec.git/lib/mspec/runner/state.rb:56:in `process'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:27:in `describe'
/opt/work/mspec.git/lib/mspec/runner/object.rb:11:in `describe'
/opt/work/spec/ruby/./1.8/core/string/rindex_spec.rb:4:in
`/opt/work/spec/ruby/./1.8/core/string/rindex_spec.rb'
/opt/work/spec/ruby/./1.8/core/string/rindex_spec.rb:45:in `load'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:45:in `files'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `instance_eval'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:120:in `protect'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:45:in `files'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:42:in `each'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:42:in `files'
/opt/work/mspec.git/lib/mspec/runner/mspec.rb:34:in `process'
/opt/work/mspec.git/bin/mspec-run:76:in `run'
/opt/work/mspec.git/lib/mspec/utils/script.rb:75:in `main'
/opt/work/mspec.git/bin/mspec-run:83
Finished in 0.486000 seconds
1 file, 28 examples, 824 expectations, 0 failures, 1 error
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email