Sha256: 6327838327be8d7c145265539a75ea20e5867ad5b94d8d9b27d2dc6cec82f073

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

Contents

require "integration/test_helper"

describe "Copy Blobs" do
  before do
    @container = Azure::Blobs.create_container(ContainerNameHelper.name)
    @container_2 = Azure::Blobs.create_container(ContainerNameHelper.name)

    @page_blob = Azure::Blobs.create_page_blob(@container, "myBlob", 2048)
    @block_blob = Azure::Blobs.create_block_blob(@container, "myBlob2", Fixtures["32px-fulls-black.jpg"].to_path)
  end

  after do
    ContainerNameHelper.clean
  end

  it "should be able to copy a page blob" do
    result = Azure::Blobs.copy(@page_blob, @container_2, "myPageBlob", {"origin" => "copied"})
    result.must_be :kind_of?, Azure::Blobs::PageBlob
    result.metadata["origin"].must_equal "copied"
  end

  it "should be able to copy a block blob" do
    result = Azure::Blobs.copy(@block_blob, @container_2, "myBlockBlob", {"origin" => "copied"})
    result.must_be :kind_of?, Azure::Blobs::BlockBlob
    result.metadata["origin"].must_equal "copied"
  end

  it "should be able to copy a blob snapshot" do
    result = Azure::Blobs.copy(@block_blob.create_snapshot, @container_2, "myCopiedSnapshot", {"origin" => "copied"})
    result.must_be :kind_of?, Azure::Blobs::Blob
    result.metadata["origin"].must_equal "copied"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
azure-0.1.1 test/integration/blobs/copy_test.rb
azure-0.1.0 test/integration/blobs/copy_test.rb