2013-05-06 13:24:48 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
2016-05-16 06:07:57 -07:00
|
|
|
use Test::Deep;
|
2013-05-06 13:24:48 -07:00
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
2014-10-14 23:33:06 -07:00
|
|
|
zci answer_type => "birth_stone";
|
|
|
|
zci is_cached => 1;
|
2013-05-06 13:24:48 -07:00
|
|
|
|
2016-05-10 14:05:23 -07:00
|
|
|
sub build_structured_answer {
|
|
|
|
my ($month, $birthstone) = @_;
|
|
|
|
return "$month birthstone: $birthstone",
|
|
|
|
structured_answer => {
|
2016-05-10 14:00:42 -07:00
|
|
|
data => {
|
2016-05-10 14:05:23 -07:00
|
|
|
title => $birthstone,
|
|
|
|
subtitle => "Birthstone for $month",
|
2016-05-10 14:00:42 -07:00
|
|
|
},
|
|
|
|
templates => {
|
2016-05-10 14:05:23 -07:00
|
|
|
group => 'text',
|
2016-05-10 14:00:42 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-10 14:05:23 -07:00
|
|
|
sub build_test { test_zci(build_structured_answer(@_)) }
|
2016-05-10 14:00:42 -07:00
|
|
|
|
2013-05-06 13:24:48 -07:00
|
|
|
ddg_goodie_test(
|
2014-10-14 23:33:06 -07:00
|
|
|
[qw( DDG::Goodie::BirthStone )],
|
2016-05-10 14:00:42 -07:00
|
|
|
'april birth stone' => build_test('April', 'Diamond'),
|
|
|
|
'birthstone JUNE' => build_test('June', 'Pearl'),
|
|
|
|
'DecEmber birthstone' => build_test('December', 'Turquoise'),
|
|
|
|
'birthstone april' => build_test('April', 'Diamond'),
|
|
|
|
'may birth stone' => build_test('May', 'Emerald')
|
2013-05-06 13:24:48 -07:00
|
|
|
);
|
|
|
|
|
2016-05-16 06:18:04 -07:00
|
|
|
done_testing;
|