Skip to content

Commit

Permalink
(PDOC-37) Use parameterized type in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iankronquist committed Jul 13, 2015
1 parent ee73970 commit 7a7f4b9
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ def max(num_a, num_b)
# @param not_num_a Integer[1,2] the first number to be compared
# @param num_b Integer[1,2] the second number to be compared
Puppet::Functions.create_function(:max) do
def max(num_a, num_b)
dispatch max_1 do
param 'Integer[1,2]', :num_a
param 'Integer[1,2]', :num_b
end
def max_1(num_a, num_b)
num_a >= num_b ? num_a : num_b
end
end
Expand All @@ -128,13 +133,13 @@ def max(num_a, num_b)
# @param also_not_a_param Integer the second number to be compared
Puppet::Functions.create_function(:max) do
dispatch max_1 do
param 'Integer', :num_a
param 'Integer[1,2]', :num_a
param 'Integer', :num_b
end
dispatch max_2 {
param 'String', :num_c
param 'String', :num_d
param 'String[1,2]', :num_d
}
def max_1(num_a, num_b)
Expand Down

0 comments on commit 7a7f4b9

Please sign in to comment.