Added touch to fileutils
This commit is contained in:
parent
c6d4b3fe5b
commit
27e24b2260
@ -95,6 +95,10 @@ module FakeFS
|
|||||||
def chown_R(user, group, list, options={})
|
def chown_R(user, group, list, options={})
|
||||||
chown(user, group, list, options={})
|
chown(user, group, list, options={})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def touch(path)
|
||||||
|
FileSystem.add(path, MockFile.new)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class File
|
class File
|
||||||
|
@ -445,6 +445,11 @@ class FakeFSTest < Test::Unit::TestCase
|
|||||||
FileUtils.ln_s 'subdir', 'new'
|
FileUtils.ln_s 'subdir', 'new'
|
||||||
assert_equal 'works', File.open('new/nother'){|f| f.read }
|
assert_equal 'works', File.open('new/nother'){|f| f.read }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_files_can_be_touched
|
||||||
|
FileUtils.touch(here("file"))
|
||||||
|
assert File.exists?(here("file"))
|
||||||
|
end
|
||||||
|
|
||||||
def here(fname)
|
def here(fname)
|
||||||
RealFile.expand_path(RealFile.dirname(__FILE__)+'/'+fname)
|
RealFile.expand_path(RealFile.dirname(__FILE__)+'/'+fname)
|
||||||
|
Loading…
Reference in New Issue
Block a user