summaryrefslogtreecommitdiff
path: root/spec/integration
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-11-21 21:21:10 -0800
committerTim Smith <tsmith84@gmail.com>2020-11-21 21:21:10 -0800
commit1002fd4449e7d8e95aa09586d31220d6897d7a2c (patch)
tree4da5f6c58417e70e08438290555d71298d2e3b8b /spec/integration
parent2478b8252d3c701da2e0fd4835028da53c59c498 (diff)
downloadchef-1002fd4449e7d8e95aa09586d31220d6897d7a2c.tar.gz
Avoid ambiguous regexesambiguous_regex
Just makes it a bit easier to read. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/integration')
-rw-r--r--spec/integration/knife/client_key_create_spec.rb2
-rw-r--r--spec/integration/knife/node_create_spec.rb2
-rw-r--r--spec/integration/knife/node_environment_set_spec.rb2
-rw-r--r--spec/integration/knife/node_run_list_add_spec.rb8
-rw-r--r--spec/integration/knife/node_run_list_remove_spec.rb2
-rw-r--r--spec/integration/knife/node_run_list_set_spec.rb2
-rw-r--r--spec/integration/knife/node_show_spec.rb2
-rw-r--r--spec/integration/recipes/notifies_spec.rb2
-rw-r--r--spec/integration/recipes/provider_choice.rb4
9 files changed, 13 insertions, 13 deletions
diff --git a/spec/integration/knife/client_key_create_spec.rb b/spec/integration/knife/client_key_create_spec.rb
index 179b0f5911..b9838d6718 100644
--- a/spec/integration/knife/client_key_create_spec.rb
+++ b/spec/integration/knife/client_key_create_spec.rb
@@ -39,7 +39,7 @@ describe "knife client key create", :workstation do
it "creates a new client key with an expiration date" do
date = "2017-12-31T23:59:59Z"
knife("client key create -k new -e #{date} bah").should_succeed stderr: /^#{out}/, stdout: /.*BEGIN RSA PRIVATE KEY/
- knife("client key show bah new").should_succeed /expiration_date:.*#{date}/
+ knife("client key show bah new").should_succeed(/expiration_date:.*#{date}/)
end
it "refuses to add an already existing key" do
diff --git a/spec/integration/knife/node_create_spec.rb b/spec/integration/knife/node_create_spec.rb
index 76aa8bbfae..e8f6d71694 100644
--- a/spec/integration/knife/node_create_spec.rb
+++ b/spec/integration/knife/node_create_spec.rb
@@ -34,7 +34,7 @@ describe "knife node create", :workstation do
it "creates a new validator node" do
knife("node create bah").should_succeed out
- knife("node show bah").should_succeed /Node Name: bah/
+ knife("node show bah").should_succeed(/Node Name: bah/)
end
it "refuses to add an existing node" do
diff --git a/spec/integration/knife/node_environment_set_spec.rb b/spec/integration/knife/node_environment_set_spec.rb
index 3a407d1b20..16a86dbc30 100644
--- a/spec/integration/knife/node_environment_set_spec.rb
+++ b/spec/integration/knife/node_environment_set_spec.rb
@@ -31,7 +31,7 @@ describe "knife node environment set", :workstation do
end
it "sets an environment on a node" do
- knife("node environment set cons lisp").should_succeed /chef_environment:.*lisp/
+ knife("node environment set cons lisp").should_succeed(/chef_environment:.*lisp/)
knife("node show cons -a chef_environment").should_succeed <<~EOM
cons:
chef_environment: lisp
diff --git a/spec/integration/knife/node_run_list_add_spec.rb b/spec/integration/knife/node_run_list_add_spec.rb
index 8b17b36a67..f13e584526 100644
--- a/spec/integration/knife/node_run_list_add_spec.rb
+++ b/spec/integration/knife/node_run_list_add_spec.rb
@@ -30,7 +30,7 @@ describe "knife node run list add", :workstation do
end
it "sets the run list" do
- knife("node run list add cons recipe[foo]").should_succeed /run_list:\s*recipe\[foo\]\n/
+ knife("node run list add cons recipe[foo]").should_succeed(/run_list:\s*recipe\[foo\]\n/)
end
end
@@ -40,15 +40,15 @@ describe "knife node run list add", :workstation do
end
it "appends to the run list" do
- knife("node run list add cons recipe[foo]").should_succeed /run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m
+ knife("node run list add cons recipe[foo]").should_succeed(/run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m)
end
it "adds to the run list before the specified item" do
- knife("node run list add cons -b recipe[bar] recipe[foo]").should_succeed /run_list:\n\s*recipe\[foo\]\n\s*recipe\[bar\]\n/m
+ knife("node run list add cons -b recipe[bar] recipe[foo]").should_succeed(/run_list:\n\s*recipe\[foo\]\n\s*recipe\[bar\]\n/m)
end
it "adds to the run list after the specified item" do
- knife("node run list add cons -a recipe[bar] recipe[foo]").should_succeed /run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m
+ knife("node run list add cons -a recipe[bar] recipe[foo]").should_succeed(/run_list:\n\s*recipe\[bar\]\n\s*recipe\[foo\]\n/m)
end
end
end
diff --git a/spec/integration/knife/node_run_list_remove_spec.rb b/spec/integration/knife/node_run_list_remove_spec.rb
index 96bc3650ea..55f224b5ac 100644
--- a/spec/integration/knife/node_run_list_remove_spec.rb
+++ b/spec/integration/knife/node_run_list_remove_spec.rb
@@ -30,7 +30,7 @@ describe "knife node run list remove", :workstation do
end
it "removes the item from the run list" do
- knife("node run list remove cons recipe[bar]").should_succeed /run_list:\s*recipe\[foo\]\n/m
+ knife("node run list remove cons recipe[bar]").should_succeed(/run_list:\s*recipe\[foo\]\n/m)
end
end
end
diff --git a/spec/integration/knife/node_run_list_set_spec.rb b/spec/integration/knife/node_run_list_set_spec.rb
index a63145f3b8..e642afc1ce 100644
--- a/spec/integration/knife/node_run_list_set_spec.rb
+++ b/spec/integration/knife/node_run_list_set_spec.rb
@@ -30,7 +30,7 @@ describe "knife node run list set", :workstation do
end
it "sets the run list" do
- knife("node run list set cons recipe[bar]").should_succeed /run_list:\s*recipe\[bar\]\n/m
+ knife("node run list set cons recipe[bar]").should_succeed(/run_list:\s*recipe\[bar\]\n/m)
end
it "with no role or recipe" do
diff --git a/spec/integration/knife/node_show_spec.rb b/spec/integration/knife/node_show_spec.rb
index 300c0b8540..cf3f166699 100644
--- a/spec/integration/knife/node_show_spec.rb
+++ b/spec/integration/knife/node_show_spec.rb
@@ -30,7 +30,7 @@ describe "knife node show", :workstation do
end
it "shows the node" do
- knife("node show cons").should_succeed /Run List:\s*recipe\[bar\], recipe\[foo\]\n/m
+ knife("node show cons").should_succeed(/Run List:\s*recipe\[bar\], recipe\[foo\]\n/m)
end
end
end
diff --git a/spec/integration/recipes/notifies_spec.rb b/spec/integration/recipes/notifies_spec.rb
index a31ba6370b..7dfa70dfe5 100644
--- a/spec/integration/recipes/notifies_spec.rb
+++ b/spec/integration/recipes/notifies_spec.rb
@@ -416,7 +416,7 @@ describe "notifications" do
EOM
result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
- expect(result.stdout).to match /\* log\[a, b\] action write/
+ expect(result.stdout).to match(/\* log\[a, b\] action write/)
result.error!
end
diff --git a/spec/integration/recipes/provider_choice.rb b/spec/integration/recipes/provider_choice.rb
index 66aa58a432..f1d57260b6 100644
--- a/spec/integration/recipes/provider_choice.rb
+++ b/spec/integration/recipes/provider_choice.rb
@@ -30,8 +30,8 @@ describe "Recipe DSL methods" do
recipe = converge do
provider_thingy("blah") {}
end
- expect(recipe.logged_warnings).to match /hello from Chef::Provider::ProviderThingy/
- expect(recipe.logged_warnings).to match /you must use 'provides' to provide DSL/i
+ expect(recipe.logged_warnings).to match(/hello from Chef::Provider::ProviderThingy/)
+ expect(recipe.logged_warnings).to match(/you must use 'provides' to provide DSL/i)
end
end
end