Add match_json_values
and use in AP worker specs (#30720)
This commit is contained in:
parent
53776cd58f
commit
84a31319e9
6 changed files with 26 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue