lib/dm/matchers/have_many.rb in dm-rspec-0.0.2 vs lib/dm/matchers/have_many.rb in dm-rspec-0.1.0
- old
+ new
@@ -13,9 +13,15 @@
relation and
relation.is_a?(DataMapper::Associations::OneToMany::Relationship) and
relation.parent_model == parent
end
+ # called only when the next syntax is used:
+ # Book.should have_many(:tags).trough(:tagging)
+ def through(broker)
+ HaveManyThrough.new(@children, broker)
+ end
+
def failure_message
"expected to have many #{@children}"
end
def negative_failure_message