diff --git a/manifests/service.pp b/manifests/service.pp index 7f0e5aa..4ba886f 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -1,9 +1,9 @@ # == Class: prosody::service -class prosody::service( +# +class prosody::service ( Optional[Boolean] $hasstatus = undef, Optional[String] $restart = undef, ) { - if pick($prosody::manage_service, $prosody::daemonize) { service { 'prosody': ensure => running, diff --git a/spec/classes/service_spec.rb b/spec/classes/service_spec.rb index 0c57e6a..0def524 100644 --- a/spec/classes/service_spec.rb +++ b/spec/classes/service_spec.rb @@ -9,24 +9,24 @@ if facts[:os]['name'] == 'Debian' is_expected.not_to contain_service('prosody') else - is_expected.to contain_service('prosody') - .with_ensure('running') - .with_enable(true) - .without_hasstatus - .without_restart + is_expected.to contain_service('prosody'). + with_ensure('running'). + with_enable(true). + without_hasstatus. + without_restart end elsif facts[:os]['family'] == 'OpenBSD' - is_expected.not_to contain_service('prosody') - .with_ensure('running') - .with_enable(true) - .without_hasstatus - .without_restart + is_expected.not_to contain_service('prosody'). + with_ensure('running'). + with_enable(true). + without_hasstatus. + without_restart else - is_expected.to contain_service('prosody') - .with_ensure('running') - .with_hasstatus(false) - .with_restart('/usr/bin/prosodyctl reload') + is_expected.to contain_service('prosody'). + with_ensure('running'). + with_hasstatus(false). + with_restart('/usr/bin/prosodyctl reload') end } end @@ -51,9 +51,9 @@ end it { - is_expected.to contain_service('prosody') - .with_ensure('running') - .with_enable(true) + is_expected.to contain_service('prosody'). + with_ensure('running'). + with_enable(true) } end context 'with manage => false' do