use strict; use warnings; use Test::More; my @content = ( < pasting to magnet_web
POE Paste with lovely alien head...

No paste!

1. Select the channel for the URL announcment.
2. Supply a nick for the announcement.
3. Supply an summary of the paste for the announcement
4. Paste!
5. Submit the form with the Paste it! button.


1. channel:     2. your nick:

3. summary:

4. paste:

5.

Valid HTML 4.01!

Pastebot is powered by POE.
FORM < Your paste, number 211360...

This content is stored as http://paste.scsys.co.uk/211360. You will be redirected shortly.

From: Someone at 217.168.150.38
Summary: ‘test’

‘test’

Pastebot is powered by POE.

RETURN ); my @requests; { package LWP::Protocol::test; use base 'LWP::Protocol'; sub request { my $self = shift; my ($req) = @_; push @requests, $req; return HTTP::Response->new(200, 'OK', [], shift @content); } } LWP::Protocol::implementor('http' => 'LWP::Protocol::test'); { package App::Nopaste::Service::MyTest; use base 'App::Nopaste::Service'; sub uri { 'http://localhost/' } } { package MyTest::Cmd; use base 'App::Nopaste::Command'; sub read_text { '‘test’' } } my $input = { nick => '', services => ['App::Nopaste::Service::MyTest'], extra_argv => [] }; my $cmd = MyTest::Cmd->new($input); isa_ok($cmd,'App::Nopaste::Command'); my $ret = $cmd->run; is($ret, 'http://paste.scsys.co.uk/211360'); my ($post) = grep { $_->method eq 'POST' } @requests; is($post->content, 'channel=&nick=&summary=&paste=%E2%80%98test%E2%80%99&private=0'); done_testing;