From c7c4d41a8286ab05af65afc1207c8cea4c11ffff Mon Sep 17 00:00:00 2001 From: Helen Campbell Date: Mon, 28 Sep 2015 16:18:56 +0100 Subject: Added acceptance test and updated readme --- README.markdown | 2 +- spec/acceptance/empty_spec.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index f919323..d023f23 100644 --- a/README.markdown +++ b/README.markdown @@ -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` diff --git a/spec/acceptance/empty_spec.rb b/spec/acceptance/empty_spec.rb index 8b46aac..2d4df90 100755 --- a/spec/acceptance/empty_spec.rb +++ b/spec/acceptance/empty_spec.rb @@ -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 -- cgit v1.2.3