diff options
Diffstat (limited to 't/01-read.t')
-rw-r--r-- | t/01-read.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/01-read.t b/t/01-read.t new file mode 100644 index 0000000..9888ad7 --- /dev/null +++ b/t/01-read.t @@ -0,0 +1,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/files/config.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"; |