From 1716058c5a97828fd5654354be71ce5adf337e40 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Mon, 24 Apr 2017 11:12:08 +0200
Subject: Update exceptions with more meaningful messages
---
t/reading.t | 15 +++++++++++++++
t/test-stub | 0
2 files changed, 15 insertions(+)
create mode 100644 t/reading.t
create mode 100644 t/test-stub
(limited to 't')
diff --git a/t/reading.t b/t/reading.t
new file mode 100644
index 0000000..52859af
--- /dev/null
+++ b/t/reading.t
@@ -0,0 +1,15 @@
+#! /usr/bin/env perl6
+
+use v6.c;
+use Test;
+use lib "lib";
+
+plan 3;
+
+use Config;
+
+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";
diff --git a/t/test-stub b/t/test-stub
new file mode 100644
index 0000000..e69de29
--
cgit v1.1