Greg on Nostr: I've been struggling for the past few days with setting up mock dependencies in unit ...
I've been struggling for the past few days with setting up mock dependencies in unit tests for a #rust project. This is first time I'm using mocks in Rust, and it feels like pushing a boulder up a hill. The idea is to swap out types of dependencies with your own implementations, so that you can measure how your own code-under-test behaves while interacting with a dependency. The borrow-checker cop, and design choices that authors of a library can make, conspire against me.
Published at
2024-03-27 14:49:30Event JSON
{
"id": "11af88637bb6f6109003126b20f163a4123b99cbb9494a773a9eb49270d5342e",
"pubkey": "52ad7b2c879736c5b966aa5b175d2d14563ab6a167078a7c9d35f421083f8e44",
"created_at": 1711550970,
"kind": 1,
"tags": [
[
"t",
"rust"
],
[
"proxy",
"https://hachyderm.io/users/gregdavis/statuses/112168204422090458",
"activitypub"
]
],
"content": "I've been struggling for the past few days with setting up mock dependencies in unit tests for a #rust project. This is first time I'm using mocks in Rust, and it feels like pushing a boulder up a hill. The idea is to swap out types of dependencies with your own implementations, so that you can measure how your own code-under-test behaves while interacting with a dependency. The borrow-checker cop, and design choices that authors of a library can make, conspire against me.",
"sig": "7ac386b787733ed02a1e3565de3700fc9ca7752b03e0c3a3e987a3d351d585e55a2a5be3c1518836f98dae26626ac5ca632577fab8e0d016b4d4524d1a30eb12"
}