Closed tu6ge closed 2 years ago
So you want to have a single object with some mock methods and other real methods? You can't, usually. An object must be either wholly mock or wholly real. But in this case it might just work since from_xml
has a default implementation. You wouldn't ever be able to mock that function, though. What happens if you try, and just don't provide a definition for from_xml
within your mock!
block?
Okay,I don't entangle
I have a trait like this:
how to I test
from_xml
with mockfrom_string
?