From e36566e2918b5252bd0462ee9e88ffe9528975e7 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 28 Dec 2016 18:10:52 +0000 Subject: test for CmdLine --- lib/Sietima/CmdLine.pm | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'lib/Sietima') 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; -- cgit v1.2.3