tests, and make this actually work
[gitmo/Package-Stash.git] / t / basic.t
index a106e9e..f20e055 100644 (file)
--- a/t/basic.t
+++ b/t/basic.t
@@ -417,4 +417,24 @@ like(exception {
     );
 }
 
+for my $package ('Foo:Bar', 'Foo/Bar', 'Foo Bar', 'Foo:::Bar', '') {
+    like(
+        exception { Package::Stash->new($package) },
+        qr/^$package is not a module name/,
+        "$package is not a module name"
+    );
+}
+
+like(
+    exception { Package::Stash->new([]) },
+    qr/^Package::Stash->new must be passed the name of the package to access/,
+    "module name must be a string"
+);
+
+like(
+    exception { Package::Stash->new(undef) },
+    qr/^Package::Stash->new must be passed the name of the package to access/,
+    "module name must be a string"
+);
+
 done_testing;