[Rt-commit] r2245 - in rtfm/branches/2.1-TESTING: . lib/RT/FM t
jesse at bestpractical.com
jesse at bestpractical.com
Sat Feb 19 21:19:20 EST 2005
Author: jesse
Date: Sat Feb 19 21:19:17 2005
New Revision: 2245
Modified:
rtfm/branches/2.1-TESTING/ (props changed)
rtfm/branches/2.1-TESTING/META.yml
rtfm/branches/2.1-TESTING/Makefile.PL
rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm
rtfm/branches/2.1-TESTING/lib/RT/FM/Record.pm
rtfm/branches/2.1-TESTING/lib/RT/FM/SearchBuilder.pm
rtfm/branches/2.1-TESTING/t/01harness.t
rtfm/branches/2.1-TESTING/t/02regression.t
Log:
r4880 at hualien: jesse | 2005-02-19T23:09:00.820641Z
New test suite actually creates articles. this is a win.
Modified: rtfm/branches/2.1-TESTING/META.yml
==============================================================================
--- rtfm/branches/2.1-TESTING/META.yml (original)
+++ rtfm/branches/2.1-TESTING/META.yml Sat Feb 19 21:19:17 2005
@@ -5,6 +5,7 @@
distribution_type: module
requires:
perl: 5.8.0
+ Text::WikiFormat: 0
RT: 3.4.0
no_index:
directory:
Modified: rtfm/branches/2.1-TESTING/Makefile.PL
==============================================================================
--- rtfm/branches/2.1-TESTING/Makefile.PL (original)
+++ rtfm/branches/2.1-TESTING/Makefile.PL Sat Feb 19 21:19:17 2005
@@ -2,6 +2,7 @@
version_from('lib/RT/FM.pm');
license('GPL version 2');
requires(perl => 5.008);
+requires('Text::WikiFormat');
requires(RT => '3.4.0');
RTx(RTFM);
&WriteAll;
Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm (original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm Sat Feb 19 21:19:17 2005
@@ -187,8 +187,11 @@
# aren't expensive and stupid
$self->__Set( Field => 'URI', Value => $self->URI );
- $self->_NewTransaction( Type => 'Create' );
-
+ my ($txn_id, $txn_msg,$txn) = $self->_NewTransaction( Type => 'Create' );
+ unless ($txn_id) {
+ $RT::Handle->Rollback();
+ return (undef, $self->loc('Internal error: [_1]', $txn_msg));
+ }
$RT::Handle->Commit();
return ( $id, $msg );
@@ -932,17 +935,17 @@
@_ );
my $trans = RT::Transaction->new( $self->CurrentUser );
- $trans->Create( Object => $self,
+ my ($id,$msg) = $trans->Create( ObjectId => $self->id,
+ ObjectType => ref($self),
Type => $args{'Type'},
Field => $args{'Field'},
OldContent => $args{'OldContent'},
- NewContent => $args{'NewContent'})
+ NewContent => $args{'NewContent'});
#something bad happened;
- unless ( $trans->Id ) {
- $RT::Logger->crit(
- $self . " could not create a transaction for " . %args );
- return ( undef, $self->loc("Internal error"), $trans );
+ unless ( $id ) {
+ $RT::Logger->crit( $self . " could not create a transaction for " . %args );
+ return ( undef, $msg, $trans );
}
return ( $trans->id, $self->loc("Transaction recorded"), $trans );
Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/Record.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/Record.pm (original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/Record.pm Sat Feb 19 21:19:17 2005
@@ -34,9 +34,9 @@
package RT::FM::Record;
-use RT::Record;
+use base qw(RT::Record);
+use RT::FM;
- at ISA= qw(RT::Record);
=head2 Load <id | Name >
Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/SearchBuilder.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/SearchBuilder.pm (original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/SearchBuilder.pm Sat Feb 19 21:19:17 2005
@@ -32,8 +32,9 @@
=cut
package RT::FM::SearchBuilder;
-use RT::SearchBuilder;
- at ISA= qw(RT::SearchBuilder);
+use base qw(RT::SearchBuilder);
+use RT::FM;
+
# {{{ sub LimitToEnabled
Modified: rtfm/branches/2.1-TESTING/t/01harness.t
==============================================================================
--- rtfm/branches/2.1-TESTING/t/01harness.t (original)
+++ rtfm/branches/2.1-TESTING/t/01harness.t Sat Feb 19 21:19:17 2005
@@ -2,11 +2,15 @@
use Test::More qw(no_plan);
-use lib "/opt/rt22/lib";
+use lib "/opt/rt3/lib";
use RT;
ok(RT::LoadConfig);
ok(RT::Init, "Basic initialization and DB connectivity");
+if ($ARGV[0]) {
+
my $test = shift @ARGV;
require $test;
+}
+
Modified: rtfm/branches/2.1-TESTING/t/02regression.t
==============================================================================
--- rtfm/branches/2.1-TESTING/t/02regression.t (original)
+++ rtfm/branches/2.1-TESTING/t/02regression.t Sat Feb 19 21:19:17 2005
@@ -9,9 +9,9 @@
ok ($RT::SystemUser->Id, "The systemuser exists");
use File::Find;
-File::Find::find({wanted => \&wanted}, 'lib/t/autogen');
-sub wanted { /^autogen.*\.t\z/s && !/\/.svn\// && require $_;}
+File::Find::find({wanted => \&wanted}, 't/autogen');
+sub wanted { /^autogen.*\.t\z/s && require $_;}
-File::Find::find({wanted => \&wanted_regression}, 'lib/t/regression');
-sub wanted_regression { /^*\.t\z/s && !/\/.svn\// && require $_; }
+File::Find::find({wanted => \&wanted_regression}, 't/regression');
+sub wanted_regression { /^.*\.t\z/s && require $_; }
More information about the Rt-commit
mailing list