Skip to content

Commit

Permalink
Add range tests for numeric with step and mixed arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Dalén committed Nov 12, 2014
1 parent ce995e1 commit af0a277
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/functions/range_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,14 @@
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

0 comments on commit af0a277

Please sign in to comment.