File tree Expand file tree Collapse file tree 3 files changed +21
-33
lines changed
Expand file tree Collapse file tree 3 files changed +21
-33
lines changed Original file line number Diff line number Diff line change @@ -422,24 +422,22 @@ class IOWaitTest < Test::Unit::TestCase
422422 testing "::IO"
423423
424424 def test_readyp
425- if_ruby31 do
426- # This method returns true|false in Ruby 2.7, nil|IO in 3.0, and true|false in 3.1.
425+ # This method returns true|false in Ruby 2.7, nil|IO in 3.0, and true|false in 3.1.
427426
428- IO . pipe . tap do |r , w |
429- assert_send_type (
430- "() -> untyped" ,
431- r , :ready?
432- )
433- end
427+ IO . pipe . tap do |r , w |
428+ assert_send_type (
429+ "() -> untyped" ,
430+ r , :ready?
431+ )
432+ end
434433
435- IO . pipe . tap do |r , w |
436- w . write ( "hello" )
434+ IO . pipe . tap do |r , w |
435+ w . write ( "hello" )
437436
438- assert_send_type (
439- "() -> untyped" ,
440- r , :ready?
441- )
442- end
437+ assert_send_type (
438+ "() -> untyped" ,
439+ r , :ready?
440+ )
443441 end
444442 end
445443
@@ -491,7 +489,7 @@ def test_nread
491489 end
492490
493491 def test_wait
494- if_ruby "3.0.0" ..."3.2.0" do
492+ if_ruby "3.0.0" ..."3.2.0" , skip : false do
495493 IO . pipe . tap do |r , w |
496494 w . write ( "hello" )
497495
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def test_min
9696
9797 def test_percent
9898 ( 1 ..10 ) . %( 2 )
99- if_ruby ( ..."3.4.0" ) do
99+ if_ruby ( ..."3.4.0" , skip : false ) do
100100 ( 'A' ...'Z' ) . %( 2 ) { |s | s . downcase }
101101 end
102102 end
@@ -110,7 +110,7 @@ def test_size
110110 def test_step
111111 ( 1 ..10 ) . step
112112 ( 1 ..10 ) . step ( 2 )
113- if_ruby ( ..."3.4.0" ) do
113+ if_ruby ( ..."3.4.0" , skip : false ) do
114114 ( 'A' ...'Z' ) . step { |s | s . downcase }
115115 ( 'A' ...'Z' ) . step ( 2 ) { |s | s . downcase }
116116 end
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def setup
2323end
2424
2525module VersionHelper
26- def if_ruby ( range )
26+ def if_ruby ( range , skip : true )
2727 r = Range . new (
2828 range . begin &.yield_self { |b | Gem ::Version . new ( b ) } ,
2929 range . end &.yield_self { |e | Gem ::Version . new ( e ) } ,
@@ -33,27 +33,17 @@ def if_ruby(range)
3333 if r === Gem ::Version . new ( RUBY_VERSION )
3434 yield
3535 else
36- notify "Skipping test: #{ r } !== #{ RUBY_VERSION } "
36+ if skip
37+ notify "Skipping test: #{ r } !== #{ RUBY_VERSION } "
38+ end
3739 end
3840 end
39-
40- def if_ruby3 ( &block )
41- if_ruby ( "3.0.0" ..."4.0.0" , &block )
42- end
43-
44- def if_ruby30 ( &block )
45- if_ruby ( "3.0.0" ..."3.1.0" , &block )
46- end
47-
48- def if_ruby31 ( &block )
49- if_ruby ( "3.1.0" ..."3.2.0" , &block )
50- end
5141end
5242
5343module WithStdlibAliases
5444 def with_timeout ( seconds : 1 , nanoseconds : 0 )
5545 unless block_given?
56- return RBS ::UnitTest ::Convertibles :: WithAliases ::WithEnum . new (
46+ return RBS ::UnitTest ::WithAliases ::WithEnum . new (
5747 to_enum ( __method__ , seconds : seconds , nanoseconds : nanoseconds )
5848 )
5949 end
You can’t perform that action at this time.
0 commit comments