Alias mkdir_p + makedirs for compatability with Rails3. Closes #79
This commit is contained in:
parent
fa2cacf2c3
commit
12532c8e37
@ -6,6 +6,7 @@ module FakeFS
|
||||
FileSystem.add(path, FakeDir.new)
|
||||
end
|
||||
alias_method :mkpath, :mkdir_p
|
||||
alias_method :makedirs, :mkdir_p
|
||||
|
||||
def mkdir(path)
|
||||
parent = path.split('/')
|
||||
|
@ -55,6 +55,16 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
assert_kind_of FakeDir, FileSystem.fs['path']['to']['dir']
|
||||
end
|
||||
|
||||
def test_can_create_directories_with_mkpath
|
||||
FileUtils.makedirs("/path/to/dir")
|
||||
assert_kind_of FakeDir, FileSystem.fs['path']['to']['dir']
|
||||
end
|
||||
|
||||
def test_can_create_directories_with_mkpath_and_options
|
||||
FileUtils.makedirs("/path/to/dir", :mode => 0755)
|
||||
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")
|
||||
|
Loading…
Reference in New Issue
Block a user