mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
Update parse_config.rb
Extend example section.
This commit is contained in:
parent
1768d952a4
commit
cdf6f647ac
1 changed files with 21 additions and 0 deletions
|
@ -23,6 +23,27 @@ module Inspec::Resources
|
||||||
describe parse_config(output, { data_config_option: value } ) do
|
describe parse_config(output, { data_config_option: value } ) do
|
||||||
its('setting') { should eq 1 }
|
its('setting') { should eq 1 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
output2 = command('curl http://127.0.0.1/php_status').stdout
|
||||||
|
# php status is in format 'key : value', and we do not allow for multiple values
|
||||||
|
options2 = {
|
||||||
|
assignment_re: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/,
|
||||||
|
multiple_values: false
|
||||||
|
}
|
||||||
|
|
||||||
|
describe parse_config(output2, options2) do
|
||||||
|
its('pool') { should eq 'www'}
|
||||||
|
its('process manager') { should eq process_manager }
|
||||||
|
end
|
||||||
|
|
||||||
|
# getting specific key from the output above, convert it to integer and then compare
|
||||||
|
# make sure 'listen queue' is below 100
|
||||||
|
describe parse_config(output2, options2 ).params['listen queue'].to_i do
|
||||||
|
it { should be < 100 }
|
||||||
|
end
|
||||||
|
|
||||||
"
|
"
|
||||||
|
|
||||||
attr_reader :content
|
attr_reader :content
|
||||||
|
|
Loading…
Reference in a new issue