guard / guard-rspec

Guard::RSpec automatically run your specs (much like autotest)

Home Page:https://rubygems.org/gems/guard-rspec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'Guard::RSpec cannot open results file' when SPEC_OPTS has been set

Jamedjo opened this issue · comments

Problem

Related to #348, #326 and #348

I was unable have guard detect more that one change because Guard was terminating the runner with Guard::RSpec has just been fired every time. I eventually worked out this was due to the SPEC_OPTS environment variable having been set in our docker container.

Possible solutions

First I think we should catch this error and show a warning instead of terminating, since it has been a problem in the past with multiple causes and prevents the use of this library.

To solve this particular cause we could unset the SPEC_OPS variable when spawning the new process.

Error

11:44:51 - ERROR - Guard::RSpec cannot open results file: "/home/git/gitlab/tmp/rspec_guard_result". This is likely a bugso please report this at http://github.com/guard/guard-rspec/issues/new along with as muchinformation as possible to reproduce this issue.
11:44:51 - ERROR - Guard::RSpec failed to achieve its <run_on_modifications>, exception was:
> [#] Errno::ENOENT: No such file or directory @ rb_sysopen - /home/git/gitlab/tmp/rspec_guard_result
> [#] /data/cache/bundle-2.5/gems/guard-rspec-4.7.3/lib/guard/rspec/results.rb:11:in `readlines'