X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Fi386%2Flibwww-mechanize-perl%2Flibwww-mechanize-perl-1.34%2Ft%2Fimage-new.t;fp=dev%2Fi386%2Flibwww-mechanize-perl%2Flibwww-mechanize-perl-1.34%2Ft%2Fimage-new.t;h=726db8f1636ea5931927f2ccd87c85afc4af3b4f;hp=0000000000000000000000000000000000000000;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hpb=df794b845212301ea0d267c919232538bfef356a diff --git a/dev/i386/libwww-mechanize-perl/libwww-mechanize-perl-1.34/t/image-new.t b/dev/i386/libwww-mechanize-perl/libwww-mechanize-perl-1.34/t/image-new.t new file mode 100644 index 0000000..726db8f --- /dev/null +++ b/dev/i386/libwww-mechanize-perl/libwww-mechanize-perl-1.34/t/image-new.t @@ -0,0 +1,31 @@ +#!perl -Tw + +use warnings; +use strict; + +use Test::More tests=>10; + +BEGIN { + use_ok( 'WWW::Mechanize::Image' ); +} + +# test new style API +my $link = WWW::Mechanize::Image->new( { + url => 'url.html', + base => 'http://base.example.com/', + name => 'name', + alt => 'alt', + tag => 'a', + height => 2112, + width => 5150, +} ); + +is( $link->url, 'url.html', 'url() works' ); +is( $link->base, 'http://base.example.com/', 'base() works' ); +is( $link->name, 'name', 'name() works' ); +is( $link->alt, 'alt', 'alt() works' ); +is( $link->tag, 'a', 'tag() works' ); +is( $link->height, 2112, 'height works' ); +is( $link->width, 5150, 'width works' ); +is( $link->url_abs, 'http://base.example.com/url.html', 'url_abs works' ); +isa_ok( $link->URI, 'URI::URL', 'Returns an object' );