Source

p5-moosex-semantic / t / rdf_export / mock_server.t

Full commit
use Test::More skip_all => 'bad solution as of now'; 
use Test::Moose;
use Data::Dumper;
use MooseX::Semantic::Test::MockServer;
use MooseX::Semantic::Test::Person;

my $server = MooseX::Semantic::Test::MockServer->new;
my $pid = fork;
if ($pid) {
    $server->run;
}

my $p = MooseX::Semantic::Test::Person->new(
    'name' => 'ABC',
);
my $resp =
  $p->export_to_web( PUT => 'http://localhost:54321', format => 'turtle' );
my $in_turtle = $p->export_to_string( format => 'turtle' );

is($resp->request->content, $in_turtle, 'Server received correct serialization');
is($resp->request->method, 'PUT', 'Server was requested using PUT');

# HTTP::Request

done_testing;
$server->kill;
# exit;