diff --git a/lib/DDG/Goodie/BirthStone.pm b/lib/DDG/Goodie/BirthStone.pm index 67aeb2ebc..2692007aa 100644 --- a/lib/DDG/Goodie/BirthStone.pm +++ b/lib/DDG/Goodie/BirthStone.pm @@ -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', } } }; diff --git a/t/BirthStone.t b/t/BirthStone.t index 758fc3d00..88d5c7092 100644 --- a/t/BirthStone.t +++ b/t/BirthStone.t @@ -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 )],