Index: trunk/Nebulous/t/62_client_delete_instance.t
===================================================================
--- trunk/Nebulous/t/62_client_delete_instance.t	(revision 20094)
+++ trunk/Nebulous/t/62_client_delete_instance.t	(revision 20965)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 62_client_delete_instance.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
+# $Id: 62_client_delete_instance.t,v 1.2 2008-12-12 21:13:41 jhoblitt Exp $
 
 use strict;
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 9;
+plan tests => 11;
 
 use lib qw( ./t ./lib );
@@ -26,9 +26,11 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->create( "foo" );
 
-    my $locations = $neb->find_instances( "foo" );
+    my $key = "foo";
+    $neb->create($key);
 
-    my $uri = $neb->delete_instance( @$locations[0] );
+    my $locations = $neb->find_instances($key);
+
+    my $uri = $neb->delete_instance($key, @$locations[0]);
 
     is( $uri, @$locations[0], "delete instance" );
@@ -43,10 +45,11 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->create( "foo" );
-    $neb->replicate( "foo" );
+    my $key = "foo";
+    $neb->create($key);
+    $neb->replicate($key);
 
     my $uri1 = $neb->find_instances( "foo" )->[0];
 
-    ok( $neb->delete_instance( $uri1 ), "delete instance" );
+    ok( $neb->delete_instance($key, $uri1), "delete instance" );
 
     my $uri2 = $neb->find_instances( "foo" )->[0];
@@ -54,10 +57,12 @@
     isnt( $uri1, $uri2, "other instance remains" );
 
-    ok( $neb->delete_instance( $uri2 ), "delete instance" );
+    ok( $neb->delete_instance($key, $uri2), "delete instance" );
 
     my $locations = $neb->find_instances( "foo" );
 
-    is( $locations, undef, "no remaning instances" );
+    is( $locations, undef, "no remaining instances" );
 }
+
+Test::Nebulous->setup;
 
 {
@@ -65,5 +70,7 @@
         proxy => "http://$hostport/nebulous",
     );
-    my $uri = $neb->delete_instance( "file:/foo" );
+    my $key = "foo";
+    $neb->create($key);
+    my $uri = $neb->delete_instance($key, "file:/foo" );
 
     is( $uri, undef, "uri does not exist" );
@@ -76,7 +83,7 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->delete_instance();
+    my $uri = $neb->delete_instance("foo", "file:/foo" );
 };
-like( $@, qr/1 was expected/, "no params" );
+like( $@, qr/is valid object key/, "bad object key" );
 
 Test::Nebulous->setup;
@@ -86,7 +93,27 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->delete_instance( "foo", 2 );
+    my $uri = $neb->delete_instance("foo");
 };
-like( $@, qr/1 was expected/, "too many params" );
+like( $@, qr/2 were expected/, "missing second param" );
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->delete_instance();
+};
+like( $@, qr/2 were expected/, "no params" );
+
+Test::Nebulous->setup;
+
+eval {
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
+    $neb->delete_instance("foo", 2, 3);
+};
+like( $@, qr/2 were expected/, "too many params" );
 
 Test::Nebulous->cleanup;
