File: target_pools_factory.rb

package info (click to toggle)
ruby-fog-google 1.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,568 kB
  • sloc: ruby: 16,775; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require "integration/factories/collection_factory"
require "integration/factories/servers_factory"
require "integration/factories/http_health_checks_factory"

class TargetPoolsFactory < CollectionFactory
  def initialize(example)
    @http_health_checks = HttpHealthChecksFactory.new(example)
    @servers = ServersFactory.new(example)
    super(Fog::Compute[:google].target_pools, example)
  end

  def cleanup
    super
    @servers.cleanup
    @http_health_checks.cleanup
  end

  def all
    @subject.all(region: TEST_REGION)
  end

  def params
    { :name => resource_name,
      :region => TEST_REGION,
      :instances => [@servers.create.self_link, @servers.create.self_link],
      :health_checks => [@http_health_checks.create.self_link] }
  end
end