summaryrefslogtreecommitdiff
path: root/lib/MooseX
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2009-12-20 15:54:45 +0100
committerfranck cuny <franck@lumberjaph.net>2009-12-20 15:54:45 +0100
commitefd88755e3abdeeed94af580f74ae8adf2cc2f0f (patch)
tree784e429b5d22aa7080d3979b5866b8ce711197a6 /lib/MooseX
parentremove tests, not clean enough (diff)
downloadnet-http-api-efd88755e3abdeeed94af580f74ae8adf2cc2f0f.tar.gz
remove tests
Diffstat (limited to '')
-rw-r--r--lib/MooseX/Net/API/Meta/Class.pm9
-rw-r--r--lib/MooseX/Net/API/Role/CatalystTest.pm58
2 files changed, 0 insertions, 67 deletions
diff --git a/lib/MooseX/Net/API/Meta/Class.pm b/lib/MooseX/Net/API/Meta/Class.pm
index 80075f8..e4bed0c 100644
--- a/lib/MooseX/Net/API/Meta/Class.pm
+++ b/lib/MooseX/Net/API/Meta/Class.pm
@@ -13,15 +13,6 @@ has local_api_methods => (
auto_deref => 1,
handles => { '_add_api_method' => 'push' },
);
-has local_api_test_methods => (
- traits => ['Array'],
- is => 'ro',
- isa => ArrayRef [Str],
- required => 1,
- default => sub { [] },
- auto_deref => 1,
- handles => { '_add_api_test_method' => 'push' },
-);
sub _build_meta_class {
my $self = shift;
diff --git a/lib/MooseX/Net/API/Role/CatalystTest.pm b/lib/MooseX/Net/API/Role/CatalystTest.pm
deleted file mode 100644
index f034804..0000000
--- a/lib/MooseX/Net/API/Role/CatalystTest.pm
+++ /dev/null
@@ -1,58 +0,0 @@
-package MooseX::Net::API::Role::CatalystTest;
-
-use lib ('t/lib');
-
-use Moose::Role; with qw/
- MooseX::Net::API::Role::Serialize
- MooseX::Net::API::Role::Deserialize/;
-
-my $list_content_type = {
- 'json' => 'application/json',
- 'yaml' => 'text/x-yaml',
- 'xml' => 'text/xml',
-};
-
-after qw/test_api_declare/ => sub {
- my $caller = shift;
- my $name = shift;
- my %options = @_;
-
- if ( $options{catalyst} ) {
- my $app = $options{catalyst_app_name};
-
- Class::MOP::load_class("HTTP::Request");
- Class::MOP::load_class("Catalyst::Test");
-
- Catalyst::Test->import($app);
-
- my $res = __PACKAGE__->meta->remove_method('_request');
- MooseX::Net::API->meta->add_method(
- '_request' => sub {
- my ( $class, $format, $options, $uri, $args ) = @_;
- my $method = $options->{method};
-
- my $res;
- if ( $method =~ /^(?:GET|DELETE)$/
- || $options->{params_in_url} )
- {
- $uri->query_form(%$args);
- my $req = HTTP::Request->new( $method => $uri );
- $req->header(
- 'Content-Type' => $list_content_type->{$format} );
- $res = request($req);
- }
- else {
- my $req = HTTP::Request->new( $method => $uri );
- $req->header(
- 'Content-Type' => $list_content_type->{$format} );
- my $content = _do_serialization($class, $args, $format);
- $req->content( $content );
- $res = request($req);
- }
- return $res;
- }
- );
- }
-};
-
-1;