Skip to content

Commit 66e99e0

Browse files
authored
Merge pull request #3816 from eregon/fix-location_test
Fix assertions in location_test.rb
2 parents 609c80c + e3df994 commit 66e99e0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/prism/ruby/location_test.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@ def test_join
1313
assert_equal 0, joined.start_offset
1414
assert_equal 10, joined.length
1515

16-
assert_raise(RuntimeError, "Incompatible locations") do
16+
e = assert_raise(RuntimeError) do
1717
argument.location.join(receiver.location)
1818
end
19+
assert_equal "Incompatible locations", e.message
1920

2021
other_argument = Prism.parse_statement("1234 + 567").arguments.arguments.first
2122

22-
assert_raise(RuntimeError, "Incompatible sources") do
23+
e = assert_raise(RuntimeError) do
2324
other_argument.location.join(receiver.location)
2425
end
26+
assert_equal "Incompatible sources", e.message
2527

26-
assert_raise(RuntimeError, "Incompatible sources") do
28+
e = assert_raise(RuntimeError) do
2729
receiver.location.join(other_argument.location)
2830
end
31+
assert_equal "Incompatible sources", e.message
2932
end
3033

3134
def test_character_offsets

0 commit comments

Comments
 (0)