From 7f86ad61cceaffca0d47fe5dc706fbc2ca9ea166 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 15 May 2020 01:21:12 +0900 Subject: [PATCH] test/scheduler: suppress warnings https://rubyci.s3.amazonaws.com/debian/ruby-master/log/20200514T123004Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/scheduler.rb:29: warning: assigned but unused variable - fiber /home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/scheduler.rb:156: warning: method redefined; discarding old fiber /home/chkbuild/chkbuild/tmp/build/20200514T123004Z/ruby/test/scheduler/test_fiber.rb:27: warning: ambiguous first argument; put parentheses or a space even after `/' operator ``` --- test/scheduler/scheduler.rb | 4 +--- test/scheduler/test_fiber.rb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/scheduler/scheduler.rb b/test/scheduler/scheduler.rb index b2d36cc728..820f441dcd 100644 --- a/test/scheduler/scheduler.rb +++ b/test/scheduler/scheduler.rb @@ -18,15 +18,13 @@ class Scheduler @ios = ObjectSpace::WeakMap.new end - attr :fiber - attr :readable attr :writable attr :waiting attr :blocking def next_timeout - fiber, timeout = @waiting.min_by{|key, value| value} + _fiber, timeout = @waiting.min_by{|key, value| value} if timeout offset = timeout - current_time diff --git a/test/scheduler/test_fiber.rb b/test/scheduler/test_fiber.rb index 3452591cd9..368065016e 100644 --- a/test/scheduler/test_fiber.rb +++ b/test/scheduler/test_fiber.rb @@ -24,6 +24,6 @@ class TestSchedulerFiber < Test::Unit::TestCase thread.join assert_not_empty scheduler.blocking - assert_match /test_fiber.rb:\d+:in `close'/, scheduler.blocking.last + assert_match(/test_fiber\.rb:\d+:in `close'/, scheduler.blocking.last) end end