Sha256: 6dd583e5b5768eeb791128a06c74c583779eedca38aed9dc8009c4767d26484d

Contents?: true

Size: 1.54 KB

Versions: 60

Compression:

Stored size: 1.54 KB

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

Shindo.tests("Fog::Storage[:softlayer] | container_tests", ["softlayer"]) do

  @storage = Fog::Storage[:softlayer]
  @container = 'example-testing'


  tests('success') do
    # should be an empty array
    tests("#get_containers") do
      data_matches_schema(Array) { @storage.get_containers.body}
    end

    # should get an empty body w/ 201 status
    tests("#put_container(#{@container})") do
      response = @storage.put_container(@container)
      data_matches_schema(201) { response.status }
      data_matches_schema('') { response.body }
    end

    tests("#get_container(#{@container})") do
      response = @storage.get_container(@container)
      data_matches_schema(200) { response.status }
      data_matches_schema(Array) { response.body }
    end

    tests("#delete_container") do
      response = @storage.delete_container(@container)
      data_matches_schema(204) { response.status}
      data_matches_schema('') { response.body }
    end

  end

  tests('failure') do
    tests("#get_container('swing-and-a-miss')") do
      data_matches_schema(404) { @storage.get_container('foo-bar-baz-bang').status }
    end

    tests("#delete_container") do
      response = @storage.delete_container('sdfgsdgsdfgsdfg')
      data_matches_schema(404) { response.status }
      data_matches_schema('<html><h1>Not Found</h1><p>The resource could not be found.</p></html>') { response.body }
    end
  end
end

Version data entries

60 entries across 58 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/tests/softlayer/requests/storage/container_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/tests/softlayer/requests/storage/container_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.1.4 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.1.3 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.1.2 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.1.1 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.1.0 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.0.3 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.0.2 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.0.1 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-1.0.0 tests/softlayer/requests/storage/container_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-0.4.7 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-0.4.6 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-0.4.5 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-0.4.4 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-0.4.3 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-0.4.2 tests/softlayer/requests/storage/container_tests.rb
fog-softlayer-0.4.2.pre tests/softlayer/requests/storage/container_tests.rb