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

Suppress the “experimental" warnings for IO::Buffer

As this warning is emitted just once per processes, needs in each
files when parallel testing.
This commit is contained in:
Nobuyoshi Nakada 2021-11-23 16:08:53 +09:00
parent da832d6c2a
commit a88b19d3d0
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 16 additions and 0 deletions

View file

@ -14,6 +14,14 @@ rescue LoadError
end
class Scheduler
experimental = Warning[:experimental]
begin
Warning[:experimental] = false
IO::Buffer.new(0)
ensure
Warning[:experimental] = experimental
end
def initialize
@readable = {}
@writable = {}

View file

@ -1,6 +1,14 @@
# frozen_string_literal: false
class TestIOBuffer < Test::Unit::TestCase
experimental = Warning[:experimental]
begin
Warning[:experimental] = false
IO::Buffer.new(0)
ensure
Warning[:experimental] = experimental
end
def assert_negative(value)
assert(value < 0, "Expected #{value} to be negative!")
end