Merge branch 'master' of github.com:defunkt/fakefs

This commit is contained in:
Chris Wanstrath 2009-09-21 19:43:17 -07:00
commit 25e47887b0
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@ module FakeFS
def mkdir_p(path)
FileSystem.add(path, FakeDir.new)
end
alias_method :mkpath, :mkdir_p
def rmdir(list, options = {})
list = [ list ] unless list.is_a?(Array)

View File

@ -25,6 +25,11 @@ class FakeFSTest < Test::Unit::TestCase
assert_kind_of FakeDir, FileSystem.fs['path']['to']['dir']
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_can_delete_directories
FileUtils.mkdir_p("/path/to/dir")
FileUtils.rmdir("/path/to/dir")