Skip to content

Commit 92c7f8b

Browse files
PragTobtrptcolin
authored andcommitted
Added one test to the polymorph suite (test name usage)
* added one tests that verifies that the diet function also accesses the name value of the map (before it was possible to just return "Bambi eats veggies." for the herbivore diet * since this is not the main purpose of these specs added just this one and not extra specs for default/carnivore as I didn't want to bloat it, but could add those as well if desired
1 parent 4050549 commit 92c7f8b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/koans/09_runtime_polymorphism.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
(= "Simba eats animals."
3131
(diet {:species "lion" :name "Simba" :age 1 :eater :carnivore}))
3232

33+
"Animals have different names"
34+
(= "Thumper eats veggies."
35+
(diet {:species "rabbit" :name "Thumper" :age 1 :eater :herbivore}))
36+
3337
"You may use a default method when no others match"
3438
(= "I don't know what Rich Hickey eats."
3539
(diet {:name "Rich Hickey"})))

0 commit comments

Comments
 (0)