From 0640f90da6e16a23fc87dd4acb32d1d3604b1267 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 11 Sep 2011 20:25:17 +0200 Subject: Add actual tests --- lib/Travel/Status/DE/VRR.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/Travel/Status/DE/VRR.pm b/lib/Travel/Status/DE/VRR.pm index e16136f..47b3b76 100644 --- a/lib/Travel/Status/DE/VRR.pm +++ b/lib/Travel/Status/DE/VRR.pm @@ -98,6 +98,21 @@ sub new { return $self; } +sub new_from_html { + my ( $class, %opt ) = @_; + + my $self = { html => $opt{html}, }; + + $self->{tree} = XML::LibXML->load_html( + string => $self->{html}, + recover => 2, + suppress_errors => 1, + suppress_warnings => 1, + ); + + return bless( $self, $class ); +} + sub errstr { my ($self) = @_; -- cgit v1.2.3