Skip to content

Commit

Permalink
Merge pull request faker-ruby#1215 from stympy/nano-phonetic-alphabet
Browse files Browse the repository at this point in the history
Added Nato Phonetic Alphabet
  • Loading branch information
vbrazo authored May 17, 2018
2 parents be985c1 + 67267c3 commit b9d0b9b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
### Latest update: 2018-05-16

**Additions**

- Added Nato Phonetic Alphabet [@timcustard](https://github.com/timcustard)
- Add Faker::Source [@graciano](https://github.com/graciano)
- Fix: Moved the Google Omniauth key id_info from root into extra [@SirRawlins](https://github.com/SirRawlins)
- Add coveralls [@vbrazo](https://github.com/vbrazo)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Contents
- [Faker::Music](doc/music.md)
- [Faker::Name](doc/name.md)
- [Faker::Nation](doc/nation.md)
- [Faker::NatoPhoneticAlphabet](doc/nato_phonetic_alphabet.md)
- [Faker::NewGirl](doc/new_girl.md)
- [Faker::Number](doc/number.md)
- [Faker::Omniauth](doc/omniauth.md)
Expand Down
6 changes: 6 additions & 0 deletions doc/nato_phonetic_alphabet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Faker::Hobbit

```ruby
# A code word from the NATO phonetic alphabet
Faker::NatoPhoneticAlphabet #=> "Hotel"
```
9 changes: 9 additions & 0 deletions lib/faker/nato_phonetic_alphabet.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Faker
class NatoPhoneticAlphabet < Base
class << self
def code_word
fetch('nato_phonetic_alphabet.code_word')
end
end
end
end
4 changes: 4 additions & 0 deletions lib/locales/en/nato_phonetic_alphabet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
en:
faker:
nato_phonetic_alphabet:
code_word: ["Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliett", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", "Yankee", "Zulu"]
11 changes: 11 additions & 0 deletions test/test_nato_phonetic_alphabet.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerNatoPhoneticAlphabet < Test::Unit::TestCase
def setup
@tester = Faker::NatoPhoneticAlphabet
end

def test_code_word
assert @tester.code_word.match(/\w+/)
end
end

0 comments on commit b9d0b9b

Please sign in to comment.