Index: /branches/neb_distrib_20081210/Nebulous-Server/Changes
===================================================================
--- /branches/neb_distrib_20081210/Nebulous-Server/Changes	(revision 23851)
+++ /branches/neb_distrib_20081210/Nebulous-Server/Changes	(revision 23852)
@@ -13,4 +13,5 @@
       hash of a key to change
     - create a pseduo directory structure on key creation
+    - Nebulous::Key parsing and testing improvements
       
 0.16
Index: /branches/neb_distrib_20081210/Nebulous-Server/lib/Nebulous/Key.pm
===================================================================
--- /branches/neb_distrib_20081210/Nebulous-Server/lib/Nebulous/Key.pm	(revision 23851)
+++ /branches/neb_distrib_20081210/Nebulous-Server/lib/Nebulous/Key.pm	(revision 23852)
@@ -54,4 +54,10 @@
         # strip off volume component if it exists
         $path =~ s|^//([^/]+)||;
+
+        # a new is not allowed to be just a volume specifier, it must have a
+        # path component to it
+        unless (length $path) {
+            die "neb URI scheme requires a path component"; 
+        }
         
         # ignore key supplied volume name if one is passed as a parameter
@@ -81,4 +87,7 @@
     # strip leading slashes
     $path =~ s|^/+||;
+
+    # strip leading '.' or '..'
+    $path =~ s|^\.{1,2}||;
 
     # remove multiple /'s and trailing slashes
@@ -92,4 +101,5 @@
 }
 
+
 sub parse_neb_volume
 {
@@ -106,4 +116,5 @@
 }
 
+
 sub _stringify_key
 {
@@ -116,4 +127,5 @@
     return "neb://${soft_volume}${volume}/$path";
 }
+
 
 1;
Index: /branches/neb_distrib_20081210/Nebulous-Server/t/75_parse_neb_key.t
===================================================================
--- /branches/neb_distrib_20081210/Nebulous-Server/t/75_parse_neb_key.t	(revision 23851)
+++ /branches/neb_distrib_20081210/Nebulous-Server/t/75_parse_neb_key.t	(revision 23852)
@@ -10,5 +10,5 @@
 use Test::More;
 
-plan tests => 80;
+plan tests => 99;
 
 use lib qw( ./t ./lib );
@@ -224,4 +224,53 @@
 }
 
+# root volume references
+{
+    my $key = parse_neb_key('neb:///');
+
+    is($key->path, '', 'path');
+    is($key->volume, undef, 'volume name');
+    is($key->soft_volume, undef, 'soft volume name');
+}
+
+{
+    my $key = parse_neb_key('neb:///.');
+
+    is($key->path, '', 'path');
+    is($key->volume, undef, 'volume name');
+    is($key->soft_volume, undef, 'soft volume name');
+}
+
+{
+    my $key = parse_neb_key('neb:///..');
+
+    is($key->path, '', 'path');
+    is($key->volume, undef, 'volume name');
+    is($key->soft_volume, undef, 'soft volume name');
+}
+
+{
+    my $key = parse_neb_key('/');
+
+    is($key->path, '', 'path');
+    is($key->volume, undef, 'volume name');
+    is($key->soft_volume, undef, 'soft volume name');
+}
+
+{
+    my $key = parse_neb_key('.');
+
+    is($key->path, '', 'path');
+    is($key->volume, undef, 'volume name');
+    is($key->soft_volume, undef, 'soft volume name');
+}
+
+{
+    my $key = parse_neb_key('..');
+
+    is($key->path, '', 'path');
+    is($key->volume, undef, 'volume name');
+    is($key->soft_volume, undef, 'soft volume name');
+}
+
 # key w/ whitespace
 eval {
@@ -267,2 +316,8 @@
 };
 like( $@, qr/requires a leading slash/, "leading slash" );
+
+# URI w/ volume but w/o path
+eval {
+    my $key = parse_neb_key('neb://foo');
+};
+like( $@, qr/requires a path/, "no path" );
