diff options
Diffstat (limited to 'stdlib/source/specification/lux/world/environment.lux')
-rw-r--r-- | stdlib/source/specification/lux/world/environment.lux | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/stdlib/source/specification/lux/world/environment.lux b/stdlib/source/specification/lux/world/environment.lux new file mode 100644 index 000000000..2163fc2e1 --- /dev/null +++ b/stdlib/source/specification/lux/world/environment.lux @@ -0,0 +1,32 @@ +(.require + [library + [lux (.except) + ["_" test (.only Test)] + [abstract + [monad (.only do)]] + [control + ["[0]" try] + [concurrency + ["[0]" async (.only Async)]]] + [data + ["[0]" text] + [collection + ["[0]" dictionary] + ["[0]" list]]] + [math + ["[0]" random]]]] + [\\library + ["[0]" /]]) + +(def .public (spec subject) + (-> (/.Environment Async) Test) + (do random.monad + [exit random.int] + (in (do [! async.monad] + [environment (/.environment ! subject)] + (_.coverage' [/.Environment] + (and (not (dictionary.empty? environment)) + (list.every? (|>> text.empty? not) + (dictionary.keys environment)) + (not (text.empty? (at subject home))) + (not (text.empty? (at subject directory))))))))) |