From eb1cde19f9d634d8fd4e355df8817f2d6279d83c Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Mon, 28 Sep 2009 22:28:38 +0800 Subject: [PATCH] Fileutils has a method ln_sf which forces the creation of a symlink --- lib/fakefs/fileutils.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/fakefs/fileutils.rb b/lib/fakefs/fileutils.rb index d991f65..6c00888 100644 --- a/lib/fakefs/fileutils.rb +++ b/lib/fakefs/fileutils.rb @@ -30,6 +30,12 @@ module FakeFS raise Errno::EEXIST, path if FileSystem.find(path) FileSystem.add(path, FakeSymlink.new(target)) end + def ln_sf(target, path) + FileSystem.delete(path) + FileSystem.add(path, FakeSymlink.new(target)) + end + + def cp(src, dest) dst_file = FileSystem.find(dest)