From 945412cd8fad832f7bea42ac3191867287a9a3c0 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Tue, 31 Aug 2010 15:40:13 +0200 Subject: initial import --- t/01_basic.t | 12 ++++++++++++ t/spec/test1.json | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 t/01_basic.t create mode 100644 t/spec/test1.json (limited to 't') diff --git a/t/01_basic.t b/t/01_basic.t new file mode 100644 index 0000000..bf1d999 --- /dev/null +++ b/t/01_basic.t @@ -0,0 +1,12 @@ +use strict; +use warnings; +use Test::More; + +use Net::HTTP::API::Spec; + +ok my $client = Net::HTTP::API::Spec->load_from_spec('t/spec/test1.json'); + +my @methods = $client->meta->get_all_net_api_methods(); +is scalar @methods, 2; + +done_testing; diff --git a/t/spec/test1.json b/t/spec/test1.json new file mode 100644 index 0000000..85cb277 --- /dev/null +++ b/t/spec/test1.json @@ -0,0 +1,38 @@ +{ + "declare" : { + "api_format_mode" : "content-type", + "api_format" : "json" + }, + "methods" : { + "add_corpus" : { + "params" : [ + "name", + "tasks" + ], + "required" : [ + "name", + "tasks" + ], + "expected" : [ + "200", + "201" + ], + "path" : "/corpus/:name", + "method" : "POST" + }, + "corpus" : { + "params" : [ + "name" + ], + "required" : [ + "name" + ], + "expected" : [ + "200", + "204" + ], + "path" : "/corpus/:name", + "method" : "GET" + } + } +} -- cgit v1.2.3