diff --git a/README.md b/README.md index 8014666aa2..454c9f9bda 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/doc/tv_shows/big_bang_theory.md b/doc/tv_shows/big_bang_theory.md new file mode 100644 index 0000000000..d312f332ea --- /dev/null +++ b/doc/tv_shows/big_bang_theory.md @@ -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." +``` diff --git a/lib/faker/tv_shows/big_bang_theory.rb b/lib/faker/tv_shows/big_bang_theory.rb new file mode 100644 index 0000000000..6900559eb8 --- /dev/null +++ b/lib/faker/tv_shows/big_bang_theory.rb @@ -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 diff --git a/lib/locales/en/big_bang_theory.yml b/lib/locales/en/big_bang_theory.yml new file mode 100644 index 0000000000..c35e0d9e1e --- /dev/null +++ b/lib/locales/en/big_bang_theory.yml @@ -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." + ] diff --git a/test/faker/tv_shows/test_big_bang_theory.rb b/test/faker/tv_shows/test_big_bang_theory.rb new file mode 100644 index 0000000000..54ed2f6935 --- /dev/null +++ b/test/faker/tv_shows/test_big_bang_theory.rb @@ -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