4444 end
4545 it { is_expected . to contain_exec ( 'initialize letsencrypt' ) }
4646 it { is_expected . to contain_exec ( 'letsencrypt certonly foo.example.com' ) }
47- it { is_expected . to contain_exec ( 'letsencrypt certonly foo.example.com' ) . with_unless "/usr/local/sbin/letsencrypt-domain-validation #{ pathprefix } /etc/letsencrypt/live/foo.example.com/cert.pem 'foo.example.com'" }
47+ it { is_expected . to contain_exec ( 'letsencrypt certonly foo.example.com' ) . with_unless ( [ 'test ! -f /usr/local/sbin/letsencrypt-domain-validation' , "/usr/local/sbin/letsencrypt-domain-validation #{ pathprefix } /etc/letsencrypt/live/foo.example.com/cert.pem 'foo.example.com'" ] ) }
4848 end
4949
5050 context 'with ensure absent' do
@@ -483,7 +483,7 @@ class { 'letsencrypt::plugin::dns_cloudflare':
483483
484484 it { is_expected . to compile . with_all_deps }
485485 it { is_expected . to contain_file ( '/foo/bar/baz' ) . with_ensure ( 'directory' ) }
486- it { is_expected . to contain_exec ( 'letsencrypt certonly foo.example.com' ) . with_unless ' /usr/local/sbin/letsencrypt-domain-validation /foo/bar/baz/live/foo.example.com/cert.pem \'foo.example.com\'' }
486+ it { is_expected . to contain_exec ( 'letsencrypt certonly foo.example.com' ) . with_unless ( [ 'test ! -f /usr/local/sbin/letsencrypt-domain-validation' , ' /usr/local/sbin/letsencrypt-domain-validation /foo/bar/baz/live/foo.example.com/cert.pem \'foo.example.com\''] ) }
487487 end
488488
489489 context 'on FreeBSD' , if : facts [ :os ] [ 'name' ] == 'FreeBSD' do
@@ -495,7 +495,7 @@ class { 'letsencrypt::plugin::dns_cloudflare':
495495 it { is_expected . to contain_ini_setting ( '/usr/local/etc/letsencrypt/cli.ini email [email protected] ' ) } 496496 it { is_expected . to contain_ini_setting ( '/usr/local/etc/letsencrypt/cli.ini server https://acme-v02.api.letsencrypt.org/directory' ) }
497497 it { is_expected . to contain_file ( '/usr/local/etc/letsencrypt' ) . with_ensure ( 'directory' ) }
498- it { is_expected . to contain_exec ( 'letsencrypt certonly foo.example.com' ) . with_unless ' /usr/local/sbin/letsencrypt-domain-validation /usr/local/etc/letsencrypt/live/foo.example.com/cert.pem \'foo.example.com\'' }
498+ it { is_expected . to contain_exec ( 'letsencrypt certonly foo.example.com' ) . with_unless ( [ 'test ! -f /usr/local/sbin/letsencrypt-domain-validation' , ' /usr/local/sbin/letsencrypt-domain-validation /usr/local/etc/letsencrypt/live/foo.example.com/cert.pem \'foo.example.com\''] ) }
499499 end
500500 end
501501 end
0 commit comments