Skip to content

Instantiation bug #3

Closed
wants to merge 4 commits into from
View
1 dist.ini
@@ -14,6 +14,7 @@ JSON = 0
LWP = 0
Moo = 0.091007
Pod::Select = 0
+Test::Most = 0
[MetaResources]
bugtracker.web = http://github.com/ironcamel/Net-OpenStack-Compute/issues
View
26 t/01-basic.t
@@ -0,0 +1,26 @@
+use Test::Most;
+
+use Net::OpenStack::Compute;
+
+throws_ok(
+ sub { Net::OpenStack::Compute->new },
+ qr/Missing required arguments/,
+ 'instantiation with no argument throws an exception'
+);
+
+throws_ok(
+ sub { Net::OpenStack::Compute->new( auth_url => 'foo' ) },
+ qr/Missing required arguments/,
+ 'instantiation with only auth_url argument throws an exception'
+);
+
+throws_ok(
+ sub { Net::OpenStack::Compute->new( auth_url => 'foo', user => 'bar' ) },
+ qr/Missing required arguments/,
+ 'instantiation with only auth_url, user arguments throws an exception'
+);
+
+my $noc = Net::OpenStack::Compute->new( auth_url => 'foo', user => 'bar', password => '123' );
+isa_ok($noc, 'Net::OpenStack::Compute');
+
+done_testing;
Something went wrong with that request. Please try again.