File: DateTime.t

package info (click to toggle)
libweather-com-perl 0.5.0-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 340 kB
  • ctags: 148
  • sloc: perl: 3,509; makefile: 44
file content (38 lines) | stat: -rw-r--r-- 1,275 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#####################################################################
#
#  Test suite for 'Weather::Com::Simple'
#
#  Functional tests with 'Test::MockObject'. These could only be run
#  if Test::MockObject is installed.
#
#  Before `make install' is performed this script should be runnable
#  with `make test'. After `make install' it should work as
#  `perl t/Simple.t'
#
#####################################################################
#
# initialization
#
use Test::More tests => 8;
BEGIN { 
	use_ok('Weather::Com::DateTime');
};

my $testtime = 1109430000;

#####################################################################
#
# Testing object instantiation (do we use the right class)?
#
my $wc = Weather::Com::DateTime->new(-6);
$wc->set_lsup('02/25/05 11:21 PM Local Time');

isa_ok($wc, "Weather::Com::DateTime",    'Is a Weatcher::Com::DateTime object');

is($wc->time(),         "23:21",                    '24 hour time');
is($wc->time_ampm(),    "11:21 PM",                 'AM/PM mode');
is($wc->day(),          "25",                       'Day Number');
is($wc->mon(),          "02",                       'Number of month');
is($wc->year(),         "2005",                     'Year');
is(gmtime($wc->epoc()), 'Sat Feb 26 05:21:00 2005', 'GMTime');