From 845fa707be7132e753f291901dd7e4d4dc48c405 Mon Sep 17 00:00:00 2001 From: Chris Price Date: Sat, 20 Oct 2012 00:24:37 -0700 Subject: Better handling of whitespace lines at ends of sections This is another bit of cosmetic functionality; prior to this commit, when adding a new setting to a section, we'd write it on the very last line before the next section, even if there was a chunk of trailing whitespace lines at the end of the existing section. This was functional, but the output was not always particularly pleasant for human consumption. This commit tweaks things so that we insert new settings just before the final chunk of whitespace lines in an existing section. This keeps things a bit cleaner. --- spec/unit/puppet/provider/ini_setting/ruby_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/unit/puppet/provider/ini_setting/ruby_spec.rb b/spec/unit/puppet/provider/ini_setting/ruby_spec.rb index dc3b7cb..19db4c7 100644 --- a/spec/unit/puppet/provider/ini_setting/ruby_spec.rb +++ b/spec/unit/puppet/provider/ini_setting/ruby_spec.rb @@ -361,6 +361,7 @@ foo = http://192.168.1.1:8080 provider.create validate_file(<<-EOS foo = yippee + [section2] foo = http://192.168.1.1:8080 EOS @@ -571,8 +572,8 @@ subby=bar bar = barvalue master = true - yahoo = yippee + [section2] foo= foovalue2 baz=bazvalue -- cgit v1.2.3