summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStefan Goethals <stefan@zipkid.eu>2014-06-04 06:12:22 -0700
committerMorgan Haskel <morgan@puppetlabs.com>2015-03-03 16:20:55 -0800
commit0236cd51bc2724b4ac68b91dda01d1b58b572df8 (patch)
tree12b8950f2c12fcecce791a08b2f790066921bb9b /spec
parentb8547b7c29801ca3d89230dfc95716d6f93040ab (diff)
Add support for hashes in the prefix function
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/functions/prefix_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/functions/prefix_spec.rb b/spec/functions/prefix_spec.rb
index 34cac53..aec8a7d 100755
--- a/spec/functions/prefix_spec.rb
+++ b/spec/functions/prefix_spec.rb
@@ -25,4 +25,9 @@ describe "the prefix function" do
result = scope.function_prefix([['a','b','c'], 'p'])
expect(result).to(eq(['pa','pb','pc']))
end
+
+ it "returns a prefixed hash" do
+ result = scope.function_prefix([{'a' => 'b','b' => 'c','c' => 'd'}, 'p'])
+ expect(result).to(eq({'pa'=>'b','pb'=>'c','pc'=>'d'}))
+ end
end