diff options
Diffstat (limited to 't/00-check-config.t')
-rw-r--r-- | t/00-check-config.t | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/t/00-check-config.t b/t/00-check-config.t index 7d334152c..20f0fe8cf 100644 --- a/t/00-check-config.t +++ b/t/00-check-config.t @@ -2,11 +2,12 @@ use strict; use warnings; use Test::More; +use YAML; use FixMyStreet; -# check that all the fields listed in general-example are also present in -# general - helps prevent later test failures due to un-noticed additions to the +# check that all the fields listed in general.yml-example are also present in +# general.yml - helps prevent later test failures due to un-noticed additions to the # config file. # This code will bail_out to prevent the test suite proceeding to save time if @@ -14,10 +15,8 @@ use FixMyStreet; # load the config file and store the contents in a readonly hash -mySociety::Config::set_file( FixMyStreet->path_to("conf/general-example") ); -my $example_config = mySociety::Config::get_list(); -mySociety::Config::set_file( FixMyStreet->path_to("conf/general") ); -my $local_config = mySociety::Config::get_list(); +my $example_config = YAML::LoadFile( FixMyStreet->path_to("conf/general.yml-example") ); +my $local_config = YAML::LoadFile( FixMyStreet->path_to("conf/general.yml") ); # find all keys missing from each config my @missing_from_example = find_missing( $example_config, $local_config ); @@ -25,12 +24,12 @@ my @missing_from_local = find_missing( $local_config, $example_config ); if ( @missing_from_example || @missing_from_local ) { - fail "Missing from 'general': $_" for @missing_from_local; - fail "Missing from 'general-example': $_" for @missing_from_example; + fail "Missing from 'general.yml': $_" for @missing_from_local; + fail "Missing from 'general.yml-example': $_" for @missing_from_example; # bail out to prevent other tests failing due to config issues BAIL_OUT( "Config has changed" - . " - update your 'general' and add/remove the keys listed above" ); + . " - update your 'general.yml' and add/remove the keys listed above" ); } else { pass "configs contain the same keys"; |