Skip to content

Commit

Permalink
Add Faker::HarryPotter.spell (faker-ruby#1279)
Browse files Browse the repository at this point in the history
* added spell in Harry Potter
* added new method spell

* updated doc

* Update changelog

* Minor change
  • Loading branch information
Anusha Bhat authored and vbrazo committed Jun 11, 2018
1 parent 30d126b commit ddff0d1
Show file tree
Hide file tree
Showing 5 changed files with 13 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,7 @@
### Latest update: 2018-06-11

### Feature Request
- [PR #1279](https://github.com/stympy/faker/pull/1279) Add Faker::HarryPotter.spell [@A9u](https://github.com/A9u)
- [PR #799](https://github.com/stympy/faker/pull/799) Faker::ElectricalComponents [@bheim6](https://github.com/bheim6)
- [PR #1050](https://github.com/stympy/faker/pull/1050) Add Faker::Invoice to generate valid bank slip references [@onnimonni](https://github.com/onnimonni)
- [PR #817](https://github.com/stympy/faker/pull/817) Faker::Lorem.multibyte for multibyte chars [@frankywahl](https://github.com/frankywahl)
Expand Down Expand Up @@ -54,6 +55,7 @@
- [PR #900](https://github.com/stympy/faker/pull/900) Add Japanese lorem words to locale [@vietqhoang](https://github.com/vietqhoang)

### Update/add locales
- [PR #1103](https://github.com/stympy/faker/pull/1103) Fix inconsistent capitalization in dishes, ingredients and spices, and some other small issues under 'food' [@evrimfeyyaz](https://github.com/evrimfeyyaz)
- [PR #1262](https://github.com/stympy/faker/pull/1262) Add fr_CH locale [@elentras](https://github.com/elentras)
- [PR #1261](https://github.com/stympy/faker/pull/1261) Add fr_CA locale [@elentras](https://github.com/elentras)
- [PR #1275](https://github.com/stympy/faker/pull/1275) Fix typo; RedWine should be two words [@johnmuhl](https://github.com/johnmuhl)
Expand Down
2 changes: 2 additions & 0 deletions doc/harry_potter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ Faker::HarryPotter.quote #=> "I solemnly swear that I am up to no good."
Faker::HarryPotter.book #=> "Harry Potter and the Chamber of Secrets"

Faker::HarryPotter.house #=> "Gryffindor"

Faker::HarryPotter.spell #=> "Reparo"
```
4 changes: 4 additions & 0 deletions lib/faker/harry_potter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def book
def house
fetch('harry_potter.houses')
end

def spell
fetch('harry_potter.spells')
end
end
end
end
1 change: 1 addition & 0 deletions lib/locales/en/harry_potter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ en:
quotes: ["It does not do to dwell on dreams and forget to live.", "It takes a great deal of bravery to stand up to our enemies, but just as much to stand up to our friends.", "To the well-organized mind, death is but the next great adventure.", "It is our choices, Harry, that show what we truly are, far more than our abilities.", "Happiness can be found even in the darkest of times if only one remembers to turn on the light.", "If you want to know what a man’s like, take a good look at how he treats his inferiors, not his equals.", "Dark and difficult times lie ahead. Soon we must all face the choice between what is right and what is easy.", "Just because you have the emotional range of a teaspoon doesn’t mean we all have.", "We’ve all got both light and dark inside us. What matters is the part we choose to act on. That’s who we really are.", "Harry, suffering like this proves you are still a man! This pain is part of being human...the fact that you can feel pain like this is your greatest strength.", "Things we lose have a way of coming back to us in the end, if not always in the way we expect.", "It is the unknown we fear when we look upon death and darkness, nothing more.", "Of course it is happening inside your head, Harry, but why on earth should that mean that it is not real?", "Words are in my not-so-humble opinion, the most inexhaustible form of magic we have, capable both of inflicting injury and remedying it.", "After all this time? Always.", "No story lives unless someone wants to listen. The stories we love best do live in us forever. So whether you come back by page or by the big screen, Hogwarts will always be there to welcome you home.", "You're a wizard, Harry.", "We could all have been killed - or worse, expelled.", "Never trust anything that can think for itself if you can't see where it keeps its brain.", "It’s wingardium leviOsa, not leviosAH.", "You sort of start thinking anything’s possible if you’ve got enough nerve.", "I solemnly swear that I am up to no good.", "There are some things you can't share without ending up liking each other, and knocking out a twelve-foot mountain troll is one of them."]
books: ["Harry Potter and the Sorcerer's Stone", "Harry Potter and the Chamber of Secrets", "Harry Potter and the Prisoner of Azkaban", "Harry Potter and the Goblet of Fire", "Harry Potter and the Order of the Phoenix", "Harry Potter and the Half-Blood Prince", "Harry Potter and the Deathly Hallows"]
houses: ["Gryffindor", "Slytherin", "Ravenclaw", "Hufflepuff", "Horned Serpent", "Wampus", "Thunderbird", "Pukwudgie"]
spells: ["Accio", "Alohomora", "Avada Kedavra", "Crucio", "Confundo", "Expelliarmus", "Expecto Patronum", "Lumos", "Obliviate", "Reparo", "Revelio", "Riddikulus", "Stupefy", "Sectumsempra", "Wingardium Leviosa"]
4 changes: 4 additions & 0 deletions test/test_faker_harry_potter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ def test_book
def test_house
assert @tester.house.match(/\w+/)
end

def test_spell
assert @tester.spell.match(/\w+/)
end
end

0 comments on commit ddff0d1

Please sign in to comment.