-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from cazgp/feat/seed
GH-2 Add ability to seed
- Loading branch information
Showing
20 changed files
with
228 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require "./spec_helper" | ||
|
||
describe Faker::Address do | ||
it "should return deterministic results when seeded" do | ||
Faker.seed 123456 | ||
Faker::Address.city.should eq "North Mercedesmouth" | ||
Faker::Address.street_name.should eq "Thalia Tunnel" | ||
Faker::Address.street_address.should eq "33421 Kunde Mills" | ||
Faker::Address.secondary_address.should eq "Apt. 475" | ||
Faker::Address.building_number.should eq "4103" | ||
Faker::Address.zip_code.should eq "32555" | ||
Faker::Address.postcode.should eq "GX44 3IC" | ||
Faker::Address.time_zone.should eq "Asia/Rangoon" | ||
Faker::Address.street_suffix.should eq "Springs" | ||
Faker::Address.city_suffix.should eq "town" | ||
Faker::Address.city_prefix.should eq "North" | ||
Faker::Address.state.should eq "Missouri" | ||
Faker::Address.state_abbr.should eq "TN" | ||
Faker::Address.country.should eq "Svalbard & Jan Mayen Islands" | ||
Faker::Address.country_code.should eq "IS" | ||
Faker::Address.latitude.should eq "15.393888556377334" | ||
Faker::Address.longitude.should eq "-77.86301819889268" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,4 +166,35 @@ describe Faker::Internet do | |
it "device_token" do | ||
# Faker::Internet.device_token.size.should eq 64 | ||
end | ||
|
||
it "should return deterministic results when seeded" do | ||
Faker.seed 123456 | ||
Faker::Internet.email.should eq "[email protected]" | ||
Faker::Internet.email("Nancy").should eq "[email protected]" | ||
Faker::Internet.free_email.should eq "[email protected]" | ||
Faker::Internet.free_email("Nancy").should eq "[email protected]" | ||
Faker::Internet.safe_email.should eq "[email protected]" | ||
Faker::Internet.safe_email("Nancy").should eq "[email protected]" | ||
Faker::Internet.user_name.should eq "faker.internet" | ||
Faker::Internet.user_name("Nancy").should eq "nancy" | ||
Faker::Internet.user_name("Nancy Johnson", [".", "_", "-"] of ::String).should eq "johnson.nancy" | ||
Faker::Internet.password.should eq "Tb34Ap05U" | ||
Faker::Internet.password(8).should eq "BhI59sBo9" | ||
Faker::Internet.password(10, 20).should eq "9r3b4iL8HeY" | ||
Faker::Internet.password(10, 20, true).should eq "91JpPrF867Z" | ||
Faker::Internet.password(10, 20, true, true).should eq "Pl5q3eOqZsK" | ||
Faker::Internet.domain_name.should eq "ullrichklocko.biz" | ||
Faker::Internet.domain_word.should eq "lockman" | ||
Faker::Internet.domain_suffix.should eq "net" | ||
Faker::Internet.ip_v4_address.should eq "6.70.63.244" | ||
Faker::Internet.ip_v6_address.should eq "8a31:c21c:fb41:eea8:9df:aeab:9f78:5a49" | ||
Faker::Internet.mac_address.should eq "00:4b:14:3d:24:55" | ||
Faker::Internet.mac_address("55:44:33").should eq "55:44:33:36:0e:5d" | ||
Faker::Internet.url.should eq "http://koelpin.biz/internet_faker" | ||
Faker::Internet.url("example.com").should eq "http://example.com/faker_internet" | ||
Faker::Internet.url("example.com", "/foobar.html").should eq "http://example.com/foobar.html" | ||
Faker::Internet.slug.should eq "voluptatem.dicta" | ||
Faker::Internet.slug("foo bar").should eq "foo.bar" | ||
Faker::Internet.slug("foo bar", "-").should eq "foo-bar" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require "./spec_helper" | ||
|
||
describe Faker::Lorem do | ||
it "should return deterministic results when seeded" do | ||
Faker.seed 123456 | ||
Faker::Lorem.word.should eq "voluptatem" | ||
Faker::Lorem.words.should eq ["quos", "recusandae", "sed"] | ||
Faker::Lorem.words(4).should eq ["iusto", "quia", "placeat", "quia"] | ||
Faker::Lorem.words(4, true).should eq ["vis", "ambulo", "vesica", "vivo"] | ||
Faker::Lorem.characters.should eq "xk7jz4c7a0w5ceh9opz68kq3xzdt5d2rtu29ky6jlb1ltxk3xvqkp87o2c7bs070wggzuz78an6t4cg8fejvhskgfe6ry104yc7kam8p91oaf6bqb61tp84q4958om8glep3wjrl9no32fj1eoklww8bzhvzmdkyp1tn51zxpzm8eynd7mbix1rimwrpufnut2a58d76mwrn4epjao7pedef2roosl2simxsvi4lejwzrdojegew2csobpw2lym" | ||
Faker::Lorem.characters(10).should eq "vp5j8u3r1l" | ||
Faker::Lorem.sentence.should eq "Itaque quod aliquam veritatis nemo dolorum sequi." | ||
Faker::Lorem.sentence(3).should eq "Accusantium dolores suscipit praesentium." | ||
Faker::Lorem.sentence(3, true).should eq "Spiculum triumphus necessitatibus appono angulus aut cariosus." | ||
Faker::Lorem.sentence(3, false, 4).should eq "Atque sed perferendis minus." | ||
Faker::Lorem.sentence(3, true, 4).should eq "Cohors traho tamdiu alveus itaque." | ||
Faker::Lorem.sentences.should eq ["Sed ab quia.", | ||
"Consequatur doloremque dolores ratione voluptas esse aut vero.", | ||
"Qui dicta est odit nihil exercitationem nesciunt."] | ||
Faker::Lorem.sentences(1).should eq ["Reiciendis doloremque vero sequi et quia."] | ||
Faker::Lorem.sentences(1, true).should eq ["Concido quisquam cerno vulpes maxime mollitia."] | ||
Faker::Lorem.paragraph.should eq "Maxime magnam vel velit id. Sed cupiditate blanditiis. Cupiditate sit aliquam vero." | ||
Faker::Lorem.paragraph(2).should eq "Nemo laboriosam quod accusamus ab modi excepturi. Eveniet rerum quasi quia culpa. Vero quis aut. A assumenda tenetur." | ||
Faker::Lorem.paragraph(2, true).should eq "Pecunia sopor ars vero subiungo quis urbanus. Demens minus delinquo." | ||
Faker::Lorem.paragraph(2, false, 4).should eq "Mollitia delectus qui et ut quasi. Eligendi aut facilis praesentium ducimus qui. Itaque molestiae laudantium qui omnis veritatis soluta. Quia reiciendis dignissimos saepe architecto. Eum excepturi dolores iusto quisquam." | ||
Faker::Lorem.paragraph(2, true, 4).should eq "Depraedor vitae spectaculum cupio acervus conatus adipisci. Pecus vulgivagus terra aliqua arbitro. Suscipio socius cupiditas arguo cetera colloco trans solitudo. Adimpleo stillicidium eaque ocer placeat adstringo ustulo balbus. Versus viduo videlicet tenus absconditus." | ||
Faker::Lorem.paragraphs.should eq ["Rerum odit ducimus ipsum at sint. Consequatur sed non dolorem. Incidunt quae libero. Enim quam molestiae necessitatibus.", | ||
"Inventore eos dolores asperiores corrupti cupiditate. Illum at molestiae cumque eaque aut. Blanditiis et laudantium neque. Consequatur labore officiis pariatur possimus facilis.", | ||
"Esse fuga cum quisquam tenetur impedit rem repellat. Quia deleniti nulla. Excepturi perferendis dolor accusamus."] | ||
Faker::Lorem.paragraphs(1).should eq ["Rerum unde voluptas sint autem. Fugit tenetur sequi totam esse. Explicabo omnis consequatur inventore autem. Et et praesentium neque quo natus."] | ||
Faker::Lorem.paragraphs(1, true).should eq ["Conitor reiciendis minima viridis temporibus spiritus. Tabula crustulum error titulus et comptus. Coruscus turpis amplitudo combibo alias deludo triginta."] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "./spec_helper" | ||
|
||
describe Faker::Name do | ||
it "should return deterministic results when seeded" do | ||
Faker.seed 123456 | ||
Faker::Name.name.should eq "Bernie Altenwerth" | ||
Faker::Name.first_name.should eq "Ron" | ||
Faker::Name.last_name.should eq "Block" | ||
Faker::Name.prefix.should eq "Mrs." | ||
Faker::Name.suffix.should eq "Sr." | ||
Faker::Name.title.should eq "Product Markets Specialist" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "./spec_helper" | ||
|
||
describe Faker::PhoneNumber do | ||
it "should return deterministic results when seeded" do | ||
Faker.seed 123456 | ||
Faker::PhoneNumber.phone_number.should eq "361-710-4228 x23421" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.