Library to create mock Ring requests for unit tests
Clojure
#11 Compare This branch is 26 commits ahead, 1 commit behind weavejester:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/ring/mock Set default port to 443 when scheme is :https (fixes #3) Sep 10, 2015
test/ring/mock
.gitignore
.travis.yml Add .travis.yml file Dec 16, 2014
README.md
project.clj Release 0.3.0 Sep 11, 2015

README.md

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.