Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #25 from nurse/delete_temp_dir_only_by_main_process

Delete SPEC_TEMP_DIR only by main process.
  • Loading branch information...
commit 1852dc783135155ce36298d50d8b18cf95a02668 2 parents 8a0be99 + 53e64e6
@brixen brixen authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/mspec/helpers/tmp.rb
View
6 lib/mspec/helpers/tmp.rb
@@ -7,9 +7,13 @@
SPEC_TEMP_UNIQUIFIER = "0"
+SPEC_TMEM_DIR_PID = Process.pid
+
at_exit do
begin
- Dir.delete SPEC_TEMP_DIR if File.directory? SPEC_TEMP_DIR
+ if SPEC_TMEM_DIR_PID == Process.pid
+ Dir.delete SPEC_TEMP_DIR if File.directory? SPEC_TEMP_DIR
+ end
rescue SystemCallError
STDERR.puts <<-EOM
Please sign in to comment.
Something went wrong with that request. Please try again.