aboutsummaryrefslogtreecommitdiff
path: root/t/01-reading.t
diff options
context:
space:
mode:
Diffstat (limited to 't/01-reading.t')
-rw-r--r--t/01-reading.t14
1 files changed, 7 insertions, 7 deletions
diff --git a/t/01-reading.t b/t/01-reading.t
index f7bf7d4..d508b1b 100644
--- a/t/01-reading.t
+++ b/t/01-reading.t
@@ -4,15 +4,18 @@ use v6.c;
use Test;
use lib "lib";
-plan 5;
+plan 6;
use Config;
my Config $config = Config.new();
+my Str $null-parser = "Config::Parser::NULL";
throws-like { $config.read("t/files/none") }, Config::Exception::FileNotFoundException, "Reading nonexisting file";
throws-like { $config.read("t/files/config", "Config::Parser:NoSuchParserForTest") }, Config::Exception::MissingParserException, "Using non-existing parser";
+is $config.read("t/files/none", $null-parser, skip-not-found => True), True, ".read allows for non-fatal execution with skip-not-found set";
+
my $hash = {
"a" => "a",
"b" => {
@@ -41,10 +44,7 @@ is-deeply $config.get(), {
subtest {
plan 3;
- # Use the NULL parser to mock the parser
- my $parser = "Config::Parser::NULL";
-
- is $config.read(("t/files/config", "t/files/config.yaml"), $parser, skip-not-found => True), True, "All paths exist";
- is $config.read(("t/files/config", "t/files/none", "t/files/config.yaml"), $parser, skip-not-found => True), True, "At least one path exists";
- is $config.read(("t/files/none", "t/files/none.yaml"), $parser, skip-not-found => True), False, "No paths exist";
+ is $config.read(("t/files/config", "t/files/config.yaml"), $null-parser, skip-not-found => True), True, "All paths exist";
+ is $config.read(("t/files/config", "t/files/none", "t/files/config.yaml"), $null-parser, skip-not-found => True), True, "At least one path exists";
+ is $config.read(("t/files/none", "t/files/none.yaml"), $null-parser, skip-not-found => True), False, "No paths exist";
}, "Read with a List of paths";