Repository: myelin-ai/mockiato (rust)

Issue:
Implement Default for mocks
Simply let `fn default() -> Self` return `Self::new()`. This needs to be documented at [the trait bounds documentation](https://github.com/myelin-ai/mockiato/blob/master/docs/trait-bounds.md) or, if #46 has been resolved, in the readme.

Pull request description:
Implement Default for mocks
Resolves #45

Patch:
diff --git a/mockiato-codegen/src/generate/mock_struct.rs b/mockiato-codegen/src/generate/mock_struct.rs
index 204f691..588a8b7 100644
--- a/mockiato-codegen/src/generate/mock_struct.rs
+++ b/mockiato-codegen/src/generate/mock_struct.rs
@@ -62,6 +62,13 @@ pub(crate) fn generate_mock_struct(
 
             #expect_methods
         }
+
+        impl Default for #mock_struct_ident {
+            /// Creates a new mock with no expectations.
+            fn default() -> Self {
+                Self::new()
+            }
+        }
     }
 }
 
diff --git a/mockiato/examples/default.rs b/mockiato/examples/default.rs
new file mode 100644
index 0000000..e58ee44
--- /dev/null
+++ b/mockiato/examples/default.rs
@@ -0,0 +1,14 @@
+use mockiato::mockable;
+use std::fmt::Debug;
+
+#[mockable]
+trait Animal: Debug {
+    fn make_sound(&self);
+}
+
+fn main() {
+    let mut animal = AnimalMock::default();
+
+    animal.expect_make_sound().times(1);
+    animal.make_sound();
+}
diff --git a/readme.md b/readme.md
index 9fc842d..cfa1583 100644
--- a/readme.md
+++ b/readme.md
@@ -12,3 +12,5 @@ The following traits are always implemented for mocks:
   Example: `cargo run --example debug`
 - [Clone](https://doc.rust-lang.org/std/clone/trait.Clone.html)  
   Example: `cargo test --example clone` 
+- [Default](https://doc.rust-lang.org/std/default/trait.Default.html)  
+  Example: `cargo test --example default` 


Test patch:
diff --git a/mockiato/tests/default.rs b/mockiato/tests/default.rs
new file mode 100644
index 0000000..6449b08
--- /dev/null
+++ b/mockiato/tests/default.rs
@@ -0,0 +1,11 @@
+mod foo {
+    use mockiato::mockable;
+
+    #[mockable]
+    pub(super) trait Bar {}
+}
+
+#[test]
+fn default_works() {
+    let _ = foo::BarMock::default();
+}