Skip to content

Commit c630573

Browse files
committed
Update annoying spec
It seems like the word token is character in some versions of JSON here, we update the message check to not rely on this
1 parent 8fcdc36 commit c630573

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/lib/canvas/checks/valid_json_check_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
it "adds an offense when a file contains invalid json" do
1616
copy_example_directory("vagabond")
1717
subject.run
18-
message = "unexpected token at 'This is an invalid custom type."
18+
message_pattern = /Invalid JSON: .+ - \nunexpected \w+(?:: | at )'This is an invalid custom type\.\n'/
1919

2020
expect(subject.offenses).to match_array(
2121
[
22-
have_attributes(message: include(message.squeeze("\n")))
22+
have_attributes(message: match(message_pattern))
2323
]
2424
)
2525
end

0 commit comments

Comments
 (0)