@@ -28,13 +28,13 @@ class { 'mysql::server': }
2828 it { is_expected . to contain_class ( 'mysql::params' ) }
2929
3030 it 'does not contain the touch command' do
31- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . without_content (
31+ is_expected . to contain_file ( 'xtrabackup.sh' ) . without_content (
3232 %r{(^\s +touch\s +$)} ,
3333 )
3434 end
3535
3636 it 'contains the wrapper script' do
37- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
37+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
3838 %r{(\n *^xtrabackup\s +.*\$ @)} ,
3939 )
4040 end
@@ -61,7 +61,7 @@ class { 'mysql::server': }
6161 end
6262
6363 it 'contains the weekly cronjob' do
64- expect ( subject ) . to contain_cron ( 'xtrabackup-weekly' )
64+ is_expected . to contain_cron ( 'xtrabackup-weekly' )
6565 . with (
6666 ensure : 'present' ,
6767 command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F)_full --backup' ,
@@ -80,7 +80,7 @@ class { 'mysql::server': }
8080 else
8181 '$(date -d "last sunday" +\%F)_full'
8282 end
83- expect ( subject ) . to contain_cron ( 'xtrabackup-daily' )
83+ is_expected . to contain_cron ( 'xtrabackup-daily' )
8484 . with (
8585 ensure : 'present' ,
8686 command : "/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp/#{ dateformat } --target-dir=/tmp/$(date +\\ %F_\\ %H-\\ %M-\\ %S) --backup" ,
@@ -100,14 +100,14 @@ class { 'mysql::server': }
100100 end
101101
102102 it 'contains the defined mysql user' do
103- expect ( subject ) . to contain_mysql_user ( 'backupuser@localhost' )
103+ is_expected . to contain_mysql_user ( 'backupuser@localhost' )
104104 . with (
105105 ensure : 'present' ,
106106 password_hash : '*4110E08DF51E70A4BA1D4E33A84205E38CF3FE58' ,
107107 )
108108 . that_requires ( 'Class[mysql::server::root_password]' )
109109
110- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
110+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
111111 . with (
112112 ensure : 'present' ,
113113 user : 'backupuser@localhost' ,
@@ -129,9 +129,9 @@ class { 'mysql::server': }
129129 end
130130
131131 it {
132- expect ( subject ) . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
133- expect ( subject ) . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
134- expect ( subject ) . not_to contain_mysql_grant ( 'backupuser@localhost/*.*' )
132+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
133+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
134+ is_expected . not_to contain_mysql_grant ( 'backupuser@localhost/*.*' )
135135 . with (
136136 ensure : 'present' ,
137137 user : 'backupuser@localhost' ,
@@ -150,7 +150,7 @@ class { 'mysql::server': }
150150 end
151151
152152 it {
153- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
153+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/*.*' )
154154 . with (
155155 ensure : 'present' ,
156156 user : 'backupuser@localhost' ,
@@ -164,7 +164,7 @@ class { 'mysql::server': }
164164 end ,
165165 )
166166 . that_requires ( 'Mysql_user[backupuser@localhost]' )
167- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
167+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.keyring_component_status' )
168168 . with (
169169 ensure : 'present' ,
170170 user : 'backupuser@localhost' ,
@@ -174,7 +174,7 @@ class { 'mysql::server': }
174174 )
175175 . that_requires ( 'Mysql_user[backupuser@localhost]' )
176176
177- expect ( subject ) . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
177+ is_expected . to contain_mysql_grant ( 'backupuser@localhost/performance_schema.log_status' )
178178 . with (
179179 ensure : 'present' ,
180180 user : 'backupuser@localhost' ,
@@ -221,7 +221,7 @@ class { 'mysql::server': }
221221 end
222222
223223 it 'contains the weekly cronjob' do
224- expect ( subject ) . to contain_cron ( 'xtrabackup-weekly' )
224+ is_expected . to contain_cron ( 'xtrabackup-weekly' )
225225 . with (
226226 ensure : 'present' ,
227227 command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F)_full --backup --skip-ssl' ,
@@ -234,7 +234,7 @@ class { 'mysql::server': }
234234 end
235235
236236 it 'contains the daily cronjob for weekdays 1-6' do
237- expect ( subject ) . to contain_cron ( 'xtrabackup-daily' )
237+ is_expected . to contain_cron ( 'xtrabackup-daily' )
238238 . with (
239239 ensure : 'present' ,
240240 command : "/usr/local/sbin/xtrabackup.sh --incremental-basedir=/tmp/#{ dateformat } --target-dir=/tmp/$(date +\\ %F_\\ %H-\\ %M-\\ %S) --backup --skip-ssl" ,
@@ -253,11 +253,11 @@ class { 'mysql::server': }
253253 end
254254
255255 it 'not contains the weekly cronjob' do
256- expect ( subject ) . not_to contain_cron ( 'xtrabackup-weekly' )
256+ is_expected . not_to contain_cron ( 'xtrabackup-weekly' )
257257 end
258258
259259 it 'contains the daily cronjob with all weekdays' do
260- expect ( subject ) . to contain_cron ( 'xtrabackup-daily' ) . with (
260+ is_expected . to contain_cron ( 'xtrabackup-daily' ) . with (
261261 ensure : 'present' ,
262262 command : '/usr/local/sbin/xtrabackup.sh --target-dir=/tmp/$(date +\%F_\%H-\%M-\%S) --backup' ,
263263 user : 'root' ,
@@ -275,7 +275,7 @@ class { 'mysql::server': }
275275 end
276276
277277 it 'contains the prescript' do
278- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
278+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
279279 %r{.*rsync -a /tmp backup01.local-lan:\n \n rsync -a /tmp backup02.local-lan:.*} ,
280280 )
281281 end
@@ -288,7 +288,7 @@ class { 'mysql::server': }
288288 end
289289
290290 it 'contains the prostscript' do
291- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
291+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
292292 %r{.*rsync -a /tmp backup01.local-lan:\n \n rsync -a /tmp backup02.local-lan:.*} ,
293293 )
294294 end
@@ -301,7 +301,7 @@ class { 'mysql::server': }
301301 end
302302
303303 it 'contain the mariabackup executor' do
304- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
304+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
305305 %r{(\n *^mariabackup\s +.*\$ @)} ,
306306 )
307307 end
@@ -313,7 +313,7 @@ class { 'mysql::server': }
313313 end
314314
315315 it 'contain the touch /tmp/backup_success command' do
316- expect ( subject ) . to contain_file ( 'xtrabackup.sh' ) . with_content (
316+ is_expected . to contain_file ( 'xtrabackup.sh' ) . with_content (
317317 %r{(^\s +touch /tmp/backup_success$)} ,
318318 )
319319 end
0 commit comments