[Rt-commit] r8931 - in rt/branches/3.7-EXPERIMENTAL/t: . mail
ruz at bestpractical.com
ruz at bestpractical.com
Wed Sep 5 07:09:28 EDT 2007
Author: ruz
Date: Wed Sep 5 07:09:28 2007
New Revision: 8931
Modified:
rt/branches/3.7-EXPERIMENTAL/t/00-mason-syntax.t
rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t
rt/branches/3.7-EXPERIMENTAL/t/web/cf_access.t
Log:
* more conversions
Modified: rt/branches/3.7-EXPERIMENTAL/t/00-mason-syntax.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/00-mason-syntax.t (original)
+++ rt/branches/3.7-EXPERIMENTAL/t/00-mason-syntax.t Wed Sep 5 07:09:28 2007
@@ -28,13 +28,13 @@
use HTML::Mason;
use HTML::Mason::Compiler;
use HTML::Mason::Compiler::ToObject;
+BEGIN { require RT::Test; }
+use Encode qw(decode_utf8);
sub compile_file {
my $file = shift;
- open my $fh, '<:utf8', $file or die "couldn't open '$file': $!";
- my $text = do { local $/; <$fh> };
- close $fh or die "couldn't close '$file': $!";
+ my $text = decode_utf8(RT::Test->file_content($file));
my $compiler = new HTML::Mason::Compiler::ToObject;
$compiler->compile(
Modified: rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t (original)
+++ rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t Wed Sep 5 07:09:28 2007
@@ -65,13 +65,7 @@
defined $file
or do { diag "Unable to find t/data/mails/gnupg-basic-set/$eid-*"; return };
- open my $mailhandle, '<', $file
- or do { diag "Unable to read $file: $!"; return };
-
- my $mail = do { local $/; <$mailhandle> };
- close $mailhandle;
-
- return $mail;
+ return RT::Test->file_content( $file );
}
sub email_ok {
Modified: rt/branches/3.7-EXPERIMENTAL/t/web/cf_access.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/web/cf_access.t (original)
+++ rt/branches/3.7-EXPERIMENTAL/t/web/cf_access.t Wed Sep 5 07:09:28 2007
@@ -6,11 +6,7 @@
my ($baseurl, $m) = RT::Test->started_ok;
use constant ImageFile => $RT::MasonComponentRoot .'/NoAuth/images/bplogo.gif';
-use constant ImageFileContent => do {
- local $/;
- open my $fh, '<:raw', ImageFile or die $!;
- scalar <$fh>;
-};
+use constant ImageFileContent => RT::Test->file_content(ImageFile);
ok $m->login, 'logged in';
More information about the Rt-commit
mailing list