lichtkind / Chart

a series of charting modules
https://metacpan.org/pod/Chart
5 stars 4 forks source link

Store test output to a temporary directory #2

Closed ppisar closed 2 years ago

ppisar commented 2 years ago

The tests wrote to ./samples directory. This prevent from runnig the tests from a read-only location:

$ perl t/bars.t
1..1
Error: File "samples/bars.png" could not be created!
 at t/bars.t line 47.

This patch fixes it by using an in-core File::Temp module to create a temporary directory. The module smart enough to locate a writable place and to clean up when exiting.

lichtkind commented 2 years ago

thanks i will merge it too bu can you please tell me if the files will be still there after running tests?

lichtkind commented 2 years ago

Thanks a lot

ppisar commented 2 years ago

No, the files are be removed when the test ends.