Iron Test
A suite of convenience methods and constructors for making requests to Iron Handlers.
Documentation
Example
extern crate iron;
extern crate iron_test;
use *;
use ;
use ;
;
API
request
The request API implements convenience methods for all the major HTTP verbs except CONNECT and TRACE. They're broken down as follows.
// Generates empty body
get // Accepts a `&str` body
post
The requests that it makes sense for accept a &str
body, while the other
requests generate an empty body for you. The request is passed directly to
the handle
call on the Handler, and the raw result is returned to you.
For examples of testing different handlers, head over to the examples directory.
Creating project layout for tests
Sometimes it is useful to have a predefined directory layout with specific files in it. You can easily create a simple project directory using a ProjectBuilder.
Ex:
use ProjectBuilder;
To access current project root, use p.root()
.
ProjectBuilder implements Drop and will clean up the project when it is dropped.
Installation
If you're using Cargo, just add iron-test to your Cargo.toml, and point it at the git url.
-test =
iron
Author
Jonathan Reem
Get Help
Come find us on #iron
or #rust
on irc.mozilla.net
License
MIT