lib/remarkable/dsl/assertions.rb in remarkable-3.0.0 vs lib/remarkable/dsl/assertions.rb in remarkable-3.0.1
- old
+ new
@@ -22,11 +22,11 @@
# @product.should validate_presence_of(:title, :name)
#
# validate_presence_of is a matcher declared as:
#
# class ValidatePresenceOfMatcher < Remarkable::Base
- # arguments :collection => :attributes
+ # arguments :collection => :attributes, :as => :attribute
# end
#
# In this case, Remarkable provides an API that enables you to easily
# assert each item of the collection. Let's check more examples:
#
@@ -105,11 +105,11 @@
# iterate through the whole collection given in <tt>:arguments</tt>.
#
# For example, validate_presence_of can be written as:
#
# class ValidatePresenceOfMatcher < Remarkable::Base
- # arguments :collection => :attributes
+ # arguments :collection => :attributes, :as => :attribute
# collection_assertions :allow_nil?
#
# protected
# def allow_nil?
# # matcher logic
@@ -166,11 +166,10 @@
define_method methods.last, &block if block_given?
@matcher_single_assertions += methods
end
alias :assertion :assertions
- # Class method that accepts a block or a Hash that will overwrite
- # instance method default_options.
+ # Class method that accepts a block or a hash to set matcher's default options.
#
def default_options(hash = {}, &block)
if block_given?
define_method :default_options, &block
else