Skip to content

Commit

Permalink
restore rdoc examples to standard markdown indentation until rdoc.inf…
Browse files Browse the repository at this point in the history
…o supports git-flavored markup
  • Loading branch information
dchelimsky committed Nov 27, 2011
1 parent 75fb857 commit dc295d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ A Test Double is an object that stands in for a real object in a test.
RSpec creates test doubles that support method stubs and message RSpec creates test doubles that support method stubs and message
expectations. expectations.


``` ruby book = double("book")
book = double("book")
```


## Method Stubs ## Method Stubs


Expand Down
8 changes: 3 additions & 5 deletions lib/rspec/mocks/methods.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ def should_not_receive(message, &block)
# #
# @example # @example
# #
# ```ruby # counter.stub(:count).and_return(37)
# counter.stub(:count).and_return(37) # counter.stub(:count => 37)
# counter.stub(:count => 37) # counter.stub(:count) { 37 }
# counter.stub(:count) { 37 }
# ```
def stub(message_or_hash, opts={}, &block) def stub(message_or_hash, opts={}, &block)
if Hash === message_or_hash if Hash === message_or_hash
message_or_hash.each {|message, value| stub(message).and_return value } message_or_hash.each {|message, value| stub(message).and_return value }
Expand Down

0 comments on commit dc295d2

Please sign in to comment.