IO#reopen should be able to change the class of the instance
------------------------------------------------------------
Key: JRUBY-4646
URL: http://jira.codehaus.org/browse/JRUBY-4646
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules, RubySpec
Affects Versions: JRuby 1.4
Reporter: Vladimir Sizikov
In JRuby:
{noformat}
jruby -e "p STDERR.reopen(File.new('foo', 'w+')).class" ==> IO
{noformat}
In other rubies:
{noformat}
pik ruby -e "p STDERR.reopen(File.new('foo', 'w+')).class"
IronRuby 0.9.3.0 on .NET 2.0.0.0
IO
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
File
ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]
File
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
File
ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-mswin32]
File
ruby 1.9.0 (2008-06-20 revision 17482) [i386-mswin32]
File
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]
File
ruby 1.9.1p0 (2009-01-30 revision 21907) [x64-mswin64_80]
File
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]
File
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]
File
ruby 1.9.2dev (2009-07-18) [i386-mswin32]
File
ruby 1.9.2dev (2009-11-12 trunk 25723) [i386-mingw32]
File
ruby 1.9.2dev (2010-02-28 trunk 26782) [i386-mingw32]
File
ruby 1.9.2dev (2010-03-05 trunk 26821) [i386-mingw32]
File
{noformat}
This also leads to two rubyspec failures:
{noformat}
2)
IO#reopen changes the class of the instance to the class of the object returned
by #to_io FAILED
Expected #<IO:0x1e47e37> (IO) to be an instance of File
/opt/work/rubyspec.git/core/io/reopen_spec.rb:28
/opt/work/rubyspec.git/core/io/reopen_spec.rb:4
/opt/work/rubyspec.git/core/io/reopen_spec.rb:56:in `load'
/opt/work/mspec.git/bin/mspec-ci:8
3)
IO#reopen with an IO may change the class of the instance FAILED
Expected #<IO:0x892cc5> (IO) to be an instance of File
/opt/work/rubyspec.git/core/io/reopen_spec.rb:198
/opt/work/rubyspec.git/core/io/reopen_spec.rb:172
/opt/work/rubyspec.git/core/io/reopen_spec.rb:56:in `load'
/opt/work/mspec.git/bin/mspec-ci:8
{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