A Clojure library for testing slingshot exceptions
quality
Stephen Starkey d0fbf862de Upgrades. Fixed project path. 4 months ago
bin Docs and utils 1 year ago
docs Removed unused file 1 year ago
spec/specl_slingshot First commit 1 year ago
src/specl_slingshot First commit 1 year ago
.gitignore Port from fossil 1 year ago
LICENSE First commit 1 year ago
README.md Port from fossil 1 year ago
project.clj Upgrades. Fixed project path. 4 months ago

README.md

specl-slingshot

A simple utility for writing specs around slingshot exceptions.

Download

Documentation

See documentation at https://specl-slingshot.calmabiding.me/doc/trunk/docs/index.html

Sample Usage

(ns some-spec
  (:require [slingshot.slingshot :refer :all]
            [specl-slingshot.core :refer :all]
            [speclj.core :refer :all])

(defn- throw-thing []
  (throw+ {:type :broken :answer 42} "Something awful"))

(describe "Exception handling"
  (it "should catch exceptions nicely"
    (should-throw+ [:type :broken] {:keys [answer]}
      [(should= 42 answer)
       (should-have-message "Something awful")]
      (throw-thing)))

License

Copyright © 2018 Stephen Starkey

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.