module FakeFS::FileSystem
def chdir(dir, &blk)
def chdir(dir, &blk) new_dir = find(dir) dir_levels.push dir if blk raise Errno::ENOENT, dir unless new_dir dir_levels.push dir if !blk blk.call if blk ensure dir_levels.pop if blk end
def chdir(dir, &blk) new_dir = find(dir) dir_levels.push dir if blk raise Errno::ENOENT, dir unless new_dir dir_levels.push dir if !blk blk.call if blk ensure dir_levels.pop if blk end