Skip to content
Discussion options

You must be logged in to vote

The answer is indeed the same as in this comment: I usually go with "call the function in child process; wait small amount of time, validate that it succeeded". I emphasized "in child process" because this test doesn't look like it does it. It is not necessary for this question, but it is strongly suggested to do for a robust testing.

So here it might be something like:

T["touch"] = function()
  local exists_before = child.lua([[
    -- Note, that these are not local, to persist across `child.lua` calls
    -- I'd do this in `pre_case` hook
    Path = require "fyler.lib.path"
    fs = require "fyler.lib.fs"

    -- Make sure that `FYLER_TESTING_DIR_DATA` is assigned *in child process*

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by echasnovski
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@echasnovski
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.test
2 participants