Skip to content

Commit dd8c88c

Browse files
authored
Rename Faker::show to Faker::Theater (#2921)
* Renamed Faker::Show to Faker::Theater * Updated Readme * Updated test to explcitly use Faker::Theater
1 parent e15e606 commit dd8c88c

File tree

6 files changed

+40
-16
lines changed

6 files changed

+40
-16
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
284284
- [Faker::Superhero](doc/default/superhero.md)
285285
- [Faker::Tea](doc/default/tea.md)
286286
- [Faker::Team](doc/default/team.md)
287+
- [Faker::Theater](doc/default/theater.md)
287288
- [Faker::Time](doc/default/time.md)
288289
- [Faker::Twitter](doc/default/twitter.md)
289290
- [Faker::Types](doc/default/types.md)

doc/default/theater.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Faker::Theater
2+
3+
```ruby
4+
# Produces the name of a musical for an older audience
5+
Faker::Theater.adult_musical #=> "Mamma Mia!"
6+
7+
# Produces the name of a musical for a younger audience
8+
Faker::Theater.kids_musical #=> "Into the Woods JR."
9+
10+
# Produces the name of a play
11+
Faker::Theater.play #=> "The Death of a Salesman"
12+

doc/unreleased/music/show.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# frozen_string_literal: true
22

33
module Faker
4-
class Show < Base
4+
class Theater < Base
55
class << self
66
##
77
# Produces the name of a musical for an older audience
88
#
99
# @return [String]
1010
#
1111
# @example
12-
# Faker::Alphanumeric.alpha
13-
# #=> "West Side Story"
12+
# Faker::Theater.adult_musical
13+
# #=> "Mamma Mia!"
1414
#
1515
# @faker.version 2.13.0
1616
def adult_musical
17-
fetch('show.adult_musical')
17+
fetch('theater.adult_musical')
1818
end
1919

2020
##
@@ -23,12 +23,12 @@ def adult_musical
2323
# @return [String]
2424
#
2525
# @example
26-
# Faker::Alphanumeric.alpha
26+
# Faker::Theater.kids_musical
2727
# #=> "Into the Woods JR."
2828
#
2929
# @faker.version 2.13.0
3030
def kids_musical
31-
fetch('show.kids_musical')
31+
fetch('theater.kids_musical')
3232
end
3333

3434
##
@@ -37,13 +37,16 @@ def kids_musical
3737
# @return [String]
3838
#
3939
# @example
40-
# Faker::Alphanumeric.alpha
40+
# Faker::Theater.play
4141
# #=> "Death of a Salesman"
4242
#
4343
# @faker.version 2.13.0
4444
def play
45-
fetch('show.play')
45+
fetch('theater.play')
4646
end
4747
end
4848
end
49+
50+
include Faker::Deprecator
51+
deprecate_generator('Show', Theater)
4952
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
en:
22
faker:
3-
show:
3+
theater:
44
adult_musical:
55
- "Elton John and Tim Rice's Aida"
66
- "Ain't Misbehavin'"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
require_relative '../../test_helper'
44

5+
class TestFakerTheater < Test::Unit::TestCase
6+
def test_adult_musical
7+
assert_match(/\w+/, Faker::Theater.adult_musical)
8+
end
9+
10+
def test_kids_musical
11+
assert_match(/\w+/, Faker::Theater.kids_musical)
12+
end
13+
14+
def test_play
15+
assert_match(/\w+/, Faker::Theater.play)
16+
end
17+
end
18+
19+
# with test_faker_show.rb
520
class TestFakerShow < Test::Unit::TestCase
621
def test_adult_musical
722
assert_match(/\w+/, Faker::Show.adult_musical)

0 commit comments

Comments
 (0)