There is a better fix for this in the pipes, but this will do for now
(cherry pick of
4f52479b)
* Fixes
- Fix incorrect collapsing-parser source being generated in the
presence of unicode data among the collapse-points
+ - Fix endless loop on BareSourcelessResultClass->throw_exception(...)
* Misc
- Depend on newer Moo, fixing some interoperability issues:
sub throw_exception {
my $self=shift;
- if (ref $self && ref $self->result_source ) {
- $self->result_source->throw_exception(@_)
+ if (ref $self && ref (my $rsrc = try { $self->result_source_instance } ) ) {
+ $rsrc->throw_exception(@_)
}
else {
DBIx::Class::Exception->throw(@_);
throws_ok { $schema->resultset} qr/resultset\(\) expects a source name/, 'resultset with no argument throws exception';
+throws_ok { $schema->source('Artist')->result_class->new( 'bugger' ) } qr/must be a hashref/;
+
done_testing;
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+
+use lib 't/lib';
+use DBICTest;
+
+{
+ package DBICTest::Foo;
+ use base "DBIx::Class::Core";
+}
+
+throws_ok { DBICTest::Foo->new("urgh") } qr/must be a hashref/;
+
+done_testing;