Basic test for get_sharedir_file
Tomas Doran [Fri, 12 Jun 2009 00:29:43 +0000 (00:29 +0000)]
t/get_sharedir_file.t [new file with mode: 0644]

diff --git a/t/get_sharedir_file.t b/t/get_sharedir_file.t
new file mode 100644 (file)
index 0000000..2ec7cab
--- /dev/null
@@ -0,0 +1,20 @@
+use strict;
+use warnings;
+
+use Test::MockObject::Extends;
+use Test::More tests => 3;
+use Test::Exception;
+
+use Catalyst::Helper;
+
+my $i = Test::MockObject::Extends->new('Catalyst::Helper');
+
+throws_ok {
+    $i->get_sharedir_file(qw/does not exist and hopefully never will or we are
+        totally screwed.txt/);
+} qr/No such/, 'Exception for file not found from ->get_sharedir_file';
+
+lives_ok {
+    ok($i->get_sharedir_file('makefile.tt'), 'has contents');
+} 'Can get_sharedir_file';
+