aboutsummaryrefslogtreecommitdiff
path: root/t/reading.t
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-04-26 08:17:33 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-04-26 08:17:33 +0200
commitfb014751bbcf785b4e43b9f622ab8114d496be09 (patch)
tree08cb12d101c47ee93286b9c42840ff068f367e81 /t/reading.t
parent8cc5724b273133ce645589b7c7e0cacd60276360 (diff)
Update test cases
Diffstat (limited to 't/reading.t')
-rw-r--r--t/reading.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/reading.t b/t/reading.t
index 52859af..ec1c40b 100644
--- a/t/reading.t
+++ b/t/reading.t
@@ -13,3 +13,28 @@ my $config = Config.new();
throws-like { $config.read("nonexistant-config") }, Config::Exception::FileNotFoundException, "Reading nonexisting file";
throws-like { $config.read("t/test-stub") }, Config::Exception::UnknownTypeException, "Reading file of unknown type";
throws-like { $config.read("t/test-stub", "Config::Parser:NoSuchParserForTest") }, Config::Exception::MissingParserException, "Using non-existing parser";
+
+my $hash = {
+ "a" =>
+ "b" => {
+ "c" => "test"
+ }
+};
+
+$config.read($hash);
+
+is-deeply $config.get(), $hash, "Correctly sets hash";
+
+$config.read({
+ "b" => {
+ "d" => "another"
+ }
+})
+
+is-deeply $config.get(), {
+ "a" =>
+ "b" => {
+ "c" => "test",
+ "d" => "another"
+ }
+}, "Correctly merges new hash into existing config";