Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (23 sloc) 0.785 kb
use t::Utils;
use Test::More;
use Mock::Inflate;
my $dbh = t::Utils->setup_dbh;
my $db = Mock::Inflate->new({ dbh => $dbh });
$db->setup_test_db;
$db->insert('mock_inflate', {
id => 1,
name => 'perl',
});
subtest "update() doesn't break inflation after called" => sub {
my $row = $db->single(mock_inflate => { id => 1 });
isa_ok $row->name, 'Mock::Inflate::Name';
$row->update({ name => 'python' });
isa_ok $row->name, 'Mock::Inflate::Name';
};
subtest "deflation called twice" => sub {
my $row = $db->single(mock_inflate => { id => 1 });
$row->update({ name => 'python' });
my $row_hash = $dbh->selectrow_hashref('select name from mock_inflate where id = 1');
is $row_hash->{name}, 'python_deflate';
};
done_testing;
Jump to Line
Something went wrong with that request. Please try again.