summaryrefslogtreecommitdiff
path: root/spec/functions/range_spec.rb
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-05-06 10:13:27 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-05-06 10:13:27 +0100
commitf49eb6b8e20a8517916d984d1606daaabbba9a23 (patch)
tree21d0171d3ff1b81467f8a9b1f78d37150d142c62 /spec/functions/range_spec.rb
parentcf251303be2e89619e0b99f01fb90ed5e676dfa2 (diff)
range(): fix TypeError(can't convert nil into Integer) when using range syntax
Diffstat (limited to 'spec/functions/range_spec.rb')
-rwxr-xr-xspec/functions/range_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/functions/range_spec.rb b/spec/functions/range_spec.rb
index ef86f97..f18b89e 100755
--- a/spec/functions/range_spec.rb
+++ b/spec/functions/range_spec.rb
@@ -68,6 +68,13 @@ describe "the range function" do
end
end
+ describe 'with a ruby-like range' do
+ it "returns a number range" do
+ result = scope.function_range(["1..4"])
+ expect(result).to eq [1,2,3,4]
+ end
+ end
+
describe 'with a numeric range' do
it "returns a range of numbers" do
expected = (1..10).to_a