diff options
author | Morgan Haskel <morgan@puppetlabs.com> | 2015-03-02 11:09:33 -0800 |
---|---|---|
committer | Morgan Haskel <morgan@puppetlabs.com> | 2015-03-02 11:09:33 -0800 |
commit | 6d07a6a8095961ad58c155a62bcfea26136549bd (patch) | |
tree | ca1ace730605023a3eac479c1be5307856482d0a /spec/functions/upcase_spec.rb | |
parent | cd6568039f53a59c145239012e9ada14685eed88 (diff) | |
parent | 85e81f9bdf9d482338c504ff3c658993a24978a0 (diff) |
Merge pull request #419 from cyberious/master
Loosen the restrictions of upcase and allow for recursion of the objects...
Diffstat (limited to 'spec/functions/upcase_spec.rb')
-rwxr-xr-x | spec/functions/upcase_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/functions/upcase_spec.rb b/spec/functions/upcase_spec.rb index a50a3ab..0689099 100755 --- a/spec/functions/upcase_spec.rb +++ b/spec/functions/upcase_spec.rb @@ -36,4 +36,23 @@ describe "the upcase function" do scope.function_upcase([{'test' => %w(this that and other thing)}]) ).to eq({'TEST' => %w(THIS THAT AND OTHER THING)}) end + + if :test.respond_to?(:upcase) + it 'should accept hashes of symbols' do + expect( + scope.function_upcase([{:test => [:this, :that, :other]}]) + ).to eq({:TEST => [:THIS, :THAT, :OTHER]}) + end + it 'should return upcase symbol' do + expect( + scope.function_upcase([:test]) + ).to eq(:TEST) + end + it 'should return mixed objects in upcease' do + expect( + scope.function_upcase([[:test, 'woot']]) + ).to eq([:TEST, 'WOOT']) + + end + end end |