lib/dm/matchers/have_property.rb in dm-rspec-0.1.2 vs lib/dm/matchers/have_property.rb in dm-rspec-0.2.0
- old
+ new
@@ -5,10 +5,11 @@
def initialize(property)
@property = property.to_sym
end
def matches?(model)
- model.properties.map(&:name).include? @property
+ model_class = model.is_a?(Class) ? model : model.class
+ model_class.properties.map(&:name).include? @property
end
def failure_message
"expected to have property #{@property}"
end