Sha256: 409013dacc811e6f0ce3fe8bad5ea78507cb8233a450ec057c51a61e3064e2b7
Contents?: true
Size: 954 Bytes
Versions: 16
Compression:
Stored size: 954 Bytes
Contents
#include <catch.hpp> #include <leatherman/util/environment.hpp> #include <leatherman/windows/windows.hpp> #include <unistd.h> using namespace std; using namespace leatherman::util; SCENARIO("path separator on Windows") { REQUIRE(environment::get_path_separator() == ';'); } SCENARIO("environment search paths") { GIVEN("paths from the environment") { auto paths = environment::search_paths(); REQUIRE(paths.size() > 0u); } GIVEN("empty paths from the environment") { string value; REQUIRE(environment::get("PATH", value)); REQUIRE(environment::set("PATH", value+";")); environment::reload_search_paths(); auto paths = environment::search_paths(); THEN("an empty path should not be searched") { REQUIRE(count(paths.begin(), paths.end(), "") == 0); } REQUIRE(environment::set("PATH", value)); environment::reload_search_paths(); } }
Version data entries
16 entries across 16 versions & 2 rubygems