Sha256: 4f243cbb5b8d19ef3f34d3a6b94df8019ddf7b94d09acff9f1c802721d4f86c4

Contents?: true

Size: 552 Bytes

Versions: 5

Compression:

Stored size: 552 Bytes

Contents

Given /^I have an person with name, address and post_code$/ do
  class Person
    include Dozuki::Mapper
    attr_accessor :name, :address, :post_code
  end
end

Given /^I have the XML:$/ do |string|
  @doc = Dozuki::XML.parse(string)
end

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

Then /^the person should have the (.*) "([^"]*)"$/ do |field, string|
  @person.send(field).should == string
end

Version data entries

5 entries across 5 versions & 1 rubygems

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