diff options
author | Erik Dalén <dalen@spotify.com> | 2014-11-12 16:02:05 +0100 |
---|---|---|
committer | Erik Dalén <dalen@spotify.com> | 2014-11-12 16:02:05 +0100 |
commit | ce995e15d5c266fd6d7fa781284771a5a5d5b00e (patch) | |
tree | a711edba883b2df23a0b346f133ebad69fa86bff /spec/functions | |
parent | e61f402283774883d7b7c7d0f04dec7c457c968c (diff) | |
download | puppet-stdlib-ce995e15d5c266fd6d7fa781284771a5a5d5b00e.tar.gz puppet-stdlib-ce995e15d5c266fd6d7fa781284771a5a5d5b00e.tar.bz2 |
Make the range function work with integers
This is needed for the future parser which actually treats numbers as
numbers and strings as strings. With this patch you can use range(1,5)
instead of having to quote them like range('1','5').
Diffstat (limited to 'spec/functions')
-rwxr-xr-x | spec/functions/range_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/functions/range_spec.rb b/spec/functions/range_spec.rb index 9b9ece0..1446b24 100755 --- a/spec/functions/range_spec.rb +++ b/spec/functions/range_spec.rb @@ -67,4 +67,11 @@ describe "the range function" do expect(scope.function_range(["00", "10"])).to eq expected end end + + describe 'with a numeric range' do + it "returns a range of numbers" do + expected = (1..10).to_a + expect(scope.function_range([1,10])).to eq expected + end + end end |