diff --git a/doc/example/reference.cpp b/doc/example/reference.cpp index fb010ee..e0783a1 100644 --- a/doc/example/reference.cpp +++ b/doc/example/reference.cpp @@ -716,6 +716,27 @@ BOOST_AUTO_TEST_CASE( demonstrates_combining_constraints ) //] } +namespace constraints_example_9 +{ +//[ constraints_example_9 +MOCK_CLASS( mock_class ) +{ + MOCK_METHOD( method, 2, void( const std::string&, std::size_t ) ) +}; + +bool custom_constraint( const std::string& actual_1, std::size_t actual_2 ) +{ + return actual_1.size() <= actual_2; +} + +BOOST_AUTO_TEST_CASE( demonstrates_one_constraint_for_all_arguments ) +{ + mock_class c; + MOCK_EXPECT( c.method ).with( &custom_constraint ); +} +//] +} + namespace sequence_example_1 { //[ sequence_example_1 diff --git a/doc/reference.qbk b/doc/reference.qbk index d4f11db..e4d0fb4 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -453,6 +453,10 @@ Example using &&, || and ! : [constraints_example_8] +Example using one constraint for all parameters : + +[constraints_example_9] + [endsect] [section Sequence]