--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Allows you to specify that a Proc will cause some value to change.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  lambda {\n    team.add_player(player)\n  }.should change(roster, :count)\n\n  lambda {\n    team.add_player(player)\n  }.should change(roster, :count).by(1)\n\n  lambda {\n    team.add_player(player)\n  }.should change(roster, :count).by_at_least(1)\n\n  lambda {\n    team.add_player(player)\n  }.should change(roster, :count).by_at_most(1)\n\n  string = &quot;string&quot;\n  lambda {\n    string.reverse\n  }.should change { string }.from(&quot;string&quot;).to(&quot;gnirts&quot;)\n\n  lambda {\n    person.happy_birthday\n  }.should change(person, :birthday).from(32).to(33)\n\n  lambda {\n    employee.develop_great_new_social_networking_app\n  }.should change(employee, :title).from(&quot;Mail Clerk&quot;).to(&quot;CEO&quot;)\n"
- !ruby/struct:SM::Flow::P 
  body: Evaluates +receiver.message+ or <tt>block</tt> before and after it evaluates the c object (generated by the lambdas in the examples above).
- !ruby/struct:SM::Flow::P 
  body: Then compares the values before and after the +receiver.message+ and evaluates the difference compared to the expected difference.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Warning
- !ruby/struct:SM::Flow::P 
  body: <tt>should_not</tt> <tt>change</tt> only supports the form with no subsequent calls to <tt>by</tt>, <tt>by_at_least</tt>, <tt>by_at_most</tt>, <tt>to</tt> or <tt>from</tt>.
- !ruby/struct:SM::Flow::P 
  body: blocks passed to <tt>should</tt> <tt>change</tt> and <tt>should_not</tt> <tt>change</tt> must use the <tt>{}</tt> form (<tt>do/end</tt> is not supported)
full_name: Spec::Matchers#change
is_singleton: false
name: change
params: |
  should change(receiver, message, &block)
  should change(receiver, message, &block).by(value)
  should change(receiver, message, &block).from(old).to(new)
  should_not change(receiver, message, &block)

visibility: public
