Sha256: 2ecc35e2cd93e0791e2640f5ccb01974a3b710613f26354f9c556ac043a5f9ae

Contents?: true

Size: 458 Bytes

Versions: 3

Compression:

Stored size: 458 Bytes

Contents

Given /^the date (\w+) (\d+), (\d{4})$/ do |month_name, day, year|
  month = Date::MONTHNAMES.index(month_name) || Date::ABBR_MONTHNAMES.index(month_name)
  assert (1..12).include?(month), "Invalid month: #{month_name}"
  @date = Date.new(year.to_i, month, day.to_i)
end

When /^I stamp the example "([^"]*)"$/ do |example|
  @formatted_date = @date.stamp(example)
end

Then /^I produce "([^"]*)"$/ do |expected|
  assert_equal expected, @formatted_date
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stamp-0.0.3 features/step_definitions/stamp_steps.rb
stamp-0.0.2 features/step_definitions/stamp_steps.rb
stamp-0.0.1 features/step_definitions/stamp_steps.rb