Changeset 907
- Timestamp:
- 12/10/06 21:22:38 (2 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
lib/OpenGuides/Config.pm (modified) (3 diffs)
-
t/11_utils.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/OpenGuides/Config.pm
r894 r907 2 2 use strict; 3 3 4 use Carp qw( croak ); 4 5 use Config::Tiny; 5 6 … … 103 104 if ( $args{file} ) { 104 105 my $read_config = Config::Tiny->read( $args{file} ) or 105 warn "Cannot read config file $args{file}";106 %stored = $read_config ? %{ $read_config->{_} } : ();106 croak "Cannot read config file '$args{file}': " . $Config::Tiny::errstr; 107 %stored = $read_config->{_}; 107 108 } elsif ( $args{vars} ) { 108 109 %stored = %{ $args{vars} }; … … 158 159 http_charset => "What character set should we put in the http headers? (This won't change the character set internally, just what it's reported as). Leave blank for none to be sent", 159 160 formatting_rules_node => "What's the name of the node or page to use for the text formatting rules link (this is by default an external document, but if you make formatting_rules_link empty, it will be a wiki node instead", 160 formatting_rules_link => "What URL do you want to use for the text formatting rules (leave blank to use a wiki node instead)?",161 formatting_rules_link => "What URL do you want to use for the text formatting rules (leave blank to use a wiki node instead)?", 161 162 backlinks_in_title => "Make node titles link to node backlinks (C2 style)?", 162 163 ellipsoid => "Which ellipsoid do you want to use? (eg 'Airy', 'WGS-84')", -
trunk/t/11_utils.t
r804 r907 3 3 use OpenGuides::Config; 4 4 use OpenGuides::Utils; 5 use Test::More tests => 7;5 use Test::More tests => 8; 6 6 7 7 eval { my $wiki = OpenGuides::Utils->make_wiki_object; }; … … 10 10 eval { my $wiki = OpenGuides::Utils->make_wiki_object( config => "foo" ); }; 11 11 ok( $@, "...and if config param isn't an OpenGuides::Config object" ); 12 13 eval { 14 my $wiki = OpenGuides::Utils->make_wiki_object( 15 config => OpenGuides::Config->new( file => 'fake' ) 16 ); 17 }; 18 19 like( $@, qr/File 'fake' does not exist/, '...and Config::Tiny errors are reported'); 12 20 13 21 eval { require DBD::SQLite; };
