File: 04_class.t

package info (click to toggle)
liborlite-migrate-perl 1.10-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 248 kB
  • ctags: 152
  • sloc: perl: 1,885; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl

BEGIN {
	$|  = 1;
	$^W = 1;
}

use Test::More tests => 4;
use File::Spec::Functions ':ALL';
use ORLite::Migrate::Timeline ();
use t::lib::Test;
use t::lib::MyTimeline;

# Set up the file
my $file = test_db();

# Create the test package
eval <<"END_PERL"; die $@ if $@;
package Foo::Bar;

use strict;
use ORLite::Migrate {
	file         => '$file',
	timeline     => 't::lib::MyTimeline',
	user_version => 3,
	prune        => 1,
};

1;
END_PERL

can_ok( 'Foo::Bar', 'do' );
can_ok( 'Foo::Bar', 'orlite' );
is( Foo::Bar::Foo->base, 'Foo::Bar', 'Foo::Bar::Foo created' );
is( Foo::Bar->pragma('user_version'), 3, 'user_version is 3' );