Config-ENV

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "eg",
         "examples",
         "author",
         "builder"
      ]
   },
   "prereqs" : {
      "build" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "6.36",
            "Test::Fatal" : "0",
            "Test::More" : "0",
            "Test::Name::FromLine" : "0"
         }
      },
      "configure" : {
         "requires" : {
            "Module::Build::Tiny" : "0.035"
         }
      },
      "develop" : {

META.yml  view on Meta::CPAN

---
abstract: 'Various config determined by %ENV'
author:
  - 'cho45 <cho45@lowreal.net>'
build_requires:
  ExtUtils::MakeMaker: '6.36'
  Test::Fatal: '0'
  Test::More: '0'
  Test::Name::FromLine: '0'
configure_requires:
  Module::Build::Tiny: '0.035'
dynamic_config: 0
generated_by: 'Minilla/v3.1.19, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'

cpanfile  view on Meta::CPAN

on build => sub {
    requires 'ExtUtils::MakeMaker', '6.36';
    requires 'Test::Fatal';
    requires 'Test::More';
    requires 'Test::Name::FromLine';
};

inc/Test/Fatal.pm  view on Meta::CPAN

#line 1
use strict;
use warnings;
package Test::Fatal;
{
  $Test::Fatal::VERSION = '0.18';
}
# ABSTRACT: incredibly simple helpers for testing code with exceptions


use Carp ();
use Try::Tiny 0.07;

use Exporter 5.57 'import';

our @EXPORT    = qw(exception);

inc/Test/Fatal.pm  view on Meta::CPAN

sub exception (&) {
  my $code = shift;

  return try {
    $code->();
    return undef;
  } catch {
    return $_ if $_;

    my $problem = defined $_ ? 'false' : 'undef';
    Carp::confess("$problem exception caught by Test::Fatal::exception");
  };
}


sub success (&;@) {
  my $code = shift;
  return finally( sub {
    return if @_; # <-- only run on success
    $code->();
  }, @_ );

t/04_local.t  view on Meta::CPAN

	config production_bot => +{
		parent('production'),
		bot => 1,
	};
};

BEGIN { MyConfig->import };
sub config { 'MyConfig' }

use Test::More;
use Test::Fatal;
use Test::Name::FromLine;

{
	my $guard = config->local(name => 'localized');
	is config->param('name'), 'localized', 'unmerged...';
};

is config->param('name'), 'foobar';

{

t/05_load.t  view on Meta::CPAN

package MyConfig;
use strict;

use Config::ENV 'FOO_ENV';
use Test::More;
use Test::Name::FromLine;
use Test::Fatal;
use Errno ();
use File::Spec;

is int(do{local ($!, $@); eval{ load('unknown_file') }; $!}), Errno::ENOENT;
like exception { load('unknown_file') }, qr{\A.+ at .* line};
like exception { load('t/data/parse_error.pl') }, qr{syntax error at .* line 2, near ";;"};
like exception { load('t/data/no_values.pl') }, qr{\At/data/no_values.pl does not return HashRef.};
is exception { load('t/data/valid.pl') }, undef;

my $rel_path = 't/data/valid.pl';



( run in 1.836 second using v1.01-cache-2.11-cpan-54e63673c56 )