Merge pull request #3030 from duckduckgo/gd/birth-stone-cleanup

BirthStone: Clean up
master
Zaahir Moolla 2016-06-23 17:10:51 -04:00 committed by GitHub
commit 6e92ddad15
2 changed files with 14 additions and 16 deletions

View File

@ -30,15 +30,15 @@ handle remainder => sub {
return unless $month;
my $stone = $birthstones{$month};
return unless $stone;
return $month . " birthstone: $stone",
structured_answer => {
return "$month birthstone: $stone",
structured_answer => {
data => {
title => $stone,
subtitle => 'Birthstone for '.$month
title => $stone,
subtitle => "Birthstone for $month",
},
templates => {
group => "text",
group => 'text',
}
}
};

View File

@ -9,23 +9,21 @@ use DDG::Test::Goodie;
zci answer_type => "birth_stone";
zci is_cached => 1;
sub get_structured_answer {
my($month, $birthstone) = @_;
return $month . " birthstone: $birthstone",
structured_answer => {
sub build_structured_answer {
my ($month, $birthstone) = @_;
return "$month birthstone: $birthstone",
structured_answer => {
data => {
title => $birthstone,
subtitle => 'Birthstone for '.$month
title => $birthstone,
subtitle => "Birthstone for $month",
},
templates => {
group => "text",
group => 'text',
}
}
}
sub build_test {
test_zci(get_structured_answer(@_));
}
sub build_test { test_zci(build_structured_answer(@_)) }
ddg_goodie_test(
[qw( DDG::Goodie::BirthStone )],