Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added month method

  • Loading branch information...
commit 46da66a2c1833d8dd7030cd178e43e74bfb24f98 1 parent 3a21886
@cheezy authored
View
3  features/data_magic.feature
@@ -91,3 +91,6 @@ Feature: Functionality of the data_magic gem
Scenario: Specifying number of days from today
Then the value for "5daysfromtoday" should be five days from today
And the value for "5daysago" should be five days ago
+
+ Scenario: Getting a random month name
+ Then the value for "some_month" should be a valid month
View
5 features/step_definitions/data_magic_steps.rb
@@ -97,3 +97,8 @@ class TestClass
the_day = Date.today - 5
@data[key].should == the_day.strftime('%D')
end
+
+Then /^the value for "(.*?)" should be a valid month$/ do |key|
+ months = %w[January February March April May June July August September October November December]
+ months.should include @data[key]
+end
View
1  features/yaml/example.yml
@@ -39,6 +39,7 @@ dm:
yesterday: ~yesterday
5daysfromtoday: ~5.days_from_today
5daysago: ~5.days_ago
+ some_month: ~month
other:
name: Cheezy
View
4 lib/data_magic/translation.rb
@@ -215,6 +215,10 @@ def mask(value)
result
end
+ def month
+ randomize(%w[January February March April May June July August September October November December])
+ end
+
private
def remove_extension(phone)
Please sign in to comment.
Something went wrong with that request. Please try again.