summaryrefslogtreecommitdiff
path: root/test/rebar_namespace_SUITE.erl
diff options
context:
space:
mode:
authorTristan Sloughter <tristan.sloughter@gmail.com>2015-03-07 15:09:50 -0600
committerTristan Sloughter <tristan.sloughter@gmail.com>2015-03-07 15:09:50 -0600
commita18ddc4c97c474bbf0f75984b77fa9e1e5fa5583 (patch)
tree6d4b692cb04efc09b4f990cc64ac42c6cd83c630 /test/rebar_namespace_SUITE.erl
parentc6f069fe4793dc205c6db1411fe4163cf03af4c5 (diff)
parent8cfb4df3e055b4f1e323273faf9b5157994a583a (diff)
Merge pull request #242 from ferd/namespace-regression
Fix namespace regressions
Diffstat (limited to 'test/rebar_namespace_SUITE.erl')
-rw-r--r--test/rebar_namespace_SUITE.erl24
1 files changed, 22 insertions, 2 deletions
diff --git a/test/rebar_namespace_SUITE.erl b/test/rebar_namespace_SUITE.erl
index 40b7238..3a55573 100644
--- a/test/rebar_namespace_SUITE.erl
+++ b/test/rebar_namespace_SUITE.erl
@@ -5,7 +5,8 @@
all() -> [implicit_compile, default_compile, do_compile,
as_default_compile, as_do_compile,
- notfound, do_notfound, default_notfound, ns_notfound].
+ notfound, do_notfound, default_notfound, ns_notfound, ns_found,
+ as_ns_invalid].
init_per_testcase(Case, Config0) ->
Config = rebar_test_utils:init_rebar_state(Config0),
@@ -77,6 +78,22 @@ ns_notfound(Config) ->
[fakecommand, ns])}
).
+ns_found(Config) ->
+ Command = ["ns", "fake_provider"],
+ rebar_test_utils:run_and_check(
+ add_fake_ns_provider(Config), [], Command,
+ {ok, []}
+ ).
+
+as_ns_invalid(Config) ->
+ %% The as namespace is not valid
+ Command = ["as", "profile", "as", "task"],
+ rebar_test_utils:run_and_check(
+ add_fake_ns_provider(Config), [], Command,
+ {error, "Namespace 'as' is forbidden"}
+ ).
+
+
%%% Helpers %%%
add_fake_ns_provider(Config) ->
State = ?config(state, Config),
@@ -84,10 +101,13 @@ add_fake_ns_provider(Config) ->
State,
providers:create(
[{name, fake_provider},
- {module, fake_provider},
+ {module, ?MODULE},
{namespace, ns},
{deps, []},
{opts, []}]
)
),
[{state, State1} | Config].
+
+%% callback for the test suite.
+do(State) -> {ok, State}.