diff --git a/doc/default/adjective.md b/doc/default/adjective.md new file mode 100644 index 0000000000..fb39292592 --- /dev/null +++ b/doc/default/adjective.md @@ -0,0 +1,9 @@ +# Faker::Adjective + +```ruby +# Random Positive Adjective +Faker::Adjective.positive #=> "Kind" + +# Random Negative Adjective +Faker::Adjective.negative #=> "Creepy" +``` diff --git a/lib/faker/default/faker_adjective.rb b/lib/faker/default/faker_adjective.rb new file mode 100644 index 0000000000..b917c7adde --- /dev/null +++ b/lib/faker/default/faker_adjective.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Faker + class Adjective < Base + flexible :adjective + + class << self + ## + # Produces a positive adjective. + # + # @return [String] + # + # @example + # Faker::Adjective.positive #=> "Kind" + # + # @faker.version next + def positive + fetch('adjective.positive') + end + + ## + # Produces a negative adjective. + # + # @return [String] + # + # @example + # Faker::Adjective.negative #=> "Creepy" + # + # @faker.version next + def negative + fetch('adjective.negative') + end + end + end +end diff --git a/lib/locales/en/adjective.yml b/lib/locales/en/adjective.yml new file mode 100644 index 0000000000..4a457416aa --- /dev/null +++ b/lib/locales/en/adjective.yml @@ -0,0 +1,179 @@ +en: + faker: + adjective: + positive: + - 'adorable' + - 'adventurous' + - 'agreeable' + - 'attractive' + - 'beautiful' + - 'brainy' + - 'brave' + - 'bright' + - 'calm' + - 'charming' + - 'cheerful' + - 'clean' + - 'clever' + - 'colorful' + - 'combative' + - 'comfortable' + - 'cooperative' + - 'courageous' + - 'curious' + - 'cute' + - 'delightful' + - 'determined' + - 'elegant' + - 'enchanting' + - 'encouraging' + - 'energetic' + - 'enthusiastic' + - 'excited' + - 'fair' + - 'faithful' + - 'famous' + - 'fancy' + - 'fantastic' + - 'fine' + - 'friendly' + - 'funny' + - 'gentle' + - 'gifted' + - 'glamorous' + - 'gleaming' + - 'glorious' + - 'good' + - 'gorgeous' + - 'graceful' + - 'handsome' + - 'happy' + - 'healthy' + - 'helpful' + - 'hilarious' + - 'homely' + - 'inexpensive' + - 'innocent' + - 'inquisitive' + - 'jolly' + - 'joyous' + - 'kind' + - 'light' + - 'lively' + - 'lovely' + - 'lucky' + - 'magnificent' + - 'modern' + - 'nice' + - 'open' + - 'outstanding' + - 'perfect' + - 'pleasant' + - 'powerful' + - 'precious' + - 'proud' + - 'quaint' + - 'rich' + - 'shiny' + - 'smiling' + - 'sparkling' + - 'splendid' + - 'spotless' + - 'successful' + - 'super' + - 'talented' + - 'tender' + - 'tasty' + - 'thankful' + - 'thoughtful' + - 'vast' + - 'victorious' + - 'vivacious' + - 'witty' + - 'zany' + - 'zealous' + negative: + - 'aggressive' + - 'annoyed' + - 'anxious' + - 'arrogant' + - 'ashamed' + - 'average' + - 'awful' + - 'bad' + - 'bloody' + - 'bored' + - 'careful' + - 'cautious' + - 'concerned' + - 'confused' + - 'crazy' + - 'creepy' + - 'cruel' + - 'dangerous' + - 'depressed' + - 'disturbed' + - 'envious' + - 'evil' + - 'expensive' + - 'exuberant' + - 'filthy' + - 'foolish' + - 'fragile' + - 'frail' + - 'frantic' + - 'frightened' + - 'grieving' + - 'grotesque' + - 'grumpy' + - 'helpless' + - 'horrible' + - 'ill' + - 'itchy' + - 'jealous' + - 'jittery' + - 'lazy' + - 'lonely' + - 'misty' + - 'muddy' + - 'nasty' + - 'naughty' + - 'nervous' + - 'nutty' + - 'obnoxious' + - 'odd' + - 'old-fashioned' + - 'outrageous' + - 'panicky' + - 'poised' + - 'poor' + - 'putrid' + - 'puzzled' + - 'repulsive' + - 'scary' + - 'selfish' + - 'shy' + - 'silly' + - 'sleepy' + - 'smoggy' + - 'sore' + - 'stormy' + - 'strange' + - 'stupid' + - 'terrible' + - 'thoughtless' + - 'tired' + - 'tough' + - 'troubled' + - 'ugliest' + - 'ugly' + - 'uninterested' + - 'unsightly' + - 'upset' + - 'uptight' + - 'weary' + - 'wicked' + - 'wild' + - 'worrisome' + - 'worried' + - 'wrong' diff --git a/test/faker/default/test_faker_adjective.rb b/test/faker/default/test_faker_adjective.rb new file mode 100644 index 0000000000..0bafc6f64a --- /dev/null +++ b/test/faker/default/test_faker_adjective.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerAdjective < Test::Unit::TestCase + def setup + @tester = Faker::Adjective + end + + def test_positive + assert @tester.positive.match(/\w+/) + end + + def test_negative + assert @tester.negative.match(/\w+/) + end +end diff --git a/test/faker/default/test_faker_bank.rb b/test/faker/default/test_faker_bank.rb index c86fb8e12d..4b307a18f7 100644 --- a/test/faker/default/test_faker_bank.rb +++ b/test/faker/default/test_faker_bank.rb @@ -47,13 +47,14 @@ def test_swift_bic end # This test makes sure there are no collissions in BIC number pool - def test_swift_bic_collission - 10.times do - samplebic1 = @tester.swift_bic - samplebic2 = @tester.swift_bic - refute_equal samplebic1, samplebic2 - end - end + # https://github.com/faker-ruby/faker/pull/2130#issuecomment-703213837 + # def test_swift_bic_collission + # 10.times do + # samplebic1 = @tester.swift_bic + # samplebic2 = @tester.swift_bic + # refute_equal samplebic1, samplebic2 + # end + # end def test_iban_default assert @tester.iban.match(/[A-Z]{4}\d{14}/)