Packages

Erlang wrapper for Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.

Current section

9 Versions

Jump to

Compare versions

8 files changed
+60 additions
-11 deletions
  @@ -1,7 +1,9 @@
1 1 pact-erlang
2 2 =====
3 3
4 - An erlang library for contract testing using pact ffi and generating consumer pacts
4 + An erlang library for contract testing using pact ffi and generating consumer pacts.
5 +
6 + This library should be considered alpha quality. It is not yet feature complete and the API is subject to change.
5 7
6 8 Docs: https://hexdocs.pm/pact_erlang/readme.html
  @@ -323,6 +323,24 @@ static ERL_NIF_TERM erl_pactffi_mock_server_matched(ErlNifEnv *env, int argc, co
323 323 }
324 324 }
325 325
326 + static ERL_NIF_TERM erl_pactffi_mock_server_mismatches(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
327 + {
328 + if (!enif_is_number(env, argv[0]))
329 + {
330 + return enif_make_badarg(env);
331 + }
332 + int mock_server_port = convert_erl_int_to_c_int(env, argv[0]);
333 + char *mismatches = pactffi_mock_server_mismatches(mock_server_port);
334 + if (mismatches != NULL)
335 + {
336 + return enif_make_string(env, mismatches, ERL_NIF_LATIN1);
337 + }
338 + else
339 + {
340 + return enif_make_atom(env, "undefined");
341 + }
342 + }
343 +
326 344 static ERL_NIF_TERM erl_pactffi_pact_handle_write_file(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
327 345 {
328 346 if (!enif_is_number(env, argv[0]))
  @@ -443,6 +461,7 @@ static ErlNifFunc nif_funcs[] =
443 461 {"erl_pactffi_response_status", 2, erl_pactffi_response_status},
444 462 {"erl_pactffi_create_mock_server_for_transport", 4, erl_pactffi_create_mock_server_for_transport},
445 463 {"erl_pactffi_mock_server_matched", 1, erl_pactffi_mock_server_matched},
464 + {"erl_pactffi_mock_server_mismatches", 1, erl_pactffi_mock_server_mismatches},
446 465 {"erl_pactffi_log_to_file", 2, erl_pactffi_log_to_file},
447 466 {"erl_pactffi_pact_handle_write_file", 3, erl_pactffi_pact_handle_write_file},
448 467 {"erl_pactffi_cleanup_mock_server", 1, erl_pactffi_cleanup_mock_server},
  @@ -5,11 +5,16 @@
5 5 {<<"files">>,
6 6 [<<"LICENSE">>,<<"Makefile">>,<<"README.md">>,<<"c_src">>,
7 7 <<"c_src/Makefile">>,<<"c_src/include">>,<<"c_src/include/pact.h">>,
8 - <<"c_src/pact_ffi_nif.c">>,<<"rebar.config">>,<<"src">>,<<"src/pact.erl">>,
9 - <<"src/pact_erlang.app.src">>,<<"src/pact_ffi_nif.erl">>]}.
8 + <<"c_src/pact_ffi_nif.c">>,<<"rebar.config">>,<<"rebar.lock">>,<<"src">>,
9 + <<"src/pact.erl">>,<<"src/pact_erlang.app.src">>,
10 + <<"src/pact_ffi_nif.erl">>]}.
10 11 {<<"licenses">>,[<<"Apache-2.0">>]}.
11 12 {<<"links">>,
12 13 [{<<"GitHub">>,<<"https://github.com/greyorange-labs/pact-erlang">>}]}.
13 14 {<<"name">>,<<"pact_erlang">>}.
14 - {<<"requirements">>,[]}.
15 - {<<"version">>,<<"0.1.1">>}.
15 + {<<"requirements">>,
16 + [{<<"thoas">>,
17 + [{<<"app">>,<<"thoas">>},
18 + {<<"optional">>,false},
19 + {<<"requirement">>,<<"~>1.0.0">>}]}]}.
20 + {<<"version">>,<<"0.1.2">>}.
  @@ -1,6 +1,6 @@
1 1 {project_plugins, [rebar3_hex, rebar3_ex_doc]}.
2 2 {erl_opts, [debug_info]}.
3 - {deps, []}.
3 + {deps, [thoas]}.
4 4
5 5 {pre_hooks, [
6 6 {"(linux|darwin|solaris)", compile, "make --no-print-directory -C c_src"},
  @@ -0,0 +1,8 @@
1 + {"1.2.0",
2 + [{<<"thoas">>,{pkg,<<"thoas">>,<<"1.0.0">>},0}]}.
3 + [
4 + {pkg_hash,[
5 + {<<"thoas">>, <<"567C03902920827A18A89F05B79A37B5BF93553154B883E0131801600CF02CE0">>}]},
6 + {pkg_hash_ext,[
7 + {<<"thoas">>, <<"FC763185B932ECB32A554FB735EE03C3B6B1B31366077A2427D2A97F3BD26735">>}]}
8 + ].
Loading more files…