blob: 97b1a231184c35ff60dcf811267c1097ec4118a2 [file] [log] [blame]
[email protected]8d80d2d62010-07-08 03:19:081// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "base/env_var.h"
6#include "base/scoped_ptr.h"
7#include "testing/gtest/include/gtest/gtest.h"
8#include "testing/platform_test.h"
9
10typedef PlatformTest EnvVarTest;
11
12TEST_F(EnvVarTest, GetEnvVar) {
13 // Every setup should have non-empty PATH...
14 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
15 std::string env_value;
16 EXPECT_TRUE(env->GetEnv("PATH", &env_value));
17 EXPECT_NE(env_value, "");
18}
19
20TEST_F(EnvVarTest, HasEnvVar) {
21 // Every setup should have PATH...
22 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
23 EXPECT_TRUE(env->HasEnv("PATH"));
24}