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

Fix/Deprecate FmaBrotherhood Generator #2856

Merged
merged 7 commits into from
Feb 26, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
- [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
- [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
- [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
- [Faker::JapaneseMedia::FmaBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
- [Faker::JapaneseMedia::FullmetalAlchemistBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
</details>

<details>
Expand Down
8 changes: 4 additions & 4 deletions doc/japanese_media/fullmetal_alchemist_brotherhood.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Faker::JapaneseMedia::FmaBrotherhood
# Faker::JapaneseMedia::FullmetalAchemistBrotherhood

```ruby
Faker::JapaneseMedia::FmaBrotherhood.character #=> "Edward Elric"
Faker::JapaneseMedia::FullmetalAchemistBrotherhood.character #=> "Edward Elric"

Faker::JapaneseMedia::FmaBrotherhood.city #=> "Central City"
Faker::JapaneseMedia::FullmetalAchemistBrotherhood.city #=> "Central City"

Faker::JapaneseMedia::FmaBrotherhood.country #=> "Xing"
Faker::JapaneseMedia::FullmetalAchemistBrotherhood.country #=> "Xing"
```
23 changes: 13 additions & 10 deletions lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,50 @@

module Faker
class JapaneseMedia
class FmaBrotherhood < Base
class FullmetalAlchemistBrotherhood < Base
stefannibrasil marked this conversation as resolved.
Show resolved Hide resolved
class << self
##
# Produces a character from FmaBrotherhood.
# Produces a character from FullmetalAlchemistBrotherhood.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::FmaBrotherhood.character #=> "Edward Elric"
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.character #=> "Edward Elric"
#
# @faker.version next
def character
fetch('fma_brotherhood.characters')
fetch('fullmetal_alchemist_brotherhood.characters')
end

##
# Produces a cities from FmaBrotherhood.
# Produces a cities from FullmetalAlchemistBrotherhood.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::FmaBrotherhood.city #=> "Central City"
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.city #=> "Central City"
#
# @faker.version next
def city
fetch('fma_brotherhood.cities')
fetch('fullmetal_alchemist_brotherhood.cities')
end

##
# Produces a country from FmaBrotherhood.
# Produces a country from FullmetalAlchemistBrotherhood.
#
# @return [String]
#
# @example
# Faker::JapaneseMedia::FmaBrotherhood.country #=> "Xing"
# Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.country #=> "Xing"
#
# @faker.version next
def country
fetch('fma_brotherhood.countries')
fetch('fullmetal_alchemist_brotherhood.countries')
end
end
end

include Faker::Deprecator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

deprecate_generator('FmaBrotherhood', FullmetalAlchemistBrotherhood)
end
end
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
en:
faker:
fma_brotherhood:
fullmetal_alchemist_brotherhood:
characters:
- Edward Elric
- Alphonse Elric
- Roy Mustang
- Riza Hawkeye
- Scar
- Winry Rockbell
- May Chang
- May Chang
- Maes Hughes
- Alex Louis Armstrong
- Jean Havoc
Expand Down Expand Up @@ -47,7 +47,7 @@ en:
- Isaac McDougal
- Solf J. Kimblee
- Van Hohenheim
- Fu
- Fu
- Ling Yao
- Lan Fan
- Olivier Mira Armstrong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,21 @@ def test_country
assert_match(/\w+/, @tester.country)
end
end

class TestFakerFullmetalAlchemistBrotherhood < Test::Unit::TestCase
def setup
@tester = Faker::JapaneseMedia::FullmetalAlchemistBrotherhood
end

def test_character
assert_match(/\w+/, @tester.character)
end

def test_city
assert_match(/\w+/, @tester.city)
end

def test_country
assert_match(/\w+/, @tester.country)
end
end