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 }
end
The expect-syntax works, but the One-Liner-Syntax does NOT work out of the box. Do I have to activate the "shoulda gem" form thougtbot?
Myron Marston
unread,
Dec 13, 2012, 10:42:37 AM12/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rspec
The syntax itself (e.g. `it { should <matcher> }`) works just fine.
The `validate_presence_of` matcher is from shoulda, though.
On Dec 6, 2:18 pm, netzfisch <tj2...@gmail.com> wrote:
> The the rspec-expectations documentation