Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

...even more resource tests

  • Loading branch information...
commit e3f4057db03f682419e3d4cec07ab176dbc571a2 1 parent 69f06a8
Stevan Little authored
View
10 t/010-resource-tests.t
@@ -69,6 +69,16 @@ my @tests = (
resource => 'B5',
request => { REQUEST_METHOD => 'GET', SERVER_PROTOCOL => 'HTTP/1.1', SCRIPT_NAME => '/' },
response => [ 415, [], [] ]
+ },
+ {
+ resource => 'B4',
+ request => { REQUEST_METHOD => 'GET', SERVER_PROTOCOL => 'HTTP/1.1', SCRIPT_NAME => '/' },
+ response => [ 413, [], [] ]
+ },
+ {
+ resource => 'B3',
+ request => { REQUEST_METHOD => 'OPTIONS', SERVER_PROTOCOL => 'HTTP/1.1', SCRIPT_NAME => '/' },
+ response => [ 200, [ 'X-Hello' => 'OH HAI!' ], [] ]
}
);
View
11 t/010-resources/B3.pm
@@ -0,0 +1,11 @@
+package B3;
+use strict;
+use warnings;
+
+use parent 'Web::Machine::Resource';
+
+sub allowed_methods { [qw[ GET HEAD OPTIONS ]] }
+
+sub options { +{ 'X-Hello' => 'OH HAI!' } }
+
+1;
View
9 t/010-resources/B4.pm
@@ -0,0 +1,9 @@
+package B4;
+use strict;
+use warnings;
+
+use parent 'Web::Machine::Resource';
+
+sub valid_entity_length { 0 }
+
+1;
Please sign in to comment.
Something went wrong with that request. Please try again.