summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-26 02:54:01 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-26 02:54:01 +0000
commit7f69d4e41f1cd77e142b786596dd005891a233f3 (patch)
tree69da424273fcdac1321588b0d0cba395175f9e84 /test/ripper
parentdf38879ae627ce4990ab3c0b0645f824df0511ce (diff)
parse.y: remove "shadowing outer local variable" warning
You can now write the following without warning. user = User.all.find {|user| cond(user) } Fixes [Feature #12490]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_parser_events.rb7
1 files changed, 0 insertions, 7 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index a420bfbf81..95ec661fcf 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -1487,13 +1487,6 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal("`$' without identifiers is not allowed as a global variable name", compile_error('$'))
end
- def test_warning_shadowing
- fmt, *args = warning("x = 1; tap {|;x|}")
- assert_match(/shadowing outer local variable/, fmt)
- assert_equal("x", args[0])
- assert_match(/x/, fmt % args)
- end
-
def test_warning_ignored_magic_comment
fmt, *args = warning("1; #-*- frozen-string-literal: true -*-")
assert_match(/ignored after any tokens/, fmt)