feat(sprint-14): add Cake cut/reset state machine

This commit is contained in:
Steven Wroblewski
2026-05-11 20:15:44 +02:00
parent 666648c154
commit 2cb265c922
2 changed files with 87 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
## Tests for Cake — state machine transitions.
extends GutTest
const CakeScript = preload("res://scripts/objects/cake.gd")
var _cake: Node2D
func before_each() -> void:
_cake = CakeScript.new()
add_child_autofree(_cake)
func test_initial_state_is_whole() -> void:
assert_eq(_cake._state, CakeScript.State.WHOLE)
func test_start_cutting_transitions_to_cutting() -> void:
_cake._start_cutting()
assert_eq(_cake._state, CakeScript.State.CUTTING)
func test_on_cut_complete_transitions_to_cut() -> void:
_cake._on_cut_complete()
assert_eq(_cake._state, CakeScript.State.CUT)
func test_on_reset_complete_transitions_to_whole() -> void:
_cake._state = CakeScript.State.RESETTING
_cake._on_reset_complete()
assert_eq(_cake._state, CakeScript.State.WHOLE)