Added acceptance test and updated readme
This commit is contained in:
parent
6f1d164da6
commit
c7c4d41a82
2 changed files with 15 additions and 1 deletions
|
@ -224,7 +224,7 @@ Converts the case of a string or of all strings in an array to lowercase. *Type*
|
|||
|
||||
#### `empty`
|
||||
|
||||
Returns true if the argument is an array or hash that contains no elements, or an empty string. *Type*: rvalue.
|
||||
Returns true if the argument is an array or hash that contains no elements, or an empty string. Returns false when the argument is a numerical value. *Type*: rvalue.
|
||||
|
||||
#### `ensure_packages`
|
||||
|
||||
|
|
|
@ -27,6 +27,20 @@ describe 'empty function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('opera
|
|||
}
|
||||
EOS
|
||||
|
||||
apply_manifest(pp, :catch_failures => true) do |r|
|
||||
expect(r.stdout).to match(/Notice: output correct/)
|
||||
end
|
||||
end
|
||||
it 'handles numerical values' do
|
||||
pp = <<-EOS
|
||||
$a = 7
|
||||
$b = false
|
||||
$o = empty($a)
|
||||
if $o == $b {
|
||||
notify { 'output correct': }
|
||||
}
|
||||
EOS
|
||||
|
||||
apply_manifest(pp, :catch_failures => true) do |r|
|
||||
expect(r.stdout).to match(/Notice: output correct/)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue