Lines Matching defs:realpath
313 d = Pathname.new(d).realpath.to_s
330 def realpath(path, basedir=nil)
331 Pathname.new(path).realpath(basedir).to_s
337 assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
339 assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
342 assert_raise(Errno::ELOOP) { realpath("#{dir}/loop") }
343 assert_raise(Errno::ELOOP) { realpath("#{dir}/loop", dir) }
346 assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist2") }
350 assert_nothing_raised { realpath("#{dir}/exist2") }
353 assert_raise(Errno::ELOOP) { realpath("#{dir}/loop-relative") }
356 assert_equal("#{dir}/exist", realpath("exist"))
357 assert_raise(Errno::ELOOP) { realpath("../loop", "#{dir}/exist") }
360 assert_raise(Errno::ELOOP) { realpath("#{dir}/loop1") }
364 assert_raise(Errno::ELOOP) { realpath("#{dir}/loop2") }
369 assert_equal("#{dir}/b", realpath("c"))
370 assert_equal("#{dir}/b", realpath("c/../c"))
371 assert_equal("#{dir}/b", realpath("c/../c/../c/."))
374 assert_equal("#{dir}/b", realpath("c/d/c/d/c"))
377 assert_equal("#{dir}/b", realpath("e"))
382 assert_equal("#{dir}/f/g", realpath("h"))
384 assert_raise(Errno::EACCES) { realpath("h") }
396 rdir = realpath(dir)