You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
542 B
Fish
30 lines
542 B
Fish
# NAME
|
|
# spec.eval - eval a test function
|
|
#
|
|
# SYNOPSIS
|
|
# spec.eval <function> [OPTIONS...]
|
|
#
|
|
# OPTIONS
|
|
# See spec.report
|
|
#
|
|
# AUTHORS
|
|
# Bruno Pinto <@pfbruno>
|
|
# Jorge Bucaran <@bucaran>
|
|
#/
|
|
import plugins/msg
|
|
|
|
function spec.eval
|
|
set -l result $status
|
|
set -l test $argv[1]
|
|
set -e argv[1]
|
|
|
|
if functions -q $test
|
|
# Run the test yielding control to the user defined spec.
|
|
set -l output (eval $test)
|
|
set result $status
|
|
# Display test results.
|
|
spec.view $test $result $argv -- $output
|
|
end
|
|
return $result
|
|
end
|