diff options
author | Matthew M. Boedicker <matthewm@boedicker.org> | 2013-10-15 21:34:52 -0700 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-11-06 09:13:47 -0800 |
commit | 40e7b69ef8f3ef95cf5506982eded139aa2b629c (patch) | |
tree | 298532cae8c5f5c9a5ab9f101f7593add1a176a6 /spec/unit | |
parent | 892a772fad4c7c5950c1c08a18d175c9bc6b5992 (diff) | |
download | chef-40e7b69ef8f3ef95cf5506982eded139aa2b629c.tar.gz |
Allow single letter usernames.
On non-Windows platforms single letter usernames are valid,
so make the valid user regex allow them.
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/config_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb index 278a41ec0a..77870e84d8 100644 --- a/spec/unit/config_spec.rb +++ b/spec/unit/config_spec.rb @@ -360,6 +360,7 @@ describe Chef::Config do expect{Chef::Config.log_location = missing_path}.to raise_error Chef::Exceptions::ConfigurationError end end + describe "Chef::Config[:event_handlers]" do it "sets a event_handlers to an empty array by default" do Chef::Config[:event_handlers].should eq([]) @@ -370,4 +371,13 @@ describe Chef::Config do Chef::Config[:event_handlers].should be_include(o) end end + + describe "Chef::Config[:user_valid_regex]" do + context "on a platform that is not Windows" do + it "allows one letter usernames" do + any_match = Chef::Config[:user_valid_regex].any? { |regex| regex.match('a') } + expect(any_match).to be_true + end + end + end end |