neatonk / ring-mock

Library to create mock ring requests for unit tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ring-Mock

Ring-Mock is a library for creating Ring request maps for testing purposes.

Installation

Add the following development dependency to your project.clj file:

[ring-mock "0.1.2"]

Documentation

Example

(ns your-app.test.core
  (:use your-app.core
        clojure.test
        ring.mock.request))

(deftest your-handler-test
  (is (= (your-handler (request :get "/doc/10"))
         {:status 200
          :headers {"content-type" "text/plain"}
          :body "Your expected result"})))

About

Library to create mock ring requests for unit tests

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%