summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorErik Dalén <dalen@spotify.com>2014-11-12 16:52:36 +0100
committerErik Dalén <dalen@spotify.com>2014-11-12 16:52:36 +0100
commitaf0a2779cb63b09a07f675ede3ae0b959c7442f6 (patch)
tree4b6356207220b4bb2da03be278b15650fa9eb05a /spec
parentce995e15d5c266fd6d7fa781284771a5a5d5b00e (diff)
downloadpuppet-stdlib-af0a2779cb63b09a07f675ede3ae0b959c7442f6.tar.gz
puppet-stdlib-af0a2779cb63b09a07f675ede3ae0b959c7442f6.tar.bz2
Add range tests for numeric with step and mixed arguments
Diffstat (limited to 'spec')
-rwxr-xr-xspec/functions/range_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/functions/range_spec.rb b/spec/functions/range_spec.rb
index 1446b24..ef86f97 100755
--- a/spec/functions/range_spec.rb
+++ b/spec/functions/range_spec.rb
@@ -73,5 +73,14 @@ describe "the range function" do
expected = (1..10).to_a
expect(scope.function_range([1,10])).to eq expected
end
+ it "returns a range of numbers with step parameter" do
+ expected = (1..10).step(2).to_a
+ expect(scope.function_range([1,10,2])).to eq expected
+ end
+ it "works with mixed numeric like strings and numeric arguments" do
+ expected = (1..10).to_a
+ expect(scope.function_range(['1',10])).to eq expected
+ expect(scope.function_range([1,'10'])).to eq expected
+ end
end
end