Skip to content

Commit af0a277

Browse files
author
Erik Dalén
committed
Add range tests for numeric with step and mixed arguments
1 parent ce995e1 commit af0a277

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

spec/functions/range_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,14 @@
7373
expected = (1..10).to_a
7474
expect(scope.function_range([1,10])).to eq expected
7575
end
76+
it "returns a range of numbers with step parameter" do
77+
expected = (1..10).step(2).to_a
78+
expect(scope.function_range([1,10,2])).to eq expected
79+
end
80+
it "works with mixed numeric like strings and numeric arguments" do
81+
expected = (1..10).to_a
82+
expect(scope.function_range(['1',10])).to eq expected
83+
expect(scope.function_range([1,'10'])).to eq expected
84+
end
7685
end
7786
end

0 commit comments

Comments
 (0)