Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

arrdem/sounds-of-silence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Sounds of Silence

Clojars Project

Hello darkness my old friend

I've come to talk with you again

-- Simon & Garfunkel ~ The Sounds of Silence

In keeping with the Unix philosophy, tests (and other programs) should produce no output when they execute normally unless they are explicitly asked to. Unfortunately, it can be difficult to track down what's writing to *out* and how to go make it stop.

This library provides a pair of clojure.test fixtures named silence and lamentation. silence as a fixture mutes all output to *out* and *err* by simply providing a bindings to a no-op Writer class. lamentation makes writing to *out* and *err* fatal, by throwing an IOException when either output stream is written to.

(ns my.tests
  (:require [clojure.test :refer [use-fixtures is deftest]]
            [sounds-of-silence :refer [lamentation]]))

(use-fixtures :each lamentation)

(deftest my-test
  (println "This will cause an IOException!"))

License

Copyright © 2017 Reid 'arrdem' McKenzie

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.