From a99ad69f3e1c42e975cc29f21fa9a7fcdabea19e Mon Sep 17 00:00:00 2001 From: Reid Vandewiele Date: Sat, 26 Oct 2013 18:24:42 -0700 Subject: [PATCH] Add tests The test sets an ip address, uses language to indicate it should end up in quotes. --- spec/acceptance/server/config_entry_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/acceptance/server/config_entry_spec.rb b/spec/acceptance/server/config_entry_spec.rb index a58903a..3e91ad4 100644 --- a/spec/acceptance/server/config_entry_spec.rb +++ b/spec/acceptance/server/config_entry_spec.rb @@ -23,4 +23,22 @@ describe 'postgresql::server::config_entry:', :unless => UNSUPPORTED_PLATFORMS.i expect(r.stderr).to eq('') end end + + it 'should correctly set a quotes-required string' do + pp = <<-EOS.unindent + class { 'postgresql::server': } + + postgresql::server::config_entry { 'listen_addresses': + value => '0.0.0.0', + } + EOS + + apply_manifest(pp, :catch_failures => true) + + psql('--command="show all" postgres') do |r| + r.stdout.should =~ /listen_adresses.+0\.0\.0\.0/ + r.stderr.should be_empty + r.exit_code.should == 0 + end + end end