Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Faker::Educator.primary_school #2256

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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