0
0
Fork 0

Add match_json_values and use in AP worker specs (#30720)

This commit is contained in:
Matt Jankowski 2024-06-19 09:46:52 -04:00 committed by GitHub
parent 53776cd58f
commit 84a31319e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 26 additions and 11 deletions

View file

@ -6,3 +6,14 @@ RSpec::Matchers.define :match_json_schema do |schema|
JSON::Validator.validate(schema_path, input_json, validate_schema: true)
end
end
RSpec::Matchers.define :match_json_values do |values|
match do |string|
expect(json_str_to_hash(string))
.to include(values)
end
failure_message do |value|
"expected that #{value} would have the same values as #{values}."
end
end