-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't watch lib folder, only works with spec folder #393
Comments
I finally figured out what this thing was. I had my lib code in two modules and I wanted to test only one so I didn't bother creating module folder in specs. I've had this:
I thought guard will figure out matching spec for file if filename is unique. It got fixed when I moved all my spec files in to Please add this to documentation because I lost 2 days and lots of nerves. Stackoverflow was useless as well. All that could have been avoided if documentation mentioned that spec folder structure must match lib folder structure, which is a pretty unique requirement. Debug output was also very useless. Interactor stopped or got an exception? Message like this would have saved me 2 days:
|
Nevermind. the |
I solved this with the following guard watch command, which watches for files in folders under lib, then runs the corresponding specs in a folder of the same name: watch(/^lib\/(.*)\/.*\.rb/) { |m| "spec/#{m[1]}" } |
I have installed & run
bundle exec guard init rspec
and it seems Guardfile is set wrong because it doesn't catch changes in my lib folder.I also get an exception when I save a file in spec folder, even though tests run.
I have used default Guardfile
How can I inspect what is
rspec.spec_files
?How to make it catch my lib folder?
When I run guard and save file in spec folder I get:
The text was updated successfully, but these errors were encountered: