Skip to content

Commit

Permalink
RE-673: bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cPholloway committed Sep 18, 2024
1 parent c5938d5 commit 913aa4d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Elevate/Components.pm
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ sub _check_single_blocker ( $self, $name ) {

sub _get_blocker_for ( $self, $name ) { # useful for tests
my $pkg = "Elevate::Components::$name"; # need to be loaded
return $pkg->new( blockers => $self );
return $pkg->new( components => $self );
}

1;
13 changes: 12 additions & 1 deletion lib/Elevate/Components/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use Carp ();
use Cpanel::JSON ();

use Simple::Accessor qw(
cpev
components
rpm
yum
dnf
Expand Down Expand Up @@ -50,6 +50,17 @@ BEGIN {
}
}

sub _build_components {
if ( $0 =~ qr{\bt/} ) {

# only for testing
return Elevate::Components->new;
}

# outside unit tests we should always be initialized with an 'Elevate::Components' object
Carp::confess(q[Missing components]);
}

sub _build_rpm ($self) {
return Elevate::RPM->new( cpev => $self );
}
Expand Down

0 comments on commit 913aa4d

Please sign in to comment.