Sha256: fbb4699d076fb2bcf83c73aa07f35eee9e386b6d466d5ae471cc00420925876d
Contents?: true
Size: 735 Bytes
Versions: 8
Compression:
Stored size: 735 Bytes
Contents
require File.expand_path('../../test_helper', __dir__) # Test class for Get Image Request class TestGetImage < Minitest::Test def setup @service = Fog::Compute::AzureRM.new(credentials) compute_client = @service.instance_variable_get(:@compute_mgmt_client) @image = compute_client.images end def test_get_image_success @image.stub :get, true do assert @service.get_image('fog-test-rg', 'TestImage') end end def test_get_image_failure response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @image.stub :get, response do assert_raises(RuntimeError) { @service.get_image('fog-test-rg', 'TestImage') } end end end
Version data entries
8 entries across 8 versions & 3 rubygems