lib/fakefs/pathname.rb
def cleanpath_aggressive
      path = @path
      names = []
      pre = path
      while (r = chop_basename(pre))
        pre, base = r
        case base
        when '.' # rubocop:disable Lint/EmptyWhen
        when '..'
          names.unshift base
        else
          if names[0] == '..'
            names.shift
          else
            names.unshift base
          end
        end
      end
      if /#{SEPARATOR_PAT}/o =~ File.basename(pre)
        names.shift while names[0] == '..'
      end
      self.class.new(prepend_prefix(pre, File.join(*names)))
    end
def cleanpath_aggressive
      path = @path
      names = []
      pre = path
      while (r = chop_basename(pre))
        pre, base = r
        case base
        when '.' # rubocop:disable Lint/EmptyWhen
        when '..'
          names.unshift base
        else
          if names[0] == '..'
            names.shift
          else
            names.unshift base
          end
        end
      end
      if /#{SEPARATOR_PAT}/o =~ File.basename(pre)
        names.shift while names[0] == '..'
      end
      self.class.new(prepend_prefix(pre, File.join(*names)))
    end
Clean the path simply by resolving and removing excess
 "." and ".." entries.
 Nothing more, nothing less.