Skip to content

Commit

Permalink
Add Big Bang Theory (#1865)
Browse files Browse the repository at this point in the history
* Added characters, quotes of big bang theory in yml file

* Added big bang theory class

* Added test for big bang theory faker class

* Added doc file

* Updated readme file

* Added missing @faker.version next tags on new generators
  • Loading branch information
pathaknv committed Jun 10, 2020
1 parent a662846 commit 388142d
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,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"
#
# @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: [
"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

0 comments on commit 388142d

Please sign in to comment.