Sha256: f71a62f6ae8ec63b5250bb63c1796593c2babc42e6d32c90a0ab9102934c91d3

Contents?: true

Size: 537 Bytes

Versions: 5

Compression:

Stored size: 537 Bytes

Contents

Given /^I have an event with start_date, end_date and sold_out$/ do
  class Event
    include Dozuki::Mapper
    attr_accessor :start_date, :end_date, :sold_out
  end
end

When /^I map the event node to an event object with:$/ do |string|
  Event.instance_eval %Q{
    map_with do |map|
      #{string}
    end
  }
  @event = Event.from_node(@doc.get('/event'))
end

Then /^the event should have a (.*) of (\d+)\/(\d+)\/(\d+)$/ do |field, day, month, year|
  @event.send(field).should == Date.civil(year.to_i, month.to_i, day.to_i)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dozuki-mapper-0.1.2 features/step_definitions/date_steps.rb
dozuki-mapper-0.1.1 features/step_definitions/date_steps.rb
dozuki-mapper-0.1.0 features/step_definitions/date_steps.rb
dozuki-mapper-0.0.2 features/step_definitions/date_steps.rb
dozuki-mapper-0.0.1 features/step_definitions/date_steps.rb