summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/functions/range_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/functions/range_spec.rb b/spec/functions/range_spec.rb
index 9b9ece0..ef86f97 100755
--- a/spec/functions/range_spec.rb
+++ b/spec/functions/range_spec.rb
@@ -67,4 +67,20 @@ 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
+ 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