unic / ScalaWebTest

ScalaWebTest is a library for writing ScalaTest/Selenium based integration tests for web applications. It helps you with your basic setup and provides a new and very efficient approach to testing.
https://scalawebtest.org
Apache License 2.0
29 stars 9 forks source link

Add "fits valuesAndAttributes of" and "fits typesAndAttributes of" #94

Closed DaniRey closed 4 years ago

DaniRey commented 5 years ago

It is sometimes interesting to not only test the minimal set of attributes and their values/types contained in the JSON, but also the maximum.

{
 "num": 123,
 "text": "abc"
}

would be valid for

json fits values of """{"num": 123}"""

but it would throw an error with

json fits valuesAndAttributes of """{"num": 123}"""

because it contains the attribute text, which is not part of the gauge.

The same should be true for

json fits types of """{"num": 1}"""

and

json fits typesAndAttributes of """{"num": 1}"""

Alternative name suggestions for valuesAndAttributes and typesAndAttributes are welcome.

DaniRey commented 4 years ago

This is superseeded by #112