Sha256: db2b7e5a276d0a015b9dc31be28cbfbba7355693f82a90b0a0eb6ba207f0f130
Contents?: true
Size: 1.33 KB
Versions: 1
Compression:
Stored size: 1.33 KB
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for Resources Collection class TestResources < Minitest::Test def setup @service = Fog::Resources::AzureRM.new(credentials) @resources = Fog::Resources::AzureRM::AzureResources.new(service: @service, tag_name: 'tag_name', tag_value: 'tag_value') @response = ApiStub::Models::Resources::Resource.list_resources_response end def test_collection_methods methods = [ :all, :get ] methods.each do |method| assert @resources.respond_to? method, true end end def test_all_method_response @service.stub :list_tagged_resources, @response do assert_instance_of Fog::Resources::AzureRM::AzureResources, @resources.all assert @resources.all.size >= 1 @resources.all.each do |r| assert_instance_of Fog::Resources::AzureRM::AzureResource, r end end end def test_get_method_response @service.stub :list_tagged_resources, @response do resource_id = '/subscriptions/########-####-####-####-############/resourceGroups/{RESOURCE-GROUP}/providers/Microsoft.Network/{PROVIDER-NAME}/{RESOURCE-NAME}' assert_instance_of Fog::Resources::AzureRM::AzureResource, @resources.get(resource_id) assert @resources.get('wrong-resource-id').nil? end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fog-azure-rm-0.0.4 | test/models/resources/test_resources.rb |