From 7d3fb4715baa59229e0fad501d17606a361835a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 6 Jun 2016 15:42:35 +0200 Subject: Add more file types to the static dir functions --- src/ct_helper.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ct_helper.erl') 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", "Hello!\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), -- cgit v1.2.3