diff --git a/erlang-meck-0001-Workaround-for-Rebar-2.x.patch b/erlang-meck-0001-Workaround-for-Rebar-2.x.patch new file mode 100644 index 0000000..267ce96 --- /dev/null +++ b/erlang-meck-0001-Workaround-for-Rebar-2.x.patch @@ -0,0 +1,51 @@ +From: Peter Lemenkov +Date: Tue, 4 Jul 2017 16:57:00 +0300 +Subject: [PATCH] Workaround for Rebar 2.x + +Signed-off-by: Peter Lemenkov + +diff --git a/test/meck_tests.erl b/test/meck_tests.erl +index 270186c..401c466 100644 +--- a/test/meck_tests.erl ++++ b/test/meck_tests.erl +@@ -1078,13 +1078,7 @@ cover_options_fail_({_OldPath, Src, Module}) -> + test_file(Module, Ext) -> + filename:join(test_dir(), atom_to_list(Module) ++ Ext). + +-test_dir() -> +- case code:which(?MODULE) of +- Filename when is_list(Filename) -> +- filename:dirname(Filename); +- Atom when is_atom(Atom) -> +- error({test_dir_not_found, ?MODULE, Atom}) +- end. ++test_dir() -> "../" ++ filename:dirname(?FILE). + + test_include() -> filename:join(test_dir(), "include"). + +@@ -1098,14 +1092,14 @@ run_mock_no_cover_file(Module) -> + %% @doc Verify that passthrough calls _don't_ appear in cover + %% analysis. + no_cover_passthrough_test() -> +- {ok, _} = cover:compile("test/meck_test_module.erl"), ++ {ok, _} = cover:compile(test_file(meck_test_module, ".erl")), + {ok, {meck_test_module, {0,3}}} = cover:analyze(meck_test_module, module), + passthrough_test([no_passthrough_cover]), + {ok, {meck_test_module, {0,3}}} = cover:analyze(meck_test_module, module). + + %% @doc Verify that passthrough calls appear in cover analysis. + cover_passthrough_test() -> +- {ok, _} = cover:compile("test/meck_test_module.erl"), ++ {ok, _} = cover:compile(test_file(meck_test_module, ".erl")), + ?assertEqual({ok, {meck_test_module, {0,3}}}, + cover:analyze(meck_test_module, module)), + passthrough_test([]), +@@ -1113,7 +1107,7 @@ cover_passthrough_test() -> + cover:analyze(meck_test_module, module)). + + cover_path_test() -> +- {ok, _} = cover:compile("test/meck_test_module.erl"), ++ {ok, _} = cover:compile(test_file(meck_test_module, ".erl")), + ?assertEqual({ok, {meck_test_module, {0,3}}}, + cover:analyze(meck_test_module, module)), + ok = meck:new(meck_test_module, [passthrough]), diff --git a/erlang-meck.spec b/erlang-meck.spec new file mode 100644 index 0000000..7f447ab --- /dev/null +++ b/erlang-meck.spec @@ -0,0 +1,38 @@ +%global realname meck +%global upstream eproxus +Name: erlang-meck +Version: 0.8.13 +Release: 1 +BuildArch: noarch +Summary: A mocking library for Erlang +License: ASL 2.0 +URL: https://github.com/eproxus/meck +Source0: https://github.com/eproxus/meck/archive/%{version}/meck-%{version}.tar.gz +Patch1: erlang-meck-0001-Workaround-for-Rebar-2.x.patch +BuildRequires: erlang-hamcrest +BuildRequires: erlang-rebar +%description +With meck you can easily mock modules in Erlang. Since meck is intended to be +used in testing, you can also perform some basic validations on the mocked +modules, such as making sure no function is called in a way it should not. + +%prep +%autosetup -p1 -n meck-%{version} + +%build +%{erlang_compile} + +%install +%{erlang_install} + +%check +%{erlang_test -C test.config} + +%files +%license LICENSE +%doc README.md NOTICE +%{erlang_appdir}/ + +%changelog +* Sat Aug 29 2020 yaokai - 0.8.13-1 +- package init diff --git a/erlang-meck.yaml b/erlang-meck.yaml new file mode 100644 index 0000000..0ffe7c0 --- /dev/null +++ b/erlang-meck.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: eproxus/meck +tag_prefix: "^" +seperator: "." diff --git a/meck-0.8.13.tar.gz b/meck-0.8.13.tar.gz new file mode 100644 index 0000000..d861ff3 Binary files /dev/null and b/meck-0.8.13.tar.gz differ