C.E. Thornton wrote:
> Core,
>
> Expand path does not seem to handle directories
> that start with "~" (tilde) character.

Sorry if you've already noticed this, but have you read the
documentation about File#expanf_path (see below)?  You are trying to
expand a nonexistent user test's home directory, which generates an
exception.

File.expand_path(file_name [, dir_string] ) -> abs_file_name

Converts a pathname to an absolute pathname. Relative paths are
referenced from the current working directory of the process unless
dir_string is given, in which case it will be used as the starting
point. The given pathname may start with a ``~'', which expands to the
process owner's home directory (the environment variable HOME must be
set correctly). ``~user'' expands to the named user's home directory.

  File.expand_path("~oracle/bin") #=> "/home/oracle/bin"