use
strict;
use
warnings;
use
Test::More;
use
File::Temp;
# Try to load GD
eval
q{ use GD }
;
SKIP: {
# If the module cannot be loaded, skip tests
skip(
'GD not installed'
, 1)
if
$@;
my
(
$fh
,
$imagefile
) = File::Temp::tempfile();
# Test writing an image to a file
{
binmode
(
$fh
);
$fh
rand_image(
bgcolor
=> [ 0, 0, 0 ] );
close
(
$fh
);
ok( !( -z
$imagefile
) );
}
}
done_testing;