summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/config.rb2
-rwxr-xr-xtest/other/config.rb12
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/puppet/config.rb b/lib/puppet/config.rb
index 23268e463..77c167ae8 100644
--- a/lib/puppet/config.rb
+++ b/lib/puppet/config.rb
@@ -230,7 +230,7 @@ class Config
when /^true$/i: true
when /^\d+$/i: Integer(value)
else
- value.gsub(/^["']|["']$/,'')
+ value.gsub(/^["']|["']$/,'').sub(/\s+$/, '')
end
end
diff --git a/test/other/config.rb b/test/other/config.rb
index 3eb6b77a6..285331c72 100755
--- a/test/other/config.rb
+++ b/test/other/config.rb
@@ -916,6 +916,18 @@ inttest = 27
# assert(! yay.find { |o| o.class.name == :group and o.name == "root" },
# "Found root group")
end
+
+ # #415
+ def test_remove_trailing_spaces
+ config = mkconfig()
+ config.setdefaults(:yay, :rah => ["testing", "a desc"])
+
+ file = tempfile()
+ File.open(file, "w") { |f| f.puts "rah = something " }
+
+ assert_nothing_raised { config.parse(file) }
+ assert_equal("something", config[:rah], "did not remove trailing whitespace in parsing")
+ end
end
# $Id$