Commit ce5d6f5
refactor: migrate mock infrastructure to trogon-std/trogon-nats
- Add trogon-std and trogon-nats crates (from main branch) to workspace
- Replace custom ReadEnv/InMemoryEnv in config.rs with trogon-std::env
- Make DiscordBridge generic over Publish<P = MessagePublisher> so tests
can inject MockPublisher without a real NATS connection
- Add with_publisher() constructor for test-only bridge construction
- Rewrite bridge_nats_tests.rs as pure unit tests using MockPublisher
(no NATS server required, captures published messages in-memory)
- Fix ratelimit handler: serenity EventHandler::ratelimit has no ctx
param, so revert to log-only; remove unreachable publish_ratelimit
- Fix bridge_tests.rs: use Bridge type alias for generic inference
- Fix outbound_tests.rs: add as_voice field to SendMessageCommand literals
All 84 discord-bot tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 08aece1 commit ce5d6f5
36 files changed
Lines changed: 2908 additions & 205 deletions
File tree
- rsworkspace
- crates
- discord-bot
- src
- handlers
- discord-nats
- trogon-nats
- src
- trogon-std
- src
- env
- fs
- time
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
| 171 | + | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
| 200 | + | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
| 204 | + | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
220 | 253 | | |
221 | 254 | | |
222 | | - | |
| 255 | + | |
223 | 256 | | |
224 | 257 | | |
225 | 258 | | |
| |||
2203 | 2236 | | |
2204 | 2237 | | |
2205 | 2238 | | |
2206 | | - | |
2207 | | - | |
2208 | | - | |
2209 | | - | |
2210 | | - | |
2211 | | - | |
2212 | | - | |
2213 | | - | |
2214 | | - | |
2215 | 2239 | | |
2216 | 2240 | | |
2217 | 2241 | | |
| |||
0 commit comments