lib/fakefs/pathname.rb
def split_names(path)
      names = []
      while (r = chop_basename(path))
        path, basename = r
        names.unshift basename
      end

      [path, names]
    end
def split_names(path)
      names = []
      while (r = chop_basename(path))
        path, basename = r
        names.unshift basename
      end

      [path, names]
    end
split_names(path) -> prefix, [name, ...]