code.test.base.runtime

all-facts

added in 3.0

(all-facts)(all-facts ns)

retrieves a list of all the facts in a namespace

(keys (all-facts))

eval-in-ns

added in 4.0

(eval-in-ns ns form)

evaluates a form in the provided namespace

exec-slim

added in 3.0

(exec-slim fpkg)

executes the fact slim (only the body

exec-thunk

added in 3.0

(exec-thunk fpkg)

executes the fact thunk (only the check

fact-id

added in 3.0

(fact-id {:keys [id refer]})

returns an id from fact data

(fact-id {:refer ’code.test.base.runtime/fact-id}) => ’test-code_test_base_runtime__fact_id

find-fact

added in 3.0

(find-fact meta)(find-fact ns {:keys [line source]})

the fact that is associated with a given line

(:id (find-fact {:line (h/code-line)})) => ’test-code_test_base_runtime__find_fact

get-fact

added in 3.0

(get-fact id)(get-fact ns id)(get-fact ns id k & more)

gets a fact

(get-fact (fsym) :refer) => ’code.test.base.runtime/purge-all

get-flag

added in 3.0

(get-flag id flag)(get-flag ns id flag)

checks if the setup flag has been set

(get-flag (fsym) :setup)

get-global

added in 3.0

(get-global)(get-global ns)(get-global ns k & more)

gets the global settings for namespace

(get-global)

list-facts

added in 3.0

(list-facts)(list-facts ns)

lists all facts in current namespace

(first (list-facts)) => ’test-code_test_base_runtime__purge_all

no-dots

added in 3.0

(no-dots s)

removes dots and slash from the string

parse-args

added in 3.0

(parse-args ns id arg more)

helper function for variable args

purge-all

added in 3.0

(purge-all)(purge-all ns)

purges all facts from namespace

purge-facts

added in 3.0

(purge-facts)(purge-facts ns)

purges all facts in the namespace (for reload)

(purge-facts) (list-facts) => []

remove-fact

added in 3.0

(remove-fact id)(remove-fact ns id)

removes a fact from namespace

run-op

added in 3.0

(run-op {:keys [line source], :as meta} op & args)

common runtime functions for easy access

(run-op {:line (h/code-line)} :self)

set-fact

added in 3.0

(set-fact id data)(set-fact ns id data)

sets the entire data on a fact

set-flag

added in 3.0

(set-flag id flag val)(set-flag ns id flag val)

sets the setup flag

(set-flag (fsym) :setup true)

set-global

added in 3.0

(set-global m)(set-global ns m)

sets the global settings for namespace

(set-global {:check {:setup ’(prn “hello”)}}) => ’{:check {:setup (prn “hello”)}}

set-in-fact

added in 3.0

(set-in-fact id ks data)(set-in-fact ns id ks data)

sets the property on a fact

(set-in-fact (fsym) :function :other(fn []))

setup-fact

added in 3.0

(setup-fact id)(setup-fact ns id)

runs the setup hook

(setup-fact (:id (find-fact {:line (h/code-line)}))) => 6

teardown-fact

added in 3.0

(teardown-fact id)(teardown-fact ns id)

runs the teardown hook

(teardown-fact (:id (find-fact {:line (h/code-line)}))) => 6

update-fact

added in 3.0

(update-fact ns id f & args)

updates a fact given a function

update-global

added in 3.0

(update-global f)(update-global ns f & args)

updates global data