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

Faker adjectives #2130

Merged
merged 7 commits into from
Oct 4, 2020
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
9 changes: 9 additions & 0 deletions doc/default/adjective.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Faker::Adjective

```ruby
# Random Positive Adjective
Faker::Adjective.positive #=> "Kind"

# Random Negative Adjective
Faker::Adjective.negative #=> "Creepy"
```
35 changes: 35 additions & 0 deletions lib/faker/default/faker_adjective.rb
Original file line number Diff line number Diff line change
@@ -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
179 changes: 179 additions & 0 deletions lib/locales/en/adjective.yml
Original file line number Diff line number Diff line change
@@ -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'
17 changes: 17 additions & 0 deletions test/faker/default/test_faker_adjective.rb
Original file line number Diff line number Diff line change
@@ -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
15 changes: 8 additions & 7 deletions test/faker/default/test_faker_bank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}/)
Expand Down