File: 04metatester.t

package info (click to toggle)
libtest-cpan-meta-yaml-perl 0.22-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 260 kB
  • ctags: 27
  • sloc: perl: 833; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 1,856 bytes parent folder | download | duplicates (4)
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
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl -w
use strict;

use Test::CPAN::Meta::YAML;
use Test::Builder::Tester tests => 7;

my $testfile = 't/samples/00-META.yml';

test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
test_out('ok 2 - t/samples/00-META.yml meets the designated specification (1.3)');
meta_spec_ok($testfile,'1.3');
test_test("$testfile with version 1.3");

test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
test_out('not ok 2 - t/samples/00-META.yml meets the designated specification (1.2)');
test_fail(2);
test_err('#   ERR: META.yml specification URL does not match version (meta-spec -> url) [Validation: 1.2]');
meta_spec_ok($testfile,'1.2');
test_test("$testfile with version 1.2");

test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
test_out('ok 2 - t/samples/00-META.yml meets the designated specification (1.1)');
meta_spec_ok($testfile,'1.1');
test_test("$testfile with version 1.1");

test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
test_out('ok 2 - t/samples/00-META.yml meets the designated specification (1.0)');
meta_spec_ok($testfile,'1.0');
test_test("$testfile with version 1.0");

test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
test_out('ok 2 - t/samples/00-META.yml meets the designated specification');
meta_spec_ok($testfile);
test_test("$testfile with assumed (1.3) version");

test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
test_out('ok 2 - my own test');
meta_spec_ok($testfile,undef,'my own test');
test_test("$testfile with assumed (1.3) version");

test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
test_out('not ok 2 - bad spec version');
test_fail(2);
test_err('#   ERR: Unknown META.yml specification, cannot validate. [Validation: 0.99]');
meta_spec_ok($testfile,'0.99','bad spec version');
test_test("$testfile with bad spec version 0.99");