From bd9924435307ffaa346c49bbe2a797207a969324 Mon Sep 17 00:00:00 2001 From: Pete Johns <pete.johns@envato.com> Date: Sat, 28 Jun 2014 13:22:01 +1000 Subject: [PATCH] Test allowing $ signs in section names Verifying that this PR addresses https://github.com/puppetlabs/puppetlabs-inifile/pull/98 --- spec/unit/puppet/util/ini_file_spec.rb | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/spec/unit/puppet/util/ini_file_spec.rb b/spec/unit/puppet/util/ini_file_spec.rb index 8ace29780..051579c7d 100644 --- a/spec/unit/puppet/util/ini_file_spec.rb +++ b/spec/unit/puppet/util/ini_file_spec.rb @@ -166,4 +166,40 @@ ] end end + + context 'Samba INI file with dollars in section names' do + let(:sample_content) do + template = <<-EOS + [global] + workgroup = FELLOWSHIP + ; ... + idmap config * : backend = tdb + + [printers] + comment = All Printers + ; ... + browseable = No + + [print$] + comment = Printer Drivers + path = /var/lib/samba/printers + + [Shares] + path = /home/shares + read only = No + guest ok = Yes + EOS + template.split("\n") + end + + it "should parse the correct section_names" do + subject.section_names.should match_array [ + '', + 'global', + 'printers', + 'print$', + 'Shares' + ] + end + end end