Skip to content

Generator, rake and YAML imposters for schema level data faking

License

Notifications You must be signed in to change notification settings

urlsplease/imposter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imposter

Real fake data. Allows creation of an entire schema of fake data that honors associations.

Forked for urlsplease.com to adapt to Ruby 1.9.x (CSV library)

Usage

# YAMLs are executed in series order much like migrations

  • rake::imposter IMPOSTER=“products” #generate only the /test/fixtures/products.csv

  • rake::imposter #generate all /test/imposter/*.yaml to /test/fixtures

  • rake::imposter –force #generate all /test/imposter/-*.yaml to /test/fixtures to

  • overwrite any existing .csv

  • Imposter::Noun.noun => “apple” #random noun

  • Imposter::Verb.verbs(3) => “run tag jump” #random verbs string space delimited

#—For unit/integration/etl testing that require real but random addresses

  • Imposter::CSZ.zip => “90210” #random real postal code

  • Imposter::CSZ.city(:zip=>“90210”) => “Beverly Hills” #real city name from zip

  • Imposter::CSZ.state_abbr(:zip=>“90210”) => “CA” #real 2 letter state abbreviation upper case

  • Imposter::CSZ.state_name(:zip=>“90210”) => “California” #Real State name Camelized

  • Imposter::CSZ.zip(:state_abbr=>“CA”) => “90115” #Random but real postal code from real state.

About

Generator, rake and YAML imposters for schema level data faking

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%