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 Big Bang Theory #1865

Merged
merged 6 commits into from
Jun 10, 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.
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 @@ -283,6 +283,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast

### Tv Shows
- [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
- [Faker::TvShows::BigBangTheory](doc/tv_shows/big_bang_theory.md)
- [Faker::TvShows::BojackHorseman](doc/tv_shows/bojack_horseman.md)
- [Faker::TvShows::BreakingBad](doc/tv_shows/breaking_bad.md)
- [Faker::TvShows::Buffy](doc/tv_shows/buffy.md)
Expand Down
7 changes: 7 additions & 0 deletions doc/tv_shows/big_bang_theory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Faker::TvShows::BigBangTheory

```ruby
Faker::TvShows::BigBangTheory.character #=> "Sheldon Cooper"

Faker::TvShows::BigBangTheory.quote #=> "I'm not crazy. My mother had me tested."
```
37 changes: 37 additions & 0 deletions lib/faker/tv_shows/big_bang_theory.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: true

module Faker
class TvShows
class BigBangTheory < Base
flexible :big_bang_theory

class << self
##
# Produces a character from Big Bang Theory
#
# @return [String]
#
# @example
# Faker::TvShows::BigBangTheory.character #=> "Sheldon Cooper"
#
pathaknv marked this conversation as resolved.
Show resolved Hide resolved
# @faker.version next
def character
fetch('big_bang_theory.characters')
end

##
# Produces a quote from Bing Bang Theory
#
# @return [String]
#
# @example
# Faker::TvShows::BigBangTheory.quote #=> "I'm not crazy. My mother had me tested."
#
# @faker.version next
def quote
fetch('big_bang_theory.quotes')
end
end
end
end
end
38 changes: 38 additions & 0 deletions lib/locales/en/big_bang_theory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
en:
faker:
big_bang_theory:
characters: [
Copy link
Contributor

Choose a reason for hiding this comment

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

We would prefer the dash syntax for yaml filed, but having each on its own line is good enough for me.

"Leonard Hofstadter",
"Sheldon Cooper",
"Penny",
"Howard Wolowitz",
"Raj Koothrappali",
"Bernadette Rostenkowski",
"Amy Farrah Fowler",
"Stuart Bloom",
"Debbie Wolowitz",
"Barry Kripke",
"Emily Sweeney",
"Wil Wheaton",
"Dr. V.M. Koothrappali",
"Dr. Beverly Hofstadter",
"Bert Kibbler",
"Mary Cooper",
"President Siebert",
"Priya Koothrappali",
"Zack Johnson",
"Mrs. Koothrappali",
"Leslie Winkle",
"Anu",
"Lucy",
"Denise",
"Mike Rostenkowski"]
quotes: [
"I'm not crazy. My mother had me tested.",
"Bazinga!",
"Scissors cuts paper, paper covers rock, rock crushes lizard, lizard poisons Spock, Spock smashes scissors, scissors decapitates lizard, lizard eats paper, paper disproves Spock, Spock vaporizes rock, and as it always has, rock crushes scissors.",
"That's no reason to cry. One cries because one is sad. For example, I cry because others are stupid, and that makes me sad.",
"Not knowing is part of the fun. Was that the motto of your community college?",
"I would have been here sooner but the bus kept stopping for other people to get on it.",
"Hard as this may be to believe, it’s possible that I’m not boyfriend material."
]
17 changes: 17 additions & 0 deletions test/faker/tv_shows/test_big_bang_theory.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerTvShowsBigBangTheory < Test::Unit::TestCase
def setup
@tester = Faker::TvShows::BigBangTheory
end

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

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