[libcode-tidyall-perl] 244/374: test_selects_and_ignores

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:26:28 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcode-tidyall-perl.

commit 96d46b0e1ec6fcb9ec60c30d93249364af0b5aad
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Fri Sep 14 14:10:50 2012 -0400

    test_selects_and_ignores
---
 lib/Code/TidyAll/t/Basic.pm |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/lib/Code/TidyAll/t/Basic.pm b/lib/Code/TidyAll/t/Basic.pm
index 0ee65de..9aac578 100644
--- a/lib/Code/TidyAll/t/Basic.pm
+++ b/lib/Code/TidyAll/t/Basic.pm
@@ -205,6 +205,25 @@ sub test_caching_and_backups : Tests {
     }
 }
 
+sub test_selects_and_ignores : Tests {
+    my $self = shift;
+
+    my @files = ( "a/foo.pl", "b/foo.pl", "a/foo.pm", "a/bar.pm", "b/bar.pm" );
+    my $root_dir = $self->create_dir( { map { $_ => 'hi' } @files } );
+    my $ct = Code::TidyAll->new(
+        root_dir => $root_dir,
+        plugins  => {
+            test_plugin('UpperText') => {
+                select => '**/*.pl **/*.pm b/bar.pm c/bar.pl',
+                ignore => 'a/foo.pl **/bar.pm c/baz.pl'
+            }
+        }
+    );
+    cmp_set( [ $ct->find_matched_files() ], [ "$root_dir/a/foo.pm", "$root_dir/b/foo.pl" ] );
+    cmp_deeply( [ map { $_->name } $ct->plugins_for_path("a/foo.pm") ],
+        [ test_plugin('UpperText') ] );
+}
+
 sub test_errors : Tests {
     my $self = shift;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git



More information about the Pkg-perl-cvs-commits mailing list