(MAINT) fix up try_get_value acceptance test
This commit is contained in:
parent
64267eb650
commit
5ef5c6629f
1 changed files with 4 additions and 4 deletions
|
@ -3,13 +3,13 @@ require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'try_get_value function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
describe 'try_get_value function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
||||||
describe 'success' do
|
describe 'success' do
|
||||||
it 'try_get_valuees a value' do
|
it 'gets a value' do
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
$data = {
|
$data = {
|
||||||
'a' => { 'b' => 'passing'}
|
'a' => { 'b' => 'passing'}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tests = try_get_value($a, 'a/b')
|
$tests = try_get_value($data, 'a/b')
|
||||||
notice(inline_template('tests are <%= @tests.inspect %>'))
|
notice(inline_template('tests are <%= @tests.inspect %>'))
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
|
@ -25,11 +25,11 @@ describe 'try_get_value function', :unless => UNSUPPORTED_PLATFORMS.include?(fac
|
||||||
'a' => { 'b' => 'passing'}
|
'a' => { 'b' => 'passing'}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tests = try_get_value($a, 'c/d', 'using the default value')
|
$tests = try_get_value($data, 'c/d', 'using the default value')
|
||||||
notice(inline_template('tests are <%= @tests.inspect %>'))
|
notice(inline_template('tests are <%= @tests.inspect %>'))
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
apply_manifest(pp, :expect_failures => true) do |r|
|
apply_manifest(pp, :catch_failures => true) do |r|
|
||||||
expect(r.stdout).to match(/using the default value/)
|
expect(r.stdout).to match(/using the default value/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue