Skip to content

Commit 01d0211

Browse files
committed
Standardize extension command title
1 parent 4b29107 commit 01d0211

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

manifests/server/extension.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
$command = "CREATE EXTENSION \"${extension}\""
1818
$unless_mod = ''
1919
$package_require = []
20-
$package_before = Postgresql_psql["Add ${extension} extension to ${database}"]
20+
$package_before = Postgresql_psql["${database}: ${command}"]
2121
}
2222

2323
'absent': {
2424
$command = "DROP EXTENSION \"${extension}\""
2525
$unless_mod = 'NOT '
26-
$package_require = Postgresql_psql["Add ${extension} extension to ${database}"]
26+
$package_require = Postgresql_psql["${database}: ${command}"]
2727
$package_before = []
2828
}
2929

@@ -39,7 +39,7 @@
3939
}
4040
}
4141

42-
postgresql_psql {"Add ${extension} extension to ${database}":
42+
postgresql_psql { "${database}: ${command}":
4343

4444
psql_user => $user,
4545
psql_group => $group,

spec/unit/defines/server/extension_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
context "with mandatory arguments only" do
2929
it {
30-
is_expected.to contain_postgresql_psql('Add postgis extension to template_postgis').with({
30+
is_expected.to contain_postgresql_psql('template_postgis: CREATE EXTENSION "postgis"').with({
3131
:db => 'template_postgis',
3232
:command => 'CREATE EXTENSION "postgis"',
3333
}).that_requires('Postgresql::Server::Database[template_postgis]')
@@ -43,7 +43,7 @@
4343
is_expected.to contain_package('postgis').with({
4444
:ensure => 'present',
4545
:name => 'postgis',
46-
}).that_comes_before('Postgresql_psql[Add postgis extension to template_postgis]')
46+
}).that_comes_before('Postgresql_psql[template_postgis: CREATE EXTENSION "postgis"]')
4747
}
4848
end
4949

@@ -54,7 +54,7 @@
5454
}) }
5555

5656
it {
57-
is_expected.to contain_postgresql_psql('Add postgis extension to template_postgis').with({
57+
is_expected.to contain_postgresql_psql('template_postgis: DROP EXTENSION "postgis"').with({
5858
:db => 'template_postgis',
5959
:command => 'DROP EXTENSION "postgis"',
6060
}).that_requires('Postgresql::Server::Database[template_postgis]')
@@ -73,7 +73,7 @@
7373
}) }
7474

7575
it {
76-
is_expected.to contain_postgresql_psql('Add postgis extension to template_postgis').with({
76+
is_expected.to contain_postgresql_psql('template_postgis: DROP EXTENSION "postgis"').with({
7777
:db => 'template_postgis',
7878
:command => 'DROP EXTENSION "postgis"',
7979
}).that_requires('Postgresql::Server::Database[template_postgis]')
@@ -83,7 +83,7 @@
8383
is_expected.to contain_package('postgis').with({
8484
:ensure => 'present',
8585
:name => 'postgis',
86-
}).that_requires('Postgresql_psql[Add postgis extension to template_postgis]')
86+
}).that_requires('Postgresql_psql[template_postgis: DROP EXTENSION "postgis"]')
8787
}
8888
end
8989
end
@@ -147,7 +147,7 @@
147147

148148
context "with mandatory arguments only" do
149149
it {
150-
is_expected.to contain_postgresql_psql('Add postgis extension to template_postgis2').with({
150+
is_expected.to contain_postgresql_psql('template_postgis2: CREATE EXTENSION "postgis"').with({
151151
:db => 'template_postgis2',
152152
:command => 'CREATE EXTENSION "postgis"',
153153
}).that_requires('Postgresql::Server::Database[template_postgis2]')

0 commit comments

Comments
 (0)