vendor/plugins/rspec/lib/spec/matchers/change.rb in spree-0.2.0 vs vendor/plugins/rspec/lib/spec/matchers/change.rb in spree-0.4.0
- old
+ new
@@ -112,32 +112,36 @@
# team.add_player(player)
# }.should change(roster, :count).by_at_most(1)
#
# string = "string"
# lambda {
- # string.reverse
+ # string.reverse!
# }.should change { string }.from("string").to("gnirts")
#
# lambda {
# person.happy_birthday
# }.should change(person, :birthday).from(32).to(33)
#
# lambda {
# employee.develop_great_new_social_networking_app
# }.should change(employee, :title).from("Mail Clerk").to("CEO")
#
- # Evaluates +receiver.message+ or +block+ before and
- # after it evaluates the c object (generated by the lambdas in the examples above).
+ # Evaluates <tt>receiver.message</tt> or <tt>block</tt> before and after
+ # it evaluates the c object (generated by the lambdas in the examples
+ # above).
#
- # Then compares the values before and after the +receiver.message+ and
- # evaluates the difference compared to the expected difference.
+ # Then compares the values before and after the <tt>receiver.message</tt>
+ # and evaluates the difference compared to the expected difference.
#
- # == Warning
- # +should_not+ +change+ only supports the form with no subsequent calls to
- # +by+, +by_at_least+, +by_at_most+, +to+ or +from+.
+ # == WARNING
+ # <tt>should_not 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>.
#
- # blocks passed to +should+ +change+ and +should_not+ +change+
- # must use the <tt>{}</tt> form (<tt>do/end</tt> is not supported)
+ # 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).
+ #
def change(target=nil, message=nil, &block)
Matchers::Change.new(target, message, &block)
end
end
end