summaryrefslogtreecommitdiff
path: root/t/03-node.t
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-07-16 14:14:14 +0200
committerfranck cuny <franck@lumberjaph.net>2010-07-16 14:14:14 +0200
commitf4b1e8d72d89383b75ea39febf05255215a49bb1 (patch)
tree7f0de874d0efdab2daee9afb7549ee01dd9cccd9 /t/03-node.t
parentadd attributes to edge (diff)
downloadgraph-gexf-f4b1e8d72d89383b75ea39febf05255215a49bb1.tar.gz
reflect API change on tests
Diffstat (limited to 't/03-node.t')
-rw-r--r--t/03-node.t18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/03-node.t b/t/03-node.t
index ccd79fe..f7db7fa 100644
--- a/t/03-node.t
+++ b/t/03-node.t
@@ -1,19 +1,19 @@
use strict;
use warnings;
use Test::More;
-
+use Test::Exception;
use Graph::GEXF::Node;
-ok my $node = Graph::GEXF::Node->new(id =>0), 'node created';
+ok my $node = Graph::GEXF::Node->new(id => 0), 'node created';
-ok !$node->attribute('url', 'http://linkfluence.net'), 'can\'t add attribute, not attributes defined';
+dies_ok { $node->attribute('url', 'http://linkfluence.net') }
+'can\'t add attribute, no attributes defined';
-ok $node = Graph::GEXF::Node->new(
- id => 0,
- attributes => {url => {title => 'url', type => 'anyURI'}}
- ),
- 'node created';
+ok $node = Graph::GEXF::Node->new(id => 0,), 'node created';
+ok $node->set_node_attribute(
+ url => {id => 0, name => 'url', type => 'anyURL'}), 'attribute added';
-ok $node->attribute('url', 'http://linkfluence.net'), 'add attribute url to node';
+ok $node->attribute('url', 'http://linkfluence.net'),
+ 'add attribute url to node';
done_testing;