use strict; use warnings; use Test::More tests => 3; use MyDB; my $schema = MyDB->connect( 'dbi:mysql:test', '', '' ); $schema->deploy( { add_drop_table => 1 } ); $schema->populate( 'Author', [ [qw/id name/], [ 1, 'Stephen King' ], ] ); $schema->populate( 'Book', [ [qw/id title author/], [ 1, 'Misery', 1 ], ] ); my $book = $schema->resultset('Book')->find(1); is( $book->title(), 'Misery' ); is( $book->author_id(), 1 ); is( $book->author->name(), 'Stephen King' );