local RESTY_FLAGS = os.getenv("BUSTED_RESTY_FLAGS") or "-e 'setmetatable(_G, nil)'"
local json = require("cjson")
print(json.encode(arg))
-- rebuild the invoked commandline, while inserting extra resty-flags
local cmd = {
"exec",
arg[-1],
"--shdict='tapis_inner_cache 10m'",
"--shdict='app_cache 10m'",
"--shdict='local_cache_ipc 10m'",
RESTY_FLAGS,
}
for i, param in ipairs(arg) do
table.insert(cmd, "'" .. param .. "'")
end
local _, _, rc = os.execute(table.concat(cmd, " "))
os.exit(rc)
Then i run busted like this: busted '--filter' 'get_subscribe_anchors get success'
I need to use resty to run busted, so i use the lua options in .busted configure file like this.
the spec/resty_runner file content is:
Then i run busted like this:
busted '--filter' 'get_subscribe_anchors get success'
The arg on spec/resty_runner print
The --filter option value become:
"4":"get_subscribe_anchors","5":"get","6":"success"
But the true one is
'get_subscribe_anchors get success'
So, how to get the true option value with space in my spec/resty_runner?