summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-02 19:03:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-02 19:03:17 +0000
commit4ef6097f9a8abd98637e296c0b5013224567c214 (patch)
tree6b4112e7394c36dfbc6a9a5298f33e06cfa3c603 /test/lib
parent2743ad8c25dd6b3f96372a0cb24b22a0779e895d (diff)
leakchecker.rb: for older IO.console
* test/lib/leakchecker.rb (check_fd_leak): do not call older version IO.console to get rid of ArgumentError, so that older versions can run to compare the resuls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib')
-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 37c87c9f72..a1093debcd 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