Test machinery hooked up to configs.

In a config, you can write something like

(let [index (default :ttl 3 (tap :index (index)))]
  (streams
    (expired #(prn "Expired" %))
    (where (not (service #"^riemann "))
           index)))

(tests
  (deftest index-test
    (is (= (inject! [{:service "test"
                      :time    1}])
           {:index [{:service "test"
            :time    1
            :ttl     3}]}))))

and invoke it with

$ riemann test riemann.config

`(inject! events)` returns a map of tap names to a vector of the events
that arrived at that tap. Time is always reset to zero at the beginning
of each test, and is automatically advanced to each event time just
prior to event arrival. You may manually advance the clock using
`riemann.time.controlled/advance!`.

Under the hood, `tests` expands to a new ns declaration based on the
current namespace--if the current namespace is `foo`, tests take place
in `foo-test`. `tests` automatically refers clojure.test's `is` and
`are`, plus riemann.test's version of `deftest` and `inject!` for
inserting events into the config's streams.

You can define regular clojure tests as well as ones using `inject!`.
Every namespace ending in "-test" is eligible for testing.
Fix tests for riemann.test