Permalink
Browse files

added month method

  • Loading branch information...
1 parent 3a21886 commit 46da66a2c1833d8dd7030cd178e43e74bfb24f98 @cheezy committed Feb 7, 2013
@@ -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
@@ -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
@@ -39,6 +39,7 @@ dm:
yesterday: ~yesterday
5daysfromtoday: ~5.days_from_today
5daysago: ~5.days_ago
+ some_month: ~month
other:
name: Cheezy
@@ -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)

0 comments on commit 46da66a

Please sign in to comment.