Planets: Update Tests
parent
6a7588d533
commit
df2527e7e3
|
@ -88,7 +88,7 @@ handle query_lc => sub {
|
|||
#Build HTML output
|
||||
sub pretty_output {
|
||||
my ($result, $operation, $image) = @_;
|
||||
my $html = "<div class='zci--planets'>";
|
||||
my $html = "<div class=\"zci--planets\">";
|
||||
$html .= "<span class=\"planets--planetImage\">";
|
||||
$html .= $image;
|
||||
$html .= "</span>";
|
||||
|
|
10
t/Planets.t
10
t/Planets.t
|
@ -4,6 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
use Test::More;
|
||||
use DDG::Test::Goodie;
|
||||
use DDG::GoodieRole::ImageLoader;
|
||||
use DDG::Test::Location;
|
||||
|
||||
zci answer_type => "planets";
|
||||
|
@ -16,13 +17,8 @@ zci is_cached => 1;
|
|||
|
||||
ddg_goodie_test(
|
||||
[qw( DDG::Goodie::Planets )],
|
||||
# At a minimum, be sure to include tests for all:
|
||||
# - primary_example_queries
|
||||
# - secondary_example_queries
|
||||
'example query' => test_zci('query'),
|
||||
# Try to include some examples of queries on which it might
|
||||
# appear that your answer will trigger, but does not.
|
||||
'bad example query' => undef,
|
||||
'size of earth' => test_zci("", html => '<div class=\"zci--planets\"><span class=\"planets--planetImage\"><img src=\"data:image/svg+xml;base64,.*\" height=\"48\" width=\"48\"/></span><span class=\"planets--info\"><span class=\"text--primary planets--planetAttribute\">3,958.8 miles</span><span class=\"text--secondary planets--planetName\">Earth, Radius</span></span></div>'),
|
||||
'bad example query' => undef
|
||||
);
|
||||
|
||||
done_testing;
|
||||
|
|
Loading…
Reference in New Issue