[Rt-commit] r8422 - in rtir/branches/2.3-EXPERIMENTAL: .
sartak at bestpractical.com
sartak at bestpractical.com
Tue Aug 7 12:35:25 EDT 2007
Author: sartak
Date: Tue Aug 7 12:35:24 2007
New Revision: 8422
Added:
rtir/branches/2.3-EXPERIMENTAL/t/031-gpg.t
Modified:
rtir/branches/2.3-EXPERIMENTAL/ (props changed)
Log:
r36969 at gorgoroth: sartak | 2007-08-07 10:52:59 -0400
Local branch of RTIR
r37040 at gorgoroth: sartak | 2007-08-07 12:34:45 -0400
Add skeleton test script for GPG
Added: rtir/branches/2.3-EXPERIMENTAL/t/031-gpg.t
==============================================================================
--- (empty file)
+++ rtir/branches/2.3-EXPERIMENTAL/t/031-gpg.t Tue Aug 7 12:35:24 2007
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More tests => 59;
+require "t/rtir-test.pl";
+
+my ($baseurl, $m) = RT::Test->started_ok;
+ok(my $user = RT::User->new($RT::SystemUser));
+ok($user->Load('root'), "Loaded user 'root'");
+$user->SetEmailAddress('recipient at example.com');
+
+for my $usage (qw/signed encrypted signed&encrypted/)
+{
+ for my $format (qw/MIME inline/)
+ {
+ for my $attachment (qw/plain text-attachment binary-attachment/)
+ {
+ my $ok = run_test($usage, $format, $attachment);
+ ok($ok, "$usage, $attachment email with $format key");
+ }
+ }
+}
+
+sub run_test
+{
+ my ($usage, $format, $attachment) = @_;
+
+ my $mail = '...';
+
+ my $mailgate = RT::Test->open_mailgate_ok($baseurl);
+ print $mailgate <<EOF;
+From: recipient\@example.com
+To: general\@$RT::rtname
+Subject: $usage, $attachment email with $format key
+
+text goes here
+EOF
+ RT::Test->close_mailgate_ok($mailgate);
+ return 0;
+}
+
More information about the Rt-commit
mailing list