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
Right now Eras complete eagerly - that is, if you have .called_any() on an Expectation, for era completion purposes, it will behave as if it is a .called_once().
This isn't intuitive - we should accept any number of calls of that function before considering the era finished.
The end goal would be that something like the following test should pass:
#[test]fntest_eras_do_not_complete_eagerly(){letmut e = Expectations::new();// Expectations
e.expect::<(),()>("c").called_any();
e.then();
e.expect::<(),()>("d").called_once();// Calls
e.was_called::<(),()>("c",());// Does NOT complete the first era, unlike today
e.was_called::<(),()>("c",());// Completes first era
e.was_called::<(),()>("d",());// Completes second era}
That said, we'll need to come up with a good solution for the following cases:
What happens when a called_any() is followed by a called_any() for the same method in the next era?
We may also need to rethink the way that Eras operate fundamentally. We could possibly also use this as an opportunity to create global expectations, or allow return/modifying behaviors to be set on a method level?
The text was updated successfully, but these errors were encountered:
Right now Eras complete eagerly - that is, if you have
.called_any()
on an Expectation, for era completion purposes, it will behave as if it is a.called_once()
.This isn't intuitive - we should accept any number of calls of that function before considering the era finished.
The end goal would be that something like the following test should pass:
That said, we'll need to come up with a good solution for the following cases:
called_any()
is followed by acalled_any()
for the same method in the next era?We may also need to rethink the way that Eras operate fundamentally. We could possibly also use this as an opportunity to create global expectations, or allow return/modifying behaviors to be set on a method level?
The text was updated successfully, but these errors were encountered: