commit bcf82e986f01a9edce372c0065a4313b3681cc0a Author: Slaven Rezic Date: Mon Apr 20 21:15:31 2015 +0200 find another invalid yaml file to test YAML 1.15 is more liberal than its predecessors and accepts yaml files without a final newline. So use another invalid yaml syntax for triggering the expected error. This should fix https://github.com/PerlDancer/Dancer/issues/1107 diff --git a/t/01_config/06_config_api.t b/t/01_config/06_config_api.t index a509896..9c1af0a 100644 --- a/t/01_config/06_config_api.t +++ b/t/01_config/06_config_api.t @@ -16,20 +16,20 @@ eval { Dancer::Config::load_settings_from_yaml('foo'); }; -like $@, qr/Unable to parse the configuration file/; +like $@, qr/Unable to parse the configuration file/, 'non-existent yaml file'; my $dir = File::Temp::tempdir(CLEANUP => 1, TMPDIR => 1); my $config_file = File::Spec->catfile($dir, 'settings.yml'); open my $fh, '>', $config_file; -print $fh '---foo\n'; +print $fh '---"foo'; close $fh; eval { Dancer::Config::load_settings_from_yaml($config_file); }; -like $@, qr/Unable to parse the configuration file/; +like $@, qr/Unable to parse the configuration file/, 'invalid yaml file'; File::Temp::cleanup();