ACME-QuoteDB
view release on metacpan or search on metacpan
t/04-get_quotes_more.t view on Meta::CPAN
Rating => '8.6',
Category => 'TV Humor',
});
# exist now
ok scalar $sq->get_quote({AttrName => 'GRIFFIN'}); # case insensitve
my $fgc = $FG_QUOTE;
$fgc .= "\n-- Peter Griffin";
is $fgc, $sq->get_quote({AttrName => 'Peter G'});
# get newly updated source and category
is( $sq->list_attr_sources, "Family Guy\nThe Simpsons" );
is( $sq->list_categories, "Humor\nTV Humor");
}
{
# crud
# get_quote id, update quote content, delete quote
my $qid = $sq->get_quote_id({Quote => $FG_QUOTE});
t/04-get_quotes_more.t view on Meta::CPAN
$sq->update_quote({
QuoteId => $qid,
Quote => $qu,
AttrName => 'Lois Simpson',
Source => 'The Simpsons Guys',
Rating => '9.6',
Category => 'Cartoon Noir',
});
$qu .= "\n-- Lois Simpson";
eval { # see, updated, should now be 'Lois Simpson'
$sq->get_quote({AttrName => 'Peter G'});
};
if ($@) {
pass 'ok' if $@ =~ m/attribution not found/;
} else {fail 'attribution does not yet exist, so should not be found'};
is $sq->get_quote({AttrName => 'Lois Simpson'}), $qu;
is $sq->get_quote({AttrName => 'Lois S'}), $qu;
is $sq->get_quote({Rating => '9.6'}), $qu;
( run in 0.236 second using v1.01-cache-2.11-cpan-05444aca049 )