> As I understand it:
>
> before(:all) runs the block one time before all of the examples are run.
> before(:each) runs the block one time before each of your specs in the
> file
>
>
> http://stackoverflow.com/questions/16617052/rails-rspec-before-all-vs-before-each
>
>
> @robpark
>
>>
>
But I got the below when I applied *:all*
Arup-iMac:yelloday shreyas$ rspec spec/models/post_spec.rb
...WARNING: let declaration `user1` accessed in a `before(:all)` hook at:
/Users/shreyas/yelloday/spec/models/post_spec.rb:881:in `block (4 levels)
in <top (required)>'
This is deprecated behavior that will not be supported in RSpec 3.
`let` and `subject` declarations are not intended to be called
in a `before(:all)` hook, as they exist to define state that
is reset between each example, while `before(:all)` exists to
define state that is shared across examples in an example group.
WARNING: let declaration `post1` accessed in a `before(:all)` hook at:
/Users/shreyas/yelloday/spec/models/post_spec.rb:881:in `block (4 levels)
in <top (required)>'
This is deprecated behavior that will not be supported in RSpec 3.
`let` and `subject` declarations are not intended to be called
in a `before(:all)` hook, as they exist to define state that
is reset between each example, while `before(:all)` exists to
define state that is shared across examples in an example group.
WARNING: let declaration `user1` accessed in a `before(:all)` hook at:
/Users/shreyas/yelloday/spec/models/post_spec.rb:882:in `block (4 levels)
in <top (required)>'
This is deprecated behavior that will not be supported in RSpec 3.
`let` and `subject` declarations are not intended to be called
in a `before(:all)` hook, as they exist to define state that
is reset between each example, while `before(:all)` exists to
define state that is shared across examples in an example group.
WARNING: let declaration `post2` accessed in a `before(:all)` hook at:
/Users/shreyas/yelloday/spec/models/post_spec.rb:882:in `block (4 levels)
in <top (required)>'
This is deprecated behavior that will not be supported in RSpec 3.
`let` and `subject` declarations are not intended to be called
in a `before(:all)` hook, as they exist to define state that
is reset between each example, while `before(:all)` exists to
define state that is shared across examples in an example group.
...................................................................................................................
Finished in 16.27 seconds
118 examples, 0 failures
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/a1aa5d9e-e2c9-4089-87de-eed932326861%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.