Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benjamin Trott
committed
Jun 17, 2011
1 parent
a06c19f
commit 11e2739
Showing
2 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
use strict; | ||
|
||
use Test; | ||
use Test::More; | ||
use XML::FOAF; | ||
use File::Basename qw( dirname ); | ||
use File::Spec; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |