voxpupuli / rspec-puppet-facts

Simplify your unit tests by looping on every supported Operating System and populating facts.
Apache License 2.0
61 stars 53 forks source link

stringify fact keys by default #189

Open bastelfreak opened 3 months ago

bastelfreak commented 3 months ago

for a long long time, the first level of keys in a factsets were symbols. Following nested hashes always had strings. This doesn't make sense and looks confusing. Also the original data contains only strings, we we actually iterated on the data and converted it to symbols. We now flip the default. This saves performance and makes code more readable.

ekohl commented 3 months ago

I'd prefer to start with converting some modules to use symbols to see how it goes.

bastelfreak commented 3 months ago

@ekohl I've one example here: https://github.com/voxpupuli/puppet-autofs/pull/217 We need a major release of rspec-puppet-facts to get the latest FacterDB version. And I think it makes sense to switch to stringified facts already. That will save us one major release.

bastelfreak commented 3 months ago

Another one: https://github.com/voxpupuli/puppet-ca_cert/pull/113

bastelfreak commented 3 months ago

Another one: https://github.com/voxpupuli/puppet-archive/pull/527

ekohl commented 3 months ago

I've summarized my thoughts in https://github.com/voxpupuli/rspec-puppet-facts/pull/188#pullrequestreview-2145684881