7 context 'on every platform' do
8 it { should contain_class 'prosody::package' }
9 it { should contain_class 'prosody::config' }
10 it { should contain_class 'prosody::service' }
12 it { should contain_package('prosody').with(ensure: 'present') }
15 context 'with daemonize => true' do
16 let(:params) { { daemonize: true } }
18 should contain_service('prosody').with(
24 context 'with daemonize => false' do
25 let(:params) { { daemonize: false } }
27 should_not contain_service('prosody').with(
33 context 'with custom options' do
34 let(:params) { { custom_options: { 'foo' => 'bar', 'baz' => 'quux' } } }
36 should contain_file('/etc/prosody/prosody.cfg.lua') \
37 .with_content(/^foo = "bar"$/, /^baz = "quux"$/)
41 context 'with deeply nested custom options' do
42 let(:params) { { custom_options: { 'foo' => { 'fnord' => '23', 'xyzzy' => '42' }, 'bar' => %w[cool elements], 'baz' => 'quux' } } }
44 should contain_file('/etc/prosody/prosody.cfg.lua') \
45 .with_content(/^foo = {\n fnord = "23";\n xyzzy = "42";\n}$/, /^baz = "quux"$/, /^bar = [ "cool"; "elements" ]$/)