Skip to content

Commit 10979b8

Browse files
committed
Ruby 4.1 changed source_location type
1 parent e34dbcf commit 10979b8

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

test/stdlib/Method_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,10 @@ def test_receiver
154154
end
155155

156156
def test_source_location
157-
assert_send_type '() -> [String, Integer]',
158-
METHOD, :source_location
157+
if_ruby(..."4.1") do
158+
assert_send_type '() -> [String, Integer]',
159+
METHOD, :source_location
160+
end
159161
assert_send_type '() -> nil',
160162
method(:__id__), :source_location
161163
end

test/stdlib/Proc_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ def test_parameters
139139
end
140140

141141
def test_source_location
142-
assert_send_type '() -> [String, Integer]',
143-
proc{}, :source_location
142+
if_ruby(..."4.1") do
143+
assert_send_type '() -> [String, Integer]',
144+
proc{}, :source_location
145+
end
144146
assert_send_type '() -> nil',
145147
Proc.new(&Kernel.method(:print)), :source_location
146148
end

test/stdlib/UnboundMethod_test.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ def test_parameters
8989
end
9090

9191
def test_source_location
92-
assert_send_type '() -> [String, Integer]?',
93-
UMETH, :source_location
94-
assert_send_type '() -> [String, Integer]?',
95-
ParamMeths.instance_method(:leading_optional), :source_location
92+
if_ruby(..."4.1") do
93+
assert_send_type '() -> [String, Integer]?',
94+
UMETH, :source_location
95+
assert_send_type '() -> [String, Integer]?',
96+
ParamMeths.instance_method(:leading_optional), :source_location
97+
end
9698
end
9799

98100
def test_super_method

0 commit comments

Comments
 (0)