summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2009-11-25 14:08:35 +0100
committerfranck cuny <franck@lumberjaph.net>2009-11-25 14:08:35 +0100
commitcfc9a03b00c59015e1d6f6e8ec157007c95b321a (patch)
tree7572cdf9a9228557117681d67b2b371ead44d472
parentadd pod and backtweet API (diff)
downloadnet-backtype-cfc9a03b00c59015e1d6f6e8ec157007c95b321a.tar.gz
add test
-rw-r--r--t/00_basic.t30
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";
+}