1#!/usr/bin/perl
2
3# Repeat the previous test, this time with a live transaction at END-time
4
5BEGIN {
6	$|  = 1;
7	$^W = 1;
8}
9
10use Test::More tests => 4;
11use File::Spec::Functions ':ALL';
12use t::lib::Test;
13
14
15#####################################################################
16# Set up for testing
17
18# Connect
19my $file = test_db();
20my $dbh  = create_ok(
21	file    => catfile(qw{ t 10_cleanup.sql }),
22	connect => [ "dbi:SQLite:$file" ],
23);
24
25# Create the test package
26eval <<"END_PERL"; die $@ if $@;
27package Foo::Bar;
28
29use strict;
30use ORLite {
31	file    => '$file',
32	cleanup => 'VACUUM ANALYZE',
33};
34
351;
36END_PERL
37
38
39#####################################################################
40# Run the tests
41
42ok( Foo::Bar->can('orlite'), 'Created the ORLite class' );
43ok( Foo::Bar->begin, 'Created the transaction' );
44ok( ! Foo::Bar->dbh->{AutoCommit}, '->{AutoCommit} is off' );
45
46