Sha256: e1f15ac93856b590b977190601521684cb16a139f81211d3f29d144ff17109ea

Contents?: true

Size: 329 Bytes

Versions: 25

Compression:

Stored size: 329 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"
    msg + @check.messages.map { |k,v| "#{k}: #{v}" }.join("\n")
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pubnub-4.0.27 spec/spec_expectations.rb
pubnub-4.0.25 spec/spec_expectations.rb
pubnub-4.0.23 spec/spec_expectations.rb
pubnub-4.0.22 spec/spec_expectations.rb
pubnub-4.0.21 spec/spec_expectations.rb
pubnub-4.0.20 spec/spec_expectations.rb
pubnub-4.0.19 spec/spec_expectations.rb
pubnub-4.0.18 spec/spec_expectations.rb
pubnub-4.0.17 spec/spec_expectations.rb
pubnub-4.0.16 spec/spec_expectations.rb
pubnub-4.0.15 spec/spec_expectations.rb
pubnub-4.0.14 spec/spec_expectations.rb
pubnub-4.0.13 spec/spec_expectations.rb
pubnub-4.0.12 spec/spec_expectations.rb
pubnub-4.0.9 spec/spec_expectations.rb
pubnub-4.0.8 spec/spec_expectations.rb
pubnub-4.0.7 spec/spec_expectations.rb
pubnub-4.0.6 spec/spec_expectations.rb
pubnub-4.0.5 spec/spec_expectations.rb
pubnub-4.0.4 spec/spec_expectations.rb