commit
6e92ddad15
|
@ -30,15 +30,15 @@ handle remainder => sub {
|
||||||
return unless $month;
|
return unless $month;
|
||||||
my $stone = $birthstones{$month};
|
my $stone = $birthstones{$month};
|
||||||
return unless $stone;
|
return unless $stone;
|
||||||
|
|
||||||
return $month . " birthstone: $stone",
|
return "$month birthstone: $stone",
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => $stone,
|
title => $stone,
|
||||||
subtitle => 'Birthstone for '.$month
|
subtitle => "Birthstone for $month",
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => "text",
|
group => 'text',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,23 +9,21 @@ use DDG::Test::Goodie;
|
||||||
zci answer_type => "birth_stone";
|
zci answer_type => "birth_stone";
|
||||||
zci is_cached => 1;
|
zci is_cached => 1;
|
||||||
|
|
||||||
sub get_structured_answer {
|
sub build_structured_answer {
|
||||||
my($month, $birthstone) = @_;
|
my ($month, $birthstone) = @_;
|
||||||
return $month . " birthstone: $birthstone",
|
return "$month birthstone: $birthstone",
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
data => {
|
data => {
|
||||||
title => $birthstone,
|
title => $birthstone,
|
||||||
subtitle => 'Birthstone for '.$month
|
subtitle => "Birthstone for $month",
|
||||||
},
|
},
|
||||||
templates => {
|
templates => {
|
||||||
group => "text",
|
group => 'text',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub build_test {
|
sub build_test { test_zci(build_structured_answer(@_)) }
|
||||||
test_zci(get_structured_answer(@_));
|
|
||||||
}
|
|
||||||
|
|
||||||
ddg_goodie_test(
|
ddg_goodie_test(
|
||||||
[qw( DDG::Goodie::BirthStone )],
|
[qw( DDG::Goodie::BirthStone )],
|
||||||
|
|
Loading…
Reference in New Issue