X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDX%2FHypothesis.pm;fp=lib%2FDX%2FHypothesis.pm;h=0386cd09c24902a3b50493c42bbbff0680508d20;hb=9e8ed9aeb93760a17572c749bfaf18d459e895c3;hp=db9364f82eb9b8bc87d8c6af50d6b60ec5aa0201;hpb=a3104d41f0465afe890855937d2b0ee95a686f3e;p=scpubgit%2FDX.git diff --git a/lib/DX/Hypothesis.pm b/lib/DX/Hypothesis.pm index db9364f..0386cd0 100644 --- a/lib/DX/Hypothesis.pm +++ b/lib/DX/Hypothesis.pm @@ -24,13 +24,14 @@ has action_policy => (is => 'ro', isa => ActionPolicy, required => 1); sub with_actions { my ($self, @actions) = @_; my $hyp = $self; + my @events; foreach my $act (@actions) { return undef unless $self->action_policy->allows($act); - ($hyp, my @events) = $act->dry_run($hyp); - return undef unless $hyp; - $hyp = $hyp->but_recheck_for(@events); + ($hyp, my @these_events) = $act->dry_run($hyp); return undef unless $hyp; + push @events, @these_events; } + $hyp = $hyp->but_recheck_for(@events); return $hyp; }