From f92976bd47ad9ef1c54de83876db7dcc9843aafd Mon Sep 17 00:00:00 2001 From: franck cuny Date: Wed, 2 Jun 2010 11:37:19 +0200 Subject: tests --- t/04_apimethod.t | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 t/04_apimethod.t (limited to 't/04_apimethod.t') 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; -- cgit 1.4.1