Skip to content

Library to create mock Ring requests for unit tests

Notifications You must be signed in to change notification settings

invetica/ring-mock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ring-Mock

Build Status

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/ring-mock "0.3.0"]

Documentation

Example

(ns your-app.core-test
  (:require [clojure.test :refer :all]
            [your-app.core :refer :all]
            [ring.mock.request :as mock]))

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

License

Copyright © 2015 James Reeves

Distributed under the MIT License.

About

Library to create mock Ring requests for unit tests

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Clojure 100.0%