diff --git a/README.md b/README.md index 2f42ed4383..cd57430b07 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,6 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main - [Faker::Beer](doc/default/beer.md) - [Faker::Blood](doc/default/blood.md) - [Faker::Boolean](doc/default/boolean.md) - - [Faker::BossaNova](doc/default/bossa_nova.md) - [Faker::Business](doc/default/business.md) - [Faker::Camera](doc/default/camera.md) - [Faker::Cannabis](doc/default/cannabis.md) @@ -420,6 +419,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main - [Faker::Music::Rush](doc/music/rush.md) - [Faker::Music::SmashingPumpkins](doc/music/smashing_pumpkins.md) - [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md) + - [Faker::Music::BossaNova](doc/music/bossa_nova.md)
diff --git a/doc/default/bossa_nova.md b/doc/default/bossa_nova.md deleted file mode 100644 index da448ba063..0000000000 --- a/doc/default/bossa_nova.md +++ /dev/null @@ -1,7 +0,0 @@ -# Faker::BossaNova - -```ruby -Faker::BossaNova.artist #=> "Tom Jobim" - -Faker::BossaNova.song #=> "Chega de Saudade" -``` diff --git a/doc/music/bossa_nova.md b/doc/music/bossa_nova.md new file mode 100644 index 0000000000..5fa6545640 --- /dev/null +++ b/doc/music/bossa_nova.md @@ -0,0 +1,7 @@ +# Faker::Music::BossaNova + +```ruby +Faker::Music::BossaNova.artist #=> "Tom Jobim" + +Faker::Music::BossaNova.song #=> "Chega de Saudade" +``` diff --git a/lib/faker/default/bossa_nova.rb b/lib/faker/default/bossa_nova.rb deleted file mode 100644 index 9a496f6f2d..0000000000 --- a/lib/faker/default/bossa_nova.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -module Faker - class BossaNova < Base - class << self - ## - # Produces the name of a bossa nova artist. - # - # @return [String] - # - # @example - # Faker::BossaNova.artist #=> "Tom Jobin" - # - # @faker.version 1.8.3 - def artist - fetch('bossa_nova.artists') - end - - ## - # Produces a bossa nova song. - # - # @return [String] - # - # @example - # Faker::BossaNova.song #=> "Chega de Saudade" - # - # @faker.version 1.8.3 - def song - fetch('bossa_nova.songs') - end - end - end -end diff --git a/lib/faker/music/bossa_nova.rb b/lib/faker/music/bossa_nova.rb new file mode 100644 index 0000000000..f0bf81a5d4 --- /dev/null +++ b/lib/faker/music/bossa_nova.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require_relative 'music' + +module Faker + class Music + class BossaNova < Base + class << self + ## + # Produces the name of a bossa nova artist. + # + # @return [String] + # + # @example + # Faker::Music::BossaNova.artist #=> "Tom Jobin" + # + # @faker.version 1.8.3 + def artist + fetch('bossa_nova.artists') + end + + ## + # Produces a bossa nova song. + # + # @return [String] + # + # @example + # Faker::Music::BossaNova.song #=> "Chega de Saudade" + # + # @faker.version 1.8.3 + def song + fetch('bossa_nova.songs') + end + end + end + end + + include Faker::Deprecator + + deprecate_generator('BossaNova', Music::BossaNova) +end diff --git a/test/faker/default/test_faker_bossa_nova.rb b/test/faker/default/test_faker_bossa_nova.rb deleted file mode 100644 index f5bc2bf112..0000000000 --- a/test/faker/default/test_faker_bossa_nova.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../test_helper' - -class TestFakerBossaNova < Test::Unit::TestCase - def setup - @tester = Faker::BossaNova - end - - def test_artists - assert_match(/\w+/, @tester.artist) - end - - def test_songs - assert_match(/\w+/, @tester.song) - end -end diff --git a/test/faker/music/test_faker_bossa_nova.rb b/test/faker/music/test_faker_bossa_nova.rb new file mode 100644 index 0000000000..02cc30f722 --- /dev/null +++ b/test/faker/music/test_faker_bossa_nova.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerBossaNova < Test::Unit::TestCase + def setup + @tester = Faker::Music::BossaNova + end + + def test_artists + assert_match(/\w+/, @tester.artist) + end + + def test_songs + assert_match(/\w+/, @tester.song) + end + + def test_deprecation + assert_deprecated do + Faker::BossaNova.artist + end + + assert_deprecated do + Faker::BossaNova.song + end + + assert_match(/\w+/, Faker::BossaNova.artist) + assert_match(/\w+/, Faker::BossaNova.song) + end +end