Function pact_mock_server::write_pact_file
[−]
[src]
#[no_mangle]pub extern "C" fn write_pact_file(
mock_server_port: int32_t,
directory: *const c_char
) -> int32_t
External interface to trigger a mock server to write out its pact file. This function should be called if all the consumer tests have passed. The directory to write the file to is passed as the second parameter. If a NULL pointer is passed, the current working directory is used.
Returns 0 if the pact file was successfully written. Returns a positive code if the file can not be written, or there is no mock server running on that port or the function panics.
Errors
Errors are returned as positive values.
Error | Description |
---|---|
1 | A general panic was caught |
2 | The pact file was not able to be written |
3 | A mock server with the provided port was not found |