Last active
January 11, 2017 16:19
-
-
Save bkuhns/135c079e0248a752c948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCENARIO("...", "[...]") | |
{ | |
QEventLoop eventLoop; | |
MockRepository mockRepo; | |
GIVEN("An exporter") { | |
auto exporterAndMocks = setUpExporterAndMocks(); | |
auto exporter = exporterAndMocks.first; | |
auto mocks = exporterAndMocks.second; | |
auto dataConverter = get<TupleDataConverter>(mocks); | |
mockRepo.ExpectCall(dataConverter, DataConverter::convert).Do([] { return vector<unique_ptr<Record>>(); }); | |
WHEN("`exportAsync()` is called.") { | |
exporter->exportAsync(getStuff(), [&] { | |
eventLoop.exit(); | |
}); | |
eventLoop.exec(); | |
THEN("the data converter should be used to export data.") { | |
REQUIRE(true); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good point. I'll see if my mocking framework supports something like this. I've just relied on the fact that Catch invalidates the test if an exception is thrown, even if previous REQUIRE()'s passed. Certainly misleading, as you say.