summaryrefslogtreecommitdiff
path: root/test/fiddle/helper.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-05 04:54:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-05 17:43:48 +0900
commit8f752c95d20134bcc0b5394f1cea723a40f1ac8c (patch)
tree1bc3d801dee68a53a5b033e72261f2f374b0a5cc /test/fiddle/helper.rb
parentafa33da72b35fd8e98ebd56eb24b6204c35994ce (diff)
[ruby/fiddle] Use test-unit gem (https://github.com/ruby/fiddle/pull/69)
https://github.com/ruby/fiddle/commit/e08c4c635e Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4810
Diffstat (limited to 'test/fiddle/helper.rb')
-rw-r--r--test/fiddle/helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb
index f7143f2422..0ea3bf57f4 100644
--- a/test/fiddle/helper.rb
+++ b/test/fiddle/helper.rb
@@ -1,4 +1,6 @@
# frozen_string_literal: true
+
+require 'rbconfig/sizeof'
require 'test/unit'
require 'fiddle'
@@ -165,5 +167,12 @@ module Fiddle
GC.start
end
end
+
+ def under_gc_stress
+ stress, GC.stress = GC.stress, true
+ yield
+ ensure
+ GC.stress = stress
+ end
end
end