From bd3bc6769547e89dc5d3e255aa4babc2cc5ffe48 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sat, 4 Jul 2020 13:46:25 +0200 Subject: Overhaul Config to 3.0.0 --- lib/Config/Parser/NULL.pm6 | 45 +++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) (limited to 'lib/Config/Parser') diff --git a/lib/Config/Parser/NULL.pm6 b/lib/Config/Parser/NULL.pm6 index 2352cfc..2845e3c 100644 --- a/lib/Config/Parser/NULL.pm6 +++ b/lib/Config/Parser/NULL.pm6 @@ -1,41 +1,30 @@ #! /usr/bin/env false -use v6.c; +use v6.d; use Config::Parser; #| The Config::Parser::NULL is a parser to mock with for testing purposes. #| It exposes an additional method, set-config, so you can set a config #| Hash to return when calling `read`. -class Config::Parser::NULL is Config::Parser -{ - my %mock-config = (); - - #| Return the mock config, skipping the file entirely. - multi method read(Str $path --> Hash) - { - %mock-config; - } +unit class Config::Parser::NULL is Config::Parser; - multi method read(IO::Path $path --> Hash) - { - %mock-config; - } +my %mock-config; - #| Set the mock config to return on read. - method set-config(Hash $config) - { - %mock-config = $config; - } +#| Return the mock config, skipping the file entirely. +multi method read(IO() $path --> Hash) +{ + %mock-config; +} - #| Return True, as if writing succeeded. - multi method write(Str $path, Hash $config --> Bool) - { - True; - } +#| Set the mock config to return on read. +method set-config(Hash $config) +{ + %mock-config = $config; +} - multi method write(IO::Path $path, Hash $config --> Bool) - { - True; - } +#| Return True, as if writing succeeded. +multi method write(IO() $path, Hash $config --> Bool) +{ + True; } -- cgit v1.1