Sha256: da61b3f5105615c46a5fc667131dbd061bc85ff29286381c588c03df31417606

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

Then /^the field (\w+) of the document '(\w+)' is not nil$/ do |field, name|
  doc = instance_variable_get("@#{name}")
  doc.send(field).should_not be_nil
end

When /^'(\w+)' references '(\w+)' as '(\w+)'$/ do |parent, child, field|
  parent_doc = instance_variable_get("@#{parent}")
  child_doc = instance_variable_get("@#{child}")
  parent_doc.send("#{field}=", child_doc)
end

When /^'(\w+)' references '(\w+)' through '(\w+)'$/ do |parent, child, field|
  parent_doc = instance_variable_get("@#{parent}")
  child_doc = instance_variable_get("@#{child}")
  parent_doc.send("#{field.singularize}_ids") << child_doc._id
end

Then /^'(\w+)' refers to '(\w+)' as '(\w+)'$/ do |name, other, field|
  doc = instance_variable_get("@#{name}")
  other_doc = instance_variable_get("@#{other}")
  doc.send("#{field}").should == other_doc
end

Then /^'(\w+)' has '(\w+)' that include '(\w+)'$/ do |name, field, included|
  doc = instance_variable_get("@#{name}")
  included_doc = instance_variable_get("@#{included}")
  doc.send("#{field}").should include(included_doc)
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mongo_doc-0.6.26 features/step_definitions/field_steps.rb
mongo_doc-0.6.25 features/step_definitions/field_steps.rb
mongo_doc-0.6.23 features/step_definitions/field_steps.rb
mongo_doc-0.6.22 features/step_definitions/field_steps.rb
mongo_doc-0.6.21 features/step_definitions/field_steps.rb
mongo_doc-0.6.20 features/step_definitions/field_steps.rb
mongo_doc-0.6.19 features/step_definitions/field_steps.rb
mongo_doc-0.6.18 features/step_definitions/field_steps.rb
mongo_doc-0.6.17 features/step_definitions/field_steps.rb
mongo_doc-0.6.16 features/step_definitions/field_steps.rb
mongo_doc-0.6.15 features/step_definitions/field_steps.rb
mongo_doc-0.6.14 features/step_definitions/field_steps.rb
mongo_doc-0.6.13 features/step_definitions/field_steps.rb
mongo_doc-0.6.12 features/step_definitions/field_steps.rb
mongo_doc-0.6.11 features/step_definitions/field_steps.rb
mongo_doc-0.6.10 features/step_definitions/field_steps.rb