View Source Authoritex.TestCase (Authoritex v1.1.1)
Shared tests for Authoritex modules
Authoritex.TestCase
ensures that an authority module implements the
Authoritex
behvaiour and that all of its functions behave as expected.
To run the shared tests, use Authoritex.TestCase, opts
within your
test module, where opts
contains:
module
-- The module you're testingcode
-- The code returned by the module'scode/0
callbackdescription
-- The description returned by the module'sdescription/0
callbacktest_uris
-- A list of URIs that should be resolvable by the module, referencing the same resourcebad_uri
-- A URI that is in the correct format but does not point to a resourceexpected
-- A keyword list containing the attributes of the resource referenced by thetest_uris
.search_result_term
-- A term or search query that will include the resource referenced by thetest_uris
in its resultssearch_count_term
-- A term or search query that will produce at least two pages of resultsdefault_results
(optional) -- The default maximum number of results returned by a search (default:30
)specified_results
(optional) -- A non-default number of results that can be used for testingsearch/2
(default:50
)See this package's test suite for detailed examples.