summaryrefslogtreecommitdiff
path: root/spec/unit/knife/bootstrap/client_builder_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/knife/bootstrap/client_builder_spec.rb')
-rw-r--r--spec/unit/knife/bootstrap/client_builder_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/knife/bootstrap/client_builder_spec.rb b/spec/unit/knife/bootstrap/client_builder_spec.rb
index 87720091cd..10edd13882 100644
--- a/spec/unit/knife/bootstrap/client_builder_spec.rb
+++ b/spec/unit/knife/bootstrap/client_builder_spec.rb
@@ -25,7 +25,7 @@ describe Chef::Knife::Bootstrap::ClientBuilder do
let(:stdin) { StringIO.new }
let(:ui) { Chef::Knife::UI.new(stdout, stderr, stdin, {}) }
- let(:knife_config) { {} }
+ let(:config) { {} }
let(:chef_config) { {} }
@@ -34,7 +34,7 @@ describe Chef::Knife::Bootstrap::ClientBuilder do
let(:rest) { double("Chef::ServerAPI") }
let(:client_builder) do
- client_builder = Chef::Knife::Bootstrap::ClientBuilder.new(knife_config: knife_config, chef_config: chef_config, ui: ui)
+ client_builder = Chef::Knife::Bootstrap::ClientBuilder.new(config: config, chef_config: chef_config, ui: ui)
allow(client_builder).to receive(:rest).and_return(rest)
allow(client_builder).to receive(:node_name).and_return(node_name)
client_builder
@@ -160,7 +160,7 @@ describe Chef::Knife::Bootstrap::ClientBuilder do
it "adds tags to the node when given" do
tag_receiver = []
- knife_config[:tags] = %w{foo bar}
+ config[:tags] = %w{foo bar}
allow(node).to receive(:run_list).with([])
allow(node).to receive(:tags).and_return(tag_receiver)
client_builder.run
@@ -168,34 +168,34 @@ describe Chef::Knife::Bootstrap::ClientBuilder do
end
it "builds a node when the run_list is a string" do
- knife_config[:run_list] = "role[base],role[app]"
+ config[:run_list] = "role[base],role[app]"
expect(node).to receive(:run_list).with(["role[base]", "role[app]"])
client_builder.run
end
it "builds a node when the run_list is an Array" do
- knife_config[:run_list] = ["role[base]", "role[app]"]
+ config[:run_list] = ["role[base]", "role[app]"]
expect(node).to receive(:run_list).with(["role[base]", "role[app]"])
client_builder.run
end
it "builds a node with first_boot_attributes if they're given" do
- knife_config[:first_boot_attributes] = { baz: :quux }
+ config[:first_boot_attributes] = { baz: :quux }
expect(node).to receive(:normal_attrs=).with({ baz: :quux })
expect(node).to receive(:run_list).with([])
client_builder.run
end
it "builds a node with an environment if its given" do
- knife_config[:environment] = "production"
+ config[:environment] = "production"
expect(node).to receive(:environment).with("production")
expect(node).to receive(:run_list).with([])
client_builder.run
end
it "builds a node with policy_name and policy_group when given" do
- knife_config[:policy_name] = "my-app"
- knife_config[:policy_group] = "staging"
+ config[:policy_name] = "my-app"
+ config[:policy_group] = "staging"
expect(node).to receive(:run_list).with([])
expect(node).to receive(:policy_name=).with("my-app")