Sha256: 64670a6341046f0a313cd7f37e4131ef12a417448233c2de95feab22fa1faa7e

Contents?: true

Size: 1.26 KB

Versions: 87

Compression:

Stored size: 1.26 KB

Contents

Shindo.tests('Fog::Rackspace::Database | database_tests', ['rackspace']) do

  pending if Fog.mocking?

  service = Fog::Rackspace::Databases.new
  instance_name = 'fog' + Time.now.to_i.to_s

    begin
    @instance_id = service.create_instance(instance_name, 1, 1).body['instance']['id']

    wait_for_request("waiting for database to be created") do
      service.get_instance(@instance_id).body["instance"]["status"] == 'ACTIVE'
    end

    tests('success') do
      database_name = 'fogdb' + Time.now.to_i.to_s

      tests("#create_database(#{@instance_id}, #{database_name})").returns(202) do
        service.create_database(@instance_id, database_name).status
      end

      tests("#list_databases{#{@instance_id})").formats(LIST_DATABASES_FORMAT) do
        service.list_databases(@instance_id).body
      end

      tests("#delete_database(#{@instance_id}, #{database_name})").returns(202) do
        service.delete_database(@instance_id, database_name).status
      end
    end

    tests('failure') do
      tests("#create_database(#{@instance_id}, '') => Invalid Create Critera").raises(Fog::Rackspace::Databases::BadRequest) do
        service.create_database(@instance_id, '')
      end
    end
  ensure
    service.delete_instance(@instance_id) if @instance_id
  end
end

Version data entries

87 entries across 85 versions & 8 rubygems

Version Path
fog-rackspace-0.1.6 tests/rackspace/requests/databases/database_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/databases/database_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/databases/database_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/tests/rackspace/requests/databases/database_tests.rb
fog-rackspace-0.1.5 tests/rackspace/requests/databases/database_tests.rb
fog-rackspace-0.1.4 tests/rackspace/requests/databases/database_tests.rb
fog-rackspace-0.1.3 tests/rackspace/requests/databases/database_tests.rb
fog-rackspace-0.1.2 tests/rackspace/requests/databases/database_tests.rb
fog-rackspace-0.1.1 tests/rackspace/requests/databases/database_tests.rb
fog-rackspace-0.1.0 tests/rackspace/requests/databases/database_tests.rb
fog-1.37.0 tests/rackspace/requests/databases/database_tests.rb
fog-1.36.0 tests/rackspace/requests/databases/database_tests.rb
fog-1.35.0 tests/rackspace/requests/databases/database_tests.rb
fog-2.0.0.pre.0 tests/rackspace/requests/databases/database_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/rackspace/requests/databases/database_tests.rb
fog-1.34.0 tests/rackspace/requests/databases/database_tests.rb
fog-1.33.0 tests/rackspace/requests/databases/database_tests.rb
fog-1.32.0 tests/rackspace/requests/databases/database_tests.rb
fog-1.31.0 tests/rackspace/requests/databases/database_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/rackspace/requests/databases/database_tests.rb