File: import_strict.t

package info (click to toggle)
libtest-spec-perl 0.45-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 252 kB
  • sloc: perl: 2,050; makefile: 2
file content (28 lines) | stat: -rwxr-xr-x 670 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
27
28
#!/usr/bin/env perl
#
# import_strict.t
#
########################################################################

package Testcase::Spec::ImportStrict;
use Test::Spec;
use FindBin qw($Bin);
use warnings;
BEGIN { require "$Bin/test_helper.pl" };

describe "Test::Spec" => sub {
  describe "test file that violates strict" => sub {
    my $tap = capture_tap("strict_violating_spec.pl");

    it "does not compile" => sub {
      like($tap, qr/aborted due to compilation errors/);
    };

    it "shows reason for failure" => sub {
      like($tap,
          qr/undefined_variable_violates_strict_mode_and_test_should_not_compile/);
    }
  }
};

runtests unless caller;