Register Test or Mock Provider #222
Closed
toddkummer
started this conversation in
Ideas
Replies: 1 comment
-
Testing is application responsibility, not library responsibility. Your dependency injection approach is exactly the right solution - clean, flexible, and doesn't add complexity to the library. RubyLLM focuses on LLM communication. Adding test providers would bloat the library with auxiliary concerns that every application handles differently. Keep using your current approach. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I find myself using dependency injection to mock the Chat in my tests. Could we have a mock or test provider that you could register before running tests that would simply handle the calls to it and allow for some inspection.
Here's what a quick-and-dirty chat mock looks like, just to start the discussion:
I think it would be cleaner to do this at the provider level rather than mocking each chat.
Beta Was this translation helpful? Give feedback.
All reactions