mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 18:43:53 +00:00
Added implementation in common lisp with unit-test
- added the existing implementation in common lisp with system-definition - added a parachute-unit-test - added a description for setup and running the unit-tests - added a description for stubbing and mocking with cl-mock
This commit is contained in:
1 parent
ec373f2795
commit
bf5b0d9cec
6 files changed
+265
No files matched your search
@@ -0,0 +1,12 @@
|
||||
;;;; package.lisp
|
||||
|
||||
(defpackage :gilded-rose-tests
|
||||
(:use :cl :gilded-rose)
|
||||
(:import-from :parachute
|
||||
:define-test
|
||||
:is)
|
||||
(:import-from :cl-mock
|
||||
:with-mocks
|
||||
:answer
|
||||
:call-previous
|
||||
:invocations))
|
||||
@@ -0,0 +1,12 @@
|
||||
(in-package :gilded-rose-tests)
|
||||
|
||||
(define-test gilded-rose-testsuite)
|
||||
|
||||
(define-test "An item in gilded-rose is updated."
|
||||
:parent gilded-rose-testsuite
|
||||
(let* ((an-item (make-instance 'item :name "An item" :sell-in 1 :quality 1))
|
||||
(some-items (list an-item))
|
||||
(my-app (make-instance 'gilded-rose :items some-items)))
|
||||
(update-quality my-app)
|
||||
(is equal (slot-value (first (slot-value my-app 'items)) 'name) "Fix me")))
|
||||
|
||||
Reference in new issue
Block a user