[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.9,1.10
From:       Dave Rolsky <autarch () users ! sourceforge ! net>
Date:       2002-09-27 16:41:31
[Download RAW message or body]

Update of /cvsroot/mason/mason/dist/t
In directory usw-pr-cvs1:/tmp/cvs-serv10930

Modified Files:
	13-errors.t 
Log Message:
add test that bad source_callback returns useful error


Index: 13-errors.t
===================================================================
RCS file: /cvsroot/mason/mason/dist/t/13-errors.t,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- 13-errors.t	27 Sep 2002 05:03:21 -0000	1.9
+++ 13-errors.t	27 Sep 2002 16:41:29 -0000	1.10
@@ -106,5 +106,32 @@
 
 #------------------------------------------------------------
 
+    $group->add_test( name => 'bad_source_callback',
+		      description => 'Make sure that a bad source_callback for a ComponentSource \
object reports a useful error', +                      interp_params => { \
resolver_class => 'My::Resolver' }, +		      component => <<'EOF',
+does not matter
+EOF
+		      expect_error => qr/Undefined subroutine.*will_explode/,
+		    );
+
+#------------------------------------------------------------
+
     return $group;
+}
+
+package My::Resolver;
+
+use base 'HTML::Mason::Resolver::File';
+
+sub get_info
+{
+    my $self = shift;
+
+    if ( my $source = $self->SUPER::get_info(@_) )
+    {
+        $source->{source_callback} = sub { will_explode() };
+
+        return $source;
+    }
 }



-------------------------------------------------------
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