diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 18:20:06 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 18:20:06 -0700 |
commit | 2da413fe65595e95b16e9e01afa240d5c668a03a (patch) | |
tree | aaa60ecf50befabe0c6a5444c593275e411873d5 /spec | |
parent | 5f45c98f1e2ae9ec7b95760a41d617a7a698cc19 (diff) | |
download | chef-2da413fe65595e95b16e9e01afa240d5c668a03a.tar.gz |
fix Style/MutableConstant
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/scripts/ssl-serve.rb | 2 | ||||
-rw-r--r-- | spec/support/shared/functional/securable_resource_with_reporting.rb | 2 | ||||
-rw-r--r-- | spec/tiny_server.rb | 12 | ||||
-rw-r--r-- | spec/unit/chef_fs/file_system/repository/directory_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/apt_repository_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider/mount/windows_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider/zypper_repository_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider_resolver_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/role_spec.rb | 2 |
10 files changed, 18 insertions, 18 deletions
diff --git a/spec/scripts/ssl-serve.rb b/spec/scripts/ssl-serve.rb index 5677e94d0a..66e400b6d0 100644 --- a/spec/scripts/ssl-serve.rb +++ b/spec/scripts/ssl-serve.rb @@ -36,7 +36,7 @@ DEFAULT_OPTIONS = { Logger: LOGGER, DocumentRoot: File.expand_path("#{Dir.tmpdir}/chef-118-sampledata") #:AccessLog => [] # Remove this option to enable the access log when debugging. -} +}.freeze webrick_opts = DEFAULT_OPTIONS.merge(server_opts) pp webrick_opts: webrick_opts diff --git a/spec/support/shared/functional/securable_resource_with_reporting.rb b/spec/support/shared/functional/securable_resource_with_reporting.rb index cd2b83fda1..abeb1ba4bb 100644 --- a/spec/support/shared/functional/securable_resource_with_reporting.rb +++ b/spec/support/shared/functional/securable_resource_with_reporting.rb @@ -19,7 +19,7 @@ ALL_EXPANDED_PERMISSIONS = ["generic read", "execute / traverse", "delete child", "read attributes", - "write attributes"] + "write attributes"].freeze shared_examples_for "a securable resource with reporting" do diff --git a/spec/tiny_server.rb b/spec/tiny_server.rb index c3eab76d8e..4a6bdfb599 100644 --- a/spec/tiny_server.rb +++ b/spec/tiny_server.rb @@ -38,7 +38,7 @@ module TinyServer # SSLEnable: options[:ssl], # SSLCertName: [ [ 'CN', WEBrick::Utils::getservername ] ], AccessLog: [], # Remove this option to enable the access log when debugging. - } + }.freeze def initialize(**options) @options = DEFAULT_OPTIONS.merge(options) @@ -101,10 +101,10 @@ module TinyServer class API include Singleton - GET = "GET" - PUT = "PUT" - POST = "POST" - DELETE = "DELETE" + GET = "GET".freeze + PUT = "PUT".freeze + POST = "POST".freeze + DELETE = "DELETE".freeze attr_reader :routes @@ -170,7 +170,7 @@ module TinyServer end class Response - HEADERS = { "Content-Type" => "application/json" } + HEADERS = { "Content-Type" => "application/json" }.freeze def initialize(response_code = 200, data = nil, headers = nil, &block) @response_code, @data = response_code, data diff --git a/spec/unit/chef_fs/file_system/repository/directory_spec.rb b/spec/unit/chef_fs/file_system/repository/directory_spec.rb index efd17204e0..5b2a0a47b8 100644 --- a/spec/unit/chef_fs/file_system/repository/directory_spec.rb +++ b/spec/unit/chef_fs/file_system/repository/directory_spec.rb @@ -22,7 +22,7 @@ require "chef/chef_fs/file_system/base_fs_object" require "chef/chef_fs/file_system/exceptions" require "chef/chef_fs/file_system/nonexistent_fs_object" -CHILD_FILES = %w{ test1.json test2.json skip test3.json skip2 test4 } +CHILD_FILES = %w{ test1.json test2.json skip test3.json skip2 test4 }.freeze class TestDirectory < Chef::ChefFS::FileSystem::Repository::Directory def make_child_entry(name) diff --git a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb index a09b192b6d..209d987e78 100644 --- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb @@ -18,7 +18,7 @@ require "spec_helper" -BAD_RECIPE = <<~E +BAD_RECIPE = <<~E.freeze # # Cookbook Name:: syntax-err # Recipe:: default diff --git a/spec/unit/provider/apt_repository_spec.rb b/spec/unit/provider/apt_repository_spec.rb index 8ea2b9b823..79b871eb6c 100644 --- a/spec/unit/provider/apt_repository_spec.rb +++ b/spec/unit/provider/apt_repository_spec.rb @@ -23,7 +23,7 @@ require "spec_helper" # # Output of the command: # => apt-key adv --list-public-keys --with-fingerprint --with-colons -APT_KEY_FINGER = <<~EOF +APT_KEY_FINGER = <<~EOF.freeze tru:t:1:1488924856:0:3:1:5 pub:-:1024:17:40976EAF437D05B5:2004-09-12:::-:Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>::scESC: fpr:::::::::630239CC130E1A7FD81A27B140976EAF437D05B5: @@ -38,7 +38,7 @@ EOF # Output of the command: # => gpg --with-fingerprint --with-colons [FILE] -GPG_FINGER = <<~EOF +GPG_FINGER = <<~EOF.freeze pub:-:1024:17:327574EE02A818DD:2009-04-22:::-:Cloudera Apt Repository: fpr:::::::::F36A89E33CC1BD0F71079007327574EE02A818DD: sub:-:2048:16:84080586D1CA74A1:2009-04-22:::: diff --git a/spec/unit/provider/mount/windows_spec.rb b/spec/unit/provider/mount/windows_spec.rb index 6d55fb958c..aeff294347 100644 --- a/spec/unit/provider/mount/windows_spec.rb +++ b/spec/unit/provider/mount/windows_spec.rb @@ -29,8 +29,8 @@ class Chef end end -GUID = "\\\\?\\Volume{578e72b5-6e70-11df-b5c5-000c29d4a7d9}\\" -REMOTE = "\\\\server-name\\path" +GUID = "\\\\?\\Volume{578e72b5-6e70-11df-b5c5-000c29d4a7d9}\\".freeze +REMOTE = "\\\\server-name\\path".freeze describe Chef::Provider::Mount::Windows do before(:each) do diff --git a/spec/unit/provider/zypper_repository_spec.rb b/spec/unit/provider/zypper_repository_spec.rb index fc8ff14afb..df45c742d4 100644 --- a/spec/unit/provider/zypper_repository_spec.rb +++ b/spec/unit/provider/zypper_repository_spec.rb @@ -20,14 +20,14 @@ require "spec_helper" # Output of the command: # => rpm -qa gpg-pubkey* -RPM_KEYS = <<~EOF +RPM_KEYS = <<~EOF.freeze gpg-pubkey-307e3d54-4be01a65 gpg-pubkey-3dbdc284-53674dd4 EOF # Output of the command: # => gpg --with-fingerprint [FILE] -GPG_FINGER = <<~EOF +GPG_FINGER = <<~EOF.freeze pub 2048R/3DBDC284 2011-08-19 [expires: 2024-06-14] Key fingerprint = 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 uid nginx signing key <signing-key@nginx.com> diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index cb03141c76..a3f2801adf 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -887,7 +887,7 @@ describe Chef::ProviderResolver do }, }, }, - } + }.freeze def self.create_provider_tests(providers, test, expected, filter) expected = expected.merge(providers.select { |key, value| key.is_a?(Symbol) }) diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb index 8e73ad347d..57f1d5c6ba 100644 --- a/spec/unit/role_spec.rb +++ b/spec/unit/role_spec.rb @@ -245,7 +245,7 @@ describe Chef::Role do end end - ROLE_DSL = <<~EOR + ROLE_DSL = <<~EOR.freeze name "ceiling_cat" description "like Aliens, but furry" EOR |