Add support for mkpath, an alias for mkdir_p on FileUtils
Signed-off-by: Chris Wanstrath <chris@ozmm.org>
This commit is contained in:
parent
e8257feadd
commit
bbb659fcf8
@ -5,6 +5,7 @@ module FakeFS
|
|||||||
def mkdir_p(path)
|
def mkdir_p(path)
|
||||||
FileSystem.add(path, FakeDir.new)
|
FileSystem.add(path, FakeDir.new)
|
||||||
end
|
end
|
||||||
|
alias_method :mkpath, :mkdir_p
|
||||||
|
|
||||||
def rm(path)
|
def rm(path)
|
||||||
FileSystem.delete(path)
|
FileSystem.delete(path)
|
||||||
|
@ -26,6 +26,11 @@ class FakeFSTest < Test::Unit::TestCase
|
|||||||
assert_kind_of FakeDir, FileSystem.fs['path']['to']['dir']
|
assert_kind_of FakeDir, FileSystem.fs['path']['to']['dir']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_can_create_directories_with_mkpath
|
||||||
|
FileUtils.mkpath("/path/to/dir")
|
||||||
|
assert_kind_of FakeDir, FileSystem.fs['path']['to']['dir']
|
||||||
|
end
|
||||||
|
|
||||||
def test_knows_directories_exist
|
def test_knows_directories_exist
|
||||||
FileUtils.mkdir_p(path = "/path/to/dir")
|
FileUtils.mkdir_p(path = "/path/to/dir")
|
||||||
assert File.exists?(path)
|
assert File.exists?(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user