| 1 | package OPM::Installer::Utils::Test; | ||
| 2 | |||
| 3 | # ABSTRACT: helper functions for Unittests | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use warnings; | ||
| 7 | |||
| 8 | our $VERSION = '1.0.1'; # VERSION | ||
| 9 | |||
| 10 | use Moo::Role; | ||
| 11 | use File::Spec; | ||
| 12 | use File::Basename; | ||
| 13 | |||
| 14 | sub _find_path { | ||
| 15 | my ($self) = @_; | ||
| 16 | |||
| 17 | my @levels_up = ('..') x 5; | ||
| 18 | my $dir = File::Spec->catdir( dirname(__FILE__), @levels_up ); | ||
| 19 | my $testdir = File::Spec->catdir( $dir, $ENV{OPMINSTALLERTEST} ); | ||
| 20 | |||
| 21 | if ( !-d $testdir ) { | ||
| 22 | $testdir = File::Spec->catdir( $dir, 3 ); | ||
| 23 | } | ||
| 24 | |||
| 25 | return $testdir; | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; | ||
| 29 | |||
| 30 | __END__ |