Sha256: 16b79f341f19d7b88776bd2cf0a3396b27bbdc2436b8306404ef85febae6f672

Contents?: true

Size: 819 Bytes

Versions: 182

Compression:

Stored size: 819 Bytes

Contents

def flavors_tests(connection, params = {}, mocks_implemented = true)
  tests('success') do

    tests("#all").succeeds do
      pending if Fog.mocking? && !mocks_implemented
      connection.flavors.all
    end

    if !Fog.mocking? || mocks_implemented
      @identity = connection.flavors.first.identity
    end

    tests("#get('#{@identity}')").succeeds do
      pending if Fog.mocking? && !mocks_implemented
      connection.flavors.get(@identity)
    end

  end

  tests('failure') do

    if !Fog.mocking? || mocks_implemented
      invalid_flavor_identity = connection.flavors.first.identity.to_s.gsub(/\w/, '0')
    end

    tests("#get('#{invalid_flavor_identity}')").returns(nil) do
      pending if Fog.mocking? && !mocks_implemented
      connection.flavors.get(invalid_flavor_identity)
    end

  end
end

Version data entries

182 entries across 149 versions & 16 rubygems

Version Path
ns-fog-1.22.2 tests/helpers/compute/flavors_helper.rb
fog-1.22.1 tests/helpers/compute/flavors_helper.rb