DRY in t/IsValid

master
Dylan Lloyd 2013-05-04 16:19:51 -04:00
parent d13f56dbb9
commit 201266bb0e
1 changed files with 2 additions and 10 deletions

View File

@ -14,11 +14,7 @@ ddg_goodie_test(
'is valid json {"test":"lol"}' => test_zci(
'Your JSON is valid!',
html => 'Your JSON is valid!'
)
);
ddg_goodie_test(
[qw(DDG::Goodie::IsValid::JSON)],
),
'is valid json {"test" "lol"}' => test_zci(
'Your JSON is invalid: \':\' expected, at character offset 8 (before ""lol"}")',
html => 'Your JSON is invalid: <pre style="font-size:12px;margin-top:5px;">\':\' expected, at character offset 8 (before ""lol"}")</pre>'
@ -30,11 +26,7 @@ ddg_goodie_test(
'is valid xml <test></test>' => test_zci(
'Your XML is valid!',
html => 'Your XML is valid!'
)
);
ddg_goodie_test(
[qw(DDG::Goodie::IsValid::XML)],
),
'is valid xml <test>lol' => test_zci(
qr/Your XML is invalid: (no element found at line \d{1,2}, column \d{1,2}, byte \d{1,2}|Premature end of data .*)/,
html => qr/Your XML is invalid: <pre style="font-size:12px;margin-top:5px;">(no element found at line \d{1,2}, column \d{1,2}, byte \d{1,2}|Premature end of data .*)<\/pre>/