summary refs log tree commit diff
path: root/t/10_mx_net_api_test.t
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2009-12-08 10:35:46 +0100
committerfranck cuny <franck@lumberjaph.net>2009-12-08 10:35:46 +0100
commita2b7ab98ccb7083ad6bdda0839a1e2e6e21ea847 (patch)
tree309219b95ca9846f53cc078a01baa2577d3399ab /t/10_mx_net_api_test.t
parentChecking in changes prior to tagging of version 0.01. Changelog diff is: (diff)
parentsmall updates to tests (diff)
downloadmoosex-net-api-a2b7ab98ccb7083ad6bdda0839a1e2e6e21ea847.tar.gz
Merge branch 'topic/create_tests'
* topic/create_tests:
  small updates to tests
  add a catalyst app to tests
  add basic tests
  remove meta class and method
  move meta class and method to new file, add meta to handle tests
Diffstat (limited to '')
-rw-r--r--t/10_mx_net_api_test.t43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/10_mx_net_api_test.t b/t/10_mx_net_api_test.t
new file mode 100644
index 0000000..96bf2be
--- /dev/null
+++ b/t/10_mx_net_api_test.t
@@ -0,0 +1,43 @@
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+    plan skip_all => 'requires Catalyst::Action::REST'
+        unless eval { require Catalyst::Action::REST };
+}
+
+{
+
+    package catalysttestapi;
+    use Moose;
+    use MooseX::Net::API::Test;
+
+    test_api_declare 'TestAPI' => (
+        catalyst          => 1,
+        catalyst_app_name => 'TestApp'
+    );
+
+    test_api_method foo => (
+        tests => {
+            simple => [
+                {
+                    # pouvoir surcharger
+                    test     => 'is_deeply',
+                    expected => { status => 1 }
+                },
+                'ok',
+            ]
+        }
+    );
+}
+
+#content_like    => [ { expected => qr/status: 1/ }, ],
+#action_ok       => [],
+#action_redirect => [],
+#action_notfound => [],
+#contenttype_is  => [],
+
+catalysttestapi->run();
+
+done_testing;