File: 31_add_metadata.t

package info (click to toggle)
libmodule-install-perl 1.21-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 636 kB
  • sloc: perl: 3,569; makefile: 13
file content (30 lines) | stat: -rw-r--r-- 594 bytes parent folder | download | duplicates (3)
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
use strict;
BEGIN {
    $|  = 1;
    $^W = 1;
}

use Test::More;
use lib 't/lib';
use MyTest;
use YAML::Tiny;

plan tests => 5;

SCOPE: {
    ok( create_dist('Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist Foo');
use inc::Module::Install;
name          'Foo';
perl_version  '5.005';
all_from      'lib/Foo.pm';
add_metadata  'x_foo' => 'bar';
WriteAll;
END_DSL

    ok( build_dist(), 'build_dist' );
    my $file = file('META.yml');
    ok( -f $file);
    my $yaml = YAML::Tiny::LoadFile($file);
    ok( $yaml->{x_foo} && $yaml->{x_foo} eq 'bar' );
    ok( kill_dist(), 'kill_dist' );
}