lib/fakefs/fileutils.rb in fakefs-0.14.3 vs lib/fakefs/fileutils.rb in fakefs-0.15.0
- old
+ new
@@ -189,11 +189,11 @@
end
if File.directory?(dest_path)
raise Errno::EEXIST, dest_path unless options[:force]
elsif File.directory?(File.dirname(dest_path))
FileSystem.delete(dest_path)
- FileSystem.add(dest_path, target.entry.clone)
FileSystem.delete(path)
+ FileSystem.add(dest_path, target.entry.clone)
else
raise Errno::ENOENT, dest_path unless options[:force]
end
else
raise Errno::ENOENT, path