Temporary file creation for unittests
Atila Neves
atila.neves at gmail.com
Mon May 21 20:50:01 UTC 2018
On Monday, 21 May 2018 at 15:20:14 UTC, Dr.No wrote:
> 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...
There's a whole lot of them here:
https://github.com/atilaneves/unit-threaded/blob/master/source/unit_threaded/should.d
More information about the Digitalmars-d-learn
mailing list