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