Skip to content

Commit

Permalink
cleanup tests and commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Axel 'fREW' Schmidt committed Jan 11, 2011
1 parent 9f52f29 commit 7b2244b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 21 deletions.
1 change: 0 additions & 1 deletion lib/Config/JFDI/Source/Loader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ sub _get_path {

my $name = $self->name;
my $path;
# $path = _env($name, 'CONFIG') if $name && ! $self->no_env;
$path = $self->_env_lookup('CONFIG') unless $self->no_env;
$path ||= $self->path;

Expand Down
5 changes: 1 addition & 4 deletions t/10-loader.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;

use Test::More;
plan qw/no_plan/;

use Config::JFDI;

Expand All @@ -14,9 +13,7 @@ is($config->load->{'Controller::Foo'}->{new}, 'key');
is($config->load->{'Model::Baz'}->{qux}, 'xyzzy');
is($config->load->{'Model::Baz'}->{another}, 'new key');
is($config->load->{'view'}, 'View::TT::New');
#is($config->load->{'foo_sub'}, 'x-y');
is($config->load->{'foo_sub'}, '__foo(x,y)__');
#is($config->load->{'literal_macro'}, '__DATA__');
is($config->load->{'literal_macro'}, '__literal(__DATA__)__');

ok(1);
done_testing;
5 changes: 2 additions & 3 deletions t/11-loader-env.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;

use Test::More;
plan qw/no_plan/;

use Config::JFDI;

Expand All @@ -15,12 +14,12 @@ is($config->load->{'Controller::Foo'}->{foo}, 'bar');
is($config->load->{'Model::Baz'}->{qux}, 'xyzzy');
is($config->load->{'view'}, 'View::TT');
is($config->load->{'random'}, 1);
#is($config->load->{'foo_sub'}, '__foo(x,y)__' );
#is($config->load->{'literal_macro'}, '__literal(__DATA__)__');

$ENV{XYZZY_CONFIG} = "t/assets/some_non_existent_file.pl";

$config->reload;

ok($config->load);
is(scalar keys %{ $config->load }, 0);

done_testing;
6 changes: 2 additions & 4 deletions t/12-loader-file.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use Test::More;
use Test::Deep;
use Test::Warn;

plan qw/no_plan/;

use Config::JFDI;

sub has_Config_General {
Expand All @@ -23,8 +21,6 @@ sub has_Config_General {
is($config->load->{'Model::Baz'}->{qux}, 'xyzzy');
is($config->load->{'view'}, 'View::TT');
is($config->load->{'random'}, 1);
#is($config->load->{'foo_sub'}, '__foo(x,y)__' );
#is($config->load->{'literal_macro'}, '__literal(__DATA__)__');
}

SKIP: {
Expand Down Expand Up @@ -78,3 +74,5 @@ SKIP: {
cmp_deeply( $config->load, {
} );
}

done_testing;
3 changes: 2 additions & 1 deletion t/13-loader-no-env.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;

use Test::More;
plan qw/no_plan/;

use Config::JFDI;

Expand All @@ -18,3 +17,5 @@ is($config->load->{'Model::Baz'}->{another}, 'new key');
is($config->load->{'view'}, 'View::TT::New');
is($config->load->{'foo_sub'}, '__foo(x,y)__' );
is($config->load->{'literal_macro'}, '__literal(__DATA__)__');

done_testing;
5 changes: 2 additions & 3 deletions t/14-loader-env-lookup.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;

use Test::More;
plan qw/no_plan/;

use Config::JFDI;

Expand All @@ -18,8 +17,6 @@ ok($config->load);
is($config->load->{'Controller::Foo'}->{foo}, 'bar');
is($config->load->{'Model::Baz'}->{qux}, 'xyzzy');
is($config->load->{'view'}, 'View::TT');
#is($config->load->{'foo_sub'}, '__foo(x,y)__' );
#is($config->load->{'literal_macro'}, '__literal(__DATA__)__');
is($config->load->{'random'}, 1);

$ENV{XYZZY_CONFIG} = "t/assets/xyzzy.pl";
Expand All @@ -34,3 +31,5 @@ is($config->load->{'Model::Baz'}->{another}, 'new key');
is($config->load->{'view'}, 'View::TT::New');
is($config->load->{'foo_sub'}, '__foo(x,y)__' );
is($config->load->{'literal_macro'}, '__literal(__DATA__)__');

done_testing;
3 changes: 2 additions & 1 deletion t/16-loader-order.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use warnings;
use Test::More;

plan skip_all => "Config::General is required for this test" unless eval "require Config::General;";
plan qw/no_plan/;

use Config::JFDI;

Expand All @@ -13,3 +12,5 @@ my $config = Config::JFDI->new(qw{ name xyzzy path t/assets/order });
ok($config->load);
is($config->load->{'last'}, 'local_pl');
is($config->load->{$_}, 1) for qw/pl perl local_pl local_perl cnf local_cnf conf local_conf/;

done_testing;
3 changes: 1 addition & 2 deletions t/17-found.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use warnings;
use Test::More;
use Test::Deep;

plan qw/no_plan/;

use Config::JFDI;

sub has_Config_General {
Expand Down Expand Up @@ -46,3 +44,4 @@ sub has_Config_General {
cmp_deeply( [ $config->found ], bag( 't/assets/some_random_file.pl' ) );
}

done_testing;
3 changes: 1 addition & 2 deletions t/18-open.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ use warnings;
use Test::More;
use Test::Warn;

plan qw/no_plan/;

use Config::JFDI;

sub has_Config_General {
Expand Down Expand Up @@ -43,3 +41,4 @@ sub has_Config_General {
ok( $config->isa('Config::JFDI') );
}

done_testing;

0 comments on commit 7b2244b

Please sign in to comment.