Module: MiniTest::Assertions

Defined in:
lib/fog/test_helpers/minitest/assertions.rb

Instance Method Summary collapse

Instance Method Details

#assert_match_schema(actual, schema, message = nil, options = {}) ⇒ Object

Compares a hash’s structure against a reference schema hash and returns true when they match. Fog::Schema::Datavalidator is used for the validation.



6
7
8
9
10
# File 'lib/fog/test_helpers/minitest/assertions.rb', line 6

def assert_match_schema(actual, schema, message = nil, options = {})
  validator = Fog::Schema::DataValidator.new
  message = "expected:\n #{actual}\nto be equivalent of:\n#{schema}"
  assert(validator.validate(actual, schema, options), message)
end