Sha256: 1959ce98ac3975b7cb9f5cf2c988fa6aa06c8ffaff260583fb4d0d50c707125b

Contents?: true

Size: 1.39 KB

Versions: 55

Compression:

Stored size: 1.39 KB

Contents

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

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

  directory_attributes = {
      :key => uniq_id('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.service.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

55 entries across 55 versions & 3 rubygems

Version Path
fog-1.22.0 tests/aws/models/storage/version_tests.rb
fog-1.21.0 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/aws/models/storage/version_tests.rb
fog-1.20.0 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/aws/models/storage/version_tests.rb
fog-1.19.0 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/aws/models/storage/version_tests.rb