File: image-new.t

package info (click to toggle)
libwww-mechanize-perl 1.73-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 668 kB
  • ctags: 143
  • sloc: perl: 3,360; makefile: 4
file content (31 lines) | stat: -rw-r--r-- 786 bytes parent folder | download | duplicates (4)
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
#!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' );