Skip to content

Instantly share code, notes, and snippets.

@MonkeyIsNull
Created May 19, 2015 15:04
Show Gist options
  • Save MonkeyIsNull/71b2d030cb66acaeed63 to your computer and use it in GitHub Desktop.
Save MonkeyIsNull/71b2d030cb66acaeed63 to your computer and use it in GitHub Desktop.
defmodule FileripperTest do
use ExUnit.Case, async: true
@test_files_path "fixtures/test"
setup do
File.mkdir_p(@test_files_path)
on_exit fn ->
IO.puts "End of test case"
File.rm_rf(@test_files_path)
end
:ok
end
test "creating some files" do
IO.puts "Test one"
File.mkdir_p(@test_files_path <> "/1")
File.touch(@test_files_path <> "/1/first")
File.touch(@test_files_path <> "/1/second")
assert File.exists?(@test_files_path <> "/1/second")
end
test "creating some more files" do
IO.puts "Test two"
File.mkdir_p(@test_files_path <> "/1")
File.touch(@test_files_path <> "/1/cats")
assert File.exists?(@test_files_path <> "/1/cats")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment