Sha256: a812bf69ae9f9216ca45d89397ffcb19e363679947e24b6c498fa6bdc3152da4

Contents?: true

Size: 1.38 KB

Versions: 20

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

20 entries across 20 versions & 9 rubygems

Version Path
hpfog-0.0.20 tests/aws/models/storage/version_tests.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/tests/aws/models/storage/version_tests.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/tests/aws/models/storage/version_tests.rb
fog-nirvanix-1.8.2 tests/aws/models/storage/version_tests.rb
fog-nirvanix-1.8.1 tests/aws/models/storage/version_tests.rb
fog-1.10.1 tests/aws/models/storage/version_tests.rb
fog-parser-fix-1.6.1 tests/aws/models/storage/version_tests.rb
fog-test-again-1.6.0 tests/aws/models/storage/version_tests.rb
fog-test-me-1.10.0 tests/aws/models/storage/version_tests.rb
fog-parser-fix-1.6.0 tests/aws/models/storage/version_tests.rb
fog-1.10.0 tests/aws/models/storage/version_tests.rb
fog-1.9.0 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.8.0.20130114204828 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.8.0.20130111070250 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.8.0.20130109172219 tests/aws/models/storage/version_tests.rb
fog-sgonyea-1.8.1 tests/aws/models/storage/version_tests.rb
fog-1.8.0 tests/aws/models/storage/version_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/aws/models/storage/version_tests.rb
fog-1.7.0 tests/aws/models/storage/version_tests.rb
fog-1.6.0 tests/aws/models/storage/version_tests.rb