class Mkspec::Matchers::ChangeMatcher

Public Class Methods

new(obj, method) click to toggle source
# File lib/mkspec/matchers/change_matcher.rb, line 7
def initialize(obj, method)
  @obj = obj
  @method = method
end

Public Instance Methods

by(quantity) click to toggle source
# File lib/mkspec/matchers/change_matcher.rb, line 12
def by(quantity)
  @quantity = quantity
  self
end
match(expectation) click to toggle source
# File lib/mkspec/matchers/change_matcher.rb, line 17
def match(expectation)
  %Q{expect{ #{expectation.action} }.#{expectation.inclination} change(#{@obj}, :count).by(#{@quantity})}
end