Sha256: c2b5713751f5d0fa41726ad6f8cf3b664e91f846ef2756cb5e59bfa2f5a3a1d9
Contents?: true
Size: 675 Bytes
Versions: 1
Compression:
Stored size: 675 Bytes
Contents
module DataMapper module Matchers class HaveOne def initialize(child) @child = child end def matches?(parent) @parent = parent relation = @parent.relationships[@child.to_s] relation and relation.is_a?(DataMapper::Associations::OneToOne::Relationship) and relation.parent_model == parent end def failure_message "expected to have one #{@child}" end def negative_failure_message "expected not to have one #{@child}" end def description "has one #{@child}" end end def have_one(name) HaveOne.new(name) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dm-rspec-0.1.2 | lib/dm/matchers/have_one.rb |