The only difference between rspec and rspec path/to/file is that rspec
loads all files matching the default pattern (spec/**/*_spec.rb) where as rspec
path/to/file loads only the specified file. I suspect that when you run rspec
path/to/file you might not be using bundler to manage and isolate your load
path, whereas raw rspec is probably booting rails and loading using
bundler. If watir is installed as a system gem but is not in your bundle
then this behavior would make sense.

HTH,
Myron
​

On Tue, Dec 20, 2016 at 2:55 PM, Artie <[email protected]> wrote:

> Hello!
>
> Maybe somebody with more experience can see what's up with the different
> invocations of rspec?
>
> I set up a new Rails app environment and noticed that when I run `rspec`
> alone on the command like I get a complaint from rails active_support:
>
>    active_support/dependencies.rb cannot load such a file -- watir
> (LoadError)
>
> for which, in the traceback, line 3 of watir_smoketest_spec.rb is
> specified as the culprit:
>     require 'watir'
>
> Yet, when I turn rspec with a argument:
>    `rspec spec/features/watir_smoketest_spec.rb`
>
> Watir is found and browser windows start popping up, executing the code
> stored in 'spec/features/watir_smoketest_spec.rb'; which is the example
> Google search from the Watir home page.
>
> Why is there such a striking difference in behavior? What can I learn from
> this?
>
> What article/doc should I be reading? :)
>
> Thank you for reading and wanting to help.
>
> --az
>
> --
> 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/1260462d-af2f-4fc9-9ef3-ef6579fac77f%40googlegroups.com
> <https://groups.google.com/d/msgid/rspec/1260462d-af2f-4fc9-9ef3-ef6579fac77f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CADUxQmumUFMKz1jcd%3Dg1fkH0w%2Bt8rT0v%2BO3Pw5nKJk_Xp0kr7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to