Sha256: e724bafe39c4e2d3581942260837f1c5e4dbd4afa785271160e83866b746abac

Contents?: true

Size: 1.91 KB

Versions: 34

Compression:

Stored size: 1.91 KB

Contents

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

  file_attributes = {
      :key => 'fog_file_tests',
      :body => lorem_file,
      :public => true,
      :auto_make_bucket => 1,
      :collections => ['test_collection']
  }

  directory_attributes = {
      :key => "fogfilestests-#{rand(65536)}"
  }

  @directory = Fog::Storage[:internetarchive].directories.create(directory_attributes)
  # @directory.versioning = true

  model_tests(@directory.files, file_attributes, Fog.mocking?) do

    @instance
    # v2 = @directory.connection.put_object(@directory.key, @instance.key, 'version 2 content').headers['x-amz-version-id']
    # v3 = @directory.connection.delete_object(@directory.key, @instance.key).headers['x-amz-version-id']
    # v4 = @directory.connection.put_object(@directory.key, @instance.key, 'version 3 content').headers['x-amz-version-id']

    # tests("#get") do
    #   tests("#get without version fetches the latest version").returns(v4) do
    #     @directory.files.get(@instance.key).version
    #   end

    #   tests("#get with version fetches that exact version").returns(v2) do
    #     @directory.files.get(@instance.key, 'versionId' => v2).version
    #   end

    #   tests("#get with a deleted version returns nil").returns(nil) do
    #     @directory.files.get(@instance.key, 'versionId' => v3)
    #   end
    # end

    # tests("#head") do
    #   tests("#head without version fetches the latest version").returns(v4) do
    #     @directory.files.head(@instance.key).version
    #   end

    #   tests("#head with version fetches that exact version").returns(v2) do
    #     @directory.files.head(@instance.key, 'versionId' => v2).version
    #   end

    #   tests("#head with a deleted version returns nil").returns(nil) do
    #     @directory.files.head(@instance.key, 'versionId' => v3)
    #   end
    # end

  end

  # @directory.versions.each(&:destroy)
  # @directory.destroy

end

Version data entries

34 entries across 34 versions & 4 rubygems

Version Path
fog-1.40.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.39.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.38.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.37.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.36.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.35.0 tests/internet_archive/models/storage/files_tests.rb
fog-2.0.0.pre.0 tests/internet_archive/models/storage/files_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/internet_archive/models/storage/files_tests.rb
fog-1.34.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.33.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.32.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.31.0 tests/internet_archive/models/storage/files_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/internet_archive/models/storage/files_tests.rb
fog-1.30.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.29.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.28.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.27.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.26.0 tests/internet_archive/models/storage/files_tests.rb
fog-1.25.0 tests/internet_archive/models/storage/files_tests.rb
nsidc-fog-1.24.1 tests/internet_archive/models/storage/files_tests.rb