diff options
author | franck cuny <franck@lumberjaph.net> | 2009-11-26 18:11:34 +0100 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2009-11-26 18:11:34 +0100 |
commit | b8b8bb3d166081a02c85ce4cb4f7c28aca2f2166 (patch) | |
tree | e9aa3575e0c521c96510dd22bbf10c2f16405c9c /t/lib/FakeAPI.pm | |
parent | add error (diff) | |
download | moosex-net-api-b8b8bb3d166081a02c85ce4cb4f7c28aca2f2166.tar.gz |
add more tests
Diffstat (limited to 't/lib/FakeAPI.pm')
-rw-r--r-- | t/lib/FakeAPI.pm | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/t/lib/FakeAPI.pm b/t/lib/FakeAPI.pm new file mode 100644 index 0000000..0496351 --- /dev/null +++ b/t/lib/FakeAPI.pm @@ -0,0 +1,38 @@ +package FakeAPI; +use Moose; +use MooseX::Net::API; + +net_api_declare fake_api => ( + base_url => 'http://identi.ca/api', + format => 'json', + format_mode => 'append', + require_authentication => 0, +); + +net_api_method foo => ( + description => 'this does foo', + method => 'GET', + path => '/foo/', + code => sub { my $self = shift; $self->get_foo }, + params => [qw/bar/], +); + +net_api_method bar => ( + description => 'this does bar', + method => 'GET', + path => '/bar/', + params => [qw/bar baz/], + required => [qw/baz/], +); + +net_api_method baz => ( + description => 'this one does baztwo', + method => 'BAZ', + path => '/baz/', + params => [qw/foo bla/], + required => [qw/bla/], +); + +sub get_foo { return 1; } + +1; |