diff options
author | Patrick Spek <p.spek@tyil.nl> | 2017-07-29 02:43:15 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2017-07-29 02:43:15 +0200 |
commit | 88425ea8064b579d47d6b8c63906612f1aceeef8 (patch) | |
tree | a8ab342eb7f6a92d506059161e35ef8e40f822ef /t | |
parent | c59e97760ca21edd3b9c9a1b46dcb5a47f8274f7 (diff) |
Add tests for reading a List of files
Diffstat (limited to 't')
-rw-r--r-- | t/01-reading.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/01-reading.t b/t/01-reading.t index f834226..07e92c3 100644 --- a/t/01-reading.t +++ b/t/01-reading.t @@ -4,7 +4,7 @@ use v6.c; use Test; use lib "lib"; -plan 4; +plan 5; use Config; @@ -37,3 +37,14 @@ is-deeply $config.get(), { "d" => "another" } }, "Correctly merges new hash into existing config"; + +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"; +}, "Read with a List of paths"; |