summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lib/leakchecker.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lib/leakchecker.rb b/test/lib/leakchecker.rb
index 37c87c9f72e..a1093debcdc 100644
--- a/test/lib/leakchecker.rb
+++ b/test/lib/leakchecker.rb
@@ -31,8 +31,8 @@ class LeakChecker
def check_fd_leak(test_name)
leaked = false
live1 = @fd_info
- if IO.respond_to?(:console)
- IO.console(:close)
+ if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
+ m[:close]
end
live2 = find_fds
fd_closed = live1 - live2