[1.9] Add Complex#rationalize
-----------------------------

                 Key: JRUBY-4298
                 URL: http://jira.codehaus.org/browse/JRUBY-4298
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Ruby 1.9
    Affects Versions: JRuby 1.4
         Environment: github trunk, Java 6, Mac OS X 10.6.2
            Reporter: Hiro Asari
             Fix For: JRuby 1.5
         Attachments: 0001-Add-Complex-rationalize-in-1.9-mode.patch

1.9.2 added Complex#rationalize. RubySpec is updated to reflect this: 
http://github.com/rubyspec/rubyspec/tree/871a605e4e7a209657d4cd0bfb3797107769c571

{noformat}
surfboard:jruby[git:master]$ jruby spec/mspec/bin/mspec -T--1.9 
spec/ruby/core/complex/rationalize_spec.rb 
jruby 1.5.0.dev (ruby 1.9.2dev trunk 24787) (2009-12-02 872c63c) (Java 
HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
FE

1)
Complex#rationalize raises RangeError if self has non-zero imaginary part FAILED
Expected RangeError
but got NoMethodError (undefined method `rationalize' for (1+5i):Complex)
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:6
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:3
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:1
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:55:in
 `load'

2)
Complex#rationalize returns a Rational if self has zero imaginary part ERROR
NoMethodError: undefined method `rationalize' for (1+0i):Complex
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:10
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:3
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:1
/Users/asari/Development/src/jruby/spec/ruby/core/complex/rationalize_spec.rb:55:in
 `load'

Finished in 0.034000 seconds

1 file, 2 examples, 1 expectation, 1 failure, 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


Reply via email to