Skip to content
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

lib/guard/rspec/inspector.rb def _focused_paths: close file before deleting #211

Closed
dwlawrence opened this issue Nov 5, 2013 · 4 comments

Comments

@dwlawrence
Copy link

Using: C:\Ruby19\lib\ruby\gems\1.9.1\gems\guard-rspec-4.0.3\lib\guard\rspec\inspector.rb

on Windows 7 I would get the following error:

ERROR - Guard::RSpec failed to achieve its <run_on_modifications>, exception was: Errno::EACCES: Permission denied - ./tmp/rspec_guard_result

inspector.rb line 51

solution: within def _focused_path close file before deleting

@thibaudgg
Copy link
Member

You should allow write permission on your tmp folder no?

@dwlawrence dwlawrence reopened this Nov 6, 2013
@dwlawrence
Copy link
Author

sorry I wasn't clear... though the error is a "permission denied", it seems to be a locking problem on windows: rspec_gaurd_result is open and therefore can't be deleted. If the file is closed before deleting, it works.

for example:

  def _focused_paths
    return nil unless options[:focus_on_failed]
    f = File.open(FOCUSED_FILE_PATH)
    f.read.split("\n")[0..10]
    f.close
  rescue
    nil
  ensure
    File.exist?(FOCUSED_FILE_PATH) && File.delete(FOCUSED_FILE_PATH)
  end

@thibaudgg
Copy link
Member

Ok I understand now, thanks for the clarification. Please try guard-rspec master, it should have been fixed.

@thibaudgg
Copy link
Member

Should be fixed in 4.0.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants