Temporary file creation for unittests

Dr.No jckj33 at gmail.com
Mon May 21 15:20:14 UTC 2018


On Monday, 21 May 2018 at 15:16:11 UTC, Atila Neves wrote:
> On Friday, 18 May 2018 at 15:16:52 UTC, Russel Winder wrote:
>> Hi,
>>
>> What's the current official position on how to create 
>> temporary files for use during a unittest. I found
>
> Not official, but...
>
>     import unit_threaded;
>
>     with(const Sandbox()) {
>         writeFile("myfile.txt", "contents");
>         shouldExist("myfile.txt");
>         shouldEqualContent("myfile.txt", "contents");
>         fileShouldContain("myfile.txt", "cont");
>     }
>
> Atila

I've never seen "should" being in used in function names before...


More information about the Digitalmars-d-learn mailing list