Sha256: cc72f2b3418482a4f4f913e64aba062a5850df6fb31eac0911aa70f0c42f5deb
Contents?: true
Size: 1.55 KB
Versions: 1
Compression:
Stored size: 1.55 KB
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for Servers Collection class TestServers < Minitest::Test def setup @service = Fog::Compute::AzureRM.new(credentials) @servers = Fog::Compute::AzureRM::Servers.new(resource_group: 'fog-test-rg', service: @service) @response = [ApiStub::Models::Compute::Server.create_windows_virtual_machine_response] end def test_collection_methods methods = [ :all, :get, :get_from_remote ] methods.each do |method| assert @servers.respond_to? method, true end end def test_collection_attributes assert @servers.respond_to? :resource_group, true end def test_all_method_response @service.stub :list_virtual_machines, @response do assert_instance_of Fog::Compute::AzureRM::Servers, @servers.all assert @servers.all.size >= 1 @servers.all.each do |s| assert_instance_of Fog::Compute::AzureRM::Server, s end end end def test_get_method_response @service.stub :list_virtual_machines, @response do assert_instance_of Fog::Compute::AzureRM::Server, @servers.get('fog-test-server') assert @servers.get('wrong-name').nil?, true end end def test_get_from_remote_method_response response = ApiStub::Models::Compute::Server.create_windows_virtual_machine_response @service.stub :get_virtual_machine, response do assert_instance_of Fog::Compute::AzureRM::Server, @servers.get_from_remote('fog-test-rg', 'fog-test-server') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fog-azure-rm-0.0.4 | test/models/compute/test_servers.rb |