test/models/network/test_network_interfaces.rb in fog-azure-rm-0.0.4 vs test/models/network/test_network_interfaces.rb in fog-azure-rm-0.0.5
- old
+ new
@@ -3,10 +3,11 @@
# Test class for NetworkInterface Collection
class TestNetworkInterfaces < Minitest::Test
def setup
@service = Fog::Network::AzureRM.new(credentials)
@network_interfaces = Fog::Network::AzureRM::NetworkInterfaces.new(resource_group: 'fog-test-rg', service: @service)
+ @network_client = @service.instance_variable_get(:@network_client)
end
def test_collection_methods
methods = [
:all,
@@ -20,21 +21,21 @@
def test_collection_attributes
assert @network_interfaces.respond_to? :resource_group
end
def test_all_method_response
- response = [ApiStub::Models::Network::NetworkInterface.create_network_interface_response]
+ response = [ApiStub::Models::Network::NetworkInterface.create_network_interface_response(@network_client)]
@service.stub :list_network_interfaces, response do
assert_instance_of Fog::Network::AzureRM::NetworkInterfaces, @network_interfaces.all
assert @network_interfaces.all.size >= 1
@network_interfaces.all.each do |nic|
assert_instance_of Fog::Network::AzureRM::NetworkInterface, nic
end
end
end
def test_get_method_response
- response = ApiStub::Models::Network::NetworkInterface.create_network_interface_response
+ response = ApiStub::Models::Network::NetworkInterface.create_network_interface_response(@network_client)
@service.stub :get_network_interface, response do
assert_instance_of Fog::Network::AzureRM::NetworkInterface, @network_interfaces.get('fog-test-rg', 'fog-test-network-interface')
end
end
end