package main;
use Evo::Base -strict;
use Test::More;
use Test::Fatal;

my $fired;

{

  package MyManager;
  use Evo::Base 'Evo::Manager';
  sub DESTROY { my $self = shift; $fired++; }
}


$fired = 0;
ROUNDTIP1: {
  my $mngr = MyManager->new;
  my $tr;
  $tr = $mngr->build_train;
  $tr->way->add(sub { });
  $tr->start(sub    { });
}
is $fired, 1, 'destroyed';

$fired = 0;
ROUNDTIP_NO_START: {
  my $mngr = MyManager->new;
  my $tr;
  $tr = $mngr->build_train;
  $tr->way->add(sub { });
}
is $fired, 1, 'destroyed';

done_testing;
