The clos-fixtures Reference Manual

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.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 clos-fixtures

ASDF-loadable fixtures for CLOS classes

Author

Fernando Borretti

Home Page

https://github.com/eudoxia0/clos-fixtures

License

MIT

Long Description

# 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.

Version

0.1

Source

clos-fixtures.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 clos-fixtures/src

Source

clos-fixtures.asd.

Parent Component

clos-fixtures (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 clos-fixtures/clos-fixtures.asd

Source

clos-fixtures.asd.

Parent Component

clos-fixtures (system).

ASDF Systems

clos-fixtures.


4.1.2 clos-fixtures/src/clos-fixtures.lisp

Source

clos-fixtures.asd.

Parent Component

src (module).

Packages

clos-fixtures.

Public Interface
Internals

read-fixtures (function).


4.1.3 clos-fixtures/src/asdf.lisp

Source

clos-fixtures.asd.

Parent Component

src (module).

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 clos-fixtures

Source

clos-fixtures.lisp.

Use List
  • asdf/interface.
  • common-lisp.
Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Ordinary functions

Function: load-fixtures (pathname &optional package-name)
Package

clos-fixtures.

Source

clos-fixtures.lisp.


6.1.2 Generic functions

Generic Function: register-fixture (instance)

Register a fixture.

Package

clos-fixtures.

Source

clos-fixtures.lisp.


6.1.3 Standalone methods

Method: output-files ((operation compile-op) (component fixture))
Package

asdf/action.

Source

asdf.lisp.

Method: perform ((o compile-op) (component fixture))
Package

asdf/action.

Source

asdf.lisp.

Method: perform ((o load-op) (component fixture))
Package

asdf/action.

Source

asdf.lisp.


6.2 Internals


6.2.1 Ordinary functions

Function: read-fixtures (path package)
Package

clos-fixtures.

Source

clos-fixtures.lisp.


6.2.2 Generic functions

Generic Reader: fixture-package-name (object)
Package

clos-fixtures.

Methods
Reader Method: fixture-package-name ((fixture fixture))

The name of the package to read the forms in.

Source

asdf.lisp.

Target Slot

package-name.


6.2.3 Classes

Class: fixture
Package

clos-fixtures.

Source

asdf.lisp.

Direct superclasses

source-file.

Direct methods
Direct slots
Slot: type
Package

common-lisp.

Initform

"lisp"

Slot: package-name

The name of the package to read the forms in.

Package

common-lisp.

Initform

:cl

Initargs

:package

Readers

fixture-package-name.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.3 Variables

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