Permalink
Browse files

Switched more tests to Test::More.

  • Loading branch information...
1 parent a06c19f commit 11e27395f84debeb8faa766e3462cbfc4b4b07af Benjamin Trott committed Jun 17, 2011
Showing with 20 additions and 20 deletions.
  1. +1 −1 t/02-parse.t
  2. +19 −19 t/03-person.t
View
@@ -1,6 +1,6 @@
use strict;
-use Test;
+use Test::More;
use XML::FOAF;
use File::Basename qw( dirname );
use File::Spec;
View
@@ -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.