5 3_conf_00_base.t - Test for the basic functionality of CGI::Ex::Conf
10 use Test::More tests => 8;
16 use_ok('CGI::Ex::Conf');
18 my $obj = CGI::Ex::Conf->new;
21 ### TODO - re-enable more fileside tests
23 if (eval { require JSON }) {
24 ok(eval { CGI::Ex::Conf::conf_write($file, {foo => "bar"}, {file_type => 'json'}) }, "Could JSON write") || diag($@);
25 my $ref = eval { CGI::Ex::Conf::conf_read($file, {file_type => 'json'}) };
26 is(eval { $ref->{'foo'} }, 'bar', "Could JSON read");
29 skip("Can't test read/write of json", 2);
33 if (eval { require YAML }) {
34 ok(eval { CGI::Ex::Conf::conf_write($file, {foo => "bar2"}, {file_type => 'yaml'}) }, "Could YAML write") || diag($@);
35 my $ref = eval { CGI::Ex::Conf::conf_read($file, {file_type => 'yaml'}) };
36 is(eval { $ref->{'foo'} }, 'bar2', "Could YAML read");
39 skip("Can't test read/write of yaml", 2);
43 if (eval { require Data::Dumper }) {
44 ok(eval { CGI::Ex::Conf::conf_write($file, {foo => "bar2"}, {file_type => 'pl'}) }, "Could Perl write") || diag($@);
45 my $ref = eval { CGI::Ex::Conf::conf_read($file, {file_type => 'pl'}) };
46 is(eval { $ref->{'foo'} }, 'bar2', "Could perl read");
49 skip("Can't test read/write of pl", 2);