diff --git a/test/stdlib/Method_test.rb b/test/stdlib/Method_test.rb index d38280f1d..05da1a947 100644 --- a/test/stdlib/Method_test.rb +++ b/test/stdlib/Method_test.rb @@ -154,8 +154,10 @@ def test_receiver end def test_source_location - assert_send_type '() -> [String, Integer]', - METHOD, :source_location + if_ruby(..."4.1") do + assert_send_type '() -> [String, Integer]', + METHOD, :source_location + end assert_send_type '() -> nil', method(:__id__), :source_location end diff --git a/test/stdlib/Proc_test.rb b/test/stdlib/Proc_test.rb index 2ee9fc6ac..481c60535 100644 --- a/test/stdlib/Proc_test.rb +++ b/test/stdlib/Proc_test.rb @@ -139,8 +139,10 @@ def test_parameters end def test_source_location - assert_send_type '() -> [String, Integer]', - proc{}, :source_location + if_ruby(..."4.1") do + assert_send_type '() -> [String, Integer]', + proc{}, :source_location + end assert_send_type '() -> nil', Proc.new(&Kernel.method(:print)), :source_location end diff --git a/test/stdlib/UnboundMethod_test.rb b/test/stdlib/UnboundMethod_test.rb index 8f9f65f13..604c8960f 100644 --- a/test/stdlib/UnboundMethod_test.rb +++ b/test/stdlib/UnboundMethod_test.rb @@ -89,10 +89,12 @@ def test_parameters end def test_source_location - assert_send_type '() -> [String, Integer]?', - UMETH, :source_location - assert_send_type '() -> [String, Integer]?', - ParamMeths.instance_method(:leading_optional), :source_location + if_ruby(..."4.1") do + assert_send_type '() -> [String, Integer]?', + UMETH, :source_location + assert_send_type '() -> [String, Integer]?', + ParamMeths.instance_method(:leading_optional), :source_location + end end def test_super_method