summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-28 11:07:38 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-28 22:13:31 -0500
commit7d33dbf6aab358751c1edb9a25174ae811b6a0d7 (patch)
tree2d09d7b39c99a2633553ea2d6cc19fd34ca488e3 /test
parent4ff95cee31cb7d06bd239e4d4ccbf8b59cdebdda (diff)
store plugin providers in app_info's state for deps
Diffstat (limited to 'test')
-rw-r--r--test/mock_pkg_resource.erl3
-rw-r--r--test/rebar_compile_SUITE.erl30
2 files changed, 15 insertions, 18 deletions
diff --git a/test/mock_pkg_resource.erl b/test/mock_pkg_resource.erl
index 9ed0962..5f1edb3 100644
--- a/test/mock_pkg_resource.erl
+++ b/test/mock_pkg_resource.erl
@@ -73,6 +73,7 @@ mock_vsn(_Opts) ->
%% into a `rebar.config' file to describe dependencies.
mock_download(Opts) ->
Deps = proplists:get_value(pkgdeps, Opts, []),
+ Config = proplists:get_value(config, Opts, []),
meck:expect(
?MOD, download,
fun (Dir, {pkg, AppBin, Vsn}, _) ->
@@ -83,7 +84,7 @@ mock_download(Opts) ->
Dir, App, binary_to_list(Vsn),
[kernel, stdlib] ++ [element(1,D) || D <- AppDeps]
),
- rebar_test_utils:create_config(Dir, [{deps, AppDeps}]),
+ rebar_test_utils:create_config(Dir, [{deps, AppDeps}]++Config),
TarApp = App++"-"++binary_to_list(Vsn)++".tar",
Tarball = filename:join([Dir, TarApp]),
Contents = filename:join([Dir, "contents.tar.gz"]),
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl
index c48b303..7025eef 100644
--- a/test/rebar_compile_SUITE.erl
+++ b/test/rebar_compile_SUITE.erl
@@ -410,17 +410,19 @@ compile_plugins(Config) ->
DepName = rebar_test_utils:create_random_name("dep1_"),
PluginName = rebar_test_utils:create_random_name("plugin1_"),
- mock_git_resource:mock([{config, [{plugins, [
- {list_to_atom(PluginName), Vsn}
- ]}]}]),
- mock_pkg_resource:mock([
- {pkgdeps, [{{iolist_to_binary(PluginName), iolist_to_binary(Vsn)}, []}]}
- ]),
+ Plugins = rebar_test_utils:expand_deps(git, [{PluginName, Vsn, []}]),
+ mock_git_resource:mock([{deps, rebar_test_utils:flat_deps(Plugins)}]),
+
+ mock_pkg_resource:mock([{pkgdeps, [{{list_to_binary(DepName), list_to_binary(Vsn)}, []}]},
+ {config, [{plugins, [
+ {list_to_atom(PluginName),
+ {git, "http://site.com/user/"++PluginName++".git",
+ {tag, Vsn}}}]}]}]),
RConfFile =
rebar_test_utils:create_config(AppDir,
[{deps, [
- {list_to_atom(DepName), {git, "http://site.com/user/"++DepName++".git", {tag, Vsn}}}
+ list_to_atom(DepName)
]}]),
{ok, RConf} = file:consult(RConfFile),
@@ -498,16 +500,10 @@ complex_plugins(Config) ->
DepName3 = rebar_test_utils:create_random_name("dep3_"),
PluginName = rebar_test_utils:create_random_name("plugin1_"),
- Plugin = {{PluginName, Vsn2}, [{list_to_atom(DepName2),
- {git, "http://site.com/user/"++DepName2++".git", {tag, Vsn}}}]},
- Dep2 = {{DepName2, Vsn},
- [{list_to_atom(DepName3),
- {git, "http://site.com/user/"++DepName3++".git", {tag, Vsn}}}]},
- mock_git_resource:mock([{deps, [Plugin,
- Dep2,
- {{iolist_to_binary(DepName), iolist_to_binary(Vsn)}, []},
- {{iolist_to_binary(DepName3), iolist_to_binary(Vsn)}, []}]}]),
-
+ Deps = rebar_test_utils:expand_deps(git, [{PluginName, Vsn2, [{DepName2, Vsn,
+ [{DepName3, Vsn, []}]}]}
+ ,{DepName, Vsn, []}]),
+ mock_git_resource:mock([{deps, rebar_test_utils:flat_deps(Deps)}]),
RConfFile =
rebar_test_utils:create_config(AppDir,