Fixed case where no uuid module found so that it dies with error, not with method...
[dbsrgits/DBIx-Class-UUIDColumns.git] / t / 05uuid.t
CommitLineData
773544fd 1use strict;
2use warnings;
3use Test::More;
4
5BEGIN {
aaeaf963 6 plan skip_all => 'needs Data::UUID for testing'
7 unless
8 eval 'require Data::UUID' ||
9 eval 'require APR::UUID' ||
10 eval 'require UUID' ||
11 eval 'require Win32::Guidgen' ||
12 eval 'require Win32API::GUID';
13
14 plan skip_all => 'needs SQL::Translator for testing'
15 unless eval 'require SQL::Translator';
16
17 plan tests => 3;
773544fd 18}
19
20use lib qw(t/lib);
21
22use UUIDTest;
23use UUIDTest::Setup;
24
25my $schema = UUIDTest->schema;
26my $row;
27
28
29$row = $schema->resultset('Test')->create({ });
30ok UUIDTest::is_uuid( $row->id ), 'got something that loks like a UUID from Auto';
31
32UUIDTest::Schema::Test->uuid_class('CustomUUIDMaker');
33Class::C3->reinitialize();
34$row = $schema->resultset('Test')->create({ });
35ok UUIDTest::is_uuid( $row->id ), 'got something that loks like a UUID from CustomUUIDMaker';
36
37UUIDTest::Schema::Test->uuid_class('::Data::UUID');
38Class::C3->reinitialize();
39$row = $schema->resultset('Test')->create({ });
40ok UUIDTest::is_uuid( $row->id ), 'got something that loks like a UUID from Data::UUID';
41
aaeaf963 421;