File: 35disable_sth_caching.t

package info (click to toggle)
libdbix-class-perl 0.08010-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,052 kB
  • ctags: 1,064
  • sloc: perl: 10,536; sql: 225; makefile: 45
file content (19 lines) | stat: -rwxr-xr-x 488 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
use strict;
use warnings;  

use Test::More;
use lib qw(t/lib);
use DBICTest;

plan tests => 2;

# Set up the "usual" sqlite for DBICTest
my $schema = DBICTest->init_schema;

my $sth_one = $schema->storage->sth('SELECT 42');
my $sth_two = $schema->storage->sth('SELECT 42');
$schema->storage->disable_sth_caching(1);
my $sth_three = $schema->storage->sth('SELECT 42');

ok($sth_one == $sth_two, "statement caching works");
ok($sth_two != $sth_three, "disabling statement caching works");