It's a bit hard to determine what structure you're attempting to achieve
here, but it's a scoping problem you have here.

Ruby's @ variables are either class or instance level depending on where
you set them.

Inside a describe or a context you are at class level, inside an it or
before hook you are at instance level.

If you truly want only one watir browser instance I would probably assign
it to a module rather than relying on a file level local variable, and
access it that way e.g.

module Watir
  def self.browser
    @browser ||= ... #assign browser here
  end
end

Call Watir.browser to instaniate it, then call the same to access it
wherever you want. You could assign this to a let for convience.

Cheers
Jon

-- 
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/CAEGxe4stVbyXkxEeyi99AwC9G3YSVk8K%3DSrOTbAhQ--yHw3EvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to