diff options
author | Loïc Hoguin <[email protected]> | 2016-06-06 15:42:35 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-06-06 15:42:35 +0200 |
commit | 7d3fb4715baa59229e0fad501d17606a361835a7 (patch) | |
tree | 95cb6a6e36ddab115abcfd03507451a0a42c2a86 | |
parent | 33121afc5f76547c3ebb74737b152d20ac9459bd (diff) | |
download | ct_helper-7d3fb4715baa59229e0fad501d17606a361835a7.tar.gz ct_helper-7d3fb4715baa59229e0fad501d17606a361835a7.tar.bz2 ct_helper-7d3fb4715baa59229e0fad501d17606a361835a7.zip |
Add more file types to the static dir functions
-rw-r--r-- | src/ct_helper.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ct_helper.erl b/src/ct_helper.erl index 33dfccd..460f48f 100644 --- a/src/ct_helper.erl +++ b/src/ct_helper.erl @@ -55,9 +55,11 @@ config(Key, Config) -> %% @doc Create a directory with various useful files for testing. create_static_dir(Path) -> - ok = file:make_dir(Path), + ok = filelib:ensure_dir(Path ++ "/file"), ok = file:make_dir(Path ++ "/directory"), ok = file:write_file(Path ++ "/unknown", "File with no extension.\n"), + ok = file:write_file(Path ++ "/file.cowboy", "File with custom extension.\n"), + ok = file:write_file(Path ++ "/plain.txt", "Timeless space.\n"), ok = file:write_file(Path ++ "/style.css", "body{color:red}\n"), ok = file:write_file(Path ++ "/index.html", "<html><body>Hello!</body></html>\n"), @@ -71,6 +73,8 @@ delete_static_dir(Path) -> ok = file:delete(Path ++ "/unreadable"), ok = file:delete(Path ++ "/index.html"), ok = file:delete(Path ++ "/style.css"), + ok = file:delete(Path ++ "/plain.txt"), + ok = file:delete(Path ++ "/file.cowboy"), ok = file:delete(Path ++ "/unknown"), ok = file:del_dir(Path ++ "/directory"), ok = file:del_dir(Path), |