Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tweak README (expect syntax)

  • Loading branch information...
commit d5417f9a9071a862b4ccee8fb7da03374f0c07be 1 parent ebd8a4c
@dchelimsky dchelimsky authored
Showing with 13 additions and 15 deletions.
  1. +13 −15
@@ -189,17 +189,27 @@ 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
@@ -207,18 +217,6 @@ describe User do
-Even though it uses a different word, it reads better than the alternative:
-it { expect validate_presence_of :email }
-for more information.
## Also see
* [](
Please sign in to comment.
Something went wrong with that request. Please try again.