From: Devin Austin Date: Thu, 20 Jan 2011 23:49:02 +0000 (-0700) Subject: tidied up class names X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69957976ab05a873c810c610111504223ea11e74;p=dbsrgits%2FDBIx-Class.git tidied up class names --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 6703a0f..574bc4b 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -1889,7 +1889,9 @@ sub inject_resultset_components { my @components = @{shift @_}; # this generation of class bit needs to go into CCC - my $class = $self->resultset_class . "::WITH::" . join ("::", @components); + my @normalized = @components; + $_ =~ s/\W/_/g for @normalized; + my $class = $self->resultset_class . "::WITH::" . join ("::", @normalized); Class::C3::Componentised->inject_base($class, $self->resultset_class); $self->resultset_class($class); diff --git a/t/resultset/components.t b/t/resultset/components.t index 3f66e6d..e23ea44 100644 --- a/t/resultset/components.t +++ b/t/resultset/components.t @@ -11,7 +11,7 @@ my $schema = DBICTest->init_schema; isa_ok $schema->resultset('Artist'), 'A::Useless', 'Artist RS'; ok !$schema->resultset('CD')->isa('A::Useless'), 'CD RS is not A::Useless'; -my @classes = ('DBICTest::BaseResultSet::WITH::+A::Useless::+A::MoarUseless', +my @classes = ('DBICTest::BaseResultSet::WITH::_A__Useless::_A__MoarUseless', 'A::Useless', 'A::MoarUseless', 'DBICTest::BaseResultSet', @@ -20,7 +20,6 @@ my @classes = ('DBICTest::BaseResultSet::WITH::+A::Useless::+A::MoarUseless', 'DBIx::Class::Componentised', 'Class::C3::Componentised', 'Class::Accessor::Grouped'); -warn "classes: " . Dumper \@classes; is_deeply(mro::get_linear_isa(ref $schema->resultset('Artist')), \@classes, 'Proper ISA Stack Order');