@@ -29,16 +29,20 @@ def test_eq
2929 end
3030
3131 def test___id__
32- assert_send_type '() -> Integer' ,
33- BOBJ , :__id__
32+ suppress_warning do
33+ assert_send_type '() -> Integer' ,
34+ BOBJ , :__id__
35+ end
3436 end
3537
3638 def test___send__
37- with_interned :__send__ do |name |
38- assert_send_type '(interned, *untyped, **untyped) -> untyped' ,
39- BOBJ , :__send__ , name , :__id__
40- assert_send_type '(interned, *untyped, **untyped) { (*untyped, **untyped) -> untyped} -> untyped' ,
41- BOBJ , :__send__ , name , :instance_exec do _1 end
39+ suppress_warning do
40+ with_interned :__send__ do |name |
41+ assert_send_type '(interned, *untyped, **untyped) -> untyped' ,
42+ BOBJ , :__send__ , name , :__id__
43+ assert_send_type '(interned, *untyped, **untyped) { (*untyped, **untyped) -> untyped} -> untyped' ,
44+ BOBJ , :__send__ , name , :instance_exec do _1 end
45+ end
4246 end
4347 end
4448
@@ -70,4 +74,14 @@ def test_instance_exec
7074 assert_send_type '(*String) { (*String) [self: BasicObject] -> Integer } -> Integer' ,
7175 BOBJ , :instance_exec , '1' , '2' do |*x | x . join . to_i end
7276 end
77+
78+ def suppress_warning
79+ origstderr = $stderr
80+ begin
81+ $stderr = StringIO . new
82+ yield
83+ ensure
84+ $stderr = origstderr
85+ end
86+ end
7387end
0 commit comments