-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Connor McArthur
committed
Jan 18, 2014
1 parent
08c72f4
commit 26c72d4
Showing
4 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(ns cmcarthur.doppler.core-test | ||
(:use midje.sweet) | ||
(:require [cmcarthur.doppler.core :refer :all] | ||
[cmcarthur.doppler.cloudwatch :as cloudwatch])) | ||
|
||
(facts "generate-metric-results" | ||
(prerequisites | ||
(cloudwatch/get-metric 1) => [{:average 1 :sum 1 :time nil}] | ||
(cloudwatch/get-metric 2) => [{:average 2 :sum 2 :time nil}] | ||
(cloudwatch/push-metric anything anything) => nil) | ||
(fact "uses map-reduce" | ||
(generate-metric-results {:mapper (comp :average first) | ||
:reducer + | ||
:metrics [1 2] | ||
:output nil}) => 3) | ||
(fact "maintains ordering" | ||
(generate-metric-results {:mapper (comp :average first) | ||
:reducer - | ||
:metrics [1 2] | ||
:output nil}) => -1) | ||
(fact "can handle more than two metrics" | ||
(generate-metric-results {:mapper (comp :average first) | ||
:reducer - | ||
:metrics [1 2 2] | ||
:output nil}) => -3) | ||
(fact "works with custom reducers" | ||
(generate-metric-results {:mapper (comp :average first) | ||
:reducer (fn [x y] (+ x y)) | ||
:metrics [1 2 2] | ||
:output nil}) => 5)) |
This file was deleted.
Oops, something went wrong.