File#link and File#symlink should not accept non-string arguments
-----------------------------------------------------------------
Key: JRUBY-1917
URL: http://jira.codehaus.org/browse/JRUBY-1917
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1RC1
Environment: Latest JRuby 1.1RC1 from trunk.
Reporter: Vladimir Sizikov
Assignee: Thomas E Enebo
Attachments: file-link-non-string-args.patch
File#link should not accept the non-string arguments:
{noformat}
File.link(:symbol, "name")
File.link("name", 10)
{noformat}
MRI for both lines prints:
TypeError: can't convert Symbol into String
TypeError: can't convert Fixnum into String
JRuby just happily accept such parameters.
This also leads to one rubyspec failure:
File.link raises a TypeError if not passed String types FAILED
Expected TypeError but no exception was raised:
./mspec/expectations.rb:10:in `fail_with'
./mspec/expectations/should.rb:6:in `should'
/opt/work/rubinius/./spec/ruby/1.8/core/file/link_spec.rb:37
/opt/work/rubinius/./spec/ruby/1.8/core/file/link_spec.rb:37:in `call'
./mspec/runner/runner.rb:136:in `describe'
./mspec/runner/runner.rb:135:in `each'
./mspec/runner/runner.rb:130:in `describe'
./mspec/runner/runner.rb:135:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/core/file/link_spec.rb:3
/opt/work/rubinius/./spec/ruby/1.8/core/file/link_spec.rb:3:in `load'
tmp/last_ci.rb:52
tmp/last_ci.rb:44:in `each'
tmp/last_ci.rb:44
Also, the same is true for File#symlink.
The proposed patch fixes both problems, and the two rubyspec failures.
--
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