Browse files

relish docs

  • Loading branch information...
1 parent aff2f95 commit e8994a75825e82066d2fc7ecb13a4e416fed6a4b @dchelimsky dchelimsky committed Jun 1, 2011
Showing with 18 additions and 0 deletions.
  1. +1 −0 features/.nav
  2. +17 −0 features/Scope.md
View
1 features/.nav
@@ -1,4 +1,5 @@
- Upgrade.md
+- Scope.md
- Changelog.md
- method_stubs:
- simple_return_value.feature
17 features/Scope.md
@@ -0,0 +1,17 @@
+Doubles, stubs, and message expectations are all cleaned out after each
+example. This ensures that each example can be run in isolation, and in any
+order.
+
+### `before(:each)`
+
+It is perfectly fine to set up doubles, stubs, and message expectations in
+a `before(:each)` hook, as that hook is executed in the scope of the example:
+
+ before(:each) do
+ @account = double('account')
+ end
+
+### Do not create doubles, stubs, or message expectations in `before(:all)`
+
+If you do, they'll get cleaned out after the first example, and you will be
+very confused as to what's going on in the second example.

0 comments on commit e8994a7

Please sign in to comment.