pyherc
pyherc copied to clipboard
easier testing
(test-setup default
actions (-> (ActionFactory)
(.build))
character (-> (CharacterBuilder)
(.with-name "Pete")
(.build))
dagger (-> (ItemBuilder)
(.with-name "dagger")
(.build)))
(defn test-case []
(with-setup default [actions character]
(move-character character actions 1)
(assert-that character.location (is- (equal-to #t(2 2))))))
(defn test-another-case []
(with-setup default [actions character dagger]
(pick-up character dagger actions)
(assert-that character (has-item dagger))))