mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
ea7c0c493e
When SimpleConfig parses a config file that has sections, such as a mysqld config file, the values within that section are returned via a Hash. However, we do not provide an easy way to write tests for those deep hash values: ``` describe mysql_conf('/tmp/my.cnf') do its('mysqld.expire_logs_days') { should cmp 10 } end MySQL Configuration ∅ undefined method `expire_logs_days' for #<Hash:0x007fe463795a00> ``` This change provides a method-based accessor for Hashes that are built via SimpleConfig. ``` describe mysql_conf('/tmp/my.cnf') do its('mysqld.expire_logs_days') { should cmp 10 } end MySQL Configuration ✔ mysqld.expire_logs_days should cmp == 10 ``` Fixes #1541 by changing the way the attributes are fetched. Signed-off-by: Adam Leff <adam@leff.co> |
||
---|---|---|
.. | ||
command_wrapper.rb | ||
convert.rb | ||
filter.rb | ||
filter_array.rb | ||
find_files.rb | ||
hash.rb | ||
json_log.rb | ||
latest_version.rb | ||
modulator.rb | ||
object_traversal.rb | ||
parser.rb | ||
plugin_registry.rb | ||
simpleconfig.rb |