Skip to content

Loading…

[minor] improved documentation for change method #51

Closed
wants to merge 1 commit into from

2 participants

@joliss

The documentation for change confused me, so I added a paragraph at the bottom:

# :call-seq:
#   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)
#
# Allows you to specify that a Proc will cause some value to change.
#
# You can either pass <tt>receiver</tt> and <tt>message</tt>, or a block,
# but not both.

There's an obscure feature that lets you write change(nil, 'my result') { ... } to get a custom message, but I don't think it's worth cluttering the docs with this.

This is my first pull request ever -- let me know if I'm doing it right, please! :-)

@joliss

improved documentation for change method

@dchelimsky
RSpec member

@Jo - you did this perfectly! Thanks. You also drew my attention to the docs, so I made some further changes in the next commit: 9059239. Please let me know if you think it helps clarify things.

@joliss

Cool, thank you so much! Yes, I think it looks much clearer now. :)

@dchelimsky
RSpec member

Great. Please feel free to submit more documentation patches like this. RSpec's documentation (or lack thereof) is probably the biggest pain point for newbies and people upgrading from RSpec 1 to RSpec 2, so any help improving that situation is much appreciated.

@kchien kchien pushed a commit to kchien/rspec-expectations that referenced this pull request
@joliss joliss improved documentation for change method
- Closes #51.
9a704ea
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 19, 2010
  1. @joliss
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/rspec/matchers/change.rb
View
3 lib/rspec/matchers/change.rb
@@ -130,6 +130,9 @@ def matches_max?
#
# Allows you to specify that a Proc will cause some value to change.
#
+ # You can either pass <tt>receiver</tt> and <tt>message</tt>, or a block,
+ # but not both.
+ #
# == Examples
#
# lambda {
Something went wrong with that request. Please try again.