File tree 2 files changed +28
-1
lines changed
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ def insync?(is)
123
123
desc 'Environment for this group'
124
124
defaultto :production
125
125
validate do |value |
126
- raise ( 'Invalid environment name' ) unless value =~ ( %r{\A [a-z0 -9_]+\Z } ) || ( value == 'agent-specified' )
126
+ raise ( 'Invalid environment name' ) unless value =~ ( %r{\A [a-zA-Z0 -9_]+\Z } ) || ( value == 'agent-specified' )
127
127
end
128
128
end
129
129
newproperty ( :classes ) do
Original file line number Diff line number Diff line change 20
20
} . not_to raise_error
21
21
end
22
22
23
+ it 'allows uppercase environment name without underscore' do
24
+ expect {
25
+ Puppet ::Type . type ( :node_group ) . new (
26
+ name : 'stubname' ,
27
+ environment : 'ENVIRONMENTNAME' ,
28
+ )
29
+ } . not_to raise_error
30
+ end
31
+
32
+ it 'allows uppercase environment name with an underscore' do
33
+ expect {
34
+ Puppet ::Type . type ( :node_group ) . new (
35
+ name : 'stubname' ,
36
+ environment : 'ENVIRONMENT_NAME' ,
37
+ )
38
+ } . not_to raise_error
39
+ end
40
+
41
+ it 'allows capitalized environment name with an underscore' do
42
+ expect {
43
+ Puppet ::Type . type ( :node_group ) . new (
44
+ name : 'stubname' ,
45
+ environment : 'Environment_name' ,
46
+ )
47
+ } . not_to raise_error
48
+ end
49
+
23
50
it 'allows environment name with a number' do
24
51
expect {
25
52
Puppet ::Type . type ( :node_group ) . new (
You can’t perform that action at this time.
0 commit comments