test/models/compute/test_servers.rb in fog-azure-rm-0.1.2 vs test/models/compute/test_servers.rb in fog-azure-rm-0.2.0

- old
+ new

@@ -10,11 +10,12 @@ end def test_collection_methods methods = [ :all, - :get + :get, + :check_vm_exists ] methods.each do |method| assert_respond_to @servers, method end end @@ -35,8 +36,20 @@ end def test_get_method_response @service.stub :get_virtual_machine, @response do assert_instance_of Fog::Compute::AzureRM::Server, @servers.get('fog-test-rg', 'fog-test-server') + end + end + + def test_check_vm_exists_true_case + @service.stub :check_vm_exists, true do + assert @servers.check_vm_exists('fog-test-rg', 'fog-test-server') + end + end + + def test_check_vm_exists_false_case + @service.stub :check_vm_exists, false do + assert !@servers.check_vm_exists('fog-test-rg', 'fog-test-server') end end end