File: 03_bad_dependency.t

package info (click to toggle)
libtest-inline-perl 2.214-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 596 kB
  • sloc: perl: 2,016; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 887 bytes parent folder | download | duplicates (6)
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
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl

# Specific test for missing dependencies

use strict;
BEGIN {
	$|  = 1;
	$^W = 1;
}

use File::Spec::Functions ':ALL';
use Test::More tests => 4;
use Test::Inline ();

# Prepare
my $file = File::Spec->catfile( 't', 'data', 'bad_dependency' );

my $PODCONTENT = <<'END_TEST';
# =begin testing foo after bar
{
is( Foo::Bar->foo, 1, '->foo returns expected value' );
}
END_TEST

# Create the Object
my $Inline = Test::Inline->new;
isa_ok( $Inline, 'Test::Inline' );
{
local $Test::Inline::Script::NO_MISSING_DEPENDENCIES_WARNING = 1;
$Test::Inline::Script::NO_MISSING_DEPENDENCIES_WARNING = 1; # Suppress another warning
ok( $Inline->add( $file ), 'Added bad_dependency file ok' );
}
my $Class = $Inline->class('Foo::Bad');
isa_ok( $Class, 'Test::Inline::Script' );
is_deeply( $Class->missing_dependencies, [ 'bar' ], '->missing_dependencies returns expected value' );

1;