From c9d720b873f570c734b136eb639f0be117803f5c Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 26 Oct 2018 03:10:02 +0000 Subject: 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]. A patch from Soutaro Matsumoto . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/lib/test/unit/assertions.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/lib') diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index 789e2d6c3d..dfa929a136 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -693,6 +693,16 @@ eom assert_warning(*args) {$VERBOSE = false; yield} end + def assert_no_warning(pat, msg = nil) + stderr = EnvUtil.verbose_warning { + EnvUtil.with_default_internal(pat.encoding) { + yield + } + } + msg = message(msg) {diff pat, stderr} + refute(pat === stderr, msg) + end + def assert_no_memory_leak(args, prepare, code, message=nil, limit: 2.0, rss: false, **opt) # TODO: consider choosing some appropriate limit for MJIT and stop skipping this once it does not randomly fail skip 'assert_no_memory_leak may consider MJIT memory usage as leak' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? -- cgit v1.2.3