lib/remarkable/dsl/assertions.rb in remarkable-3.0.1 vs lib/remarkable/dsl/assertions.rb in remarkable-3.0.2

- old
+ new

@@ -62,16 +62,16 @@ args = names.dup @matcher_arguments[:names] = names if collection = options.delete(:collection) - @matcher_arguments[:collection] = collection - + @matcher_arguments[:collection] = collection + if options[:as] - @matcher_arguments[:as] = options.delete(:as) - else - raise ArgumentError, 'You gave me :collection as option but have not give me :as as well' + @matcher_arguments[:as] = options.delete(:as) + else + raise ArgumentError, 'You gave me :collection as option but have not give me :as as well' end args << "*#{collection}" get_options = "#{collection}.extract_options!" set_collection = "@#{collection} = #{collection}" @@ -145,20 +145,20 @@ # allow_blank: allowed the value to be blank # # Or you can set the message in the instance variable @expectation in the # assertion method if you don't want to rely on I18n API. # - # As you might have noticed from the examples above, this method is also + # As you might have noticed from the examples above, this method is also # aliased as <tt>collection_assertion</tt>. # def collection_assertions(*methods, &block) define_method methods.last, &block if block_given? @matcher_collection_assertions += methods end alias :collection_assertion :collection_assertions - # In contrast to <tt>collection_assertions</tt>, the methods given here - # are called just once. In other words, it does not iterate through the + # In contrast to <tt>collection_assertions</tt>, the methods given here + # are called just once. In other words, it does not iterate through the # collection given in arguments. # # It also accepts blocks and is aliased as assertion. # def assertions(*methods, &block)