diff options
Diffstat (limited to 'spec/unit/knife')
-rw-r--r-- | spec/unit/knife/core/bootstrap_context_spec.rb | 14 | ||||
-rw-r--r-- | spec/unit/knife/node_run_list_remove_spec.rb | 21 |
2 files changed, 32 insertions, 3 deletions
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index 1291571358..af8fa3f698 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -205,4 +205,18 @@ EXPECTED end end + describe "prerelease" do + it "isn't set in the config_content by default" do + expect(bootstrap_context.config_content).not_to include("prerelease") + end + + describe "when configured via cli" do + let(:config) {{:prerelease => true}} + + it "uses CLI value" do + expect(bootstrap_context.latest_current_chef_version_string).to eq("-p") + end + end + end + end 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 - - - |