summaryrefslogtreecommitdiff
path: root/t/01_MyClass.t
blob: b8c7c150d38f380be748679c77f331045ed20ce3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;
use Capture::Tiny qw( capture );
use Test::More import => [qw( done_testing is )];

# Need to pass some signal to inquistor to not run during its CHECK block. Alternatively, maybe we can check for the test harness environment variable?
BEGIN { $ENV{'PERLNAVIGATORTEST'} = 1; }

use FindBin qw( $Bin );
use lib "$Bin/../server/src/perl";
use Inquisitor ();


my $testFile = File::Spec->rel2abs("$Bin/../testWorkspace/MyLib/MyClass.pm");
my $output = capture(sub { Inquisitor::run($testFile) });
my $symbols = Inquisitor::tags_to_symbols($output);

is($symbols->{'overridden_method'}->[0]->{'type'}, 's', 'Basic sub');
is($symbols->{'overridden_method'}->[0]->{'line'}, '11;14', 'Sub boundaries');

done_testing;