about summary refs log tree commit diff
path: root/t/04_apimethod.t
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-06-03 10:01:01 +0200
committerfranck cuny <franck@lumberjaph.net>2010-06-03 10:01:01 +0200
commit3da11a8153d3b42af2f2a250008be6cc52e57b09 (patch)
tree4da02b541e9f8d35e5f20d63908cd33fe64dc7f8 /t/04_apimethod.t
parentreplace remainging with nothing (diff)
parentfix attribute declaration (diff)
downloadnet-http-api-3da11a8153d3b42af2f2a250008be6cc52e57b09.tar.gz
merge
Diffstat (limited to 't/04_apimethod.t')
-rw-r--r--t/04_apimethod.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/04_apimethod.t b/t/04_apimethod.t
new file mode 100644
index 0000000..cac2715
--- /dev/null
+++ b/t/04_apimethod.t
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Exception;
+use MooseX::Net::API::Meta::Method;
+
+dies_ok {
+    MooseX::Net::API::Meta::Method->wrap(
+        name         => 'test_method',
+        package_name => 'test::api',
+        body         => sub {1},
+    );
+}
+"missing some params";
+
+ok my $method = MooseX::Net::API::Meta::Method->wrap(
+    name         => 'test_method',
+    package_name => 'test::api',
+    body         => sub {1},
+    method       => 'GET',
+    path         => '/user/',
+  ),
+  'method created';
+
+is $method->method, 'GET', 'method is GET';
+
+ok $method = MooseX::Net::API::Meta::Method->wrap(
+    name         => 'test_method',
+    package_name => 'test::api',
+    method       => 'GET',
+    path         => '/user/',
+    params       => [qw/name id street/],
+    required     => [qw/name id/],
+);
+
+done_testing;