Skip to content

Commit

Permalink
Add Faker::Educator.primary_school
Browse files Browse the repository at this point in the history
Generates a primary school name. For example:

    "Brighthurst Elementary School"
  • Loading branch information
jdufresne committed Feb 5, 2021
1 parent 664cbaf commit 5446693
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/default/educator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Faker::Educator.university #=> "Mallowtown Technical College"

Faker::Educator.secondary_school #=> "Iceborough Secondary College"

Faker::Educator.primary_school #=> "Brighthurst Elementary School"

Faker::Educator.degree #=> "Associate Degree in Criminology"

Faker::Educator.course_name #=> "Criminology 101"
Expand Down
13 changes: 13 additions & 0 deletions lib/faker/default/educator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ def secondary_school
parse('educator.secondary_school')
end

##
# Produces a primary school.
#
# @return [String]
#
# @example
# Faker::Educator.primary_school #=> "Brighthurst Elementary School"
#
# @faker.version next
def primary_school
parse('educator.primary_school')
end

##
# Produces a campus name.
#
Expand Down
6 changes: 6 additions & 0 deletions lib/locales/en/educator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ en:
- High
- High School
- Secondary College
primary:
- Elementary School
- Grade School
- Primary School
university:
- "#{Educator.school_name} #{Educator.tertiary.university_type}"
secondary_school:
- "#{Educator.school_name} #{secondary}"
primary_school:
- "#{school_name} #{primary}"
campus:
- "#{Educator.school_name} Campus"
subject:
Expand Down
4 changes: 4 additions & 0 deletions test/faker/default/test_faker_educator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def test_secondary_school
assert @tester.secondary_school.match(/(\w+\.? ?){2,3}/)
end

def test_primary_school
assert @tester.primary_school.match(/(\w+\.? ?){2,3}/)
end

def test_campus
assert @tester.campus.match(/(\w+\.? ?){1,2}/)
end
Expand Down

0 comments on commit 5446693

Please sign in to comment.