From 7e38f2229497e49f0c00f12e51f37d6942c0cfea Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 7 Feb 2006 17:24:37 +0000 Subject: raccolta meta-dati, con test. TODO collezioni git-svn-id: svn://luxion/repos/WebCoso/trunk@160 fcb26f47-9200-0410-b104-b98ab5b095f3 --- t/steps/rest-xml.t | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 't') 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"); + } +} -- cgit v1.2.3