diff options
Diffstat (limited to 'spec/functional/knife')
-rw-r--r-- | spec/functional/knife/configure_spec.rb | 12 | ||||
-rw-r--r-- | spec/functional/knife/cookbook_delete_spec.rb | 16 | ||||
-rw-r--r-- | spec/functional/knife/exec_spec.rb | 6 | ||||
-rw-r--r-- | spec/functional/knife/smoke_test.rb | 2 | ||||
-rw-r--r-- | spec/functional/knife/ssh_spec.rb | 38 |
5 files changed, 37 insertions, 37 deletions
diff --git a/spec/functional/knife/configure_spec.rb b/spec/functional/knife/configure_spec.rb index 3bef18a0aa..4c02f15200 100644 --- a/spec/functional/knife/configure_spec.rb +++ b/spec/functional/knife/configure_spec.rb @@ -16,23 +16,23 @@ # limitations under the License. # -require 'spec_helper' +require "spec_helper" -require 'chef/knife/configure' -require 'ohai' +require "chef/knife/configure" +require "ohai" describe "knife configure" do let (:ohai) do o = Ohai::System.new o.load_plugins - o.require_plugin 'os' - o.require_plugin 'hostname' + o.require_plugin "os" + o.require_plugin "hostname" o end it "loads the fqdn from Ohai" do knife_configure = Chef::Knife::Configure.new - hostname_guess = ohai[:fqdn] || ohai[:machinename] || ohai[:hostname] || 'localhost' + hostname_guess = ohai[:fqdn] || ohai[:machinename] || ohai[:hostname] || "localhost" expect(knife_configure.guess_servername).to eql(hostname_guess) end end diff --git a/spec/functional/knife/cookbook_delete_spec.rb b/spec/functional/knife/cookbook_delete_spec.rb index bffad8cbed..9b847ba2da 100644 --- a/spec/functional/knife/cookbook_delete_spec.rb +++ b/spec/functional/knife/cookbook_delete_spec.rb @@ -16,8 +16,8 @@ # limitations under the License. # -require 'spec_helper' -require 'tiny_server' +require "spec_helper" +require "tiny_server" describe Chef::Knife::CookbookDelete do before(:all) do @@ -32,7 +32,7 @@ describe Chef::Knife::CookbookDelete do Chef::Config[:node_name] = nil Chef::Config[:client_key] = nil - Chef::Config[:chef_server_url] = 'http://localhost:9000' + Chef::Config[:chef_server_url] = "http://localhost:9000" end after(:all) do @@ -44,7 +44,7 @@ describe Chef::Knife::CookbookDelete do before do @knife.name_args = %w{no-such-cookbook} - @api.get("/cookbooks/no-such-cookbook", 404, Chef::JSONCompat.to_json({'error'=>'dear Tim, no. -Sent from my iPad'})) + @api.get("/cookbooks/no-such-cookbook", 404, Chef::JSONCompat.to_json({"error"=>"dear Tim, no. -Sent from my iPad"})) end around do |ex| @@ -71,7 +71,7 @@ describe Chef::Knife::CookbookDelete do context "when there is only one version of a cookbook" do before do @knife.name_args = %w{obsolete-cookbook} - @cookbook_list = {'obsolete-cookbook' => { 'versions' => ['version' => '1.0.0']} } + @cookbook_list = {"obsolete-cookbook" => { "versions" => ["version" => "1.0.0"]} } @api.get("/cookbooks/obsolete-cookbook", 200, Chef::JSONCompat.to_json(@cookbook_list)) end @@ -112,9 +112,9 @@ describe Chef::Knife::CookbookDelete do context "when there are several versions of a cookbook" do before do @knife.name_args = %w{obsolete-cookbook} - versions = ['1.0.0', '1.1.0', '1.2.0'] - with_version = lambda { |version| { 'version' => version } } - @cookbook_list = {'obsolete-cookbook' => { 'versions' => versions.map(&with_version) } } + versions = ["1.0.0", "1.1.0", "1.2.0"] + with_version = lambda { |version| { "version" => version } } + @cookbook_list = {"obsolete-cookbook" => { "versions" => versions.map(&with_version) } } @api.get("/cookbooks/obsolete-cookbook", 200, Chef::JSONCompat.to_json(@cookbook_list)) end diff --git a/spec/functional/knife/exec_spec.rb b/spec/functional/knife/exec_spec.rb index 6262094a9f..9fa0bcc83a 100644 --- a/spec/functional/knife/exec_spec.rb +++ b/spec/functional/knife/exec_spec.rb @@ -16,8 +16,8 @@ # limitations under the License. # -require 'spec_helper' -require 'tiny_server' +require "spec_helper" +require "tiny_server" describe Chef::Knife::Exec do before(:all) do @@ -32,7 +32,7 @@ describe Chef::Knife::Exec do Chef::Config[:node_name] = nil Chef::Config[:client_key] = nil - Chef::Config[:chef_server_url] = 'http://localhost:9000' + Chef::Config[:chef_server_url] = "http://localhost:9000" $output = StringIO.new end diff --git a/spec/functional/knife/smoke_test.rb b/spec/functional/knife/smoke_test.rb index b718bc50e0..77ee4a88fb 100644 --- a/spec/functional/knife/smoke_test.rb +++ b/spec/functional/knife/smoke_test.rb @@ -16,7 +16,7 @@ # limitations under the License. # -require 'spec_helper' +require "spec_helper" describe "knife smoke tests" do diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb index 0844a0aa85..56ba2ecfa2 100644 --- a/spec/functional/knife/ssh_spec.rb +++ b/spec/functional/knife/ssh_spec.rb @@ -16,8 +16,8 @@ # limitations under the License. # -require 'spec_helper' -require 'tiny_server' +require "spec_helper" +require "tiny_server" describe Chef::Knife::Ssh do @@ -50,7 +50,7 @@ describe Chef::Knife::Ssh do describe "identity file" do context "when knife[:ssh_identity_file] is set" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_identity_file] = "~/.ssh/aws.rsa" end @@ -62,7 +62,7 @@ describe Chef::Knife::Ssh do context "when knife[:ssh_identity_file] is set and frozen" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_identity_file] = "~/.ssh/aws.rsa".freeze end @@ -74,7 +74,7 @@ describe Chef::Knife::Ssh do context "when -i is provided" do before do - setup_knife(['-i ~/.ssh/aws.rsa', '*:*', 'uptime']) + setup_knife(["-i ~/.ssh/aws.rsa", "*:*", "uptime"]) Chef::Config[:knife][:ssh_identity_file] = nil end @@ -92,7 +92,7 @@ describe Chef::Knife::Ssh do context "when knife[:ssh_identity_file] is not provided]" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_identity_file] = nil end @@ -106,7 +106,7 @@ describe Chef::Knife::Ssh do describe "port" do context "when -p 31337 is provided" do before do - setup_knife(['-p 31337', '*:*', 'uptime']) + setup_knife(["-p 31337", "*:*", "uptime"]) end it "uses the ssh_port" do @@ -119,7 +119,7 @@ describe Chef::Knife::Ssh do describe "user" do context "when knife[:ssh_user] is set" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_user] = "ubuntu" end @@ -131,7 +131,7 @@ describe Chef::Knife::Ssh do context "when knife[:ssh_user] is set and frozen" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_user] = "ubuntu".freeze end @@ -143,7 +143,7 @@ describe Chef::Knife::Ssh do context "when -x is provided" do before do - setup_knife(['-x ubuntu', '*:*', 'uptime']) + setup_knife(["-x ubuntu", "*:*", "uptime"]) Chef::Config[:knife][:ssh_user] = nil end @@ -161,7 +161,7 @@ describe Chef::Knife::Ssh do context "when knife[:ssh_user] is not provided]" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_user] = nil end @@ -175,7 +175,7 @@ describe Chef::Knife::Ssh do describe "attribute" do context "when knife[:ssh_attribute] is set" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_attribute] = "ec2.public_hostname" end @@ -187,7 +187,7 @@ describe Chef::Knife::Ssh do context "when knife[:ssh_attribute] is not provided]" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_attribute] = nil end @@ -199,7 +199,7 @@ describe Chef::Knife::Ssh do context "when -a ec2.public_ipv4 is provided" do before do - setup_knife(['-a ec2.public_hostname', '*:*', 'uptime']) + setup_knife(["-a ec2.public_hostname", "*:*", "uptime"]) Chef::Config[:knife][:ssh_attribute] = nil end @@ -212,7 +212,7 @@ describe Chef::Knife::Ssh do # This is the setting imported from knife.rb Chef::Config[:knife][:ssh_attribute] = "fqdn" # Then we run knife with the -a flag, which sets the above variable - setup_knife(['-a ec2.public_hostname', '*:*', 'uptime']) + setup_knife(["-a ec2.public_hostname", "*:*", "uptime"]) @knife.run expect(@knife.config[:attribute]).to eq("ec2.public_hostname") end @@ -222,7 +222,7 @@ describe Chef::Knife::Ssh do describe "gateway" do context "when knife[:ssh_gateway] is set" do before do - setup_knife(['*:*', 'uptime']) + setup_knife(["*:*", "uptime"]) Chef::Config[:knife][:ssh_gateway] = "user@ec2.public_hostname" end @@ -235,7 +235,7 @@ describe Chef::Knife::Ssh do context "when -G user@ec2.public_hostname is provided" do before do - setup_knife(['-G user@ec2.public_hostname', '*:*', 'uptime']) + setup_knife(["-G user@ec2.public_hostname", "*:*", "uptime"]) Chef::Config[:knife][:ssh_gateway] = nil end @@ -248,7 +248,7 @@ describe Chef::Knife::Ssh do context "when the gateway requires a password" do before do - setup_knife(['-G user@ec2.public_hostname', '*:*', 'uptime']) + setup_knife(["-G user@ec2.public_hostname", "*:*", "uptime"]) Chef::Config[:knife][:ssh_gateway] = nil allow(@knife.session).to receive(:via) do |host, user, options| raise Net::SSH::AuthenticationFailed unless options[:password] @@ -274,7 +274,7 @@ describe Chef::Knife::Ssh do Chef::Config[:node_name] = nil Chef::Config[:client_key] = nil - Chef::Config[:chef_server_url] = 'http://localhost:9000' + Chef::Config[:chef_server_url] = "http://localhost:9000" @api.get("/search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0", 200) { %({"total":1, "start":0, "rows":[{"name":"i-xxxxxxxx", "json_class":"Chef::Node", "automatic":{"fqdn":"the.fqdn", "ec2":{"public_hostname":"the_public_hostname"}},"recipes":[]}]}) |