File tree 2 files changed +29
-2
lines changed
2 files changed +29
-2
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: #{ value } " ) 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 (
53
80
name : 'stubname' ,
54
81
environment : 'not-a-valid-name' ,
55
82
)
56
- } . to raise_error ( %r{Invalid environment name} )
83
+ } . to raise_error ( %r{Invalid environment name: not-a-valid-name } )
57
84
end
58
85
59
86
it 'allows name with symbols, numbers, and whitespace' do
You can’t perform that action at this time.
0 commit comments