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

Add Faker::Movies::Departed Class #1931

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
### Movies
- [Faker::Movie](doc/movies/movie.md)
- [Faker::Movies::BackToTheFuture](doc/movies/back_to_the_future.md)
- [Faker::Movies::Departed](doc/movies/departed.md)
- [Faker::Movies::Ghostbusters](doc/movies/ghostbusters.md)
- [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
- [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
Expand Down
11 changes: 11 additions & 0 deletions doc/movies/departed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Faker::Movies::Departed

Available since version next.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to adjust this version value - I might have missed how to generate the next version (I did peek at the contribution guide, but could have misread the section on document generation).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these docs, I don't think we keep track of when a set of generators were added.


```ruby
Faker::Movies::Departed.actor #=> "Matt Damon"

Faker::Movies::Departed.character #=> "Frank Costello"

Faker::Movies::Departed.quote #=> "I'm the guy who does his job. You must be the other guy"
```
49 changes: 49 additions & 0 deletions lib/faker/movies/departed.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# frozen_string_literal: true

module Faker
class Movies
class Departed < Base
class << self
##
# Produces an actor from The Departed.
#
# @return [String]
#
# @example
# Faker::Movies::Departed.actor #=> "Matt Damon"
#
# @faker.version next
def actor
fetch('departed.actors')
end

##
# Produces a character from The Departed.
#
# @return [String]
#
# @example
# Faker::Movies::Departed.character #=> "Frank Costello"
#
# @faker.version next
def character
fetch('departed.characters')
end

##
# Produces a quote from The Departed.
#
# @return [String]
#
# @example
# Faker::Movies::Departed.quote
# #=> "I'm the guy who does his job. You must be the other guy"
#
# @faker.version next
def quote
fetch('departed.quotes')
end
end
end
end
end
50 changes: 50 additions & 0 deletions lib/locales/en/departed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
en:
faker:
departed:
actors:
- Leonardo DiCaprio
- Matt Damon
- Jack Nicholson
- Mark Wahlberg
- Martin Sheen
- Ray Winstone
- Vera Farmiga
- Anthony Anderson
- Alec Baldwin
- Kevin Corrigan
- James Badge Dale
- David O'Hara
- Mark Rolston
characters:
- Billy Costigan
- Colin Sullivan
- Frank Costello
- Sean Dignam
- Oliver Queenan
- Arnold French
- Madolyn Madden
- Tony Brown
- George Ellerby
- Sean Costigan
- James Barrigan
- Patrick Fitzgibbons
- Timothy Delahunt
quotes:
- I'm the guy who does his job. You must be the other guy.
- You have an immaculate record. Some guys don't trust an immaculate record.
I do. I have an immaculate record.
- You got a nice suit at home or do you like coming to work everyday dressed
like you're going to invade Poland?
- All due respect Mr. Costello school is out.
- Normally he's a very uh nice guy. Don't judge him from this meeting alone.
- Maybe. Maybe not. Maybe fuck yourself.
- My theory on Feds is that they're like mushrooms feed 'em shit and keep 'em
in the dark
- Don't laugh! This ain't reality TV!
- Let's say you have no idea and leave it at that okay? No idea. Zip. None.
- Families are always rising or falling in America am I right?
- What Freud said about the Irish is we're the only people who are impervious
to psychoanalysis.
- One of you mugs got a light?
- Do you want to be a cop or do you want to appear to be a cop?
- Yeah, it's working... Overtime!
21 changes: 21 additions & 0 deletions test/faker/movies/test_faker_departed.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerDeparted < Test::Unit::TestCase
def setup
@tester = Faker::Movies::Departed
end

def test_actor
assert @tester.actor.match(/\w+/)
end

def test_character
assert @tester.character.match(/\w+/)
end

def test_quote
assert @tester.quote.match(/\w+/)
end
end