File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,7 @@ class UserSession < Session::Base
2222 property username : String ? = " example"
2323end
2424
25- # Crystal 1.19+ needs a concrete type for @store since the library
26- # declares `property store = nil` (no type annotation).
27- # Provide the type so specs compile.
28- class Session::Configuration
29- @store : Session ::MemoryStore (UserSession )? = nil
30- end
25+ Session .use_store(Session ::MemoryStore (UserSession ))
3126
3227# Reset configuration to defaults before each test
3328def reset_config
Original file line number Diff line number Diff line change @@ -125,6 +125,10 @@ module Session
125125 macro use_store (store_type )
126126 class Session::Configuration
127127 property store : {{store_type}}? = nil
128+
129+ def session : {{store_type}}
130+ @store || raise " Session store not configured. Call Session.configure and set c.store before using Session.session."
131+ end
128132 end
129133 end
130134
You can’t perform that action at this time.
0 commit comments