summaryrefslogtreecommitdiff
path: root/test/ruby/test_symbol.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_symbol.rb')
-rw-r--r--test/ruby/test_symbol.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index cb6ba90698..3d1f45a927 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -117,18 +117,29 @@ class TestSymbol < Test::Unit::TestCase
ary_ids = ary.collect{|x| x.object_id }
assert_equal ary_ids, ary.collect(&:object_id)
end
+ end
+ def test_to_proc_yield
assert_ruby_status([], <<-"end;", timeout: 5.0)
GC.stress = true
true.tap(&:itself)
end;
+ end
+ def test_to_proc_new_proc
assert_ruby_status([], <<-"end;", timeout: 5.0)
GC.stress = true
2.times {Proc.new(&:itself)}
end;
end
+ def test_to_proc_no_method
+ assert_separately([], <<-"end;", timeout: 5.0)
+ bug11566 = '[ruby-core:70980] [Bug #11566]'
+ assert_raise(NoMethodError, bug11566) {Proc.new(&:foo).(1)}
+ end;
+ end
+
def test_call
o = Object.new
def o.foo(x, y); x + y; end