diff options
| author | franck cuny <franck@lumberjaph.net> | 2009-11-25 14:08:35 +0100 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2009-11-25 14:08:35 +0100 |
| commit | cfc9a03b00c59015e1d6f6e8ec157007c95b321a (patch) | |
| tree | 7572cdf9a9228557117681d67b2b371ead44d472 /t | |
| parent | add pod and backtweet API (diff) | |
| download | net-backtype-cfc9a03b00c59015e1d6f6e8ec157007c95b321a.tar.gz | |
add test
Diffstat (limited to 't')
| -rw-r--r-- | t/00_basic.t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/00_basic.t b/t/00_basic.t new file mode 100644 index 0000000..83b718f --- /dev/null +++ b/t/00_basic.t @@ -0,0 +1,30 @@ +use strict; +use warnings; +use Test::More; +use Net::Backtype; +use Net::Backtweet; +use YAML::Syck; + +sum_methods( 'Net::Backtype', 11 ); +sum_methods( 'Net::Backtweet', 12 ); + +my $obj = Net::Backtweet->new; +ok $obj, '... object created'; +my $method = $obj->meta->find_method_by_name('user_comments'); +ok $method->meta->has_attribute('method'), '... got method as attribute'; +is $method->method, 'GET', '... method is GET'; + + +done_testing; + +sub sum_methods { + my $module = shift; + my $expect = shift; + my $obj = $module->new(); + my @methods = $obj->meta->get_all_methods(); + my $total = 0; + foreach my $m (@methods) { + ++$total if $m->meta->has_attribute('description'); + } + is $total, $expect, "... got $expect methods in our client"; +} |
