Skip to content

Commit

Permalink
Fix error message expectations in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Feb 5, 2024
1 parent 685f434 commit fefcb98
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/rbi/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,11 @@ def test_parse_errors
def bar
RBI
end
assert_equal("cannot parse the expression. expected an `end` to close the `def` statement.", e.message)
assert_equal(
"unexpected end of file, assuming it is closing the parent top level context. expected an `end` " \
"to close the `def` statement.",
e.message,
)
assert_equal("-:2:0", e.location.to_s)

e = assert_raises(ParseError) do
Expand Down Expand Up @@ -942,7 +946,11 @@ class Foo
e = assert_raises(ParseError) do
Parser.parse_file(path)
end
assert_equal("cannot parse the expression. expected an `end` to close the `class` statement.", e.message)
assert_equal(
"unexpected end of file, assuming it is closing the parent top level context. expected an `end` " \
"to close the `class` statement.",
e.message,
)
assert_equal("test_parse_real_file_with_error.rbi:2:0", e.location.to_s)

FileUtils.rm_rf(path)
Expand Down

0 comments on commit fefcb98

Please sign in to comment.