aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-29 07:03:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-29 07:03:11 +0000
commit72922eabff967d07d5a9a90815759973a690c328 (patch)
tree9ec1c18d9efb09f76e8c51db9e4cb921bb0d2e58 /spec
parentbe4be90ea31ac0579b301cdd5983e3d520c0fb30 (diff)
downloadruby-72922eabff967d07d5a9a90815759973a690c328.tar.gz
fix up r58952
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): rescue File.stat when the target does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r--spec/mspec/lib/mspec/helpers/fs.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/mspec/lib/mspec/helpers/fs.rb b/spec/mspec/lib/mspec/helpers/fs.rb
index e842896126..5a9c3bdba1 100644
--- a/spec/mspec/lib/mspec/helpers/fs.rb
+++ b/spec/mspec/lib/mspec/helpers/fs.rb
@@ -17,12 +17,12 @@ class Object
parts.each do |part|
name = File.join name, part
- stat = File.stat name
- if stat.file?
+ stat = File.stat name rescue nil
+ if stat and stat.file?
raise ArgumentError, "path component of #{path} is a file"
end
- unless stat.directory?
+ unless stat and stat.directory?
begin
Dir.mkdir name
rescue Errno::EEXIST