Skip to content

Commit

Permalink
Clean up the entire spec temp dir when finished with mock dirs.
Browse files Browse the repository at this point in the history
The mock dirs are created with mkdir_p, so they'll create the spec
temp dir if it doesn't already exist. However, it does so after
changing the umask to 0, which affects the permissions on the spec
temp dir. The spec temp dir is normally not recreated if it already
exists, so these atypical permissions persist after any test using
the mock dirs is finished. The safest thing to do is delete the
entire spec temp dir, since the next spec requiring it will cause
it to be recreated, but this time with the corrected umask.
nirvdrum committed Feb 29, 2016
1 parent 6cc96c1 commit 789e2b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/ruby/core/dir/fixtures/common.rb
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ def self.create_mock_dirs
end

def self.delete_mock_dirs
rm_r mock_dir
rm_r SPEC_TEMP_DIR
end

def self.mock_rmdir(*dirs)

2 comments on commit 789e2b1

@nirvdrum
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eregon Please verify that this is fine to do. All specs pass for me and I can't find a case where it would break anything.

Sorry, something went wrong.

@eregon
Copy link
Member

@eregon eregon commented on 789e2b1 Mar 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nirvdrum Would not changing the umask also fix it?

Sorry, something went wrong.

Please sign in to comment.