Move herbivore assertions together
This commit is contained in:
parent
92c7f8b2f0
commit
0cf4cd3121
@ -26,14 +26,14 @@
|
|||||||
(= "Bambi eats veggies."
|
(= "Bambi eats veggies."
|
||||||
(diet {:species "deer" :name "Bambi" :age 1 :eater :herbivore}))
|
(diet {:species "deer" :name "Bambi" :age 1 :eater :herbivore}))
|
||||||
|
|
||||||
"Different methods are used depending on the dispatch function result"
|
|
||||||
(= "Simba eats animals."
|
|
||||||
(diet {:species "lion" :name "Simba" :age 1 :eater :carnivore}))
|
|
||||||
|
|
||||||
"Animals have different names"
|
"Animals have different names"
|
||||||
(= "Thumper eats veggies."
|
(= "Thumper eats veggies."
|
||||||
(diet {:species "rabbit" :name "Thumper" :age 1 :eater :herbivore}))
|
(diet {:species "rabbit" :name "Thumper" :age 1 :eater :herbivore}))
|
||||||
|
|
||||||
|
"Different methods are used depending on the dispatch function result"
|
||||||
|
(= "Simba eats animals."
|
||||||
|
(diet {:species "lion" :name "Simba" :age 1 :eater :carnivore}))
|
||||||
|
|
||||||
"You may use a default method when no others match"
|
"You may use a default method when no others match"
|
||||||
(= "I don't know what Rich Hickey eats."
|
(= "I don't know what Rich Hickey eats."
|
||||||
(diet {:name "Rich Hickey"})))
|
(diet {:name "Rich Hickey"})))
|
||||||
|
Loading…
Reference in New Issue
Block a user