Index: trunk/Nebulous/t/56_client_find_instances.t
===================================================================
--- trunk/Nebulous/t/56_client_find_instances.t	(revision 17750)
+++ trunk/Nebulous/t/56_client_find_instances.t	(revision 17756)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 56_client_find_instances.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
+# $Id: 56_client_find_instances.t,v 1.2 2008-05-20 03:46:11 jhoblitt Exp $
 
 use strict;
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 19;
+plan tests => 29;
 
 use lib qw( ./t ./lib );
@@ -74,4 +74,66 @@
 
 {
+    # key, volume == undef
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo" );
+
+    my $locations = $neb->find_instances( "foo", undef );
+
+    is( scalar @$locations, 1, "found 1" );
+    like( @$locations[0], qr/file:/, "URIs match" );
+    ok( -e _get_file_path( @$locations[0] ), "URI matches file" );
+}
+
+Test::Nebulous->setup;
+
+{
+    # volume/key
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo" );
+
+    my $locations = $neb->find_instances( "neb://node01/foo");
+
+    is( scalar @$locations, 1, "found 1" );
+    like( @$locations[0], qr/file:/, "URIs match" );
+    ok( -e _get_file_path( @$locations[0] ), "URI matches file" );
+}
+
+Test::Nebulous->setup;
+
+{
+    # volume/key, volume override
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo", "node01" );
+
+    my $locations = $neb->find_instances( "neb://node01/foo", "node02" );
+
+    is($locations, undef, "no instances on specified volume" );
+}
+
+Test::Nebulous->setup;
+
+{
+    # volume/key, volume override
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->create( "foo", "node01" );
+
+    my $locations = $neb->find_instances( "neb://node02/foo", ":any" );
+
+    is( scalar @$locations, 1, "found 1" );
+    like( @$locations[0], qr/file:/, "URIs match" );
+    ok( -e _get_file_path( @$locations[0] ), "URI matches file" );
+}
+
+Test::Nebulous->setup;
+
+{
     # key
     my $neb = Nebulous::Client->new(
Index: trunk/Nebulous/t/57_client_find.t
===================================================================
--- trunk/Nebulous/t/57_client_find.t	(revision 17750)
+++ trunk/Nebulous/t/57_client_find.t	(revision 17756)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 57_client_find.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
+# $Id: 57_client_find.t,v 1.2 2008-05-20 03:46:11 jhoblitt Exp $
 
 use strict;
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 4;
+plan tests => 7;
 
 use lib qw( ./t ./lib );
@@ -37,4 +37,47 @@
 
 {
+    # key, volume
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    my $uri = $neb->create( "foo", "node01" );
+
+    my $path = $neb->find( "foo", "node01" );
+
+    ok( -e $path, "file exists" );
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, volume does not hold key but this works anyways ans find will fall
+    # back to looking for ":any"
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    my $uri = $neb->create( "foo", "node01" );
+
+    my $path = $neb->find( "foo", "node02" );
+
+    ok( -e $path, "file exists" );
+}
+
+Test::Nebulous->setup;
+
+{
+    # key, volume :any
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    my $uri = $neb->create( "foo", "node01" );
+
+    my $path = $neb->find( "foo", ":any" );
+
+    ok( -e $path, "file exists" );
+}
+
+Test::Nebulous->setup;
+
+{
     my $neb = Nebulous::Client->new(
         proxy => "http://$hostport/nebulous",
@@ -43,5 +86,5 @@
     my $path = $neb->find( "foo" );
 
-    ok( ! -e $path, "file doesn't exist" );
+    is($path, undef, "file doesn't exist" );
 }
 
@@ -55,5 +98,5 @@
     $neb->find();
 };
-like( $@, qr/1 was expected/, "no params" );
+like( $@, qr/1 - 2 were expected/, "no params" );
 
 Test::Nebulous->setup;
@@ -64,7 +107,7 @@
     );
 
-    $neb->find( "foo", "bar" );
+    $neb->find( "foo", "bar", "bong" );
 };
-like( $@, qr/1 was expected/, "too many params" );
+like( $@, qr/1 - 2 were expected/, "too many params" );
 
 Test::Nebulous->cleanup;
