mirror of
https://github.com/askn/faker.git
synced 2023-08-10 21:13:01 +03:00
284782b26a
All the random functions are now passed through Faker.rng, a random number generator that is created by default, but can also be set with `Faker.seed`. The tests use all the examples in the README to ensure that everything has been seeded properly. The only module not updated is Finance, but that's because the file itself did not seem to compile, and there weren't any examples of using it in the README.
11 lines
351 B
Crystal
11 lines
351 B
Crystal
require "./spec_helper"
|
|
|
|
describe Faker::Business do
|
|
it "should return deterministic results when seeded" do
|
|
Faker.seed 123456
|
|
Faker::Business.credit_card_number.should eq "1234-2121-1221-1211"
|
|
Faker::Business.credit_card_expiry_date.should eq Time.new(2013, 9, 12)
|
|
Faker::Business.credit_card_type.should eq "diners_club"
|
|
end
|
|
end
|