-
Notifications
You must be signed in to change notification settings - Fork 3
/
02-command-meta.t
73 lines (50 loc) · 1.71 KB
/
02-command-meta.t
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#! /usr/bin/env perl6
use v6.c;
use App::Assixt::Commands::Meta;
use App::Assixt::Config;
use App::Assixt::Test;
use Config;
use Dist::Helper::Meta;
use File::Temp;
use Test::Output;
use Test;
plan 5;
my IO::Path $module = create-test-module("Test::Meta::SourceUrl", tempdir.IO, %(
runtime => %(
auth => "",
),
));
my Config $config = get-config(:!user-config).read: %(
cwd => $module,
);
subtest "Error messages", {
plan 1;
output-like {
App::Assixt::Commands::Meta.run(config => get-config(:!user-config));
}, / "check the App::Assixt::Commands::Meta" .+ "documentation" /, "Reference to the documentation is shown";
}
subtest "auth", {
plan 2;
is get-meta($module.absolute)<auth>, "", "Auth is empty";
App::Assixt::Commands::Meta.run("auth", "gitlab:tyil", :$config);
is get-meta($module.absolute)<auth>, "gitlab:tyil", "Auth got updated";
}
subtest "description", {
plan 2;
is get-meta($module.absolute)<description>, "Nondescript", "Description is Nondescript";
App::Assixt::Commands::Meta.run("description", "This is a test description!", :$config);
is get-meta($module.absolute)<description>, "This is a test description!", "Description got updated";
}
subtest "license", {
plan 2;
is get-meta($module.absolute)<license>, "AGPL-3.0", "License is AGPL-3.0";
App::Assixt::Commands::Meta.run("license", "Artistic-2.0", :$config);
is get-meta($module.absolute)<license>, "Artistic-2.0", "License got updated";
}
subtest "source-url", {
plan 2;
is get-meta($module.absolute)<source-url>, "Localhost", "Source-url is Localhost";
App::Assixt::Commands::Meta.run("source-url", "tyil.nl", :$config);
is get-meta($module.absolute)<source-url>, "tyil.nl", "Source-url got updated";
}
# vim: ft=perl6 noet