diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-10-26 11:51:28 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-10-26 11:51:28 -0700 |
commit | 8837ebfda2a4292976d44ec564f349f357349fc1 (patch) | |
tree | 765d2e98a4c0bead2030f411f07613207e5070b5 /spec/unit/knife/configure_spec.rb | |
parent | 4d13c5acaa8596eab50b7d62252a6d94ab290d61 (diff) | |
download | chef-simplify_regex.tar.gz |
Simplify some regexes by removing redundant character classessimplify_regex
New RuboCop here. There's no need for character classes when all we have is a single character.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/knife/configure_spec.rb')
-rw-r--r-- | spec/unit/knife/configure_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/unit/knife/configure_spec.rb b/spec/unit/knife/configure_spec.rb index 6b41e54778..d642d003ae 100644 --- a/spec/unit/knife/configure_spec.rb +++ b/spec/unit/knife/configure_spec.rb @@ -157,9 +157,9 @@ describe Chef::Knife::Configure do expect(::File).to receive(:open).with("/home/you/.chef/credentials", "w").and_yield config_file @knife.config[:repository] = "/home/you/chef-repo" @knife.run - expect(config_file.string).to match(/^client_name[\s]+=[\s]+'#{Etc.getlogin}'$/) - expect(config_file.string).to match(%r{^client_key[\s]+=[\s]+'/home/you/.chef/#{Etc.getlogin}.pem'$}) - expect(config_file.string).to match(/^chef_server_url\s+=[\s]+'#{default_server_url}'$/) + expect(config_file.string).to match(/^client_name\s+=\s+'#{Etc.getlogin}'$/) + expect(config_file.string).to match(%r{^client_ky[\s=[\s+'/home/you/.chef/#{Etc.getlogin}.pem'$}) + expect(config_file.string).to match(/^chef_server_url\s+=\s+'#{default_server_url}'$/) end it "creates a new client when given the --initial option" do |