|
my $request = Weather::OpenWeatherMap::Request->new_for(
Forecast =>
api_key => 'abcde' ,
tag => 'foo' ,
location => 'Manchester, NH' ,
);
ok $request ->days == 7, 'default days ok' ;
cmp_ok $request ->url,
'eq' ,
. 'daily?q=Manchester,NH&units=imperial&cnt=7' ,
'url ok' ;
$request = Weather::OpenWeatherMap::Request->new_for(
Forecast =>
tag => 'foo' ,
location => 'lat 42, long 24' ,
);
cmp_ok $request ->url,
'eq' ,
. 'daily?lat=42&lon=24&units=imperial&cnt=7' ,
'url ok (lat/long)' ;
$request = Weather::OpenWeatherMap::Request->new_for(
Forecast =>
tag => 'foo' ,
location => 5089178,
);
cmp_ok $request ->url,
'eq' ,
. 'daily?id=5089178&units=imperial&cnt=7' ,
'url ok (city code)' ;
done_testing
|