use strict; use Test::More tests => 16; use vars qw( $display $captured_html ); { package HTML::Display::Capture; use parent 'HTML::Display::Common'; sub display_html { $::captured_html = $_[1]; }; }; sub display_ok { my ($html,$base,$expected,$name) = @_; undef $captured_html; $display->display( html => $html, location => $base); is($captured_html,$expected,$name); }; SKIP: { use_ok("HTML::Display"); $display = HTML::Display->new(); isa_ok($display,"HTML::Display::Common","Default class"); $display = HTML::Display->new( class => 'HTML::Display::Capture' ); isa_ok($display,"HTML::Display::Common"); # Now check our published API : for my $meth (qw( display )) { can_ok($display,$meth); }; # Now check the handling of base tags : display_ok("
","http://example.com",'','http://example.com/','
',"Single
tag"); };