Sha256: 137a16350d00fe750403572f413ec65509aac812c8b8abfdbd1982eaad64ab0c

Contents?: true

Size: 1.17 KB

Versions: 37

Compression:

Stored size: 1.17 KB

Contents

Shindo.tests("Storage[:internet_archive] | directory", ["internetarchive"]) do

  directory_attributes = {
    :key => "fogdirectorytests-#{rand(65536)}",
    :collections => ['test_collection']
  }

  tests('success') do
    params = directory_attributes
    mocks_implemented = Fog.mocking?

    collection = Fog::Storage[:internetarchive].directories
    @instance = collection.new(params)

    tests("#save").succeeds do
      pending if Fog.mocking? && !mocks_implemented
      @instance.save
    end

    tests("#public_url").returns("http://archive.org/details/#{directory_attributes[:key]}") do
      @instance.public_url
    end

  end

  tests("#set_metadata_array_headers") do
    params = directory_attributes

    collection = Fog::Storage[:internetarchive].directories
    @instance = collection.new(params)

    @instance.collections = ['test_collection', 'opensource']
    @options = {}
    @instance.set_metadata_array_headers(:collections, @options)

    tests("#set_metadata_array_headers should set options").returns(true) do
      @options['x-archive-meta01-collection'] == 'opensource' &&
      @options['x-archive-meta02-collection'] == 'test_collection'
    end
  end

end

Version data entries

37 entries across 35 versions & 6 rubygems

Version Path
fog-internet-archive-0.0.2 tests/internet_archive/models/storage/directory_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-internet-archive-0.0.1/tests/internet_archive/models/storage/directory_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-internet-archive-0.0.1/tests/internet_archive/models/storage/directory_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-internet-archive-0.0.1/tests/internet_archive/models/storage/directory_tests.rb
fog-1.40.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.39.0 tests/internet_archive/models/storage/directory_tests.rb
fog-internet-archive-0.0.1 tests/internet_archive/models/storage/directory_tests.rb
fog-1.38.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.37.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.36.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.35.0 tests/internet_archive/models/storage/directory_tests.rb
fog-2.0.0.pre.0 tests/internet_archive/models/storage/directory_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/internet_archive/models/storage/directory_tests.rb
fog-1.34.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.33.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.32.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.31.0 tests/internet_archive/models/storage/directory_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/internet_archive/models/storage/directory_tests.rb
fog-1.30.0 tests/internet_archive/models/storage/directory_tests.rb
fog-1.29.0 tests/internet_archive/models/storage/directory_tests.rb