-
Notifications
You must be signed in to change notification settings - Fork 240
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
Guard::RSpec has just been fired - tmp/rspec_guard_result error #348
Comments
Also, I saw #326 but I don't use zeus so I figure that doesn't apply to me. |
Generally, using chdir is bad, because then every tool run within the chdir has to rely on absolute paths. rspec has a And even RSpec config files locations are messed up, because you'd have to have .rspec config files your fixtures_root. So in general - do everything you can to avoid rspec_results = File.expand_path('rspec_guard_result')
guard :rspec, results_file: rspec_results do
# (...) Again, avoid using chdir at all costs (unless you're using it for switching projects to run a different, unrelated tool). Think of 'chdir' as just a method to switch projects (and nothing more specific). Symlinks may be a better option, depending on what you need. Otherwise, you can create a small repo with the problem, and I can take a look (otherwise, there's just too much guessing and it's too complex to imagine what could go wrong and how to best fix it). |
Also, if you really need
which isolates the tool without creating problems in the current project. If you're testing a thor app, it's best to run it in a separate process anyway (using |
Thank you @e2! Your suggestion to use this in my
Thank you also for the |
Glad to help :) |
I've got the same error, and I don't use |
@e2 thanks for a quick response! I will |
this can also occur if you inadvertently have 2 instances of guard running (in multiple terminals, for instance). |
@alexdean - it's best to set the results file inside the Guardfile - so that the results file is created within generated temporary directory. That way, every Guard instance will generate a different temporary directory. Or the output file could just have the PID attached. |
Probably unrelated but just as reference, I also got that error
but didn't have to do specifically with guard, as I have this in my guard :rspec, cmd: "bin/rspec" and that bundle binstubs rspec-core --force and that fixed my problem. |
I just returned to a project I left off about 4 weeks ago and suddenly have a weird error message when running specs through guard.
If I run
bundle exec rspec
, everything runs fine without errors.When I run guard, my tests pass/fail as expected, but I get a giant error that pollutes my console at the end each time:
Note about
results_file
: I purposely changed the path, so it would output in the right place. I am testing a thor app, which generates files, so I have in my code:I thought that might be the problem, so I tried adding:
where
fixtures_root
andproject_root
are both working helper methods.Guard/Guard::RSpec still seems to be in the wrong directory because it is creating the
tmp/rspec_guard_result
file in myfixtures
directory.I tried fixing this by adding
results_file: './../../tmp/rspec_guard_result'
to myGuardfile
, which outputs the file in the correcttmp
folder.But the error remains. Anything else I should be trying?
Gem Versions
I ran
bundle update
in case something changed after upgrading to El Capitan in recent weeks and have the following versions install:The text was updated successfully, but these errors were encountered: