summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-20 13:26:39 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-20 13:26:39 +0200
commitcafd103a950682711fdc9e155d73da7f2fc59caa (patch)
tree38a0c1e25e74ffc38d78b0b99e585c2e983db741
parent5f3ef37839e6efd0bcb07846ba23a55c67d00e71 (diff)
Mock Term::ReadLine so the App::Raps2 test runs fine without a tty
-rw-r--r--Build.PL2
-rw-r--r--t/29-app-raps2.t14
2 files changed, 13 insertions, 3 deletions
diff --git a/Build.PL b/Build.PL
index 1994415..2d9c370 100644
--- a/Build.PL
+++ b/Build.PL
@@ -8,7 +8,7 @@ my $build = Module::Build->new(
build_requires => {
'Test::Command' => 0,
'Test::Compile' => 0,
- 'Test::Fatal' => 0,
+ 'Test::MockObject' => 0,
'Test::More' => 0,
'Test::Pod' => 0,
},
diff --git a/t/29-app-raps2.t b/t/29-app-raps2.t
index 8034791..d1f5bac 100644
--- a/t/29-app-raps2.t
+++ b/t/29-app-raps2.t
@@ -3,8 +3,18 @@ use strict;
use warnings;
use 5.010;
-use Test::More tests => 3;
-use Test::Fatal;
+use Test::More;
+
+eval "use Test::MockObject";
+plan skip_all => 'Test::MockObject required' if $@;
+
+plan tests => 3;
+
+my $mock = Test::MockObject->new();
+$mock->fake_module(
+ 'Term::ReadLine',
+ new => sub { return bless({}, $_[0]) },
+);
use_ok('App::Raps2');