File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def self.title_patterns
53
53
54
54
newproperty ( :key ) do
55
55
desc "The key itself; generally a long string of unencoded characters. The `key`
56
- attribute may not contain whitespace.
56
+ attribute may not contain leading or trailing whitespace.
57
57
58
58
Make sure to omit the following in this attribute (and specify them in
59
59
other attributes):
@@ -62,7 +62,7 @@ def self.title_patterns
62
62
* Key identifiers / comments, such as 'joescomputer.local' --- put these in
63
63
the `name` attribute/resource title."
64
64
validate do |value |
65
- raise Puppet ::Error , _ ( 'Key must not contain whitespace: %{value}' ) % { value : value } if %r{\s } . match? ( value )
65
+ raise Puppet ::Error , _ ( 'Key must contain neither leading nor trailing whitespace: %{value}' ) % { value : value } if %r{^ \s | \s $ } . match? ( value )
66
66
end
67
67
end
68
68
Original file line number Diff line number Diff line change 76
76
} . to raise_error ( Puppet ::Error , %r{cannot include whitespace} )
77
77
end
78
78
79
- it "doesn't accept whitespace in the key contents" do
79
+ it "doesn't accept leading or trailing whitespace in the key contents" do
80
80
expect {
81
- described_class . new ( name : 'foo' , key : 'AAA FA ==' )
82
- } . to raise_error ( Puppet ::Error , %r{Key must not contain whitespace} )
81
+ described_class . new ( name : 'foo' , key : ' AAAFA ==' )
82
+ } . to raise_error ( Puppet ::Error , %r{Key must contain neither leading nor trailing whitespace} )
83
83
end
84
84
85
85
it "doesn't accept aliases in the resourcename" do
You can’t perform that action at this time.
0 commit comments