[Rt-commit] r8887 - rtfm/branches/2.1-TESTING/t

ruz at bestpractical.com ruz at bestpractical.com
Tue Sep 4 10:53:49 EDT 2007


Author: ruz
Date: Tue Sep  4 10:53:40 2007
New Revision: 8887

Added:
   rtfm/branches/2.1-TESTING/t/URI_fsck_com_rtfm.t

Log:
* extract tests from POD, we forgot to do that because of some unknown reason

Added: rtfm/branches/2.1-TESTING/t/URI_fsck_com_rtfm.t
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/t/URI_fsck_com_rtfm.t	Tue Sep  4 10:53:40 2007
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 10;
+BEGIN { require 't/utils.pl' }
+
+use_ok 'RT';
+RT::LoadConfig();
+RT::Init();
+
+use_ok "RT::URI::fsck_com_rtfm";
+my $uri = RT::URI::fsck_com_rtfm->new( $RT::SystemUser );
+
+ok $uri;
+isa_ok $uri, 'RT::URI::fsck_com_rtfm';
+isa_ok $uri, 'RT::URI::base';
+isa_ok $uri, 'RT::Base';
+
+is $uri->LocalURIPrefix, 'fsck.com-rtfm://example.com/article/';
+
+my $class = RT::FM::Class->new( $RT::SystemUser );
+$class->Create( Name => 'URItest - '. $$ );
+ok $class->id, 'created a class';
+my $article = RT::FM::Article->new( $RT::SystemUser );
+my ($id, $msg) = $article->Create(
+    Name    => 'Testing URI parsing - '. $$,
+    Summary => 'In which this should load',
+    Class => $class->Id
+);
+ok($id,$msg);
+
+my $uri = RT::URI::fsck_com_rtfm->new( $article->CurrentUser );
+is $uri->LocalURIPrefix . $article->id, $uri->URIForObject( $article );
+


More information about the Rt-commit mailing list