Skip to content

Commit

Permalink
Modified BEGIN blocks to better suit test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieb9 committed Jan 12, 2016
1 parent 4c1568e commit 6424bfa
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/Devel/Examine/Subs.pm
Expand Up @@ -30,7 +30,7 @@ BEGIN {
import Devel::Trace::Subs qw(trace);
};

if ($@){
if ($@ || ! defined &trace){
*trace = sub {};
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Examine/Subs/Engine.pm
Expand Up @@ -24,7 +24,7 @@ BEGIN {
import Devel::Trace::Subs qw(trace);
};

if ($@){
if ($@ || ! defined &trace){
*trace = sub {};
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Examine/Subs/Postprocessor.pm
Expand Up @@ -21,7 +21,7 @@ BEGIN {
import Devel::Trace::Subs qw(trace);
};

if ($@){
if ($@ || ! defined &trace){
*trace = sub {};
}
};
Expand Down
12 changes: 7 additions & 5 deletions lib/Devel/Examine/Subs/Preprocessor.pm
Expand Up @@ -10,17 +10,19 @@ use Data::Dumper;

BEGIN {

# we need to do some trickery for DTS due to a circular install
# we need to do some trickery for DTS due to circular referencing,
# which broke CPAN installs.

eval {
require Devel::Trace::Subs;
};

if ($@){
*trace = sub {};
}
else {
eval {
import Devel::Trace::Subs qw(trace);
};

if ($@ || ! defined &trace){
*trace = sub {};
}
};

Expand Down
9 changes: 5 additions & 4 deletions lib/Devel/Examine/Subs/Sub.pm
Expand Up @@ -15,11 +15,12 @@ BEGIN {
require Devel::Trace::Subs;
};

if ($@){
*trace = sub {};
}
else {
eval {
import Devel::Trace::Subs qw(trace);
};

if ($@ || ! defined &trace){
*trace = sub {};
}
};

Expand Down

0 comments on commit 6424bfa

Please sign in to comment.