summaryrefslogtreecommitdiff
path: root/spec/unit/knife/node_run_list_remove_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/knife/node_run_list_remove_spec.rb')
-rw-r--r--spec/unit/knife/node_run_list_remove_spec.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/spec/unit/knife/node_run_list_remove_spec.rb b/spec/unit/knife/node_run_list_remove_spec.rb
index ea951e21dd..ceceef7178 100644
--- a/spec/unit/knife/node_run_list_remove_spec.rb
+++ b/spec/unit/knife/node_run_list_remove_spec.rb
@@ -66,9 +66,24 @@ describe Chef::Knife::NodeRunListRemove do
expect(@node.run_list).not_to include('role[monkey]')
expect(@node.run_list).not_to include('recipe[duck::type]')
end
+
+ it "should remove the items from the run list when name args contains whitespace" do
+ @node.run_list << 'role[monkey]'
+ @node.run_list << 'recipe[duck::type]'
+ @knife.name_args = [ 'adam', 'role[monkey], recipe[duck::type]' ]
+ @knife.run
+ expect(@node.run_list).not_to include('role[monkey]')
+ expect(@node.run_list).not_to include('recipe[duck::type]')
+ end
+
+ it "should remove the items from the run list when name args contains multiple run lists" do
+ @node.run_list << 'role[blah]'
+ @node.run_list << 'recipe[duck::type]'
+ @knife.name_args = [ 'adam', 'role[monkey], recipe[duck::type]', 'role[blah]' ]
+ @knife.run
+ expect(@node.run_list).not_to include('role[monkey]')
+ expect(@node.run_list).not_to include('recipe[duck::type]')
+ end
end
end
end
-
-
-