Replies: 1 comment
-
Late reply but — insta tries to serialize the object, but otherwise the object is opaque to insta. The standard approach would be to unbox it? |
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
-
So I have a trait and have a
Box<dyn MyTrait>
of that trait. now i want to snapshot test this box withassert_ron_snapshot!
. But that doesnt work because it doesnt know that the thing behind MyTrait is Serializable. I also tried to maketrait MyTrait: Serializable
but then it can't be made into an object. Any suggestions?Also: Is there a way to make the tests back into a mod tests { } ? currently i have to make them out of that #[cfg(debug)] flagged module for insta to see them. Can i also change the snapshot path to not be inside the src/ folder?
Beta Was this translation helpful? Give feedback.
All reactions