lib/spec/matchers/has.rb in rspec-1.2.9 vs lib/spec/matchers/has.rb in rspec-1.3.0

- old
+ new

@@ -1,15 +1,15 @@ module Spec module Matchers class Has - def initialize(expected, *args) - @expected, @args = expected, args + def initialize(expected, *args, &block) + @expected, @args, @block = expected, args, block end def matches?(actual) - actual.__send__(predicate(@expected), *@args) + actual.__send__(predicate(@expected), *@args, &@block) end def failure_message_for_should "expected ##{predicate(@expected)}(#{@args[0].inspect}) to return true, got false" end