diff options
author | Tim Smith <tsmith84@gmail.com> | 2019-12-29 18:00:24 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2019-12-29 18:00:24 -0800 |
commit | ecad8fee4a946b337e60a4274de2b2c872c9e81b (patch) | |
tree | bbf7fc8b3feae42007f7b9d7fe53648d315c410a /spec | |
parent | a8206d6c6f03de1fde15c49f6fe9ddb1d0071b7a (diff) | |
download | chef-zero-ecad8fee4a946b337e60a4274de2b2c872c9e81b.tar.gz |
Apply Chefstyle
Autocorrect with the latest chefstyle
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/run_oc_pedant.rb | 8 | ||||
-rw-r--r-- | spec/search_spec.rb | 4 | ||||
-rw-r--r-- | spec/socketless_server_map_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/oc_pedant.rb | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index 068cb4d..b1760b6 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -32,6 +32,7 @@ DEFAULT_LOG_LEVEL = :warn def log_level return ENV["LOG_LEVEL"].downcase.to_sym if ENV["LOG_LEVEL"] return :debug if ENV["DEBUG"] + DEFAULT_LOG_LEVEL end @@ -39,7 +40,7 @@ def start_chef_server(opts = {}) opts = DEFAULT_SERVER_OPTIONS.merge(opts) opts[:log_level] = log_level - ChefZero::Server.new(opts).tap { |server| server.start_background } + ChefZero::Server.new(opts).tap(&:start_background) end def start_cheffs_server(chef_repo_path) @@ -49,12 +50,12 @@ def start_cheffs_server(chef_repo_path) require "chef/chef_fs/chef_fs_data_store" require "chef_zero/server" - Dir.mkdir(chef_repo_path) if !File.exist?(chef_repo_path) + Dir.mkdir(chef_repo_path) unless File.exist?(chef_repo_path) # 11.6 and below had a bug where it couldn't create the repo children automatically if Chef::VERSION.to_f < 11.8 %w{clients cookbooks data_bags environments nodes roles users}.each do |child| - Dir.mkdir("#{chef_repo_path}/#{child}") if !File.exist?("#{chef_repo_path}/#{child}") + Dir.mkdir("#{chef_repo_path}/#{child}") unless File.exist?("#{chef_repo_path}/#{child}") end end @@ -84,6 +85,7 @@ end def args_from_env(key) return [] unless ENV[key] + ENV[key].split end diff --git a/spec/search_spec.rb b/spec/search_spec.rb index f0b9b5e..72e4b53 100644 --- a/spec/search_spec.rb +++ b/spec/search_spec.rb @@ -6,8 +6,8 @@ describe ChefZero::Solr::SolrParser do docs = [] [{ "foo" => "a" }, { "foo" => "d" }].each_with_index do |h, i| - docs.push ChefZero::Solr::SolrDoc.new(h, i) - end + docs.push ChefZero::Solr::SolrDoc.new(h, i) + end docs end diff --git a/spec/socketless_server_map_spec.rb b/spec/socketless_server_map_spec.rb index 795dba4..0e33a48 100644 --- a/spec/socketless_server_map_spec.rb +++ b/spec/socketless_server_map_spec.rb @@ -2,7 +2,7 @@ require "chef_zero/socketless_server_map" describe "Socketless Mode" do - let(:server_map) { ChefZero::SocketlessServerMap.instance.tap { |i| i.reset! } } + let(:server_map) { ChefZero::SocketlessServerMap.instance.tap(&:reset!) } let(:server) { instance_double("ChefZero::Server") } diff --git a/spec/support/oc_pedant.rb b/spec/support/oc_pedant.rb index 03c4db1..82f5cfc 100644 --- a/spec/support/oc_pedant.rb +++ b/spec/support/oc_pedant.rb @@ -140,7 +140,7 @@ requestors({ }, }) -self[:tags] = [:validation, :authentication, :authorization] +self[:tags] = %i{validation authentication authorization} verify_error_messages false ruby_users_endpoint? false |