forked from faker-ruby/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Faker::Cannabis class (faker-ruby#987)
Add Faker::Cannabis class
- Loading branch information
Showing
6 changed files
with
162 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
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,35 @@ | ||
# Faker::Cannabis | ||
|
||
Available since version 1.8.0. | ||
|
||
```ruby | ||
# Random strain | ||
Faker::Cannabis.strain #=> "24k" | ||
|
||
# Random cannabinoid_abbreviation | ||
Faker::Cannabis.cannabinoid_abbreviation #=> "THC" | ||
|
||
# Random cannabinoid | ||
Faker::Cannabis.cannabinoid #=> "Tetrahydrocannabinol" | ||
|
||
# Random terpene | ||
Faker::Cannabis.terpene #=> "α Pinene" | ||
|
||
# Random medical_use | ||
Faker::Cannabis.medical_use #=> "analgesic" | ||
|
||
# Random health_benefit | ||
Faker::Cannabis.health_benefit #=> "relieves pain" | ||
|
||
# Random category | ||
Faker::Cannabis.category #=> "capsules" | ||
|
||
# Random type | ||
Faker::Cannabis.type #=> "hybrid" | ||
|
||
# Random buzzword | ||
Faker::Cannabis.buzzword #=> "blunt wrap" | ||
|
||
# Random website | ||
Faker::Cannabis.website #=> "https://weedmaps.com" | ||
``` |
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,45 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Cannabis < Base | ||
def self.strain | ||
fetch('cannabis.strains') | ||
end | ||
|
||
def self.cannabinoid_abbreviation | ||
fetch('cannabis.cannabinoid_abbreviations') | ||
end | ||
|
||
def self.cannabinoid | ||
fetch('cannabis.cannabinoids') | ||
end | ||
|
||
def self.terpene | ||
fetch('cannabis.terpenes') | ||
end | ||
|
||
def self.medical_use | ||
fetch('cannabis.medical_uses') | ||
end | ||
|
||
def self.health_benefit | ||
fetch('cannabis.health_benefits') | ||
end | ||
|
||
def self.category | ||
fetch('cannabis.categories') | ||
end | ||
|
||
def self.type | ||
fetch('cannabis.types') | ||
end | ||
|
||
def self.buzzword | ||
fetch('cannabis.buzzwords') | ||
end | ||
|
||
def self.website | ||
fetch('cannabis.websites') | ||
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,13 @@ | ||
en: | ||
faker: | ||
cannabis: | ||
strains: ["24k", "Alien Diesel", "Banana OG", "Bio-Diesel", "Black Diamond OG", "Black Jack", "Blackberry Cookies", "Blackberry Soda", "Blackwater OG", "Blue Dream", "Blueberry Tangie", "Boss Hog", "Cali Mist", "Candy Skunk", "Candyland", "Canna Sutra", "Cheese", "Chem Berry", "Cherry Cheese", "Cherry Lime", "Chocolate Hashberry", "Chronic", "Church OG", "Clementine", "Colfax Cookies", "Colfax Jack", "Colfax Platinum", "Critical Kush", "Diablo OG", "Double Dutch Bus", "Dutch Treat", "Forbidden Fruit", "Gelato", "Ghost OG", "Girl Scout Cookies", "Godzilla Glue", "Golden Strawberries", "Gorilla Glue", "Gorilla Princess", "Granddaddy Purple Kush", "Grapefruit Kush", "Green Cobra", "Green Queen", "Hardcore Grapes", "Heavy OG", "Jack Frost", "Key Lime Pie", "King Kong OG", "King Louis OG", "Kings Reserve OG", "Koffee Cake", "Lemon Jack", "Lemon Meringue", "Lemon Skunk", "Lemonade", "Lime #5", "Lucky Charms", "Master OG", "Maui Jack", "Mendo Breath", "Mojito", "Moon Glue", "Mr. Nice Guy", "NY Sour Diesel", "Nectarine", "Novicane Kush", "Nug Salad", "OG Chem", "OG Salad", "ONAC OG", "Panama Punch", "Pineapple Sage", "Pinesol OG", "Pink Lotus", "Pitbull", "Platinum OG", "Presidential OG", "Private Reserve", "Purple Punch", "Queen Dream", "Rainbow Sherbet", "Raskal OG", "Redwood Bubba Kush", "Rude Boi OG", "Satellite OG", "Saturn OG", "Sherbert", "Skywalker OG", "Snozzberry OG", "Sonoma Glue", "Soul Assasin OG", "Soul Assassin", "Sour Cheese", "Strawberry Banana", "Strawberry Cough", "Strawberry Moonrocks", "Strawberry Shortcake", "Sugar Momma", "Sunset Sherbert", "Super Glue", "Super Jack", "Super Silver Haze", "Tangie", "Watermelon", "White Tahoe Cookies", "Whitewalker OG", "XJ-13"] | ||
cannabinoid_abbreviations: ["THC", "THCa", "∆9THC", "∆8THC", "THCv", "THCv", "CBD", "CBDa", "CBDv", "CBN", "CBNa", "CBG", "CBGa", "CBC", "CBCa", "CBL", "CBLa"] | ||
cannabinoids: ["Tetrahydrocannabinol", "Tetrahydrocannabinolic Acid", "Tetrahydrocannabivarin", "Cannabidiol", "Cannabidiolic Acid", "Cannabidivarin", "Cannabinol", "Cannabinolic Acid", "Cannabigerol", "Cannabigerolic Acid", "Cannabichromene", "Cannabichromic Acid", "Cannabicyclol", "Cannabicyclic Acid"] | ||
terpenes: ["α Pinene", "Myrcene", "α Phellandrene", "∆ 3 Carene", "Terpinene", "Limonene", "α Terpinolene", "Linalool", "Fenchol", "Borneol", "Terpineol", "Geraniol", "α Humulene", "β Caryophyllene", "Caryophyllene Oxide", "α Bisabolol", "Camphene", "β Pinene", "Ocimene", "Sabinene", "Camphor", "Isoborneol", "Menthol", "α Cedrene", "Nerolidol", "R-(+)-Pulegone", "Eucalyptol", "p-Cymene", "(-)-Isopulegol", "Geranyl", "Acetate", "Guaiol", "Valencene", "Phytol", "Citronellol"] | ||
medical_uses: ["analgesic", "anti-bacterial", "anti-diabetic", "anti-emetic", "anti-epileptic", "anti-fungal", "anti-depressant", "anti-inflammatory", "anti-insomnia", "anti-ischemic", "anti-cancer", "anti-psoriatic", "anti-psychotic", "anti-spasmodic", "anti-anxiety", "appetite stimulant", "anorectic", "bone stimulant", "immunoregulation", "immunostimulant", "intestinal anti-prokinetic", "neuroprotective", "bronchodilator", "anti-stress", "anti-septic", "psychoactive", "non-psychoactive", "decongestant", "anti-histamine", "anti-oxidant", "anti-viral"] | ||
health_benefits: ["relieves pain", "kills or slows bacteria growth", "reduces blood sugar levels", "reduces vomiting and nausea", "reduces seizures and convulsion", "treats fungal infection", "treats depression", "reduces inflammation", "aids sleep", "reduces risk of artery blockage", "inhibits cell growth in tumors/cancer cells", "treats psoriasis", "tranquilizing", "suppresses muscle spasms", "relieves anxiety", "stimulates appetite", "suppresses appetite", "promotes bone growth", "regulates function in the immune system", "stimulates function in the immune system", "reduces contractions in the small intestines", "protects against nervous system degeneration", "improves airflow to lungs", "prevents stress", "prevents infection", "affects mental activity", "does not affect mental activity", "relieves congestion", "treats allergy symptoms", "cell protectant", "treats viral infections"] | ||
categories: ["capsules", "concentrates", "crumble", "crystalline", "distillate", "edibles", "flower", "ice hash", "live resin", "medical", "rosin", "seeds & clones", "shatter", "tinctures", "topicals", "vape pens"] | ||
types: ["hybrid", "indica", "sativa"] | ||
buzzwords: ["blunt wrap", "bong", "bottom shelf", "bubbler", "cashed", "cbd", "dank", "eighth", "gram", "high", "hydroponic", "keef", "marijuana", "mary jane", "munchies", "ounce", "papers", "pipe", "pound", "private reserve", "ripped", "spliff", "stoned", "terpene", "thc", "toke", "top shelf", "wake and bake", "weed"] | ||
websites: ["https://weedmaps.com"] |
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,65 @@ | ||
# frozen_string_literal: true | ||
|
||
require File.expand_path(File.dirname(__FILE__) + '/test_helper') | ||
|
||
class TestFakerCannabis < Test::Unit::TestCase | ||
def setup | ||
Faker::Config.locale = nil | ||
end | ||
|
||
def test_strain | ||
10.times { assert Faker::Cannabis.strain.match(/[\w]+/) } | ||
end | ||
|
||
def test_cannabinoid_abbreviation | ||
10.times { assert Faker::Cannabis.cannabinoid_abbreviation.match(/[\w]+/) } | ||
end | ||
|
||
def test_cannabinoid | ||
10.times { assert Faker::Cannabis.cannabinoid.match(/[\w]+/) } | ||
end | ||
|
||
def test_terpene | ||
10.times { assert Faker::Cannabis.terpene.match(/[\w]+/) } | ||
end | ||
|
||
def test_medical_use | ||
10.times { assert Faker::Cannabis.medical_use.match(/[\w]+/) } | ||
end | ||
|
||
def test_health_benefit | ||
10.times { assert Faker::Cannabis.health_benefit.match(/[\w]+/) } | ||
end | ||
|
||
def test_category | ||
10.times { assert Faker::Cannabis.category.match(/[\w]+/) } | ||
end | ||
|
||
def test_type | ||
10.times { assert Faker::Cannabis.type.match(/[\w]+/) } | ||
end | ||
|
||
def test_buzzword | ||
10.times { assert Faker::Cannabis.buzzword.match(/[\w]+/) } | ||
end | ||
|
||
def test_website | ||
10.times { assert Faker::Cannabis.website.match(/[\w]+/) } | ||
end | ||
|
||
def test_locales | ||
[nil, 'en', 'de'].each do |_locale_name| | ||
Faker::Config.locale = 'de' | ||
assert Faker::Cannabis.strain.is_a? String | ||
assert Faker::Cannabis.cannabinoid_abbreviation.is_a? String | ||
assert Faker::Cannabis.cannabinoid.is_a? String | ||
assert Faker::Cannabis.terpene.is_a? String | ||
assert Faker::Cannabis.medical_use.is_a? String | ||
assert Faker::Cannabis.health_benefit.is_a? String | ||
assert Faker::Cannabis.category.is_a? String | ||
assert Faker::Cannabis.type.is_a? String | ||
assert Faker::Cannabis.buzzword.is_a? String | ||
assert Faker::Cannabis.website.is_a? String | ||
end | ||
end | ||
end |