summaryrefslogtreecommitdiff
path: root/test/ruby/test_method.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r--test/ruby/test_method.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 1e5f05473c..7816e6c3a0 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -322,7 +322,7 @@ class TestMethod < Test::Unit::TestCase
def o.define(n)
define_singleton_method(n)
end
- assert_raise(ArgumentError) {o.define(:bar) {:bar}}
+ assert_raise(ArgumentError, bug11283) {o.define(:bar) {:bar}}
end
def test_define_method_invalid_arg
@@ -804,7 +804,7 @@ class TestMethod < Test::Unit::TestCase
def test_curry_from_proc
c = Class.new {
- define_method(:three_args) {|a,b,c| a + b + c}
+ define_method(:three_args) {|x,y,z| x + y + z}
}
assert_curry_three_args(c.new.method(:three_args))
end
@@ -901,7 +901,7 @@ class TestMethod < Test::Unit::TestCase
class C
D = "Const_D"
def foo
- a = b = c = 12345
+ a = b = c = a = b = c = 12345
end
end
@@ -909,16 +909,16 @@ class TestMethod < Test::Unit::TestCase
bug11012 = '[ruby-core:68673] [Bug #11012]'
b = C.new.method(:foo).to_proc.binding
- assert_equal([], b.local_variables)
- assert_equal("Const_D", b.eval("D")) # Check CREF
-
- assert_raise(NameError){ b.local_variable_get(:foo) }
- assert_equal(123, b.local_variable_set(:foo, 123))
- assert_equal(123, b.local_variable_get(:foo))
- assert_equal(456, b.local_variable_set(:bar, 456))
- assert_equal(123, b.local_variable_get(:foo))
- assert_equal(456, b.local_variable_get(:bar))
- assert_equal([:bar, :foo], b.local_variables.sort)
+ assert_equal([], b.local_variables, bug11012)
+ assert_equal("Const_D", b.eval("D"), bug11012) # Check CREF
+
+ assert_raise(NameError, bug11012){ b.local_variable_get(:foo) }
+ assert_equal(123, b.local_variable_set(:foo, 123), bug11012)
+ assert_equal(123, b.local_variable_get(:foo), bug11012)
+ assert_equal(456, b.local_variable_set(:bar, 456), bug11012)
+ assert_equal(123, b.local_variable_get(:foo), bug11012)
+ assert_equal(456, b.local_variable_get(:bar), bug11012)
+ assert_equal([:bar, :foo], b.local_variables.sort, bug11012)
end
class MethodInMethodClass