Skip to content

golsombe/imposter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imposter

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

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