aboutsummaryrefslogtreecommitdiff
path: root/t/read.t
blob: 7a2c0f7589808cf6827bccee2bdf7c97a81faeaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /usr/bin/env perl6

use v6.c;
use Test;
use lib "lib";

use Config;

plan 5;

my $config = Config.new();

ok $config.read("t/test.yaml"), "Read a YAML file";

ok $config.get("a") eq "a", "Get simple key";
ok $config.get("b.c") eq "c", "Get nested key";
ok $config.get("nonexistant") === Nil, "Get nonexistant key";
ok $config.get("nonexistant", "test") === "test", "Get nonexistant key with default";