Sha256: 0059276b90ae5d38655d0f2741e6bce2cd1a79180e4ab3789ad7f58563a6dd1c

Contents?: true

Size: 1.38 KB

Versions: 12

Compression:

Stored size: 1.38 KB

Contents

Shindo.tests("Storage[:aws] | version", [:aws]) do

  file_attributes = {
      :key => 'fog_file_tests',
      :body => lorem_file,
      :public => true
  }

  directory_attributes = {
      :key => 'fogfilestests'
  }

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

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

    @version_instance = @instance.versions.first
    @directory.connection.put_object(@directory.key, @instance.key, 'second version content')

    tests("#file") do
      tests("#file should return the object associated with the version").returns(@version_instance.version) do
        @version_instance.file.version
      end
    end

    tests("#delete_marker") do
      tests("#delete_marker should be false if the version isn't a DeleteMarker'").returns(false) do
        @version_instance.delete_marker
      end

      tests("#delete_marker should be true if the version is a DeleteMarker'").returns(true) do
        @instance.destroy

        @instance.versions.all.first.delete_marker
      end
    end

    tests("#destroy") do
      tests("#destroy removes the specific version").returns(false) do
        @version_instance.destroy

        @instance.versions.all.collect(&:version).include?(@version_instance.version)
      end
    end

  end

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

end

Version data entries

12 entries across 12 versions & 6 rubygems

Version Path
fog-1.5.0 tests/aws/models/storage/version_tests.rb
rackspace-fog-1.4.2 tests/aws/models/storage/version_tests.rb
fog-1.4.0 tests/aws/models/storage/version_tests.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/tests/aws/models/storage/version_tests.rb
michiels-fog-1.3.1 tests/aws/models/storage/version_tests.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/tests/aws/models/storage/version_tests.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/tests/aws/models/storage/version_tests.rb
fog-1.3.1 tests/aws/models/storage/version_tests.rb
fog-1.3.0 tests/aws/models/storage/version_tests.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/tests/aws/models/storage/version_tests.rb
fog-1.2.0 tests/aws/models/storage/version_tests.rb
ktheory-fog-1.1.2 tests/aws/models/storage/version_tests.rb