Sha256: c03da15d5240c0fedae2e8f63af7d478caedb16045cdefa6f105ee033a4962c7
Contents?: true
Size: 681 Bytes
Versions: 5
Compression:
Stored size: 681 Bytes
Contents
module DataMapper module Matchers class HaveManyAndBelongTo def initialize(name) @name = name end def matches?(model) @model = model relation = @model.relationships[@name.to_s] relation && relation.is_a?(DataMapper::Associations::ManyToMany::Relationship) end def failure_message "expected to have many and belong to #{@name}" end def negative_failure_message "expected to not have many and belong to #{@name}" end def description "belongs to #{@parent}" end end def have_many_and_belong_to(name) HaveManyAndBelongTo.new(name) end end end
Version data entries
5 entries across 5 versions & 1 rubygems