Add sqlite to validate_re
When doing spec tests on your custom modules you want to have as little dependencies as possible so specifying sqlite is the simplest. If you specify mysql or postgresql you'll need your custom testing grabing the upstream puppetlabs-mysql or puppetlabs-postgresql modules which just adds unnecessary deps instead of a few bytes in a validate_re function. Change-Id: If25e8c0161bdd487f11460884883f42ea13074b3
This commit is contained in:
parent
b723fe7e98
commit
c8fb3d1b5c
|
@ -57,7 +57,7 @@ class magnum::db (
|
|||
include ::magnum::deps
|
||||
|
||||
validate_re($database_connection,
|
||||
'^(mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
|
||||
oslo::db { 'magnum_config':
|
||||
connection => $database_connection,
|
||||
|
|
|
@ -57,7 +57,7 @@ describe 'magnum::db' do
|
|||
|
||||
context 'with incorrect database_connection string' do
|
||||
let :params do
|
||||
{ :database_connection => 'sqlite://magnum:magnum@localhost/magnum', }
|
||||
{ :database_connection => 'invalid://magnum:magnum@localhost/magnum', }
|
||||
end
|
||||
|
||||
it_raises 'a Puppet::Error', /validate_re/
|
||||
|
|
Loading…
Reference in New Issue