summaryrefslogtreecommitdiffstats
path: root/t/requires-tty.t
blob: e574f674c97c92d08197a695d22f6fa1cfe2fffd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Fatal;

use Term::Filter;

my ($input, $output);
open my $infh, '<', \$input or die "Couldn't open: $!";
open my $outfh, '<', \$output or die "Couldn't open: $!";
like(
    exception { Term::Filter->new(input => $infh) },
    qr/Term::Filter requires input and output filehandles to be attached to a terminal/,
    "requires a terminal"
);
like(
    exception { Term::Filter->new(output => $outfh) },
    qr/Term::Filter requires input and output filehandles to be attached to a terminal/,
    "requires a terminal"
);

done_testing;