Sha256: dce46ec055bbbfb6bfda1bce1f3626697818740191ceb1f1c558d28a8e3bfcff
Contents?: true
Size: 468 Bytes
Versions: 14
Compression:
Stored size: 468 Bytes
Contents
require "rspec/expectations" RSpec::Matchers.define :satisfies_schema do |expected| match do |actual| @check = expected.call actual @check.success? end failure_message do |actual| msg = "expected that given hash will fit the schema.\n" @check.errors.each do |item| item.path.each do |path| msg += "#{path}." end msg = msg.delete_suffix(".") msg += ": #{item.text}\n" end return msg end end
Version data entries
14 entries across 14 versions & 1 rubygems