[rspec-devel] [ rspec-Patches-15565 ] [PATCH] Adding support for by_at_least/by_at_most in Change matcher.

noreply at rubyforge.org noreply at rubyforge.org
Sun Nov 18 20:12:15 EST 2007


Patches item #15565, was opened at 2007-11-11 22:52
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=15565&group_id=797

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Saimon Moore (saimon)
Assigned to: Nobody (None)
Summary: [PATCH] Adding support for by_at_least/by_at_most in Change matcher. 

Initial Comment:
Added the following methods to Spec::Matchers:Change

def by_at_least(minimum);...end 

def by_at_most(maximum);...end

Example specs:

  it "should pass when attribute is changed by greater than the expected amount" do
    lambda { @instance.some_value += 2 }.should change(@instance, :some_value).by_at_least(1)
  end

  it "should pass when attribute is changed by less than the expected amount" do
    lambda { @instance.some_value += 2 }.should change(@instance, :some_value).by_at_most(3)
  end

Patch has full specs and updated documentation.


----------------------------------------------------------------------

Comment By: Chad Humphries (spicycode)
Date: 2007-11-18 20:12

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/14-15565-patch-adding-support-for-by_at_least-by_at_most-in-change-matcher

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=15565&group_id=797


More information about the rspec-devel mailing list