+# TODO: This test has a broken usage of ports. 
 defmodule PactElixir.RustPactMockServerFacadeTest do
   use ExUnit.Case
   alias PactElixir.RustPactMockServerFacade


      assert {:error, :io_error} =
               RustPactMockServerFacade.write_pact_file(port, "/not/existing/path")
    end
  end



  describe "mock_server_mismatches" do
    test "returns mismatches json when no requests were made" do
      port = 50824
      RustPactMockServerFacade.create_mock_server(@pact, port)

      assert {:ok, mismatches_json_string} = RustPactMockServerFacade.mock_server_mismatches(port)

      assert String.ends_with?(mismatches_json_string, "}]")
      RustPactMockServerFacade.cleanup_mock_server(port)
    end
  end

  describe "matched" do
    test "returns false if none of expected requests were made" do
      port = 50828
      RustPactMockServerFacade.create_mock_server(@pact, port)
      assert {:ok, false} = RustPactMockServerFacade.mock_server_matched(port)
      RustPactMockServerFacade.cleanup_mock_server(port)
    end
  end

