diff --git a/README.md b/README.md index 104c93f2e3..882153c852 100644 --- a/README.md +++ b/README.md @@ -284,6 +284,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main - [Faker::Superhero](doc/default/superhero.md) - [Faker::Tea](doc/default/tea.md) - [Faker::Team](doc/default/team.md) + - [Faker::Theater](doc/default/theater.md) - [Faker::Time](doc/default/time.md) - [Faker::Twitter](doc/default/twitter.md) - [Faker::Types](doc/default/types.md) diff --git a/doc/default/theater.md b/doc/default/theater.md new file mode 100644 index 0000000000..29d0c85b30 --- /dev/null +++ b/doc/default/theater.md @@ -0,0 +1,12 @@ +# Faker::Theater + +```ruby +# Produces the name of a musical for an older audience +Faker::Theater.adult_musical #=> "Mamma Mia!" + +# Produces the name of a musical for a younger audience +Faker::Theater.kids_musical #=> "Into the Woods JR." + +# Produces the name of a play +Faker::Theater.play #=> "The Death of a Salesman" + diff --git a/doc/unreleased/music/show.md b/doc/unreleased/music/show.md deleted file mode 100644 index f9aa688380..0000000000 --- a/doc/unreleased/music/show.md +++ /dev/null @@ -1,7 +0,0 @@ -# Faker::Music::Show - -```ruby -Faker::Music::Show.adult_musical # => "West Side Story" -Faker::Music::Show.kids_musical # => "Into the Woods JR." -Faker::Music::Show.play # => "Death of a Salesman" -``` diff --git a/lib/faker/music/show.rb b/lib/faker/default/theater.rb similarity index 68% rename from lib/faker/music/show.rb rename to lib/faker/default/theater.rb index d155d525d5..b9e8af3db5 100644 --- a/lib/faker/music/show.rb +++ b/lib/faker/default/theater.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Faker - class Show < Base + class Theater < Base class << self ## # Produces the name of a musical for an older audience @@ -9,12 +9,12 @@ class << self # @return [String] # # @example - # Faker::Alphanumeric.alpha - # #=> "West Side Story" + # Faker::Theater.adult_musical + # #=> "Mamma Mia!" # # @faker.version 2.13.0 def adult_musical - fetch('show.adult_musical') + fetch('theater.adult_musical') end ## @@ -23,12 +23,12 @@ def adult_musical # @return [String] # # @example - # Faker::Alphanumeric.alpha + # Faker::Theater.kids_musical # #=> "Into the Woods JR." # # @faker.version 2.13.0 def kids_musical - fetch('show.kids_musical') + fetch('theater.kids_musical') end ## @@ -37,13 +37,16 @@ def kids_musical # @return [String] # # @example - # Faker::Alphanumeric.alpha + # Faker::Theater.play # #=> "Death of a Salesman" # # @faker.version 2.13.0 def play - fetch('show.play') + fetch('theater.play') end end end + + include Faker::Deprecator + deprecate_generator('Show', Theater) end diff --git a/lib/locales/en/show.yml b/lib/locales/en/theater.yml similarity index 99% rename from lib/locales/en/show.yml rename to lib/locales/en/theater.yml index 027067bfb8..06efe8fe28 100644 --- a/lib/locales/en/show.yml +++ b/lib/locales/en/theater.yml @@ -1,6 +1,6 @@ en: faker: - show: + theater: adult_musical: - "Elton John and Tim Rice's Aida" - "Ain't Misbehavin'" diff --git a/test/faker/music/test_faker_show.rb b/test/faker/default/test_faker_theater.rb similarity index 52% rename from test/faker/music/test_faker_show.rb rename to test/faker/default/test_faker_theater.rb index f91524f47b..360c2fef62 100644 --- a/test/faker/music/test_faker_show.rb +++ b/test/faker/default/test_faker_theater.rb @@ -2,6 +2,21 @@ require_relative '../../test_helper' +class TestFakerTheater < Test::Unit::TestCase + def test_adult_musical + assert_match(/\w+/, Faker::Theater.adult_musical) + end + + def test_kids_musical + assert_match(/\w+/, Faker::Theater.kids_musical) + end + + def test_play + assert_match(/\w+/, Faker::Theater.play) + end +end + +# with test_faker_show.rb class TestFakerShow < Test::Unit::TestCase def test_adult_musical assert_match(/\w+/, Faker::Show.adult_musical)