[MKDoc-commit] [mkd-import] fix corrupted test file

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Wed Mar 16 12:32:58 GMT 2005


Log Message:
-----------
[mkd-import] fix corrupted test file

Modified Files:
--------------
    mkd-import/t:
        110_MKDoc_Import_Source_Document_ConnectUK_Root.t

-------------- next part --------------
Index: 110_MKDoc_Import_Source_Document_ConnectUK_Root.t
===================================================================
RCS file: /var/spool/cvs/mkd-import/t/110_MKDoc_Import_Source_Document_ConnectUK_Root.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lt/110_MKDoc_Import_Source_Document_ConnectUK_Root.t -Lt/110_MKDoc_Import_Source_Document_ConnectUK_Root.t -u -r1.2 -r1.3
--- t/110_MKDoc_Import_Source_Document_ConnectUK_Root.t
+++ t/110_MKDoc_Import_Source_Document_ConnectUK_Root.t
@@ -1 +1,59 @@
-:ext:jhiver at cvs.mkdoc.com:/var/spool/cvs
+#!/usr/bin/perl
+use strict;
+use warnings;
+use lib qw /lib/;
+use Test::More 'no_plan';
+
+eval "use MKDoc::Import::Source::ConnectUK::Root";
+ok (!$@ => 'compiles');
+
+
+my $doc = undef;
+eval { $doc = new MKDoc::Import::Source::ConnectUK::Root() };
+ok (!$@  => 'new - no errors');
+ok ($doc => 'new - not undef');
+
+
+$doc->{'.tmpl_dir'} = 't/data';
+my $tmpl = $doc->build_content_template();
+ok ($tmpl                 => 'build_content_template - true value');
+ok (ref $tmpl             => 'build_content_template - is a reference');
+ok ($tmpl->isa ('Petal')  => 'build_content_template - is a Petal object');
+
+
+$doc->build_content();
+
+
+# well, we don't _really_ want to save stuff in a test...
+no warnings;
+sub MKDoc::Import::Source::ConnectUK::Root::save
+{
+}
+
+
+use warnings;
+
+is ($doc->date_created(),    '2002-01-01 00:00:00'  => 'date_created');
+is ($doc->language,          'fr'                   => 'language');
+is ($doc->editor_created_id, 3                      => 'editor_created_id');
+is ($doc->keywords, 'One, Two, Three'               => 'keywords');
+is ($doc->title, 'Big Title'                        => 'title');
+is ($doc->editor_last_modified_id, 3                => 'editor_last_modified_id');
+is ($doc->name(), 'big-title'                       => 'name');
+is ($doc->description(), 'This is some description' => 'description');
+
+
+my $components = $doc->components();
+ok ($components->[0]                                => 'components[0] - defined');
+ok (ref $components->[0]                            => 'components[0] - is a reference');
+ok ($components->[0]->isa ('flo::editor::Html')     => 'components[0] - is some HTML');
+ok ($components->[1]                                => 'components[1] - defined');
+ok (ref $components->[1]                            => 'components[1] - is a reference');
+ok ($components->[1]->isa ('flo::editor::Link')     => 'components[1] - is a link');
+is ($components->[1]->url(), '#',                   => 'components[1]/url');
+is ($components->[1]->description(), 'foo',         => 'components[1]/description');
+is ($components->[1]->title(), 'Foo Bar',           => 'components[1]/title');
+
+
+1;
+


More information about the MKDoc-commit mailing list