mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
Add check for registering multiple reporters under same name
This commit is contained in:
@@ -312,3 +312,18 @@ TEST_CASE("Registering reporter with '::' in name fails",
|
||||
Catch::Detail::make_unique<TestReporterFactory>() ),
|
||||
"'::' is not allowed in reporter name: 'with::doublecolons'" );
|
||||
}
|
||||
|
||||
TEST_CASE("Registering multiple reporters with the same name fails",
|
||||
"[reporters][registration][approvals]") {
|
||||
Catch::ReporterRegistry registry;
|
||||
|
||||
registry.registerReporter(
|
||||
"some-reporter-name",
|
||||
Catch::Detail::make_unique<TestReporterFactory>() );
|
||||
|
||||
REQUIRE_THROWS_WITH(
|
||||
registry.registerReporter(
|
||||
"some-reporter-name",
|
||||
Catch::Detail::make_unique<TestReporterFactory>() ),
|
||||
"reporter using 'some-reporter-name' as name was already registered" );
|
||||
}
|
||||
|
Reference in New Issue
Block a user