11 / 12 lines covered (91.7%)
1unit module BDD::Behave::SharedContexts;23class SharedContextRegistry {4 has %.contexts;56 method register(Str:D $name, Callable:D $block) {7 %!contexts{$name} = $block;8 $block;9 }1011 method lookup(Str:D $name) {12 %!contexts{$name}:exists13 or die "Unknown shared context: '$name'";14 %!contexts{$name};15 }1617 method exists(Str:D $name) {18 %!contexts{$name}:exists;19 }2021 method names {22 %!contexts.keys.sort.List;23 }2425 method clear {26 %!contexts = ();27 }28}2930my SharedContextRegistry $REGISTRY .= new;3132our sub registry() is export(:DEFAULT) {33 $REGISTRY;34}