Sha256: b65f3c58eeea410e641f4690960a0599cfda80e2b33144d6d62481702c1caa24

Contents?: true

Size: 524 Bytes

Versions: 16

Compression:

Stored size: 524 Bytes

Contents

require "integration/factories/collection_factory"

class NetworksFactory < CollectionFactory
  def initialize(example)
    # We cannot have 2 networks with the same IP range so instantiating a
    # class variable holding a generator, ensuring that the factory gives
    # us a new network every time it's called
    @octet_generator = (0..255).each
    super(Fog::Compute[:google].networks, example)
  end

  def params
    { :name => resource_name,
      :ipv4_range => "172.16.#{@octet_generator.next}.0/24" }
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
fog-google-1.15.0 test/integration/factories/networks_factory.rb
fog-google-1.14.0 test/integration/factories/networks_factory.rb
gitlab-fog-google-1.14.0 test/integration/factories/networks_factory.rb
fog-google-1.13.0 test/integration/factories/networks_factory.rb
gitlab-fog-google-1.13.0 test/integration/factories/networks_factory.rb
fog-google-1.12.1 test/integration/factories/networks_factory.rb
fog-google-1.12.0 test/integration/factories/networks_factory.rb
fog-google-1.11.0 test/integration/factories/networks_factory.rb
fog-google-1.10.0 test/integration/factories/networks_factory.rb
fog-google-1.9.1 test/integration/factories/networks_factory.rb
fog-google-1.9.0 test/integration/factories/networks_factory.rb
fog-google-1.8.2 test/integration/factories/networks_factory.rb
fog-google-1.8.1 test/integration/factories/networks_factory.rb
fog-google-1.8.0 test/integration/factories/networks_factory.rb
fog-google-1.7.1 test/integration/factories/networks_factory.rb
fog-google-1.7.0 test/integration/factories/networks_factory.rb