summaryrefslogtreecommitdiff
path: root/t/03-node.t
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;