Skip to content

Commit

Permalink
Fix clone mock test
Browse files Browse the repository at this point in the history
  • Loading branch information
orbwalk committed Feb 23, 2022
1 parent d2ebbf7 commit 9f94020
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ fn can_clone_real() {
}

#[test]
#[should_panic]
fn cloning_mock_panics() {
let real = Foo::faux();
let _ = real.clone();
fn can_clone_mock() {
let mut mock = Foo::faux();
let cloned = mock.clone();
faux::when!(mock.get()).then_return(4);
assert_eq!(cloned.get(), 4);
}

0 comments on commit 9f94020

Please sign in to comment.