Add File.symlink as an alias for FileUtils.ln_s
This commit is contained in:
parent
34a88c4e63
commit
7e927d8ff0
@ -123,6 +123,10 @@ module FakeFS
|
|||||||
0
|
0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.symlink(source, dest)
|
||||||
|
FileUtils.ln_s(source, dest)
|
||||||
|
end
|
||||||
|
|
||||||
def self.stat(file)
|
def self.stat(file)
|
||||||
File::Stat.new(file)
|
File::Stat.new(file)
|
||||||
end
|
end
|
||||||
|
@ -618,6 +618,14 @@ class FakeFSTest < Test::Unit::TestCase
|
|||||||
assert_equal 'works', File.open('new/nother') { |f| f.read }
|
assert_equal 'works', File.open('new/nother') { |f| f.read }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_can_symlink_through_file
|
||||||
|
FileUtils.touch("/foo")
|
||||||
|
|
||||||
|
File.symlink("/foo", "/bar")
|
||||||
|
|
||||||
|
assert File.symlink?("/bar")
|
||||||
|
end
|
||||||
|
|
||||||
def test_files_can_be_touched
|
def test_files_can_be_touched
|
||||||
FileUtils.touch('touched_file')
|
FileUtils.touch('touched_file')
|
||||||
assert File.exists?('touched_file')
|
assert File.exists?('touched_file')
|
||||||
|
Loading…
Reference in New Issue
Block a user