Garbage/Tests/SimpleConf/Files.cpp

24 lines
632 B
C++
Raw Permalink Normal View History

#include <catch2/catch_test_macros.hpp>
#include <Garbage/SimpleConf.hpp>
TEST_CASE("Interactions with files")
{
SECTION("Try loading a nonexistent file")
{
using ReadError = Garbage::SimpleConfImplementation::ReadError;
std::filesystem::path path("TestConfigs/ThisOneShouldntExist.conf");
REQUIRE_THROWS_AS(Garbage::SimpleConf(path), ReadError);
}
SECTION("Try loading a directory")
{
using ReadError = Garbage::SimpleConfImplementation::ReadError;
std::filesystem::path path("TestConfigs");
REQUIRE_THROWS_AS(Garbage::SimpleConf(path), ReadError);
}
}