App-Phoebe

 view release on metacpan or  search on metacpan

t/WebDAV.t  view on Meta::CPAN

my $resource = $dav->propfind(-url=>"/", -depth=>1);
ok($resource && $resource->is_collection, "Found /");
my @list = $resource->get_resourcelist->get_resources;
my $item = first { $_->get_uri->path eq "/page/" } @list;
ok($item && $item->is_collection, "Found /page");
$item = first { $_->get_uri->path eq "/raw/" } @list;
ok($item && $item->is_collection, "Found /raw");
$item = first { $_->get_uri->path eq "/file/" } @list;
ok($item && $item->is_collection, "Found /files");

# Attempt to write a file without credentials
my $str = "Ganymede\n";
ok(not($dav->put(-local=>\$str, -url=>"https://$host:$port/raw/M%C3%B6%C3%B6n")),
   "Failed to post without token");

# Retry with credentials
$dav->credentials(-user => "alex", -pass => "hello", -realm => "Phoebe");
ok($dav->put(-local=>\$str, -url=>"https://$host:$port/raw/M%C3%B6%C3%B6n"),
   "Post gemtext with token");

# /raw
$resource = $dav->propfind(-url=>"/raw", -depth=>1);
ok($resource && $resource->is_collection, "Found /raw");
@list = $resource->get_resourcelist->get_resources;
$item = first { decode_utf8(uri_unescape($_->get_uri->path)) eq "/raw/Möön" } @list;

ok($item && !$item->is_collection, "Found /raw/Moon");

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.471 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )