lib/micronaut/matchers/respond_to.rb in spicycode-micronaut-0.1.2 vs lib/micronaut/matchers/respond_to.rb in spicycode-micronaut-0.1.3

- old
+ new

@@ -1,9 +1,10 @@ module Micronaut module Matchers class RespondTo #:nodoc: + def initialize(*names) @names = names @names_not_responded_to = [] end @@ -12,11 +13,11 @@ @names.each do |name| unless given.respond_to?(name) @names_not_responded_to << name end end - return @names_not_responded_to.empty? + @names_not_responded_to.empty? end def failure_message "expected #{@given.inspect} to respond to #{@names_not_responded_to.collect {|name| name.inspect }.join(', ')}" end @@ -27,10 +28,11 @@ def description # Ruby 1.9 returns the same thing for array.to_s as array.inspect, so just use array.inspect here "respond to #{@names.inspect}" end + end # :call-seq: # should respond_to(*names) # should_not respond_to(*names) @@ -41,7 +43,8 @@ # == Examples # def respond_to(*names) Matchers::RespondTo.new(*names) end + end end