Update quoting because addresses are not floats

This commit is contained in:
Hunter Haugen 2016-02-18 10:05:56 -08:00
parent 8464e33222
commit f6dd7ca482
2 changed files with 6 additions and 1 deletions

View file

@ -23,7 +23,7 @@ Puppet::Type.type(:postgresql_conf).provide(
else
val = h[:value]
end
dontneedquote = val.match(/^([\d\.]+|\w+)$/)
dontneedquote = val.match(/^(\d+.?\d+|\w+)$/)
dontneedequal = h[:name].match(/^(include|include_if_exists)$/i)
str = h[:name].downcase # normalize case

View file

@ -137,6 +137,11 @@ describe provider_class do
)
end
it "quotes addresses" do
expect(provider.to_line( {:name=>"listen_addresses", :value=>"0.0.0.0", :comment=>nil, :record_type=>:parsed })).to eq(
"listen_addresses = '0.0.0.0'"
)
end
end
end