Skip to content

Commit 4d6c883

Browse files
author
Jani Rahkola
committed
tests for HAS-ALL-THE-AWARDS that don't assume a fixed awards set
1 parent 85d032e commit 4d6c883

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
# predicates
22

3-
A Clojure library designed to ... well, that part is up to you.
3+
I'm part of the [120 hour epic sax marathon](http://iloveponies.github.com/120-hour-epic-sax-marathon/).
44

55
## Usage
66

7-
FIXME
8-
9-
## License
10-
11-
Copyright © 2012 FIXME
12-
13-
Distributed under the Eclipse Public License, the same as Clojure.
7+
Make a fork of me!

project.clj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
(defproject predicates "0.1.0-SNAPSHOT"
2-
:dependencies [[org.clojure/clojure "1.4.0"]]
3-
:profiles {:dev {:dependencies [[midje "1.4.0"]
4-
[com.stuartsierra/lazytest "1.2.3"]]
5-
:plugins [[lein-midje "2.0.0-SNAPSHOT"]]}}
6-
:repositories {"stuart" "http://stuartsierra.com/maven2"}
7-
:url "http://example.com/FIXME")
2+
:dependencies [[org.clojure/clojure "1.5.0"]]
3+
:profiles {:dev {:dependencies [[midje "1.5-RC1"]]
4+
:plugins [[lein-midje "3.0-RC1"]]}})

test/predicates_test.clj

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,18 @@
6262
(has-award? scanner-darkly :hugo) => false)
6363

6464
(facts "HAS-ALL-THE-AWARDS?"
65-
(HAS-ALL-THE-AWARDS? cities awards) => true
66-
(HAS-ALL-THE-AWARDS? lord-of-light awards) => false
67-
(HAS-ALL-THE-AWARDS? lord-of-light #{:hugo}) => true
68-
(HAS-ALL-THE-AWARDS? scanner-darkly #{}) => true)
65+
(HAS-ALL-THE-AWARDS? cities #{:locus})
66+
=> true
67+
(HAS-ALL-THE-AWARDS? cities #{:locus :world-fantasy :hugo})
68+
=> true
69+
(HAS-ALL-THE-AWARDS? cities #{:locus :world-fantasy :hugo :pulitzer})
70+
=> false
71+
(HAS-ALL-THE-AWARDS? lord-of-light #{:locus :world-fantasy :hugo})
72+
=> false
73+
(HAS-ALL-THE-AWARDS? lord-of-light #{:hugo})
74+
=> true
75+
(HAS-ALL-THE-AWARDS? scanner-darkly #{})
76+
=> true)
6977

7078
(facts "my-some"
7179
(my-some even? [1 3 5 7]) => falsey

0 commit comments

Comments
 (0)