Object#instance_of? should not accept non-Class or non-Module arguments
-----------------------------------------------------------------------

                 Key: JRUBY-1936
                 URL: http://jira.codehaus.org/browse/JRUBY-1936
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC1
         Environment: Latest JRuby 1.1RC1 from trunk.
            Reporter: Vladimir Sizikov
         Attachments: object-instance-of.patch

Consider the following example:

{noformat}
"test".instance_of?(Object.new)
{noformat}

MRI returns:
TypeError: class or module required

JRuby returns:
false.

This leads to one rubyspec failure:
Object #instance_of? raises a TypeError if given an object that is not a Class 
nor a Module 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/object/instance_of_P_spec.rb:49
tmp/last_ci.rb:52:in `call'
./mspec/runner/runner.rb:136:in `describe'
./mspec/runner/object.rb:11:in `each'
./mspec/runner/runner.rb:130:in `describe'
./mspec/runner/object.rb:11:in `describe'
/opt/work/rubinius/./spec/ruby/1.8/core/object/instance_of_P_spec.rb:17
tmp/last_ci.rb:52:in `load'
tmp/last_ci.rb:52
tmp/last_ci.rb:1:in `each'
tmp/last_ci.rb:44

The proposed patch fixes the problem.


-- 
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

Reply via email to