1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

envutil.rb: under_gc_stress parameter

* test/ruby/envutil.rb (EnvUtil#under_gc_stress): add stress parameter
  so that making possible to disable stressing explicitly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-11-09 16:46:17 +00:00
parent e72ca2e044
commit 0a5b32c45a

View file

@ -124,8 +124,8 @@ module EnvUtil
end
module_function :suppress_warning
def under_gc_stress
stress, GC.stress = GC.stress, true
def under_gc_stress(stress = true)
stress, GC.stress = GC.stress, stress
yield
ensure
GC.stress = stress