summaryrefslogtreecommitdiffstats
path: root/puppet/modules/git/tests/config.pp
blob: a00ad0ecfa69769dd50b4a71c1481d5f3166c38a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
selftest::expect_no_warnings { "no warnings from git::config": }

# =============== default git::config should manage $HOME/.gitconfig ==========
#
git::config { "user.name":
    content => "Fake Git User",
    user => "fakeuser_bob",
}

$default_homedir = $::operatingsystem ? {
    windows => "(?i:c:\\\\Users\\\\fakeuser_bob\\\\)",   # case-insensitive regex
    Darwin => "/Users/fakeuser_bob/",
    default => "/home/fakeuser_bob/",
}

selftest::expect { "default .gitconfig file":
    output => "Exec\\[git::config set user\\.name in ${default_homedir}.gitconfig\\]",
}

# =============== file can be set explicitly where needed =====================
#
git::config { "user.email":
    content => "fake-git-user@example.com",
    user => "fakeuser_bob",
    file => "/some/fake/file",
}

selftest::expect { "explicit file":
    output => 'Exec\[git::config set user\.email in /some/fake/file\]',
}