From c51610fc451d1222069a84703239a611ecb4973b Mon Sep 17 00:00:00 2001 From: Andrew Stangl Date: Sat, 28 May 2016 10:34:23 +0200 Subject: [PATCH] add specs to test that arrays are properly handled - #64 --- spec/classes/init_spec.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 6793193..cbeadde 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -62,4 +62,30 @@ end it { is_expected.to_not contain_yumrepo('kibana-4.5') } end + + context 'handles array values in the config hash' do + let :facts do + { + :osfamily => 'RedHat' + } + end + let :params do + { + :version => 'latest', + :service_ensure => true, + :service_enable => true, + :config => { + 'server.port' => 5601, + 'server.host' => '0.0.0.0', + 'elasticsearch.url' => 'http://localhost:9200', + 'bundled_plugin_ids' => [ + 'plugins/visualize/index' + ] + } + } + end + it { is_expected.to contain_file('kibana-config-file') + .with_content(/^( - plugins\/visualize\/index)$/) } + end + end