Browse files

tweak README (expect syntax)

  • Loading branch information...
1 parent ebd8a4c commit d5417f9a9071a862b4ccee8fb7da03374f0c07be @dchelimsky dchelimsky committed Jul 10, 2012
Showing with 13 additions and 15 deletions.
  1. +13 −15
@@ -189,36 +189,34 @@ RSpec.configure do |config|
+for more information.
### Motivation for `expect`
We added the `expect` syntax to resolve some edge case issues, most notably
that objects whose definitions wipe out all but a few methods were throwing
`should` and `should_not` away. `expect` solves that by not monkey patching
-`Object` (or `Kernel`).
+those methods onto `Kernel` (or any global object).
+for a detailed explanation.
### One-liners
-The one-liner syntax supported by rspec-core uses `should` even when
-`config.syntax = :expect`:
+The one-liner syntax supported by
+[rspec-core]( uses `should` even when
+`config.syntax = :expect`. It reads better than the alternative, and does not
+require a global monkey patch:
describe User do
it { should validate_presence_of :email }
-Even though it uses a different word, it reads better than the alternative:
-it { expect validate_presence_of :email }
-for more information.
## Also see
* [](

0 comments on commit d5417f9

Please sign in to comment.