Sha256: 7baac54ffcabc46a3fc08cc5b2e31116f6773eebdc644f521206789d8a22cb53
Contents?: true
Size: 1.13 KB
Versions: 29
Compression:
Stored size: 1.13 KB
Contents
require File.expand_path '../../test_helper', __dir__ # Storage Blob Class class TestCreatePageBlob < Minitest::Test # This class posesses the test cases for the requests of creating storage page blobs. def setup Fog.mock! @mock_service = Fog::Storage::AzureRM.new(storage_account_credentials) Fog.unmock! @mocked_response = mocked_storage_http_error @service = Fog::Storage::AzureRM.new(storage_account_credentials) @blob_client = @service.instance_variable_get(:@blob_client) end def test_create_page_blob_success @blob_client.stub :create_page_blob, true do assert @service.create_page_blob('test_container', 'test_blob', 1_024) end end def test_create_page_blob_http_exception http_exception = ->(*) { raise Azure::Core::Http::HTTPError.new(@mocked_response) } @blob_client.stub :create_page_blob, http_exception do assert_raises(Azure::Core::Http::HTTPError) do @service.create_page_blob('test_container', 'test_blob', 1_024) end end end def test_create_page_blob_mock assert @mock_service.create_page_blob('test_container', 'test_blob', 1_024) end end
Version data entries
29 entries across 29 versions & 3 rubygems