Most functors as constraints are detected automatically

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@6 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2009-08-28 20:22:26 +00:00
parent 22d9120dc8
commit 0d0b921d83
6 changed files with 135 additions and 5 deletions

View file

@ -303,12 +303,12 @@ BOOST_AUTO_TEST_CASE( triggering_an_expectation_with_failing_custom_constraint_t
{
{
mock::expectation< void( int ) > e;
e.expect().with( mock::constraint( &custom_constraint ) );
e.expect().with( &custom_constraint );
BOOST_CHECK_EXCEPTION_CONTAINS( e( 42 ), "unexpected call" );
}
{
mock::expectation< int( int, const std::string& ) > e;
e.expect().with( mock::constraint( &custom_constraint ), "actual" );
e.expect().with( &custom_constraint, "actual" );
BOOST_CHECK_EXCEPTION_CONTAINS( e( 42, "actual" ), "unexpected call" );
}
}
@ -655,7 +655,7 @@ BOOST_AUTO_TEST_CASE( expectation_can_be_serialized_to_be_human_readable )
}
{
mock::expectation< void( int ) > e( "my expectation" );
e.expect().once().with( mock::constraint( &custom_constraint ) );
e.expect().once().with( &custom_constraint );
std::stringstream s;
s << e;
const std::string expected = "my expectation\n"