diff options
Diffstat (limited to 't/request_type_with_data.t')
-rw-r--r-- | t/request_type_with_data.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/request_type_with_data.t b/t/request_type_with_data.t new file mode 100644 index 0000000..71cd733 --- /dev/null +++ b/t/request_type_with_data.t @@ -0,0 +1,22 @@ +use strict; +use warnings; + +use Test::More 0.88; +use HTTP::Request::Common; + +# I'd use Test::Warnings here, but let's respect our downstream consumers and +# not force that prereq on them +my @warnings; +$SIG{__WARN__} = sub { push @warnings, grep { length } @_ }; + +my $request = HTTP::Request::Common::request_type_with_data( + 'POST' => 'https://localhost/', + 'content_type' => 'multipart/form-data; boundary=----1234', + 'content' => [ a => 1, b => undef ], +); + +isa_ok($request, 'HTTP::Request'); +is(scalar(@warnings), 0, 'no warnings') + or diag('got warnings: ', explain(\@warnings)); + +done_testing; |