lib/mspec/helpers/fs.rb in mspec-1.5.20 vs lib/mspec/helpers/fs.rb in mspec-1.5.21
- old
+ new
@@ -36,16 +36,16 @@
unless path[0, prefix.size] == prefix
raise ArgumentError, "#{path} is not prefixed by #{prefix}"
end
# File.symlink? needs to be checked first as
- # File.exists? returns false for dangling symlinks
+ # File.exist? returns false for dangling symlinks
if File.symlink? path
File.unlink path
elsif File.directory? path
Dir.entries(path).each { |x| rm_r "#{path}/#{x}" unless x =~ /^\.\.?$/ }
Dir.rmdir path
- elsif File.exists? path
+ elsif File.exist? path
File.delete path
end
end
end