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:
NicoSimoski authored and GitHub committed 2023-07-26 17:17:59 +02:00
1 parent ec373f2795
commit bf5b0d9cec
6 files changed
+265

No files matched your search

+12
View File
@@ -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))
+12
View File
@@ -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")))