Sha256: 24d10e3bd358fcec89cb0b984be57458c6c03b0fa853c67ffc7a08102616aff8

Contents?: true

Size: 486 Bytes

Versions: 23

Compression:

Stored size: 486 Bytes

Contents

require 'spec_helper'

RSpec::Matchers.define :define_attribute do |attribute|
  match do |entity_klass|
    entity = entity_klass.new 'entity'
    entity.respond_to?(attribute) &&
    entity.respond_to?("#{ attribute }=")
  end

  failure_message do |entity_klass|
    "#{ entity_klass.class } does not define attribute #{ attribute.inspect }"
  end

  failure_message_when_negated do |entity_klass|
    "#{ entity_klass.class } does define attribute #{ attribute.inspect }"
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
json-schema_builder-0.8.2 spec/support/attribute_matcher.rb
json-schema_builder-0.8.1 spec/support/attribute_matcher.rb
json-schema_builder-0.8.0 spec/support/attribute_matcher.rb
json-schema_builder-0.7.1 spec/support/attribute_matcher.rb
json-schema_builder-0.7.0 spec/support/attribute_matcher.rb
json-schema_builder-0.6.1 spec/support/attribute_matcher.rb
json-schema_builder-0.6.0 spec/support/attribute_matcher.rb
json-schema_builder-0.5.0 spec/support/attribute_matcher.rb
json-schema_builder-0.4.0 spec/support/attribute_matcher.rb
json-schema_builder-0.3.1 spec/support/attribute_matcher.rb
json-schema_builder-0.3.0 spec/support/attribute_matcher.rb
json-schema_builder-0.2.1 spec/support/attribute_matcher.rb
json-schema_builder-0.2.0 spec/support/attribute_matcher.rb
json-schema_builder-0.1.0 spec/support/attribute_matcher.rb
json-schema_builder-0.0.9 spec/support/attribute_matcher.rb
json-schema_builder-0.0.8 spec/support/attribute_matcher.rb
json-schema_builder-0.0.7 spec/support/attribute_matcher.rb
json-schema_builder-0.0.6 spec/support/attribute_matcher.rb
json-schema_builder-0.0.5 spec/support/attribute_matcher.rb
json-schema_builder-0.0.4 spec/support/attribute_matcher.rb