Is it currently possible to define the JSON patterns outside of a test?
I've tried to define my patterns in a module in spec/support/json_patterns.rb, but have not been able to do so successfully. It would be nice to be able to have them all together so the patterns don't take up space in the tests.
Also, you'd be able to do something like.
module JsonPatterns
class Person
self.pattern = {
id: :person_id,
first_name: String,
last_name: String,
created_at: wildcard_matcher,
updated_at: wildcard_matcher
}
end
class Family
self.pattern = {
id: :family_id,
father: Person.pattern,
mother: Person.pattern,
....
}
end
end
Is it currently possible to define the JSON patterns outside of a test?
I've tried to define my patterns in a module in spec/support/json_patterns.rb, but have not been able to do so successfully. It would be nice to be able to have them all together so the patterns don't take up space in the tests.
Also, you'd be able to do something like.