#!/usr/bin/perl -w
if
(not
$ENV
{ONLINE_TEST}) {
plan
skip_all
=>
'Set $ENV{ONLINE_TEST} to run this test'
;
}
plan
tests
=> 13;
my
$quoter
= Finance::Quote->new();
my
%quotes
=
$quoter
->aex(
"AH"
);
ok(
%quotes
);
ok(
$quotes
{
"AH"
,
"success"
});
ok(
$quotes
{
"AH"
,
"last"
} > 0);
ok(
$quotes
{
"AH"
,
"date"
});
ok(
$quotes
{
"AH"
,
"volume"
} > 0);
my
$year
= (
localtime
())[5] + 1900;
my
$lastyear
=
$year
- 1;
ok(
substr
(
$quotes
{
"AH"
,
"isodate"
},0,4) ==
$year
||
substr
(
$quotes
{
"AH"
,
"isodate"
},0,4) ==
$lastyear
);
ok(
substr
(
$quotes
{
"AH"
,
"date"
},6,4) ==
$year
||
substr
(
$quotes
{
"AH"
,
"date"
},6,4) ==
$lastyear
);
%quotes
=
$quoter
->fetch(
"aex"
,
"AMG"
);
ok(
%quotes
);
ok(
$quotes
{
"AMG"
,
"success"
});
ok(
$quotes
{
"AMG"
,
"last"
} > 0);
%quotes
=
$quoter
->aex(
"NL0000009165"
);
ok(
%quotes
);
ok(
$quotes
{
"NL0000009165"
,
"success"
});
%quotes
=
$quoter
->aex(
"BOGUS"
);
ok( !
$quotes
{
"BOGUS"
,
"success"
});