Sha256: b15ada39b7afcbe06693c516717c064d4b6019af9fba9654b666db4846a151bf

Contents?: true

Size: 719 Bytes

Versions: 26

Compression:

Stored size: 719 Bytes

Contents

require "integration/factories/collection_factory"

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

  def get(identity)
    @subject.get(identity, TEST_REGION)
  end

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

  def params
    { :name => resource_name,
      :network => "default",
      :region => TEST_REGION,
      :ip_cidr_range => "192.168.#{@octet_generator.next}.0/24" }
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
fog-google-1.24.1 test/integration/factories/subnetworks_factory.rb
fog-google-1.24.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.23.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.22.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.21.1 test/integration/factories/subnetworks_factory.rb
fog-google-1.21.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.20.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.19.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.18.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.17.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.16.1 test/integration/factories/subnetworks_factory.rb
fog-google-1.16.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.15.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.14.0 test/integration/factories/subnetworks_factory.rb
gitlab-fog-google-1.14.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.13.0 test/integration/factories/subnetworks_factory.rb
gitlab-fog-google-1.13.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.12.1 test/integration/factories/subnetworks_factory.rb
fog-google-1.12.0 test/integration/factories/subnetworks_factory.rb
fog-google-1.11.0 test/integration/factories/subnetworks_factory.rb