#!/usr/bin/perl

use strict;
use warnings;

use Test::More;

eval "use Test::TrailingSpace";
if ($@)
{
    plan skip_all => "Test::TrailingSpace required for trailing space test.";
}
else
{
    plan tests => 2;
}

my %common =
(
    filename_regex => qr/(?:(?:\.(?:t|pm|pl|PL|yml|json|arc|vim))|README|Changes|LICENSE)\z/,
);

{
    my $finder = Test::TrailingSpace->new(
        {
            root => '.',
            %common,
        },
    );

    # TEST
    $finder->no_trailing_space(
        "No trailing space was found."
    );

}

{
    my $finder = Test::TrailingSpace->new(
        {
            root => $ENV{FCS_PATH},
            %common,
        },
    );

    # TEST
    $finder->no_trailing_space(
        "No trailing space was found in FCS_PATH"
    );

}

