use File::Spec qw//;
use Cwd qw//;
use Digest::MD5 qw//;
+use Lingua::EN::Inflect::Number qw//;
require DBIx::Class;
our $VERSION = '0.04999_05';
$moniker = $self->moniker_map->($table);
}
- $moniker ||= join '', map ucfirst, split /[\W_]+/, lc $table;
+ $moniker ||= join '', map ucfirst, split /[\W_]+/,
+ Lingua::EN::Inflect::Number::to_S(lc $table);
return $moniker;
}
sub run_tests {
my $self = shift;
- plan tests => 3 + 2 * (131 + ($self->{extra}->{count} || 0));
+ plan tests => 3 + 2 * (132 + ($self->{extra}->{count} || 0));
$self->create();
my $debug = ($self->{verbose} > 1) ? 1 : 0;
my %loader_opts = (
- constraint => qr/^(?:\S+\.)?(?:$self->{vendor}_)?loader_test[0-9]+$/i,
+ constraint => qr/^(?:\S+\.)?(?:$self->{vendor}_)?loader_test[0-9]+s?$/i,
relationships => 1,
additional_classes => 'TestAdditional',
additional_base_classes => 'TestAdditionalBase',
$classes->{$table_name} = $schema_class . q{::} . $source_name;
}
- my $moniker1 = $monikers->{loader_test1};
- my $class1 = $classes->{loader_test1};
+ my $moniker1 = $monikers->{loader_test1s};
+ my $class1 = $classes->{loader_test1s};
my $rsobj1 = $conn->resultset($moniker1);
my $moniker2 = $monikers->{loader_test2};
}
ok($uniq1_test, "Unique constraint");
+ is($moniker1, 'LoaderTest1', 'moniker singularisation');
+
my %uniq2 = $class2->unique_constraints;
my $uniq2_test = 0;
foreach my $ucname (keys %uniq2) {
my $make_auto_inc = $self->{auto_inc_cb} || sub {};
my @statements = (
qq{
- CREATE TABLE loader_test1 (
+ CREATE TABLE loader_test1s (
id $self->{auto_inc_pk},
dat VARCHAR(32) NOT NULL UNIQUE
) $self->{innodb}
},
- $make_auto_inc->(qw/loader_test1 id/),
+ $make_auto_inc->(qw/loader_test1s id/),
- q{ INSERT INTO loader_test1 (dat) VALUES('foo') },
- q{ INSERT INTO loader_test1 (dat) VALUES('bar') },
- q{ INSERT INTO loader_test1 (dat) VALUES('baz') },
+ q{ INSERT INTO loader_test1s (dat) VALUES('foo') },
+ q{ INSERT INTO loader_test1s (dat) VALUES('bar') },
+ q{ INSERT INTO loader_test1s (dat) VALUES('baz') },
qq{
CREATE TABLE loader_test2 (
my $self = shift;
my @tables = qw/
- loader_test1
+ loader_test1s
loader_test2
LOADER_TEST23
LoAdEr_test24
/;
my @tables_auto_inc = (
- [ qw/loader_test1 id/ ],
+ [ qw/loader_test1s id/ ],
[ qw/loader_test2 id/ ],
);