File: deprecation.t

package info (click to toggle)
libcatalyst-view-mason-perl 0.19-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 372 kB
  • sloc: perl: 2,028; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!perl

use strict;
use warnings;
use Test::More tests => 4;

use FindBin;
use lib "$FindBin::Bin/lib";

use TestApp::FakeLog;

my @warnings;

my $mock_log = TestApp::FakeLog->new(\@warnings);

{
    no warnings 'once';
    $::fake_log = $mock_log;
    $::setup_match = 1;
}

use_ok('Catalyst::Test', 'TestApp');

ok(scalar @warnings, 'loading component which sets use_match to something true causes a warning');
like($warnings[0], qr/^DEPRECATION WARNING/, 'the warning is a deprecation warning');
like($warnings[0], qr/TestApp::View::Mason::Match/, 'the warning contains the name of the component causing it');