1
0
mirror of https://github.com/askn/faker.git synced 2023-08-10 21:13:01 +03:00
faker/spec/team_spec.cr
Caroline Glassberg-Powell 284782b26a GH-2 Add ability to seed
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.
2017-07-09 12:44:14 +01:00

27 lines
617 B
Crystal

require "./spec_helper"
describe Faker::Team do
it "name" do
Faker::Team.name.match(/(\w+\.? ?){2}/).should_not eq nil
end
it "creature" do
Faker::Team.creature.match(/(\w+){1}/).should_not eq nil
end
it "state" do
Faker::Team.state.match(/(\w+){1}/).should_not eq nil
end
it "sport" do
# Faker::Team.sport.match(/(\w+){1}/).should_not eq nil
end
it "should return deterministic results when seeded" do
Faker.seed 123456
Faker::Team.creature.should eq "buffalo"
Faker::Team.name.should eq "Washington sorcerors"
Faker::Team.state.should eq "Delaware"
end
end