mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +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> |
||
---|---|---|
.. | ||
bsd_mount_parser_test.rb | ||
filter_array_test.rb | ||
filter_table_test.rb | ||
find_files_test.rb | ||
object_traversal_test.rb | ||
passwd_parser_test.rb | ||
simpleconfig_test.rb | ||
solaris_netstat_parser.rb |