Skip to content

Commit

Permalink
Add average
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilmari Vacklin committed May 19, 2012
1 parent 4caa294 commit 817370c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/training_day.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
(defn abs [x]
":(")

(defn average [a b]
":(")

; ^_______________________^
; v v
10 changes: 7 additions & 3 deletions test/training_day_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
(:use training-day
midje.sweet))

(facts
(facts "square"
(square 2) => 4
(square 3) => 9)

(facts
(facts "abs"
(abs -2) => 2
(abs 42) => 42)

(facts
(facts "fizzbuzz"
(fizzbuzz 45) => "gotcha!"
(fizzbuzz 48) => "fizz"
(fizzbuzz 70) => "buzz")

(facts "average"
(average 2 4) => 3
(average 1 2) => 3/2)

0 comments on commit 817370c

Please sign in to comment.