Skip to content

Commit

Permalink
Fix faker-ruby#2093 Allow custom start for forward date generator
Browse files Browse the repository at this point in the history
 *Allow set from as String or Date type
  • Loading branch information
luciagirasoles committed Jun 25, 2023
1 parent 35738db commit 4c5fe06
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/faker/default/test_faker_date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ def test_forward
end
end

def test_forward_with_from
from = Date.parse('2012-01-01')

100.times do
random_date = @tester.forward(from: from, days: 5)

assert random_date > from, "Expected > \"#{from}\", but got #{random_date}"
end
end

def test_backward
today = Date.today

Expand Down

0 comments on commit 4c5fe06

Please sign in to comment.