lib/spec/matchers/change.rb in dchelimsky-rspec-1.1.12 vs lib/spec/matchers/change.rb in dchelimsky-rspec-1.1.99.1
- old
+ new
@@ -3,13 +3,11 @@
#Based on patch from Wilson Bilkovich
class Change #:nodoc:
def initialize(receiver=nil, message=nil, &block)
@message = message || "result"
- @value_proc = block || lambda {
- receiver.__send__(message)
- }
+ @value_proc = block || lambda {receiver.__send__(message)}
end
def matches?(event_proc)
raise_block_syntax_error if block_given?
@@ -81,9 +79,13 @@
end
def from (from)
@from = from
self
+ end
+
+ def description
+ "change ##{@message}"
end
end
# :call-seq:
# should change(receiver, message, &block)