diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-08-07 23:07:03 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-08-07 23:07:03 +0200 |
commit | a0ec8b088f8846f2b2aba657eed0fe9d9216183e (patch) | |
tree | 63e3d167169e87c6ef152bdc4ae31a063172ab57 | |
parent | 9059ccee1a66f9d32e1b9e54c6e87bcc82544692 (diff) |
Add Test::Synopsis test, rename pod test
-rw-r--r-- | Build.PL | 1 | ||||
-rw-r--r-- | lib/WWW/Efa.pm | 32 | ||||
-rw-r--r-- | t/02-synopsis.t | 18 | ||||
-rwxr-xr-x | t/10-pod.t (renamed from t/10-pod-coverage.t) | 0 |
4 files changed, 51 insertions, 0 deletions
@@ -10,6 +10,7 @@ my $build = Module::Build->new( 'Test::Compile' => 0, 'Test::Pod' => 0, 'Test::Command' => 0, + 'Test::Synopsis' => 0, }, module_name => 'WWW::Efa', license => 'unrestricted', diff --git a/lib/WWW/Efa.pm b/lib/WWW/Efa.pm index adbf5c7..cdd8d62 100644 --- a/lib/WWW/Efa.pm +++ b/lib/WWW/Efa.pm @@ -1,5 +1,37 @@ package WWW::Efa; +=head1 NAME + +WWW::Efa - inofficial interface to the efa.vrr.de German itinerary service + +=head1 SYNOPSIS + + use WWW::Efa; + + my $efa = WWW::Efa->new( + from => ['Essen', 'HBf'], + to => ['Muelheim', 'HBf'], + ); + + $efa->submit(); + $efa->parse(); + + for my $con ($efa->connections()) { + for my $c (@{$con}) { + printf( + "%-5s ab %-30s %-20s %s\n%-5s an %-30s\n\n",, + @{$c}->{'dep_time', 'dep_stop', 'train_line', 'train_dest'}, + @{$c}->{'arr_time', 'arr_stop'}, + ); + } + } + +=head1 DESCRIPTION + +Foo bar + +=cut + use strict; use warnings; use 5.010; diff --git a/t/02-synopsis.t b/t/02-synopsis.t new file mode 100644 index 0000000..3b5f0c8 --- /dev/null +++ b/t/02-synopsis.t @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +use Test::More; + +eval "use Test::Synopsis"; + +if ($@) { + plan skip_all => 'Test::Synopsis required for testing'; +} +else { + plan tests => 1; +} + +for my $m (qw(lib/WWW/Efa.pm)) { + synopsis_ok($m); +} diff --git a/t/10-pod-coverage.t b/t/10-pod.t index 5fe4faa..5fe4faa 100755 --- a/t/10-pod-coverage.t +++ b/t/10-pod.t |