zeroclickinfo-goodies/t/BirthStone.t

38 lines
945 B
Perl
Raw Normal View History

2013-05-06 13:24:48 -07:00
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
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
sub build_structured_answer {
my ($month, $birthstone) = @_;
return "$month birthstone: $birthstone",
structured_answer => {
data => {
title => $birthstone,
subtitle => "Birthstone for $month",
},
templates => {
group => 'text',
}
}
}
sub build_test { test_zci(build_structured_answer(@_)) }
2013-05-06 13:24:48 -07:00
ddg_goodie_test(
2014-10-14 23:33:06 -07:00
[qw( DDG::Goodie::BirthStone )],
'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;