aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/steps/rest-xml.t47
1 files changed, 47 insertions, 0 deletions
diff --git a/t/steps/rest-xml.t b/t/steps/rest-xml.t
index 2b351ef..1d9f956 100644
--- a/t/steps/rest-xml.t
+++ b/t/steps/rest-xml.t
@@ -107,3 +107,50 @@ END_REST
$step->process($resource,'meta');
$dom=$resource->get_property('xml');
isa_ok($dom,'XML::LibXML::Document','chiavi arbitrarie');
+
+# test dei metadati
+$step=WebCoso::Step::ReST::ToXml->new();
+$srckey='rstdoc';
+$resource=make_res(<<'END_REST');
+========
+ Titolo
+========
+
+sottotitolo
+===========
+
+:Authors: - dakkar
+ - doraemon
+:Version: 12
+:Status: draft
+:Date: 2006-02-07
+:CreationDate: 2006-01-30
+:Collections: - uno
+ - due
+ - tre
+
+testo
+
+END_REST
+$step->process($resource,'meta');
+my %meta_fields=(
+ author => ['dakkar','doraemon'],
+ title => 'Titolo',
+ subtitle => 'sottotitolo',
+ version => 12,
+ status => 'draft',
+ date => '2006-02-07',
+ creation_date => '2006-01-30',
+);
+while (my ($f,$v)=each %meta_fields) {
+ if (ref $v) {
+ is_deeply([sort @{$resource->get_property($f)}],
+ $v,
+ "meta: $f");
+ }
+ else {
+ is($resource->get_property($f),
+ $v,
+ "meta: $f");
+ }
+}