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