diff options
author | Patrick Spek <p.spek@tyil.nl> | 2017-04-24 11:12:08 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2017-04-24 11:12:08 +0200 |
commit | b01a053e3d4012064a667745634010dd654b4777 (patch) | |
tree | ed702ba420a3cda7f39f0b6b249b294f02dca487 /t | |
parent | ede6b8c4cfac8c5eed668ba8357f9e8b11ccbc43 (diff) |
Update exceptions with more meaningful messages
Diffstat (limited to 't')
-rw-r--r-- | t/reading.t | 15 | ||||
-rw-r--r-- | t/test-stub | 0 |
2 files changed, 15 insertions, 0 deletions
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 --- /dev/null +++ b/t/test-stub |