use Test::More;
use Test::Exception;
use lib qw(t/lib);
-use Devel::Dwarn;
use ViewDeps;
BEGIN {
use_ok('DBIx::Class::ResultSource::View');
}
+### SANITY
+
my $view = DBIx::Class::ResultSource::View->new( { name => 'Quux' } );
-isa_ok( $view, 'DBIx::Class::ResultSource' );
-isa_ok( $view, 'DBIx::Class' );
+isa_ok( $view, 'DBIx::Class::ResultSource', 'A new view');
+isa_ok( $view, 'DBIx::Class', 'A new view also');
can_ok( $view, $_ ) for qw/new from depends_on/;
-#################################
+### DEPS
my $schema = ViewDeps->connect;
ok( $schema, 'Connected to ViewDeps schema OK' );
'DBIx::Class::ResultSource::View',
'though Foo'
);
-#diag($schema->resultset('Baz')->result_source->table_class);
-isa_ok($schema->resultset('Baz')->result_source, 'DBIx::Class::ResultSource::Table', "Baz on the other hand");
-dies_ok { ViewDeps::Result::Baz->result_source_instance->depends_on(
- { ViewDeps::Result::Mixin->result_source_instance->name => 1 }
- ) } "...and you cannot use depends_on with that";
+isa_ok(
+ $schema->resultset('Baz')->result_source,
+ 'DBIx::Class::ResultSource::Table',
+ "Baz on the other hand"
+);
+dies_ok {
+ ViewDeps::Result::Baz->result_source_instance->depends_on(
+ { ViewDeps::Result::Mixin->result_source_instance->name => 1 } );
+}
+"...and you cannot use depends_on with that";
done_testing;