[Catalyst] Hair-pulling over YAML config

Jonathan Rockway jon at jrock.us
Thu Jan 24 13:42:23 GMT 2008


"Carl Vincent" <C.A.Vincent at newcastle.ac.uk> writes:

> Hi everyone,
>
> I've just spent an inordinate amount of time debugging a problem which
> was actually caused by my Yaml config file not parsing properly.
> Catalyst isn't helping much - all it does is skip out the line of debug
> that says "[debug] Loaded Config ..." and that's easy to overlook.
>
> I discovered that when the file is loaded in Config::Any, if there's an
> error with the parsing it just skips it and doesn't bother to alert
> anyone.
>
> Is there a smart way to test for your config file failing to parse? 

I tend to add a unit test for this (using Test::YAML::Valid).  Here's
one from Angerwhale:

    use strict;
    use warnings;
    use Test::More tests => 2;
    use Test::YAML::Valid;
    
    ok(-e 'angerwhale.yml');
    yaml_file_ok('angerwhale.yml','angerwhale.yml validates');

Regards,
Jonathan Rockway



More information about the Catalyst mailing list