Skip to content

Commit

Permalink
Documentation changes for should_change
Browse files Browse the repository at this point in the history
  • Loading branch information
jferris committed Jun 9, 2009
1 parent d13a460 commit af142c6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/shoulda/macros.rb
Expand Up @@ -26,9 +26,14 @@ module Macros
#
# Combinations of <tt>:by</tt>, <tt>:from</tt>, and <tt>:to</tt> are allowed:
#
# should_change("the post title") { @post.title } # => assert the value changed in some way
# should_change("the post title", :from => "old") { @post.title } # => assert the value changed to anything other than "old"
# should_change("the post title", :to => "new") { @post.title } # => assert the value changed from anything other than "new"
# # Assert the value changed in some way:
# should_change("the post title") { @post.title }
#
# # Assert the value changed to anything other than "old:"
# should_change("the post title", :from => "old") { @post.title }
#
# # Assert the value changed to "new:"
# should_change("the post title", :to => "new") { @post.title }
def should_change(description, options = {}, &block)
by, from, to = get_options!([options], :by, :from, :to)
stmt = "change #{description}"
Expand Down

0 comments on commit af142c6

Please sign in to comment.