From 9f87297c21e2e375990166214327634b212e50fb Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 4 Apr 2013 06:46:53 +0000 Subject: enum.c: avoid inadvertent symbol creation * enum.c (enum_inject): avoid inadvertent symbol creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/symbol/test_inadvertent_creation.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/-ext-/symbol/test_inadvertent_creation.rb b/test/-ext-/symbol/test_inadvertent_creation.rb index 96a0dafc4b..247a42cab3 100644 --- a/test/-ext-/symbol/test_inadvertent_creation.rb +++ b/test/-ext-/symbol/test_inadvertent_creation.rb @@ -187,5 +187,11 @@ module Test_Symbol assert_not_send([Thread.current, :thread_variable?, name]) assert_not_send([Bug::Symbol, :interned?, name]) end + + def test_enumerable_inject_op + name = noninterned_name + assert_raise(NoMethodError) {[1, 2].inject(name)} + assert_not_send([Bug::Symbol, :interned?, name]) + end end end -- cgit v1.2.3