Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Launcher
-
Labels:None
-
Number of attachments :
Description
Run the following ruby script. This testcase seems to be part of the one that is shipped with ruby 1.7.0 source .
require 'test/unit'
class TestMethodMissing < Test::Unit::TestCase
class AMethodMissingClass
def method_missing name, *args
1
end
end
def test_attr_assign_missing_returns_rhs
assert_equal(AMethodMissingClass.new.foo=2, 2) <-----------------------------------------
assert_equal(eval("AMethodMissingClass.new.foo=2"), 2)
end
end
The reason for failure with 1.7.0 seems to be there because it is not getting the value "2" assigned in the pointed out assertion.
Hence the comparison happens between value "1" and "2" and the failure occurs.
One more observation here is that when I run the script with --debug option , i.e as "jruby --debug test.rb " failure isn't seen.
Good catch. I thought I handled this correctly, but perhaps I missed something. Checking.