Skip to content
Browse files

Added docs for .with_any_args.

Closes #10
  • Loading branch information...
1 parent 0d8cde3 commit 7d283d0bb48b7a2ef001b03095732cfa1bdeab1d Brian Takita committed Oct 18, 2009
Showing with 9 additions and 0 deletions.
  1. +9 −0 README.rdoc
View
9 README.rdoc
@@ -140,6 +140,15 @@ When the method is called "Information" is returned.
view = controller.template
mock(view).render(:partial => "user_info") {"Information"}
+You can also allow any number of arguments to be passed into the mock by using:
+ mock(view).render.with_any_args.twice do |*args|
+ if args.first == {:partial => "user_info}
+ "User Info"
+ else
+ "Stuff in the view #{args.inspect}"
+ end
+ end
+
=== stub
stub replaces the method on the object with only an implementation. You
can still use arguments to differentiate which stub gets invoked.

0 comments on commit 7d283d0

Please sign in to comment.
Something went wrong with that request. Please try again.