diff options
author | David de Boer <david@ddeboer.nl> | 2016-09-14 16:32:16 +0200 |
---|---|---|
committer | David de Boer <david@ddeboer.nl> | 2016-09-15 08:57:24 +0200 |
commit | 2b6fa7a25e0acdee4ce2a452152b688f2df27dea (patch) | |
tree | db33b567acc87a099469ec000b1c6257116679d2 /test | |
parent | 0e2b1a11b23658f06fb88076234eaad31605ff4c (diff) |
Ignore mv warnings
In some cases, mv will throw a warning, while still moving the files
correctly and returning a 0 return code:
"mv: can't preserve ownership of ... Permission denied".
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_file_utils_SUITE.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/rebar_file_utils_SUITE.erl b/test/rebar_file_utils_SUITE.erl index a44a06d..7285e13 100644 --- a/test/rebar_file_utils_SUITE.erl +++ b/test/rebar_file_utils_SUITE.erl @@ -14,7 +14,8 @@ path_from_ancestor/1, canonical_path/1, resolve_link/1, - split_dirname/1]). + split_dirname/1, + mv_warning_is_ignored/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -27,7 +28,8 @@ all() -> path_from_ancestor, canonical_path, resolve_link, - split_dirname]. + split_dirname, + mv_warning_is_ignored]. groups() -> [{tmpdir, [], [raw_tmpdir, empty_tmpdir, simple_tmpdir, multi_tmpdir]}, @@ -135,3 +137,9 @@ split_dirname(_Config) -> ?assertEqual({".", "foo"}, rebar_file_utils:split_dirname("foo")), ?assertEqual({"/foo", "bar"}, rebar_file_utils:split_dirname("/foo/bar")), ?assertEqual({"foo", "bar"}, rebar_file_utils:split_dirname("foo/bar")). + +mv_warning_is_ignored(_Config) -> + meck:new(rebar_utils, [passthrough]), + meck:expect(rebar_utils, sh, fun("mv ding dong", _) -> {ok, "Warning"} end), + ok = rebar_file_utils:mv("ding", "dong"), + meck:unload(rebar_utils). |