{
}
{
__PACKAGE__->table(
'post'
);
__PACKAGE__->add_columns(
qw(
feed_id author url title posted_on summary body
)
);
__PACKAGE__->resultset_class(
'Test::Schema::PostResultSet'
);
}
{
}
{
__PACKAGE__->table(
'feed'
);
__PACKAGE__->add_columns(
qw(
id url link title owner
)
);
__PACKAGE__->resultset_class(
'Test::Schema::FeedResultSet'
);
}
{
__PACKAGE__->load_classes(
qw(
Post
Feed
)
);
}
my
$schema
= Test::Schema->
connect
(
'dbi:SQLite::memory:'
);
$schema
->deploy;
$schema
->resultset(
'Feed'
)->create({
id
=>
'Test Feed'
,
url
=>
"file:$Bin/var/test.xml"
,
title
=>
'Test feed'
,
owner
=>
'Test demons'
,
});
my
$perlanet
= Perlanet::DBIx::Class->new(
post_resultset
=>
$schema
->resultset(
'Post'
),
feed_resultset
=>
$schema
->resultset(
'Feed'
),
);
$perlanet
->run;
is(
$schema
->resultset(
'Post'
)->count, 1);
done_testing;