File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ def insync?(is)
123123 desc 'Environment for this group'
124124 defaultto :production
125125 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' )
127127 end
128128 end
129129 newproperty ( :classes ) do
Original file line number Diff line number Diff line change 2020 } . not_to raise_error
2121 end
2222
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+
2350 it 'allows environment name with a number' do
2451 expect {
2552 Puppet ::Type . type ( :node_group ) . new (
You can’t perform that action at this time.
0 commit comments