summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnshul Sharma <justanshulsharma@gmail.com>2014-10-18 10:08:45 +0530
committerAnshul Sharma <justanshulsharma@gmail.com>2014-10-18 10:08:45 +0530
commit298040c6038065dc9d10d00af8766394c2b466c7 (patch)
tree314b759d5c0fd250342636c14be649bb9b68638c
parentf760df982c37793fca33d9f0cd78f7c1d34b1ea4 (diff)
downloadchef-298040c6038065dc9d10d00af8766394c2b466c7.tar.gz
added tests
-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 5a008a3e07..744c24596a 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
@node.run_list.should_not include('role[monkey]')
@node.run_list.should_not 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
+ @node.run_list.should_not include('role[monkey]')
+ @node.run_list.should_not 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[monkey]'
+ @node.run_list << 'recipe[duck::type]'
+ @knife.name_args = [ 'adam', 'role[monkey], recipe[duck::type]', 'role[blah]' ]
+ @knife.run
+ @node.run_list.should_not include('role[monkey]')
+ @node.run_list.should_not include('recipe[duck::type]')
+ end
end
end
end
-
-
-