| 1234567891011121314151617181920212223242526272829303132 |
- //
- // config_test.cxx
- // pokemon_test_xc
- //
- // Created by Sam Jaffe on 12/22/18.
- // Copyright © 2018 Sam Jaffe. All rights reserved.
- //
- #include "xcode_gtest_helper.h"
- #include <json/json.h>
- #include "stub_config.h"
- using testing::Eq;
- TEST(ConfigTest, ConfigFileLoadAbsolutePath) {
- Config cfg("config_test/absolute.cfg.json");
- EXPECT_THAT(cfg.resource(""), Eq("/usr/local/lib/engine_test_xc/absolute/"));
- }
- TEST(ConfigTest, ConfigFileLoadSelfReferencePath) {
- Config cfg("config_test/at-config.cfg.json");
- std::string const root = Config().resource("config_test");
- EXPECT_THAT(cfg.resource(""), Eq(root + "/relative/"));
- }
- TEST(ConfigTest, ConfigFromJsonCannotPerformAtConfigSubs) {
- Json::Value json;
- json["resource_path"] = "@config/root";
- Config cfg(json);
- EXPECT_THAT(cfg.resource(""), Eq("/root/"));
- }
|