Skip to content

Commit

Permalink
Switched more tests to Test::More.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Trott committed Jun 17, 2011
1 parent a06c19f commit 11e2739
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion t/02-parse.t
@@ -1,6 +1,6 @@
use strict;

use Test;
use Test::More;
use XML::FOAF;
use File::Basename qw( dirname );
use File::Spec;
Expand Down
38 changes: 19 additions & 19 deletions t/03-person.t
@@ -1,32 +1,32 @@
use strict;

use Test;
use Test::More tests => 15;
use XML::FOAF;
use File::Basename qw( dirname );
use File::Spec;

BEGIN { plan tests => 16 }

my $test_file = File::Spec->catfile(dirname($0), 'samples', 'person.foaf');
die "$test_file does not exist" unless -e $test_file;
my $foaf = XML::FOAF->new($test_file, 'http://foo.com');
ok($foaf);
ok(my $person = $foaf->person);
ok($person->name, 'Benjamin Trott');
ok($person->firstName, 'Benjamin');
ok($person->surname, 'Trott');
ok($person->nick, 'Ben');
ok($person->mbox, 'mailto:ben@stupidfool.org');
ok($person->homepage, 'http://www.stupidfool.org/');
ok($person->workplaceHomepage, 'http://www.sixapart.com/');
ok(my $friends = $person->knows);
ok(@$friends, 1);
ok($friends->[0]->name, 'Mena Trott');
ok($friends->[0]->mbox, 'mailto:mena@dollarshort.org');
isa_ok $foaf, 'XML::FOAF';
my $person = $foaf->person;
isa_ok $person, 'XML::FOAF::Person';
is $person->name, 'Benjamin Trott';
is $person->firstName, 'Benjamin';
is $person->surname, 'Trott';
is $person->nick, 'Ben';
is $person->mbox, 'mailto:ben@stupidfool.org';
is $person->homepage, 'http://www.stupidfool.org/';
is $person->workplaceHomepage, 'http://www.sixapart.com/';
my $friends = $person->knows;
is @$friends, 1;
is $friends->[0]->name, 'Mena Trott';
is $friends->[0]->mbox, 'mailto:mena@dollarshort.org';

$test_file = File::Spec->catfile(dirname($0), 'samples', 'person-lower-case.foaf');
die "$test_file does not exist" unless -e $test_file;
$foaf = XML::FOAF->new($test_file, 'http://foo.com');
ok($foaf);
ok($person = $foaf->person);
ok($person->name, 'Benjamin Trott');
isa_ok $foaf, 'XML::FOAF';
$person = $foaf->person;
isa_ok $person, 'XML::FOAF::Person';
is $person->name, 'Benjamin Trott';

0 comments on commit 11e2739

Please sign in to comment.