Sha256: e73d6e9e09ac761670899dda55786b3753d3f2b68e87cd3d70049fcf3f908126

Contents?: true

Size: 675 Bytes

Versions: 3

Compression:

Stored size: 675 Bytes

Contents

# encoding: UTF-8

Watchmaker.learn :two_garages do
  2.times do 
    Factory.create(:garage)
  end
end

Watchmaker.learn :two_cars do
  2.times do 
    Factory.create(:car)
  end
end

Watchmaker.learn :garage, :factories => [:garage]

Watchmaker.learn :car_with_garage, :factories => [:car], :watchmakers => [:garage]

Watchmaker.learn :car_in_garage, :factories => [:garage, :car] do |garage, car|
  garage.cars << car
end

Watchmaker.learn :two_garages, :factories => [:garage, :garage]

Watchmaker.learn :two_cars_and_two_garages => [:two_garages, :car, :car] do |garages, car1, car2| 
  garages.each do |garage|
    garage.cars << car1
    garage.cars << car2
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
watchmaker-0.1.2 spec/support/watchmakers.rb
watchmaker-0.1.1 spec/support/watchmakers.rb
watchmaker-0.1.0 spec/support/watchmakers.rb