From c9bf554fff299bb429b7f93c474c97d14b749e3f Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 6 Dec 2008 23:01:49 -0500 Subject: get rid of each_match, it really doesn't belong here --- lib/MooseX/Role/Matcher.pm | 8 +------- t/100-collection.t | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm index bfb658e..d4731cc 100644 --- a/lib/MooseX/Role/Matcher.pm +++ b/lib/MooseX/Role/Matcher.pm @@ -2,7 +2,7 @@ package MooseX::Role::Matcher; use MooseX::Role::Parameterized; use List::Util qw/first/; -use List::MoreUtils qw/any apply/; +use List::MoreUtils qw/any/; parameter default_match => ( is => 'ro', @@ -27,12 +27,6 @@ method first_match => sub { $class->_apply_to_matches(\&first, @_); }; -method each_match => sub { - my $class = shift; - my $code = shift; - $class->_apply_to_matches(\&apply, $code, @_); -}; - method grep_matches => sub { my $class = shift; my $grep = sub { my $code = shift; grep { $code->() } @_ }; diff --git a/t/100-collection.t b/t/100-collection.t index 9c406e7..4a29e4d 100644 --- a/t/100-collection.t +++ b/t/100-collection.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 3; use Test::Deep; package Foo; @@ -57,7 +57,3 @@ ok(!$foos->any_match(b => qr/z/), 'any_match works'); is_deeply([shallow($foo2), shallow($foo3)], set($foos->grep_matches(c => qr/o/)), 'grep_matches works'); -my @each; -$foos->each_match(sub { push @each, $_ }, b => qr/a/); -is_deeply([shallow($foo1), shallow($foo3)], set(@each), - 'each_match works'); -- cgit v1.2.3-54-g00ecf