You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structMyMock{pubmock_do_stuff:Mock<(),i32>,}implMyMock{pubfndo_stuff(&self) -> i32{self.mock_do_stuff.call(())}}implDefaultforMyMock{fndefault() -> MyMock{MyMock{mock_do_stuff:Mock::new(10),}}}#[test]pubfnplayground(){let mock = MyMock::default();assert_eq!(mock.do_stuff(), 10);
mock.mock_do_stuff.return_value(42);
mock.mock_do_stuff.return_value(84);let result1 = mock.do_stuff();let result2 = mock.do_stuff();assert_eq!(result1, 42);// returns 84; desire is it would return 42 on the first call and 84 on any remaining calls.assert_eq!(result2, 84);}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: