feat: add configurable mockPrefix to Cuckoofile.toml#598
feat: add configurable mockPrefix to Cuckoofile.toml#598mmustafasenoglu wants to merge 1 commit into
Conversation
Add a global `mockPrefix` option to Cuckoofile.toml that allows customizing the prefix of generated mock class names. Default: "Mock" (existing behavior) Example: mockPrefix = "Fake" generates FakeGreeter instead of MockGreeter The prefix can be set: - Globally in Cuckoofile.toml: `mockPrefix = "Fake"` - Per-module in options: `[modules.X.options]` with `mockPrefix = "Fake"` Closes Brightify#564
|
Hi @MatyasKriz, thanks for taking a look! That's great to hear you had planned this for 2.0. I've implemented the I've also added a basic test case for the prefix configuration. Happy to adjust the implementation if you'd prefer a different approach. Let me know how you'd like to proceed with testing on your end. |
|
@mzschwartz5 Thanks for taking a look!
Correct - no defaults were changed. The default prefix stays as |
|
@mmustafasenoglu I think you're conflating a couple PRs here. I imagine you meant to respond to me here |
Summary
Add a global
mockPrefixoption toCuckoofile.tomlthat allows customizing the prefix of generated mock class names.Closes #564
Changes
mockPrefixtoDTO.OptionsandOptionsstructsmockNameto useModule.mockPrefixinstead of hardcoded"Mock"mockPrefixTOML keymockPrefixoptionUsage
This generates
FakeGreeterinstead ofMockGreeter.Backward Compatibility
"Mock", preserving existing behaviormockPrefixis not specified