lib/rspec-virtus/matcher.rb in rspec-virtus-1.0.0 vs lib/rspec-virtus/matcher.rb in rspec-virtus-1.0.1
- old
+ new
@@ -4,10 +4,14 @@
def initialize(attribute_name)
@attribute_name = attribute_name
@options = {}
end
+ def description
+ "have #{@attribute_name} defined"
+ end
+
def of_type(type, options={})
@options[:type] = type
@options[:member_type] = options.delete(:member_type)
self
end
@@ -19,10 +23,10 @@
def failure_message
"expected #{@attribute_name} to be defined"
end
- def negative_failure_message
+ def failure_message_when_negated
"expected #{@attribute_name} not to be defined"
end
private