[prev in list] [next in list] [prev in thread] [next in thread]
List: mason-cvs
Subject: [Mason-checkins] CVS: mason/dist/t 13-errors.t,1.7,1.8
From: Dave Rolsky <autarch () users ! sourceforge ! net>
Date: 2002-09-27 1:43:50
[Download RAW message or body]
Update of /cvsroot/mason/mason/dist/t
In directory usw-pr-cvs1:/tmp/cvs-serv1892
Modified Files:
13-errors.t
Log Message:
test that we get a useful error when a component's source file is unreadable
Index: 13-errors.t
===================================================================
RCS file: /cvsroot/mason/mason/dist/t/13-errors.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- 13-errors.t 5 Mar 2002 22:34:45 -0000 1.7
+++ 13-errors.t 27 Sep 2002 01:43:47 -0000 1.8
@@ -2,6 +2,7 @@
use strict;
+use File::Spec;
use HTML::Mason::Tests;
my $tests = make_tests();
@@ -35,7 +36,7 @@
$group->add_support( path => '/support/error2',
component => <<'EOF',
-% die "horrible error";
+% die "horrible error";
EOF
);
@@ -61,6 +62,28 @@
</%init>
EOF
expect_error => q|horrible error.*|
+ );
+
+#------------------------------------------------------------
+
+ $group->add_support( path => '/support/unreadable',
+ component => <<'EOF',
+unreadable
+EOF
+ );
+
+ my $file = File::Spec->catfile( $group->comp_root, 'errors', 'support', 'unreadable' );
+
+ $group->add_test( name => 'cannot_read_source',
+ description => 'Make sure that Mason throws a useful error when it cannot read a source file',
+ component => <<"EOF",
+<%init>
+chmod 0222, '$file'
+ or die "Cannot chmod $file to 0222: \$!";
+\$m->comp('support/unreadable');
+</%init>
+EOF
+ expect_error => q|Permission denied|
);
#------------------------------------------------------------
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mason-checkins mailing list
Mason-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-checkins
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic