summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-03-04 11:18:35 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-03-04 11:18:35 +0100
commit9ceaba5d70e982d865c39940156237ebd55b3f1e (patch)
tree2cdabc317dee2e8fa20c84d1f8a08a77264c5c82 /lib
parentd19c50977b10e379418e879acb7b6b5463081729 (diff)
downloadApp-BorgRestore-9ceaba5d70e982d865c39940156237ebd55b3f1e.tar.gz
App-BorgRestore-9ceaba5d70e982d865c39940156237ebd55b3f1e.tar.xz
Add new_no_defaults constructor for test suite
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/App/BorgRestore.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm
index 4ca2716..cfc6a90 100644
--- a/lib/App/BorgRestore.pm
+++ b/lib/App/BorgRestore.pm
@@ -67,6 +67,22 @@ sub new {
$self->{opts} = $opts;
$self->{borg} = $deps->{borg} // App::BorgRestore::Borg->new();
+ $self->{db} = $deps->{db} // App::BorgRestore::DB->new();
+
+ return $self;
+}
+
+sub new_no_defaults {
+ my $class = shift;
+ my $opts = shift;
+ my $deps = shift;
+
+ my $self = {};
+ bless $self, $class;
+
+ $self->{opts} = $opts;
+ $self->{borg} = $deps->{borg};
+ $self->{db} = $deps->{db};
return $self;
}