summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoberto Ostinelli <roberto@ostinelli.net>2012-08-19 14:23:06 -0700
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-08-20 12:58:31 +0200
commitfa6618f2b410c2b71877c1878dff3a0c8503000c (patch)
treece7102414e0a90be3ea9ddb5e52f84bde9be7649 /test
parent9dd8e7f2ee581842d0376fef4292613b4e8275be (diff)
downloadrebar-fa6618f2b410c2b71877c1878dff3a0c8503000c.tar.gz
Add experimental tests= filter without eunit suites
Diffstat (limited to 'test')
-rw-r--r--test/rebar_eunit_tests.erl20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/rebar_eunit_tests.erl b/test/rebar_eunit_tests.erl
index d70d4b7..bf2428b 100644
--- a/test/rebar_eunit_tests.erl
+++ b/test/rebar_eunit_tests.erl
@@ -138,7 +138,7 @@ eunit_with_suites_and_tests_test_() ->
{"Selected suite tests are run once",
?_assert(string:str(RebarOut, "All 3 tests passed") =/= 0)}]
end},
- {"Ensure EUnit runs specific test in _tests suites",
+ {"Ensure EUnit runs specific test in a _tests suite",
setup,
fun() ->
setup_project_with_multiple_modules(),
@@ -155,6 +155,24 @@ eunit_with_suites_and_tests_test_() ->
{"Selected suite tests is run once",
?_assert(string:str(RebarOut, "Test passed") =/= 0)}]
+ end},
+ {"Ensure EUnit runs a specific test without a specified suite",
+ setup,
+ fun() ->
+ setup_project_with_multiple_modules(),
+ rebar("-v eunit tests=myprivate")
+ end,
+ fun teardown/1,
+ fun(RebarOut) ->
+ [{"Only selected suite tests are found and run",
+ [?_assert(string:str(RebarOut,
+ "myapp_mymod:myprivate_test/0") =/= 0),
+ ?_assert(string:str(RebarOut,
+ "myapp_mymod2:myprivate2_test/0")
+ =/= 0)]},
+
+ {"Selected suite tests is run once",
+ ?_assert(string:str(RebarOut, "All 2 tests passed") =/= 0)}]
end}].
cover_test_() ->