aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2016-06-19 18:30:22 +0100
committerdakkar <dakkar@thenautilus.net>2016-06-19 18:30:22 +0100
commitd3f14711a3e2419f59e93f408e4854366c3997cb (patch)
treec0610256ba94b3a37fb851571848a45d87a194d4 /t
parentDebounce role (diff)
downloadSietima-d3f14711a3e2419f59e93f408e4854366c3997cb.tar.gz
Sietima-d3f14711a3e2419f59e93f408e4854366c3997cb.tar.bz2
Sietima-d3f14711a3e2419f59e93f408e4854366c3997cb.zip
bump perl requirement to 5.24
I can haz postderef!
Diffstat (limited to 't')
-rw-r--r--t/lib/Test/Sietima.pm12
-rw-r--r--t/lib/Test/Sietima/MailStore.pm8
-rw-r--r--t/tests/sietima.t2
-rw-r--r--t/tests/sietima/message.t2
-rw-r--r--t/tests/sietima/role/avoid-dups.t2
-rw-r--r--t/tests/sietima/role/debounce.t2
-rw-r--r--t/tests/sietima/role/nomail.t2
-rw-r--r--t/tests/sietima/role/subscriberonly/drop.t4
-rw-r--r--t/tests/sietima/role/subscriberonly/moderate.t4
-rw-r--r--t/tests/sietima/subscriber.t2
10 files changed, 20 insertions, 20 deletions
diff --git a/t/lib/Test/Sietima.pm b/t/lib/Test/Sietima.pm
index 549d654..115a1e6 100644
--- a/t/lib/Test/Sietima.pm
+++ b/t/lib/Test/Sietima.pm
@@ -1,7 +1,7 @@
package Test::Sietima;
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Import::Into;
use Email::Stuffer;
@@ -21,7 +21,7 @@ sub import {
for my $function (qw(transport make_sietima make_mail
deliveries_are test_sending)) {
no strict 'refs';
- *{"${target}::${function}"} = __PACKAGE__->can($function);
+ "${target}::${function}"->** = __PACKAGE__->can($function);
}
return;
}
@@ -38,7 +38,7 @@ sub make_sietima {
my $class = 'Sietima';
if (my $traits = delete $args{with_traits}) {
- $class = $class->with_traits(@{$traits});
+ $class = $class->with_traits($traits->@*);
}
$class->new({
@@ -57,7 +57,7 @@ my $maybe = sub {
my $mapit = sub {
my ($obj,$method,$arg) = @_;
return $obj unless $arg;
- for my $k (keys %{$arg}) {
+ for my $k (keys $arg->%*) {
$obj = $obj->$method($k, $arg->{$k});
}
return $obj;
@@ -81,7 +81,7 @@ sub deliveries_are {
my $ctx = context();
my $to = $args{to};
- my @recipients = ref($to) ? @{$to} : $to;
+ my @recipients = ref($to) ? $to->@* : $to;
my @deliveries = transport->deliveries;
is(
\@deliveries,
@@ -131,7 +131,7 @@ sub test_sending {
);
$args{from} ||= $sietima->return_path;
- $args{to} ||= [ map { $_->address} @{$sietima->subscribers} ];
+ $args{to} ||= [ map { $_->address} $sietima->subscribers->@* ];
deliveries_are(%args);
$ctx->release;
diff --git a/t/lib/Test/Sietima/MailStore.pm b/t/lib/Test/Sietima/MailStore.pm
index abf4435..78b76f3 100644
--- a/t/lib/Test/Sietima/MailStore.pm
+++ b/t/lib/Test/Sietima/MailStore.pm
@@ -1,7 +1,7 @@
package Test::Sietima::MailStore;
use strict;
use warnings;
-use 5.020;
+use 5.024;
use Moo;
use List::AllUtils qw(all);
use namespace::clean;
@@ -19,7 +19,7 @@ sub store {
my ($self,$mail,@tags) = @_;
my $id = time();
- push @{$self->_mails}, {
+ push $self->_mails->@*, {
id => $id,
mail => $mail->as_string,
tags => { map {$_ => 1;} @tags, },
@@ -31,7 +31,7 @@ sub retrieve_by_tags {
my ($self,@tags) = @_;
my @ret;
- for my $m (@{$self->_mails}) {
+ for my $m ($self->_mails->@*) {
next unless all { $m->{tags}{$_} } @tags;
push @ret, {
%{$m}{id},
@@ -45,7 +45,7 @@ sub retrieve_by_tags {
sub retrieve_by_id {
my ($self,$id) = @_;
- for my $m (@{$self->_mails}) {
+ for my $m ($self->_mails->@*) {
next unless $m->{id} eq $id;
return Email::MIME->new($m->{mail});
}
diff --git a/t/tests/sietima.t b/t/tests/sietima.t
index 3644763..143c026 100644
--- a/t/tests/sietima.t
+++ b/t/tests/sietima.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Test::Sietima;
diff --git a/t/tests/sietima/message.t b/t/tests/sietima/message.t
index 2db7fda..5d9ceca 100644
--- a/t/tests/sietima/message.t
+++ b/t/tests/sietima/message.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Test2::Bundle::Extended;
use Test2::Plugin::DieOnFail;
diff --git a/t/tests/sietima/role/avoid-dups.t b/t/tests/sietima/role/avoid-dups.t
index 997f3fd..d5fcab3 100644
--- a/t/tests/sietima/role/avoid-dups.t
+++ b/t/tests/sietima/role/avoid-dups.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Test::Sietima;
diff --git a/t/tests/sietima/role/debounce.t b/t/tests/sietima/role/debounce.t
index 6021f2b..698cd36 100644
--- a/t/tests/sietima/role/debounce.t
+++ b/t/tests/sietima/role/debounce.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Test::Sietima;
diff --git a/t/tests/sietima/role/nomail.t b/t/tests/sietima/role/nomail.t
index df4d106..fe64e84 100644
--- a/t/tests/sietima/role/nomail.t
+++ b/t/tests/sietima/role/nomail.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Test::Sietima;
diff --git a/t/tests/sietima/role/subscriberonly/drop.t b/t/tests/sietima/role/subscriberonly/drop.t
index 165268d..c4123af 100644
--- a/t/tests/sietima/role/subscriberonly/drop.t
+++ b/t/tests/sietima/role/subscriberonly/drop.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Test::Sietima;
@@ -11,7 +11,7 @@ my @subscriber_addresses = (
);
my $s = make_sietima(
with_traits => ['SubscriberOnly::Drop'],
- subscribers => [@subscriber_addresses],
+ subscribers => \@subscriber_addresses,
);
subtest 'from subscriber' => sub {
diff --git a/t/tests/sietima/role/subscriberonly/moderate.t b/t/tests/sietima/role/subscriberonly/moderate.t
index c76e69b..6564b13 100644
--- a/t/tests/sietima/role/subscriberonly/moderate.t
+++ b/t/tests/sietima/role/subscriberonly/moderate.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use lib 't/lib';
use Test::Sietima;
use Test::Sietima::MailStore;
@@ -14,7 +14,7 @@ my $admin = 'admin@lists.example.com';
my $ms = Test::Sietima::MailStore->new();
my $s = make_sietima(
with_traits => ['SubscriberOnly::Moderate'],
- subscribers => [@subscriber_addresses],
+ subscribers => \@subscriber_addresses,
admin => $admin,
mail_store => $ms,
);
diff --git a/t/tests/sietima/subscriber.t b/t/tests/sietima/subscriber.t
index 5a06bba..979997b 100644
--- a/t/tests/sietima/subscriber.t
+++ b/t/tests/sietima/subscriber.t
@@ -1,7 +1,7 @@
#!perl
use strict;
use warnings;
-use 5.020;
+use 5.024;
use Test2::Bundle::Extended;
use Test2::Plugin::DieOnFail;
use Sietima::Subscriber;