More playing with RSpec-Rails.
I’ve noticed that I do not have access to the @request object in before
(:all) but do in before(:each)
Is this expected behavior?
More playing with RSpec-Rails.
I’ve noticed that I do not have access to the @request object in before
(:all) but do in before(:each)
Is this expected behavior?
On Oct 28, 2009, at 2:05 PM, Brian C. wrote:
More playing with RSpec-Rails.
I’ve noticed that I do not have access to the @request object in
before
(:all) but do in before(:each)Is this expected behavior?
Yes. In general, before(:all) is intended for setting global state and
should only be used for expensive operations like setting up databases
and network connections. It is true that instance variables created in
a before(:all) block are copied to each example, but they do not have
access to the things that are generated per-example, like the request
object.
HTH,
David
Thanks again Dave. I’m slowly learning the world of Rspec
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs