user.name will not translate to a URI, no? But your point is correct.
Probably should do it on the working directory, which should be
permissioned to the JVM.
 On Sep 14, 2013 8:52 AM, "Josh Albrecht" <notifications@github.com> wrote:

> In
> src/test/scala/com/codexica/s3crate/filetree/local/LinuxFileTreeSpec.scala:
>
> > @@ -46,41 +56,91 @@ class LinuxFileTreeSpec extends Specification {
> >
> >    "getting the owner" should {
> >      "return the user's name for regular files" in new Context {
> > -      throw new NotImplementedError()
> > +      val file = new File("/tmp/linuxFileOwnerTest")
> > +      if (!file.exists()) {
> > +        file.createNewFile()
> > +      }
> > +      val path = Paths.get(file.toURI())
> > +      val owner: UserPrincipal = Files.getOwner(Paths.get(new File(System.getProperty("user.home")).toURI()))
>
> A subtle bug here: will probably fail when run on a remote testing
> machine/service because it will likely run as a user without a home
> directory. A more robust approach is probably:
>
> System.getProperty("user.name")
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/joshalbrecht/s3crate/pull/1/files#r6364080>
> .
>