Created Fog::Schema::DataValidator to contain the matching logic for the
data based schemas used by the tests.
This is tested in isolation and removes dependency on Shindo. Also
exposes a #message call to get the last message set by the validator to
avoid coupling the test output to the internals.
Tests for the #data_matches_schema helper are added as well.
* Adds and documents Shindo::Tests#data_matches_schema
* Deprecates Shindo::Tests#format method
* Strict mode is replace by expandable options
* Uses Fog::Logger instead of p for debug output
* Shindo::Tests#formats_kernel removed (was private)
* Shindo::Tests#confirm_data_matches_schema added
* #confirm_data_matches_schema uses yield
Related to issue #1477
Shindo::Tests#formats incorrectly treated missing keys as valid if their
value is allowed to be "nullable" or NilClass. These keys are not
optional. They are required but can be the value nil or the Nullable
class.
Unfortunately due to lack of documentation and a bug in the code the
current Nullable classes can be interpreted as optional and work as such.
This replaces the old format checker with a new version that supports
options to control the matching behaviour related to extra keys in
either the data or the schema.
This corrects the behaviour so extra keys in either the schema or the
supplied data fail the check unless non strict has been used.
A legacy version of the #formats test is in place that passes the
options so it behaves as the old version does.
Premptive patches have been added to fix those tests that were already
broken but passed the original checks.