Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

FakeFS::Dir.mkdir cannot create subdirectories with absolute paths #96

Closed
sometimesfood opened this Issue · 1 comment

2 participants

@sometimesfood

FakeFS::Dir.mkdir seems to have problems with subdirectories with absolute paths.

Minimal example:

require 'fakefs'

Dir.mkdir '/baz
Dir.mkdir '/baz/foo'

Output:

~ % ruby -rubygems fakefs-mkdir-short.rb
/var/lib/gems/1.8/gems/fakefs-0.4.0/lib/fakefs/dir.rb:6:in `_check_for_valid_file': No such file or directory - No such file or directory - baz (Errno::ENOENT)
        from /var/lib/gems/1.8/gems/fakefs-0.4.0/lib/fakefs/dir.rb:104:in `mkdir'
        from fakefs-mkdir-short.rb:3

Longer example:

require 'fakefs'
require 'fileutils'

# this works
FileUtils.mkdir '/foo'
FileUtils.mkdir '/foo/bar'

# this does, too
Dir.mkdir '/bar'
FileUtils.mkdir '/bar/foo'

# so does this
Dir.mkdir 'quux'
Dir.mkdir 'quux/foo'

# this doesn't
Dir.mkdir '/baz'
Dir.mkdir '/baz/foo'

# neither does this
FileUtils.mkdir '/qux'
Dir.mkdir '/qux/bar'
@sometimesfood

Here's a pull request that should fix this issue: #97

@sometimesfood sometimesfood referenced this issue from a commit in sometimesfood/sandwich
@sometimesfood sometimesfood Add monkey patch for defunkt/fakefs#96 4a1a601
@sometimesfood sometimesfood referenced this issue from a commit in sometimesfood/sandwich
@sometimesfood sometimesfood Add monkey patch for defunkt/fakefs#96 2ad6a8f
@rue rue closed this in c4e36e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.