summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2011-01-29 17:37:15 +0100
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-01-29 17:37:15 +0100
commitb18194e24d9b764bcd912ac87c2132a6c3866a21 (patch)
treeb0135e904db05a3a35c150c912fe8d96f0593972
parent0e729bf90e64a00bd8915e227d83f82877038e9e (diff)
Fix file existence checks
-rw-r--r--inttest/tdeps1/tdeps1_rt.erl2
-rw-r--r--test/rebar_eunit_tests.erl6
-rw-r--r--test/rebar_file_utils_tests.erl14
3 files changed, 11 insertions, 11 deletions
diff --git a/inttest/tdeps1/tdeps1_rt.erl b/inttest/tdeps1/tdeps1_rt.erl
index 5eb831d..690e273 100644
--- a/inttest/tdeps1/tdeps1_rt.erl
+++ b/inttest/tdeps1/tdeps1_rt.erl
@@ -33,7 +33,7 @@ run(Dir) ->
{ok, _} = retest_sh:run("./rebar get-deps compile", []),
- true = filelib:is_file("ebin/a.beam"),
+ true = filelib:is_regular("ebin/a.beam"),
ok.
diff --git a/test/rebar_eunit_tests.erl b/test/rebar_eunit_tests.erl
index 4179c9b..acd21f2 100644
--- a/test/rebar_eunit_tests.erl
+++ b/test/rebar_eunit_tests.erl
@@ -119,7 +119,7 @@ environment_test_() ->
?_assert(filelib:is_dir(?TMP_DIR))},
{"Ensure the rebar script can be found, copied, and run",
- [?_assert(filelib:is_file(?REBAR_SCRIPT)),
+ [?_assert(filelib:is_regular(?REBAR_SCRIPT)),
fun assert_rebar_runs/0]}]}.
assert_rebar_runs() ->
@@ -236,12 +236,12 @@ assert_dirs_in(Name, [Dir|T]) ->
assert_dirs_in(_, []) -> [].
assert_files_in(Name, [File|T]) ->
- [{Name ++ " has file: " ++ File, ?_assert(filelib:is_file(File))} |
+ [{Name ++ " has file: " ++ File, ?_assert(filelib:is_regular(File))} |
assert_files_in(Name, T)];
assert_files_in(_, []) -> [].
assert_files_not_in(Name, [File|T]) ->
- [{Name ++ " does not have file: " ++ File, ?_assertNot(filelib:is_file(File))} |
+ [{Name ++ " does not have file: " ++ File, ?_assertNot(filelib:is_regular(File))} |
assert_files_not_in(Name, T)];
assert_files_not_in(_, []) -> [].
diff --git a/test/rebar_file_utils_tests.erl b/test/rebar_file_utils_tests.erl
index fd9a141..832cc64 100644
--- a/test/rebar_file_utils_tests.erl
+++ b/test/rebar_file_utils_tests.erl
@@ -96,7 +96,7 @@ cp_r_file_to_file_test_() ->
filename:join([?TMP_DIR,"dest","new_file"]))
end,
fun teardown/1,
- [?_assert(filelib:is_file(filename:join([?TMP_DIR,"dest","new_file"])))]}.
+ [?_assert(filelib:is_regular(filename:join([?TMP_DIR,"dest","new_file"])))]}.
cp_r_file_to_dir_test_() ->
{"cp_r copies a file to directory",
@@ -107,7 +107,7 @@ cp_r_file_to_dir_test_() ->
filename:join([?TMP_DIR,"dest"]))
end,
fun teardown/1,
- [?_assert(filelib:is_file(filename:join([?TMP_DIR,"dest","file1"])))]}.
+ [?_assert(filelib:is_regular(filename:join([?TMP_DIR,"dest","file1"])))]}.
cp_r_dir_to_dir_test_() ->
{"cp_r copies a directory to directory",
@@ -132,7 +132,7 @@ cp_r_wildcard_file_to_dir_test_() ->
filename:join([?TMP_DIR,"dest"]))
end,
fun teardown/1,
- [?_assert(filelib:is_file(filename:join([?TMP_DIR,"dest","file1"])))]}.
+ [?_assert(filelib:is_regular(filename:join([?TMP_DIR,"dest","file1"])))]}.
cp_r_wildcard_dir_to_dir_test_() ->
{"cp_r copies wildcard directory to directory",
@@ -224,8 +224,8 @@ mv_file_test_() ->
filename:join([?TMP_DIR,"dest"]))
end,
fun teardown/1,
- [?_assert(filelib:is_file(filename:join([?TMP_DIR,"dest","file1"]))),
- ?_assertNot(filelib:is_file(filename:join([?TMP_DIR,"source","file1"])))]}.
+ [?_assert(filelib:is_regular(filename:join([?TMP_DIR,"dest","file1"]))),
+ ?_assertNot(filelib:is_regular(filename:join([?TMP_DIR,"source","file1"])))]}.
%% ====================================================================
%% Utilities
@@ -266,12 +266,12 @@ teardown(_) ->
%% ====================================================================
assert_files_in(Name, [File|T]) ->
- [{Name ++ " has file: " ++ File, ?_assert(filelib:is_file(File))} |
+ [{Name ++ " has file: " ++ File, ?_assert(filelib:is_regular(File))} |
assert_files_in(Name, T)];
assert_files_in(_, []) -> [].
assert_files_not_in(Name, [File|T]) ->
[{Name ++ " does not have file: " ++ File,
- ?_assertNot(filelib:is_file(File))} |
+ ?_assertNot(filelib:is_regular(File))} |
assert_files_not_in(Name, T)];
assert_files_not_in(_, []) -> [].