summaryrefslogtreecommitdiff
path: root/spec/ruby/shared/file
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-29 14:38:03 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-29 15:28:40 +0900
commit32e7d9140eb2bc9890a690fd62bf1690ee8fd5e3 (patch)
treee3c8bb1ca46d99d725b79c61eaf1e5d3383ac9e5 /spec/ruby/shared/file
parent56d6cfe88ae355a089a164f351dcd7f2112cf852 (diff)
[ruby/spec] Temporary directories should be under the mock_dir
Diffstat (limited to 'spec/ruby/shared/file')
-rw-r--r--spec/ruby/shared/file/world_readable.rb2
-rw-r--r--spec/ruby/shared/file/world_writable.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/shared/file/world_readable.rb b/spec/ruby/shared/file/world_readable.rb
index 85761e633f..c2c6264627 100644
--- a/spec/ruby/shared/file/world_readable.rb
+++ b/spec/ruby/shared/file/world_readable.rb
@@ -35,7 +35,7 @@ describe :file_world_readable, shared: true do
end
it "returns a Fixnum if the file is a directory and chmod 644" do
- dir = rand().to_s + '-ww'
+ dir = tmp(rand().to_s + '-ww')
Dir.mkdir(dir)
Dir.should.exist?(dir)
File.chmod(0644, dir)
diff --git a/spec/ruby/shared/file/world_writable.rb b/spec/ruby/shared/file/world_writable.rb
index 61b691bcb6..84d7deb5d3 100644
--- a/spec/ruby/shared/file/world_writable.rb
+++ b/spec/ruby/shared/file/world_writable.rb
@@ -34,7 +34,7 @@ describe :file_world_writable, shared: true do
end
it "returns a Fixnum if the file is a directory and chmod 777" do
- dir = rand().to_s + '-ww'
+ dir = tmp(rand().to_s + '-ww')
Dir.mkdir(dir)
Dir.should.exist?(dir)
File.chmod(0777, dir)