-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
5 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |