aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2016-12-28 18:10:52 +0000
committerdakkar <dakkar@thenautilus.net>2016-12-28 18:12:50 +0000
commite36566e2918b5252bd0462ee9e88ffe9528975e7 (patch)
treed0d88d513952cd5eaa8513ac6558095a20548bfd /lib
parenttest for mail_store coercion (diff)
downloadSietima-e36566e2918b5252bd0462ee9e88ffe9528975e7.tar.gz
Sietima-e36566e2918b5252bd0462ee9e88ffe9528975e7.tar.bz2
Sietima-e36566e2918b5252bd0462ee9e88ffe9528975e7.zip
test for CmdLine
Diffstat (limited to 'lib')
-rw-r--r--lib/Sietima/CmdLine.pm23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/Sietima/CmdLine.pm b/lib/Sietima/CmdLine.pm
index 3d78be2..20141df 100644
--- a/lib/Sietima/CmdLine.pm
+++ b/lib/Sietima/CmdLine.pm
@@ -29,20 +29,31 @@ sub BUILDARGS($class,@args) {
return $args;
}
-sub run($self) {
+has app_spec => (
+ is => 'lazy',
+ init_arg => undef,
+);
+
+sub _build_app_spec($self) {
my $spec_data = $self->sietima->command_line_spec();
- my $app_spec = App::Spec->read({
+ return App::Spec->read({
$spec_data->%*,
$self->extra_spec->%*,
});
+}
- my $runner = Sietima::Runner->new({
- spec => $app_spec,
+has runner => (
+ is => 'lazy',
+ init_arg => undef,
+ handles => [qw(run)],
+);
+
+sub _build_runner($self) {
+ return Sietima::Runner->new({
+ spec => $self->app_spec,
cmd => $self->sietima,
});
-
- $runner->run;
}
1;