← Back to index

lib/BDD/Behave/Callsite.rakumod

6 / 6 lines covered (100.0%)

1unit module BDD::Behave::Callsite;23# Run from a checkout, a frame's file is the path under lib/BDD/Behave. Run4# from an installed distribution, it is `site#sources/<sha1> (BDD::Behave::DSL)`.5our sub is-behave-source($file --> Bool) is export {6  my $name = ($file // '').Str;78  so $name.contains('BDD/Behave')9     || $name ~~ / '(BDD::Behave' [ '::' <-[)]>+ ]? ')' $ /;10}1112our sub user-frame() is export {13  my $depth = 1;14  my $frame = callframe($depth);1516  while $frame.defined && is-behave-source($frame.file) {17    $frame = callframe(++$depth);18  }1920  $frame;21}