Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the clack-pretend Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 12:59:42 2020 GMT+0.
• Introduction | What clack-pretend is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Are you tired of jumping to your web browser every time you need to test your work in Clack? Clack-pretend will capture and replay calls to your clack middleware stack. When developing a web application with clack, you will often find it inconvenient to run your code from the lisp REPL because it expects a clack environment, including perhaps, cookies or a logged-in user. With clack-pretend, you can run prior web requests from your REPL, moving development back where it belongs.
First, replace lack:builder or clack:builder:
(lack:builder
...
with pretend-builder:
(clack-pretend:pretend-builder (:insert 3)
...
Pretend builder, aside from its recording features, is a thin wrapper around lack:builder.
The :insert parameter is where pretend will capture the environment and output. For example given this app:
(clack-pretend:pretend-builder (:insert 3)
(:static :path "~/public_html/")
:accesslog
:session
(custom-middleware param)
(my-app))
The collection point will be inserted just after the session middleware, and just before custom-middleware.
To use clack-pretend, restart your clack app and visit a page with your web browser.
(quick-summary)
This function gives a list of URLs that have been captured.
Most of the info functions hava an optional parameter named index. The default is 0, or the last request received by the stack. By default clack-pretend stores up to 10 requests. Higher indices retrieve older requests.
(last-input (&optional (index 0))
The input environment as it was received from the middleware above the insertion point.
(last-output (&optional (index 0))
The output of the app below the insertion point.
(last-request-object (&optional (index 0))
A clack request object generated from the results of last-input.
(last-request-url ())
The URL of the last request.
(last-session (&optional (index 0))
The session object from the last request.
(last-as-code (&optional (index 0))
Attempts to output the last environment and session as usable source code. This is useful for turning a web request into something usable as a unit test for your middleware.
> (run-pretend)
Runs the last web request starting below the insert point with the saved environment information from above the insert point.
Ben McGunigle (bnmcgn at gmail.com)
Copyright (c) 2017 Ben McGunigle
Apache License version 2.0
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The clack-pretend system |
Ben McGunigle <bnmcgn@gmail.com>
Apache License, version 2.0
A testing and debugging tool for Clack
clack-pretend.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The clack-pretend.asd file | ||
• The clack-pretend/package.lisp file | ||
• The clack-pretend/clack-pretend.lisp file |
Next: The clack-pretend/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
clack-pretend.asd
clack-pretend (system)
Next: The clack-pretend/clack-pretend․lisp file, Previous: The clack-pretend․asd file, Up: Lisp files [Contents][Index]
clack-pretend (system)
package.lisp
Previous: The clack-pretend/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
clack-pretend (system)
clack-pretend.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The clack-pretend package |
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
clack-pretend.lisp (file)
clack-pretend.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
clack-pretend.lisp (file)
clack-pretend.lisp (file)
clack-pretend.lisp (file)
Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Returns a source code representation of a hash table.
clack-pretend.lisp (file)
clack-pretend.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | F H L M P Q R V |
---|
Jump to: | F H L M P Q R V |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Jump to: | C P S |
---|