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::Subscription (faker-ruby#1440)
* add Faker::Subscription * fix test * typo * add tests for locales * adding _mx to test name * move to unreleased content * Update CHANGELOG.md * Update README.md
- Loading branch information
Showing
13 changed files
with
124 additions
and
3 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,13 @@ | ||
# Faker::Subscription | ||
|
||
```ruby | ||
Faker::Subscription.plan #=> "Platinum" | ||
|
||
Faker::Subscription.status #=> "Active" | ||
|
||
Faker::Subscription.payment_method #=> "Paypal" | ||
|
||
Faker::Subscription.subscription_term #=> "Annual" | ||
|
||
Faker::Subscription.payment_term #=> "Monthly" | ||
``` |
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,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Subscription < Base | ||
def self.plan | ||
fetch('subscription.plans') | ||
end | ||
|
||
def self.status | ||
fetch('subscription.statuses') | ||
end | ||
|
||
def self.payment_method | ||
fetch('subscription.payment_methods') | ||
end | ||
|
||
def self.subscription_term | ||
fetch('subscription.subscription_terms') | ||
end | ||
|
||
def self.payment_term | ||
fetch('subscription.payment_terms') | ||
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,8 @@ | ||
en: | ||
faker: | ||
subscription: | ||
plans: ["Free Trial", "Basic", "Starter", "Essential", "Student", Bronze", "Standard", "Silver", "Gold", "Platinum", "Professional", "Business", "Diamond", "Premium"] | ||
statuses: ["Active", "Idle", "Blocked", "Pending"] | ||
payment_methods: ["Credit card", "Debit card", "Paypal", "Cash", "Money transfer", "Bitcoins", "Cheque", "Apple Pay", "Google Pay", "WeChat Pay", "Alipay", "Visa checkout"] | ||
subscription_terms: ["Daily", "Weekly", "Monthly", "Annual", "Biennal", "Triennal", "Quinquennal", "Lifetime"] | ||
payment_terms: ["Payment in advance", "Monthly", "Annual", "Full subscription"] |
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
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,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'test_helper' | ||
|
||
class TestFakerSubscription < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Subscription | ||
end | ||
|
||
def test_plan | ||
assert @tester.plan.match(/\w+/) | ||
end | ||
|
||
def test_status | ||
assert @tester.status.match(/\w+/) | ||
end | ||
|
||
def test_payment_method | ||
assert @tester.payment_method.match(/\w+/) | ||
end | ||
|
||
def test_subscription_term | ||
assert @tester.subscription_term.match(/\w+/) | ||
end | ||
|
||
def test_payment_term | ||
assert @tester.payment_term.match(/\w+/) | ||
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
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