mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Don't return *this in expectation::with
Chaining is done via the wrapper class not the expectation class
This commit is contained in:
parent
3845d57531
commit
c8c6af273e
1 changed files with 2 additions and 4 deletions
|
|
@ -123,16 +123,14 @@ namespace mock { namespace detail {
|
||||||
void invoke(std::unique_ptr<invocation> i) { invocation_ = std::move(i); }
|
void invoke(std::unique_ptr<invocation> i) { invocation_ = std::move(i); }
|
||||||
|
|
||||||
template<typename... Constraints>
|
template<typename... Constraints>
|
||||||
std::enable_if_t<(arity > 0u) && sizeof...(Constraints) == arity, expectation&> with(Constraints... c)
|
std::enable_if_t<(arity > 0u) && sizeof...(Constraints) == arity> with(Constraints... c)
|
||||||
{
|
{
|
||||||
matcher_ = std::make_unique<single_matcher<void(Constraints...), Args...>>(c...);
|
matcher_ = std::make_unique<single_matcher<void(Constraints...), Args...>>(c...);
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
template<typename Constraint, std::size_t Arity = arity>
|
template<typename Constraint, std::size_t Arity = arity>
|
||||||
std::enable_if_t<(Arity > 1u), expectation&> with(const Constraint& c)
|
std::enable_if_t<(Arity > 1u)> with(const Constraint& c)
|
||||||
{
|
{
|
||||||
matcher_ = std::make_unique<multi_matcher<Constraint, Args...>>(c);
|
matcher_ = std::make_unique<multi_matcher<Constraint, Args...>>(c);
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void add(sequence& s)
|
void add(sequence& s)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue