Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #35 from pusewicz/master

Add job title faker
  • Loading branch information...
commit 4ce88523c1a2b8215ab925a907fb76dedea58ac7 2 parents 0a28109 + eaf0b17
@EmmanuelOga authored
Showing with 44 additions and 4 deletions.
  1. +5 −4 lib/ffaker.rb
  2. +27 −0 lib/ffaker/job.rb
  3. +12 −0 test/test_faker_job.rb
View
9 lib/ffaker.rb
@@ -25,17 +25,18 @@ def self.bothify(masks)
end
autoload :Address, 'ffaker/address'
- autoload :AddressUS, 'ffaker/address_us'
- autoload :AddressDE, 'ffaker/address_de'
+ autoload :AddressAU, 'ffaker/address_au'
autoload :AddressCA, 'ffaker/address_ca'
+ autoload :AddressDE, 'ffaker/address_de'
autoload :AddressUK, 'ffaker/address_uk'
- autoload :AddressAU, 'ffaker/address_au'
+ autoload :AddressUS, 'ffaker/address_us'
autoload :Company, 'ffaker/company'
autoload :Education, 'ffaker/education'
autoload :Geolocation, 'ffaker/geolocation'
autoload :HTMLIpsum, 'ffaker/html_ipsum'
autoload :HipsterIpsum, 'ffaker/hipster_ipsum'
autoload :Internet, 'ffaker/internet'
+ autoload :Job, 'ffaker/job'
autoload :Lorem, 'ffaker/lorem'
autoload :LoremCN, 'ffaker/lorem_cn'
autoload :Name, 'ffaker/name'
@@ -45,8 +46,8 @@ def self.bothify(masks)
autoload :NameRU, 'ffaker/name_ru'
autoload :NameSN, 'ffaker/name_sn'
autoload :PhoneNumber, 'ffaker/phone_number'
- autoload :PhoneNumberSN, 'ffaker/phone_number_sn'
autoload :PhoneNumberAU, 'ffaker/phone_number_au'
+ autoload :PhoneNumberSN, 'ffaker/phone_number_sn'
autoload :Product, 'ffaker/product'
autoload :VERSION, 'ffaker/version'
end
View
27 lib/ffaker/job.rb
@@ -0,0 +1,27 @@
+module Faker
+ module Job
+ extend ModuleUtils
+ extend self
+
+ def title
+ "#{JOB_PREFIX.rand} #{JOB_ADJ.rand} #{JOB_NOUN.rand}"
+ end
+
+ JOB_PREFIX = k %w(Lead Senior Direct Corporate Dynamic Future Product National
+ Regional District Central Global Customer Investor Dynamic
+ International Legacy Forward Internal Human Chief Principal)
+
+ JOB_ADJ = k %w(Solutions Program Brand Security Research Marketing Directives
+ Implementation Integration Functionality Response Paradigm Tactics
+ Identity Markets Group Division Applications Optimization
+ Operations Infrastructure Intranet Communications Web Branding
+ Quality Assurance Mobility Accounts Data Creative Configuration
+ Accountability Interactions Factors Usability Metrics)
+
+ JOB_NOUN = k %w(Supervisor Associate Executive Liason Officer Manager Engineer
+ Specialist Director Coordinator Administrator Architect Analyst
+ Designer Planner Orchestrator Technician Developer Producer
+ Consultant Assistant Facilitator Agent Representative Strategist)
+ end
+end
+
View
12 test/test_faker_job.rb
@@ -0,0 +1,12 @@
+require 'helper'
+
+class TestFakerJob < Test::Unit::TestCase
+ def setup
+ @tester = Faker::Job
+ end
+
+ def test_title
+ assert @tester.title.match(/(\w+\.? ?){2,3}/)
+ end
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.