1. Shlomi Fish
  2. web-cpan

Commits

Shlomi Fish  committed 00fdbc0

Fix a bug with guessing a unix like format.

  • Participants
  • Parent commits 48fa59a
  • Branches default
  • Tags Module-Format-v0.0.3

Comments (0)

Files changed (6)

File Module-Format/Module-Format/Changes

View file
 Revision history for Module-Format
 
+0.0.3   Wed Dec  1 13:03:47 IST 2010
+        - Correct a bug with the regex of guessing a 
+        MooseX/Role/BuildInstanceOf.pm -like unix path.
+
 0.0.2   Sun Nov 28 22:13:26 IST 2010
         - Add keywords and resources to the Build.PL/META.yml.
         - Removed the depenedency on List::MoreUtils.

File Module-Format/Module-Format/lib/Module/Format.pm

View file
 
 =head1 VERSION
 
-Version 0.0.2
+Version 0.0.3
 
 =cut
 
-our $VERSION = '0.0.2';
+our $VERSION = '0.0.3';
 
 
 =head1 SYNOPSIS

File Module-Format/Module-Format/lib/Module/Format/Module.pm

View file
 
 =head1 VERSION
 
-Version 0.0.2
+Version 0.0.3
 
 =cut
 
-our $VERSION = '0.0.2';
+our $VERSION = '0.0.3';
 
 =head1 SYNOPSIS
 
     },
     {
         name => 'unix',
-        regex => qr{\A(?:\w+/)*\.pm\z},
+        regex => qr{\A(?:\w+/)*\w+\.pm\z},
         input => sub {
             my ($class, $value) = @_;
 

File Module-Format/Module-Format/lib/Module/Format/ModuleList.pm

View file
 
 =head1 VERSION
 
-Version 0.0.2
+Version 0.0.3
 
 =cut
 
-our $VERSION = '0.0.2';
+our $VERSION = '0.0.3';
 
 =head1 SYNOPSIS
 

File Module-Format/Module-Format/lib/Module/Format/PerlMF_App.pm

View file
 
 =head1 VERSION
 
-Version 0.0.2
+Version 0.0.3
 
 =cut
 
-our $VERSION = '0.0.2';
+our $VERSION = '0.0.3';
 
 =head1 SYNOPSIS
 

File Module-Format/Module-Format/t/module.t

View file
 use strict;
 use warnings;
 
-use Test::More tests => 59;
+use Test::More tests => 63;
 
 use Module::Format::Module;
 
         "format_as works for from_guess()ed colon module",
     );
 }
+
+{
+    my $chosen_format;
+    my $module = Module::Format::Module->from_guess(
+        {
+            value => 'MooseX/Role/BuildInstanceOf.pm',
+            format_ref => \$chosen_format,
+        }
+    );
+    
+    # TEST
+    ok ($module, "from_guess initialises a module.");
+
+    # TEST
+    is_deeply(
+        $module->get_components_list(),
+        [qw(MooseX Role BuildInstanceOf)],
+        "from_guess got good components.",
+    );
+
+    # TEST
+    is ($chosen_format, 'unix', 'chosen format was initialised');
+
+    # TEST
+    is ($module->format_as('dash'), 'MooseX-Role-BuildInstanceOf',
+        "format_as works for from_guess()ed module",
+    );
+}