The method to test allows adding a path
to additional files the user adds which contain data.
For example, the user might store a file called data.txt
in the /workspace/data
directory. And we want to add the path to this directory to an already existing array called DATA_PATH
.
Method:
def add_custom_path(path)
DATA_PATH.unshift(path)
end
Where path
is a location in a Rails app where the user stores a file.
The gem uses test-unit
.
Question:
Is there a way to temparily generate a file in some directory, run an assert_not_empty
test, and then have the file disappear?
I don't have experience writing tests for gems so any guidance would be very appreciated.