-
-
Notifications
You must be signed in to change notification settings - Fork 242
Expand file tree
/
Copy pathglobal_config_entry_spec.rb
More file actions
85 lines (75 loc) · 1.93 KB
/
global_config_entry_spec.rb
File metadata and controls
85 lines (75 loc) · 1.93 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
require 'spec_helper'
describe 'nodejs::npm::global_config_entry', type: :define do
let :pre_condition do
'class { "nodejs": }'
end
on_supported_os.each do |os, facts|
context "on #{os} " do
let :facts do
facts
end
context 'with name set to proxy and value set to proxy.domain' do
let(:title) { 'proxy' }
let :params do
{
ensure: 'present',
value: 'proxy.domain',
}
end
it do
is_expected.to contain_ini_setting(title).with(
ensure: params[:ensure],
setting: title,
value: params[:value],
)
end
end
context 'with name set to https-proxy and value set to proxy.domain' do
let(:title) { 'https-proxy' }
let :params do
{
ensure: 'present',
value: 'proxy.domain'
}
end
it do
is_expected.to contain_ini_setting(title).with(
ensure: params[:ensure],
setting: title,
value: params[:value],
)
end
end
context 'with name set to color and ensure set to absent' do
let(:title) { 'color' }
let :params do
{
ensure: 'absent'
}
end
it do
is_expected.to contain_ini_setting(title).with(
ensure: params[:ensure],
setting: title,
)
end
end
context 'with name set to :_secret and ensure set to present' do
let(:title) { '//path.to.registry/:_secret' }
let :params do
{
ensure: 'present',
value: 'cGFzc3dvcmQ=',
}
end
it do
is_expected.to contain_ini_setting(title).with(
ensure: params[:ensure],
setting: title,
value: params[:value],
)
end
end
end
end
end