[rspec-users] load global variable so I can access in spec files

S Ahmed sahmed1020 at gmail.com
Fri Sep 28 02:16:13 UTC 2012


I do have it in my spec_helper, does it have to be inside the RSpec.config
block?

On Wed, Sep 26, 2012 at 11:17 PM, Andy Lindeman <alindeman at gmail.com> wrote:

> On Wed, Sep 26, 2012 at 10:25 PM, S Ahmed <sahmed1020 at gmail.com> wrote:
> > How can I do this?
>
> If it's truly something that just needs to be loaded once and then is
> used without mutation in any number of tests, you might just set it to
> a constant in spec_helper.rb:
>
> CONFIG = YAML.load("...")
>
> MyClass.new(CONFIG)
>
> --
> Andy Lindeman
> http://www.andylindeman.com/
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120927/eed10879/attachment.html>


More information about the rspec-users mailing list