This is the clos-fixtures Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:42:26 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
clos-fixtures
ASDF-loadable fixtures for CLOS classes
Fernando Borretti
MIT
# clos-fixtures
[![Build Status](https://travis-ci.org/eudoxia0/clos-fixtures.svg?branch=master)](https://travis-ci.org/eudoxia0/clos-fixtures)
ASDF-loadable fixtures for CLOS classes.
# Usage
## Fixture Syntax
“‘lisp
(package:class-name
(:slot-name1 value
:slot-name2 value)
(:slot-name1 value
:slot-name2 value))
(package:another-class
...)
“‘
## Example
“‘lisp
(app:user
(:name "eudoxia"
:groups (:admin :staff))
(:name "joe"
:groups (:admin)))
(app:company
(:name "Initech"
:city "Denver"))
“‘
## ‘register-fixture‘
This method has to be defined for every class you want to load.
An example using the ‘user‘ model from the last example:
“‘lisp
(defmethod clos-fixtures:register-fixture ((user myapp:user))
(cl-mongo:db.insert "users" (cl-mongo:kv (name user) (groups user))))
“‘
## Loading from Lisp
“‘lisp
(clos-fixtures:load-fixtures
#P"/path/to/fixture-file")
“‘
## Loading from ASDF
Simply put this in your components tree (Check ‘clos-fixtures-test.asd‘ for an example):
“‘lisp
(:fixture "filename")
“‘
Optionally, you can use the ‘:package‘ argument so you don’t have to specify the
package in the fixture itself. An example from the tests:
“‘lisp
(:fixture "molecules" :package :clos-fixtures-test)
“‘
“‘lisp
(molecule
(:name "Methane"
:formula "CH4")
(:name "Cubane"
:formula "C8H8"))
“‘
# License
Copyright (c) 2014-2015 Fernando Borretti (eudoxiahp@gmail.com)
Licensed under the MIT License.
0.1
src
(module).
Modules are listed depth-first from the system components tree.
clos-fixtures/src
clos-fixtures
(system).
clos-fixtures.lisp
(file).
asdf.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
clos-fixtures/src/clos-fixtures.lisp
src
(module).
load-fixtures
(function).
register-fixture
(generic function).
read-fixtures
(function).
clos-fixtures/src/asdf.lisp
src
(module).
output-files
(method).
perform
(method).
perform
(method).
fixture
(class).
fixture-package-name
(reader method).
Packages are listed by definition order.
clos-fixtures
asdf/interface
.
common-lisp
.
load-fixtures
(function).
register-fixture
(generic function).
fixture
(class).
fixture-package-name
(generic reader).
read-fixtures
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Register a fixture.
Jump to: | F G L M O P R |
---|
Jump to: | F G L M O P R |
---|
Jump to: | P S T |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
P | |||
package-name : | Private classes | ||
| |||
S | |||
Slot, package-name : | Private classes | ||
Slot, type : | Private classes | ||
| |||
T | |||
type : | Private classes | ||
|
Jump to: | P S T |
---|
Jump to: | A C F M P S |
---|
Jump to: | A C F M P S |
---|