chizmw / test-dbix-class-schema

DBIx::Class schema sanity checking tests
http://search.cpan.org/dist/Test-DBIx-Class-Schema/
3 stars 6 forks source link

Missing relation with Moose throws an exception (v1.0.9) #21

Open willsheppard opened 6 years ago

willsheppard commented 6 years ago

I mis-typed a relationship name in the expected 'relations', and I got an exception:

Can't call method "isa" on unblessed reference

I expected a proper test failure with a message like:

not ok 9 - 'mis-typed_method_name' is not a valid relationship

Stack trace:

Can't call method "isa" on unblessed reference at /opt/bar/lib/site_perl/DBIx/Class/ResultSet.pm line 310.
    DBIx::Class::ResultSet::new("Foo::Schema::ResultSet::Public::Channel", HASH(0x7010b10)) called at constructor Foo::Schema::ResultSet::Public::Channel::new (defined at /src/policy/lib/policy.pm line 166) line 27
    Foo::Schema::ResultSet::Public::Channel::new(Foo::Schema::ResultSet::Public::Channel=HASH(0x6ee0568), HASH(0x7010b10)) called at /opt/bar/lib/site_perl/Test/DBIx/Class/Schema.pm line 156
    Test::DBIx::Class::Schema::_test_normal_methods(Test::DBIx::Class::Schema=HASH(0x6eeaa40), Foo::Schema::ResultSet::Public::Channel=HASH(0x6ee0568)) called at /opt/bar/lib/site_perl/Test/DBIx/Class/Schema.pm line 76
    Test::DBIx::Class::Schema::run_tests(Test::DBIx::Class::Schema=HASH(0x6eeaa40)) called at t/10-env/schema_test.t line 74
willsheppard commented 6 years ago

There is something that sounds like this in the Changes file for v1.0.12, but I don't think it's this issue because:

I believe I've reproduced it using version 1.0.12, with DBIx::Class 0.082821 and Moose 2.1801.