diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-13 11:44:32 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-13 11:44:32 -0800 |
commit | af4afcc712d24dbc85a9c020a124acadeed295d2 (patch) | |
tree | 08a71e81175177fee945d09bb831d5ae37a24606 /spec/unit | |
parent | 1edd3dba71b4531bb1a570dd7e387620e8ee61de (diff) | |
download | chef-af4afcc712d24dbc85a9c020a124acadeed295d2.tar.gz |
autocorrecting Style/TrailingCommalcg/trailing_comma
chefstyle -a fixed 1044 occurrances
Diffstat (limited to 'spec/unit')
100 files changed, 557 insertions, 557 deletions
diff --git a/spec/unit/api_client/registration_spec.rb b/spec/unit/api_client/registration_spec.rb index 4cf1c20eaa..6f0f552c4d 100644 --- a/spec/unit/api_client/registration_spec.rb +++ b/spec/unit/api_client/registration_spec.rb @@ -48,7 +48,7 @@ describe Chef::ApiClient::Registration do let(:server_v10_response) do { "uri" => "https://chef.local/clients/#{client_name}", - "private_key" => "--begin rsa key etc--" + "private_key" => "--begin rsa key etc--", } end @@ -73,7 +73,7 @@ describe Chef::ApiClient::Registration do "uri" => "", "chef_key" => { "public_key" => generated_public_key.to_pem - } + }, } end diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb index 810c806af5..2a3f63bde5 100644 --- a/spec/unit/api_client_spec.rb +++ b/spec/unit/api_client_spec.rb @@ -176,7 +176,7 @@ describe Chef::ApiClient do "private_key" => "monkeypants", "admin" => true, "validator" => true, - "json_class" => "Chef::ApiClient" + "json_class" => "Chef::ApiClient", } end @@ -221,7 +221,7 @@ describe Chef::ApiClient do "private_key" => "monkeypants", "admin" => true, "validator" => true, - "json_class" => "Chef::ApiClient" + "json_class" => "Chef::ApiClient", } @http_client = double("Chef::ServerAPI mock") allow(Chef::ServerAPI).to receive(:new).and_return(@http_client) diff --git a/spec/unit/api_client_v1_spec.rb b/spec/unit/api_client_v1_spec.rb index 17aba8c3af..ab55a04950 100644 --- a/spec/unit/api_client_v1_spec.rb +++ b/spec/unit/api_client_v1_spec.rb @@ -199,7 +199,7 @@ describe Chef::ApiClientV1 do "private_key" => "monkeypants", "admin" => true, "validator" => true, - "create_key" => true + "create_key" => true, } end @@ -248,7 +248,7 @@ describe Chef::ApiClientV1 do "private_key" => "monkeypants", "admin" => true, "create_key" => true, - "validator" => true + "validator" => true, } @http_client = double("Chef::ServerAPI mock") @@ -332,7 +332,7 @@ describe Chef::ApiClientV1 do { :name => "some_name", :validator => true, - :admin => true + :admin => true, } } diff --git a/spec/unit/audit/audit_event_proxy_spec.rb b/spec/unit/audit/audit_event_proxy_spec.rb index 17a5d3d771..d8c495deeb 100644 --- a/spec/unit/audit/audit_event_proxy_spec.rb +++ b/spec/unit/audit/audit_event_proxy_spec.rb @@ -128,21 +128,21 @@ describe Chef::Audit::AuditEventProxy do { :described_class => described_class, :example_group => example_group, - :line_number => line + :line_number => line, } } let(:example_group) { { :description => group_description, - :parent_example_group => parent_group + :parent_example_group => parent_group, } } let(:parent_group) { { :description => control_group_name, - :parent_example_group => nil + :parent_example_group => nil, } } @@ -155,7 +155,7 @@ describe Chef::Audit::AuditEventProxy do :resource_type => resource_type, :resource_name => resource_name, :context => context, - :line_number => line + :line_number => line, } } @@ -287,14 +287,14 @@ describe Chef::Audit::AuditEventProxy do let(:parent_group) { { :description => outer_group_description, - :parent_example_group => control_group + :parent_example_group => control_group, } } let(:control_group) { { :description => control_group_name, - :parent_example_group => nil + :parent_example_group => nil, } } diff --git a/spec/unit/audit/audit_reporter_spec.rb b/spec/unit/audit/audit_reporter_spec.rb index 1a8cee1cd5..f9f03c9620 100644 --- a/spec/unit/audit/audit_reporter_spec.rb +++ b/spec/unit/audit/audit_reporter_spec.rb @@ -284,7 +284,7 @@ EOM let(:ordered_control_groups) { { "foo" => control_group_foo, - "bar" => control_group_bar + "bar" => control_group_bar, } } diff --git a/spec/unit/audit/control_group_data_spec.rb b/spec/unit/audit/control_group_data_spec.rb index e21ab066fd..3705fafbe7 100644 --- a/spec/unit/audit/control_group_data_spec.rb +++ b/spec/unit/audit/control_group_data_spec.rb @@ -178,7 +178,7 @@ describe Chef::Audit::ControlGroupData do :resource_type => resource_type, :resource_name => resource_name, :context => context, - :line_number => line_number + :line_number => line_number, } } diff --git a/spec/unit/chef_fs/config_spec.rb b/spec/unit/chef_fs/config_spec.rb index c9cf756dc0..145cdf2d12 100644 --- a/spec/unit/chef_fs/config_spec.rb +++ b/spec/unit/chef_fs/config_spec.rb @@ -67,8 +67,8 @@ describe Chef::ChefFS::Config do node_path: "/base_path/nodes", role_path: "/base_path/roles", user_path: "/base_path/users", - policy_path: "/base_path/policies" - }) + policy_path: "/base_path/policies", + },) end let(:chef_fs_config) { Chef::ChefFS::Config.new(chef_config, Dir.pwd) } diff --git a/spec/unit/chef_fs/data_handler/group_handler_spec.rb b/spec/unit/chef_fs/data_handler/group_handler_spec.rb index 5f14646602..6e71fa3b10 100644 --- a/spec/unit/chef_fs/data_handler/group_handler_spec.rb +++ b/spec/unit/chef_fs/data_handler/group_handler_spec.rb @@ -38,7 +38,7 @@ describe Chef::ChefFS::DataHandler::GroupDataHandler do { 'name' => 'worker_bees', 'clients' => %w(honey sting), 'users' => %w(fizz buzz), - 'actors' => %w(honey) + 'actors' => %w(honey), } end @@ -46,11 +46,11 @@ describe Chef::ChefFS::DataHandler::GroupDataHandler do { 'actors' => { 'users' => %w(fizz buzz), 'clients'=> %w(honey sting), - 'groups'=> [] + 'groups'=> [], }, 'groupname' => 'workers', 'name' => 'worker_bees', - 'orgname' => 'hive' + 'orgname' => 'hive', } end diff --git a/spec/unit/chef_fs/diff_spec.rb b/spec/unit/chef_fs/diff_spec.rb index 71605393f3..284a7a5ab7 100644 --- a/spec/unit/chef_fs/diff_spec.rb +++ b/spec/unit/chef_fs/diff_spec.rb @@ -44,7 +44,7 @@ describe 'diff', :uses_diff => true do :sub_a_only_dir => { :subsub => nil }, :sub_a_only_file => nil, :sub_dir_in_a_file_in_b => {}, - :sub_file_in_a_dir_in_b => nil + :sub_file_in_a_dir_in_b => nil, }, :both_files => nil, :both_files_different => "a\n", @@ -56,7 +56,7 @@ describe 'diff', :uses_diff => true do :a_only_dir => { :subsub => nil }, :a_only_file => nil, :dir_in_a_file_in_b => {}, - :file_in_a_dir_in_b => nil + :file_in_a_dir_in_b => nil, }, /cannot_be_in_a/) } let(:b) { @@ -71,7 +71,7 @@ describe 'diff', :uses_diff => true do :sub_b_only_dir => { :subsub => nil }, :sub_b_only_file => nil, :sub_dir_in_a_file_in_b => nil, - :sub_file_in_a_dir_in_b => {} + :sub_file_in_a_dir_in_b => {}, }, :both_files => nil, :both_files_different => "b\n", @@ -83,7 +83,7 @@ describe 'diff', :uses_diff => true do :b_only_dir => { :subsub => nil }, :b_only_file => nil, :dir_in_a_file_in_b => nil, - :file_in_a_dir_in_b => {} + :file_in_a_dir_in_b => {}, }, /cannot_be_in_b/) } it 'Chef::ChefFS::CommandLine.diff_print(/)' do @@ -295,7 +295,7 @@ CONTEXT_LINE_NUMBERS "b/b_only_dir\n", "b/b_only_file\n", "b/dir_in_a_file_in_b\n", - "b/file_in_a_dir_in_b\n" + "b/file_in_a_dir_in_b\n", ]) end it 'Chef::ChefFS::CommandLine.diff_print(/) in name-status mode' do @@ -321,7 +321,7 @@ CONTEXT_LINE_NUMBERS "A\tb/b_only_dir\n", "A\tb/b_only_file\n", "T\tb/dir_in_a_file_in_b\n", - "T\tb/file_in_a_dir_in_b\n" + "T\tb/file_in_a_dir_in_b\n", ]) end end diff --git a/spec/unit/chef_fs/file_system_spec.rb b/spec/unit/chef_fs/file_system_spec.rb index 75ca4d4be9..a765be61db 100644 --- a/spec/unit/chef_fs/file_system_spec.rb +++ b/spec/unit/chef_fs/file_system_spec.rb @@ -60,15 +60,15 @@ describe Chef::ChefFS::FileSystem do :a => { :aa => { :c => '', - :zz => '' + :zz => '', }, :ab => { - :c => '', - } + :c => '' + }, }, :x => '', - :y => {} - }) + :y => {}, + },) } context 'list' do it '/**' do diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index 633632b58c..48b0b2a059 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -203,7 +203,7 @@ describe Chef::Cookbook::Metadata do :version => "0.6.0", :source_url => "http://example.com", :issues_url => "http://example.com/issues", - :privacy => true + :privacy => true, } params.sort { |a,b| a.to_s <=> b.to_s }.each do |field, field_value| describe field do @@ -434,7 +434,7 @@ describe Chef::Cookbook::Metadata do it "should allow you set a grouping" do group = { "title" => "MySQL Tuning", - "description" => "Setting from the my.cnf file that allow you to tune your mysql server" + "description" => "Setting from the my.cnf file that allow you to tune your mysql server", } expect(metadata.grouping("/db/mysql/databases/tuning", group)).to eq(group) end @@ -470,7 +470,7 @@ describe Chef::Cookbook::Metadata do "default" => [ ], "source_url" => "http://example.com", "issues_url" => "http://example.com/issues", - "privacy" => true + "privacy" => true, } expect(metadata.attribute("/db/mysql/databases", attrs)).to eq(attrs) end @@ -654,7 +654,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "string", :choice => [ "test1", "test2" ], - :default => "test1" + :default => "test1", } expect { metadata.attribute("test_cookbook/test", options) @@ -663,7 +663,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "boolean", :choice => [ true, false ], - :default => true + :default => true, } expect { metadata.attribute("test_cookbook/test", options) @@ -672,7 +672,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "numeric", :choice => [ 1337, 420 ], - :default => 1337 + :default => 1337, } expect { metadata.attribute("test_cookbook/test", options) @@ -681,7 +681,7 @@ describe Chef::Cookbook::Metadata do options = { :type => "numeric", :choice => [ true, "false" ], - :default => false + :default => false, } expect { metadata.attribute("test_cookbook/test", options) @@ -692,14 +692,14 @@ describe Chef::Cookbook::Metadata do expect { attrs = { :calculated => true, - :default => [ "I thought you said calculated" ] + :default => [ "I thought you said calculated" ], } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) expect { attrs = { :calculated => true, - :default => "I thought you said calculated" + :default => "I thought you said calculated", } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) @@ -709,14 +709,14 @@ describe Chef::Cookbook::Metadata do expect { attrs = { :choice => [ "a", "b", "c"], - :default => "b" + :default => "b", } metadata.attribute("db/mysql/databases", attrs) }.not_to raise_error expect { attrs = { :choice => [ "a", "b", "c", "d", "e"], - :default => ["b", "d"] + :default => ["b", "d"], } metadata.attribute("db/mysql/databases", attrs) }.not_to raise_error @@ -726,14 +726,14 @@ describe Chef::Cookbook::Metadata do expect { attrs = { :choice => [ "a", "b", "c"], - :default => "d" + :default => "d", } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) expect { attrs = { :choice => [ "a", "b", "c", "d", "e"], - :default => ["b", "z"] + :default => ["b", "z"], } metadata.attribute("db/mysql/databases", attrs) }.to raise_error(ArgumentError) diff --git a/spec/unit/cookbook_loader_spec.rb b/spec/unit/cookbook_loader_spec.rb index 7234183a11..8d4413105d 100644 --- a/spec/unit/cookbook_loader_spec.rb +++ b/spec/unit/cookbook_loader_spec.rb @@ -25,7 +25,7 @@ describe Chef::CookbookLoader do let(:repo_paths) do [ File.expand_path(File.join(CHEF_SPEC_DATA, "kitchen")), - File.expand_path(File.join(CHEF_SPEC_DATA, "cookbooks")) + File.expand_path(File.join(CHEF_SPEC_DATA, "cookbooks")), ] end @@ -179,7 +179,7 @@ describe Chef::CookbookLoader do [ File.join(CHEF_SPEC_DATA, "kitchen"), File.join(CHEF_SPEC_DATA, "cookbooks"), - File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo") + File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo"), ] end @@ -245,7 +245,7 @@ describe Chef::CookbookLoader do [ File.join(CHEF_SPEC_DATA, "kitchen"), File.join(CHEF_SPEC_DATA, "cookbooks"), - File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo") + File.join(CHEF_SPEC_DATA, "invalid-metadata-chef-repo"), ] end diff --git a/spec/unit/cookbook_site_streaming_uploader_spec.rb b/spec/unit/cookbook_site_streaming_uploader_spec.rb index 0041a142dc..07069810dd 100644 --- a/spec/unit/cookbook_site_streaming_uploader_spec.rb +++ b/spec/unit/cookbook_site_streaming_uploader_spec.rb @@ -108,7 +108,7 @@ describe Chef::CookbookSiteStreamingUploader do it "should be able to receive strings to attach as argument" do Chef::CookbookSiteStreamingUploader.make_request(:put, @uri, 'bill', @secret_filename, { - :mystring => 'Lorem ipsum', + :mystring => 'Lorem ipsum' }) end diff --git a/spec/unit/cookbook_uploader_spec.rb b/spec/unit/cookbook_uploader_spec.rb index a08b6b29d0..b74d08f620 100644 --- a/spec/unit/cookbook_uploader_spec.rb +++ b/spec/unit/cookbook_uploader_spec.rb @@ -97,7 +97,7 @@ describe Chef::CookbookUploader do upload_headers = { "content-type" => "application/x-binary", "content-md5" => an_instance_of(String), - "accept" => "application/json" + "accept" => "application/json", } expect(http_client).to receive(:put). diff --git a/spec/unit/cookbook_version_file_specificity_spec.rb b/spec/unit/cookbook_version_file_specificity_spec.rb index 73b10899d4..ff79573113 100644 --- a/spec/unit/cookbook_version_file_specificity_spec.rb +++ b/spec/unit/cookbook_version_file_specificity_spec.rb @@ -30,31 +30,31 @@ describe Chef::CookbookVersion, "file specificity" do :name => "afile.rb", :path => "files/host-examplehost.example.org/afile.rb", :checksum => "csum-host", - :specificity => "host-examplehost.example.org" + :specificity => "host-examplehost.example.org", }, { :name => "afile.rb", :path => "files/ubuntu-9.10/afile.rb", :checksum => "csum-platver-full", - :specificity => "ubuntu-9.10" + :specificity => "ubuntu-9.10", }, { :name => "afile.rb", :path => "files/newubuntu-9/afile.rb", :checksum => "csum-platver-partial", - :specificity => "newubuntu-9" + :specificity => "newubuntu-9", }, { :name => "afile.rb", :path => "files/ubuntu/afile.rb", :checksum => "csum-plat", - :specificity => "ubuntu" + :specificity => "ubuntu", }, { :name => "afile.rb", :path => "files/default/afile.rb", :checksum => "csum-default", - :specificity => "default" + :specificity => "default", }, # for different/odd platform_versions @@ -62,25 +62,25 @@ describe Chef::CookbookVersion, "file specificity" do :name => "bfile.rb", :path => "files/fakeos-2.0.rc.1/bfile.rb", :checksum => "csum2-platver-full", - :specificity => "fakeos-2.0.rc.1" + :specificity => "fakeos-2.0.rc.1", }, { :name => "bfile.rb", :path => "files/newfakeos-2.0.rc/bfile.rb", :checksum => "csum2-platver-partial", - :specificity => "newfakeos-2.0.rc" + :specificity => "newfakeos-2.0.rc", }, { :name => "bfile.rb", :path => "files/fakeos-maple tree/bfile.rb", :checksum => "csum3-platver-full", - :specificity => "maple tree" + :specificity => "maple tree", }, { :name => "bfile.rb", :path => "files/fakeos-1/bfile.rb", :checksum => "csum4-platver-full", - :specificity => "fakeos-1" + :specificity => "fakeos-1", }, # directory adirectory @@ -88,114 +88,114 @@ describe Chef::CookbookVersion, "file specificity" do :name => "anotherfile1.rb", :path => "files/host-examplehost.example.org/adirectory/anotherfile1.rb.host", :checksum => "csum-host-1", - :specificity => "host-examplehost.example.org" + :specificity => "host-examplehost.example.org", }, { :name => "anotherfile2.rb", :path => "files/host-examplehost.example.org/adirectory/anotherfile2.rb.host", :checksum => "csum-host-2", - :specificity => "host-examplehost.example.org" + :specificity => "host-examplehost.example.org", }, { :name => "anotherfile1.rb", :path => "files/ubuntu-9.10/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum-platver-full-1", - :specificity => "ubuntu-9.10" + :specificity => "ubuntu-9.10", }, { :name => "anotherfile2.rb", :path => "files/ubuntu-9.10/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum-platver-full-2", - :specificity => "ubuntu-9.10" + :specificity => "ubuntu-9.10", }, { :name => "anotherfile1.rb", :path => "files/newubuntu-9/adirectory/anotherfile1.rb.platform-partial-version", :checksum => "csum-platver-partial-1", - :specificity => "newubuntu-9" + :specificity => "newubuntu-9", }, { :name => "anotherfile2.rb", :path => "files/newubuntu-9/adirectory/anotherfile2.rb.platform-partial-version", :checksum => "csum-platver-partial-2", - :specificity => "nweubuntu-9" + :specificity => "nweubuntu-9", }, { :name => "anotherfile1.rb", :path => "files/ubuntu/adirectory/anotherfile1.rb.platform", :checksum => "csum-plat-1", - :specificity => "ubuntu" + :specificity => "ubuntu", }, { :name => "anotherfile2.rb", :path => "files/ubuntu/adirectory/anotherfile2.rb.platform", :checksum => "csum-plat-2", - :specificity => "ubuntu" + :specificity => "ubuntu", }, { :name => "anotherfile1.rb", :path => "files/default/adirectory/anotherfile1.rb.default", :checksum => "csum-default-1", - :specificity => "default" + :specificity => "default", }, { :name => "anotherfile2.rb", :path => "files/default/adirectory/anotherfile2.rb.default", :checksum => "csum-default-2", - :specificity => "default" + :specificity => "default", }, # for different/odd platform_versions { :name => "anotherfile1.rb", :path => "files/fakeos-2.0.rc.1/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum2-platver-full-1", - :specificity => "fakeos-2.0.rc.1" + :specificity => "fakeos-2.0.rc.1", }, { :name => "anotherfile2.rb", :path => "files/fakeos-2.0.rc.1/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum2-platver-full-2", - :specificity => "fakeos-2.0.rc.1" + :specificity => "fakeos-2.0.rc.1", }, { :name => "anotherfile1.rb", :path => "files/newfakeos-2.0.rc.1/adirectory/anotherfile1.rb.platform-partial-version", :checksum => "csum2-platver-partial-1", - :specificity => "newfakeos-2.0.rc" + :specificity => "newfakeos-2.0.rc", }, { :name => "anotherfile2.rb", :path => "files/newfakeos-2.0.rc.1/adirectory/anotherfile2.rb.platform-partial-version", :checksum => "csum2-platver-partial-2", - :specificity => "newfakeos-2.0.rc" + :specificity => "newfakeos-2.0.rc", }, { :name => "anotherfile1.rb", :path => "files/fakeos-maple tree/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum3-platver-full-1", - :specificity => "fakeos-maple tree" + :specificity => "fakeos-maple tree", }, { :name => "anotherfile2.rb", :path => "files/fakeos-maple tree/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum3-platver-full-2", - :specificity => "fakeos-maple tree" + :specificity => "fakeos-maple tree", }, { :name => "anotherfile1.rb", :path => "files/fakeos-1/adirectory/anotherfile1.rb.platform-full-version", :checksum => "csum4-platver-full-1", - :specificity => "fakeos-1" + :specificity => "fakeos-1", }, { :name => "anotherfile2.rb", :path => "files/fakeos-1/adirectory/anotherfile2.rb.platform-full-version", :checksum => "csum4-platver-full-2", - :specificity => "fakeos-1" + :specificity => "fakeos-1", }, ] } diff --git a/spec/unit/cookbook_version_spec.rb b/spec/unit/cookbook_version_spec.rb index 2bccddcaec..e248267eab 100644 --- a/spec/unit/cookbook_version_spec.rb +++ b/spec/unit/cookbook_version_spec.rb @@ -249,7 +249,7 @@ describe Chef::CookbookVersion do ["1.2", "1.3.0"], ["1.2", "1.3"], ["1.2", "2.1.1"], - ["1.2", "2.1"] + ["1.2", "2.1"], ] examples.each do |smaller, larger| sm = Chef::CookbookVersion.new("foo", '/tmp/blah') diff --git a/spec/unit/dsl/data_query_spec.rb b/spec/unit/dsl/data_query_spec.rb index b93ae1f1d6..7bca47af3e 100644 --- a/spec/unit/dsl/data_query_spec.rb +++ b/spec/unit/dsl/data_query_spec.rb @@ -65,8 +65,8 @@ describe Chef::DSL::DataQuery do "greeting" => "hello", "nested" => { "a1" => [1, 2, 3], - "a2" => { "b1" => true } - } + "a2" => { "b1" => true }, + }, }} let(:item) do diff --git a/spec/unit/dsl/platform_introspection_spec.rb b/spec/unit/dsl/platform_introspection_spec.rb index e41560c034..438dde126e 100644 --- a/spec/unit/dsl/platform_introspection_spec.rb +++ b/spec/unit/dsl/platform_introspection_spec.rb @@ -42,7 +42,7 @@ describe Chef::DSL::PlatformIntrospection::PlatformDependentValue do :openbsd => {:default => 'free, functional, secure'}, [:redhat, :centos, :fedora, :scientific] => {:default => '"stable"'}, :ubuntu => {'10.04' => 'using upstart more', :default => 'using init more'}, - :default => 'bork da bork' + :default => 'bork da bork', } @platform_specific_value = Chef::DSL::PlatformIntrospection::PlatformDependentValue.new(platform_hash) end @@ -91,7 +91,7 @@ describe Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue do [:rhel, "fedora"] => "redhatty value", "suse" => @array_values, :gentoo => "gentoo value", - :default => "default value" + :default => "default value", } @platform_family_value = Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue.new(@platform_family_hash) diff --git a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb index 1e2b2a85e8..1090f46745 100644 --- a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +++ b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb @@ -44,8 +44,8 @@ describe Chef::EncryptedDataBagItem::CheckEncrypted do "greeting" => "hello", "nested" => { "a1" => [1, 2, 3], - "a2" => { "b1" => true } - } + "a2" => { "b1" => true }, + }, }} let(:version) { 1 } diff --git a/spec/unit/encrypted_data_bag_item_spec.rb b/spec/unit/encrypted_data_bag_item_spec.rb index b4d75d2480..26501684c8 100644 --- a/spec/unit/encrypted_data_bag_item_spec.rb +++ b/spec/unit/encrypted_data_bag_item_spec.rb @@ -323,7 +323,7 @@ describe Chef::EncryptedDataBagItem do let(:plaintext_data) {{ "id" => "item_name", "greeting" => "hello", - "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }} + "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }}, }} let(:secret) { "abc123SECRET" } let(:encoded_data) { subject.encrypt_data_bag_item(plaintext_data, secret) } diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index 4116150d6e..4a8f94e770 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -106,7 +106,7 @@ describe Chef::Environment do @cookbook_versions = { "apt" => "= 1.0.0", "god" => "= 2.0.0", - "apache2" => "= 4.2.0" + "apache2" => "= 4.2.0", } end @@ -221,10 +221,10 @@ describe Chef::Environment do "cookbook_versions" => { "apt" => "= 1.2.3", "god" => ">= 4.2.0", - "apache2" => "= 2.0.0" + "apache2" => "= 2.0.0", }, "json_class" => "Chef::Environment", - "chef_type" => "environment" + "chef_type" => "environment", } @environment = Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(@data)) end @@ -245,7 +245,7 @@ describe Chef::Environment do @cookbook_versions = { "apt" => "= 1.0.0", "god" => "= 2.0.0", - "apache2" => "= 4.2.0" + "apache2" => "= 4.2.0", } end @@ -422,7 +422,7 @@ describe Chef::Environment do }, "json_class" => "Chef::Environment", "description" => "desc", - "chef_type" => "environment" + "chef_type" => "environment", } expect(IO).to receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(Chef::JSONCompat.to_json(environment_hash)) environment = Chef::Environment.load('foo') diff --git a/spec/unit/exceptions_spec.rb b/spec/unit/exceptions_spec.rb index 85c54aa693..c738bcf840 100644 --- a/spec/unit/exceptions_spec.rb +++ b/spec/unit/exceptions_spec.rb @@ -67,7 +67,7 @@ describe Chef::Exceptions do Chef::Exceptions::InvalidEnvironmentPath => ArgumentError, Chef::Exceptions::EnvironmentNotFound => RuntimeError, Chef::Exceptions::InvalidVersionConstraint => ArgumentError, - Chef::Exceptions::IllegalVersionConstraint => NotImplementedError + Chef::Exceptions::IllegalVersionConstraint => NotImplementedError, } exception_to_super_class.each do |exception, expected_super_class| diff --git a/spec/unit/formatters/doc_spec.rb b/spec/unit/formatters/doc_spec.rb index 7266afc320..b0be913304 100644 --- a/spec/unit/formatters/doc_spec.rb +++ b/spec/unit/formatters/doc_spec.rb @@ -34,9 +34,9 @@ describe Chef::Formatters::Base do "recipe[apt::default]", "recipe[java::default]", "recipe[jenkins::master]", - "recipe[policyfile_demo::default]" + "recipe[policyfile_demo::default]", ], - "cookbook_locks"=> { } + "cookbook_locks"=> { }, } formatter.policyfile_loaded(minimal_policyfile) diff --git a/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb b/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb index b8c2de2b8b..6f90ea0b27 100644 --- a/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +++ b/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb @@ -37,7 +37,7 @@ describe Chef::Formatters::APIErrorFormatting do { "min_version" => min_version, "max_version" => max_version, - "request_version" => request_version + "request_version" => request_version, } } 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 3c8d5dfa29..6cea22680b 100644 --- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb @@ -63,7 +63,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do [ "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'", "/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'", - "/home/someuser/.multiruby/gems/chef/lib/chef/client.rb:123:in `run'" + "/home/someuser/.multiruby/gems/chef/lib/chef/client.rb:123:in `run'", ] end @@ -122,7 +122,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do let(:trace) do [ "/tmp/kitchen/cache/cookbooks/foo/recipes/default.rb:2:in `block in from_file'", - "/tmp/kitchen/cache/cookbooks/foo/recipes/default.rb:1:in `from_file'" + "/tmp/kitchen/cache/cookbooks/foo/recipes/default.rb:1:in `from_file'", ] end @@ -148,7 +148,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:229:in `block in foreach_cookbook_load_segment'", "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:227:in `each'", "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:227:in `foreach_cookbook_load_segment'", - "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:137:in `load_libraries'" + "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:137:in `load_libraries'", ] end @@ -199,7 +199,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do "C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/application.rb:70:in `run'", "C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/bin/chef-client:26:in `<top (required)>'", "C:/opscode/chef/bin/chef-client:19:in `load'", - "C:/opscode/chef/bin/chef-client:19:in `<main>'" + "C:/opscode/chef/bin/chef-client:19:in `<main>'", ] end diff --git a/spec/unit/http/basic_client_spec.rb b/spec/unit/http/basic_client_spec.rb index b7552f54aa..16f62f8d97 100644 --- a/spec/unit/http/basic_client_spec.rb +++ b/spec/unit/http/basic_client_spec.rb @@ -89,7 +89,7 @@ describe "HTTP Connection" do { "https_proxy" => "https://proxy.mycorp.com:8080", "https_proxy_user" => "jane_username", - "https_proxy_pass" => "opensesame" + "https_proxy_pass" => "opensesame", } end diff --git a/spec/unit/http/validate_content_length_spec.rb b/spec/unit/http/validate_content_length_spec.rb index 79bd539af3..16eede1859 100644 --- a/spec/unit/http/validate_content_length_spec.rb +++ b/spec/unit/http/validate_content_length_spec.rb @@ -157,7 +157,7 @@ describe Chef::HTTP::ValidateContentLength do let(:response_headers) { { "content-length" => content_length_value, - "transfer-encoding" => "chunked" + "transfer-encoding" => "chunked", } } diff --git a/spec/unit/key_spec.rb b/spec/unit/key_spec.rb index 66f5fb9b13..64601cfbab 100644 --- a/spec/unit/key_spec.rb +++ b/spec/unit/key_spec.rb @@ -443,12 +443,12 @@ EOS actor_type => "foobar", "name" => key.name, "create_key" => true, - "expiration_date" => key.expiration_date + "expiration_date" => key.expiration_date, } $expected_input = { "name" => key.name, "create_key" => true, - "expiration_date" => key.expiration_date + "expiration_date" => key.expiration_date, } end @@ -534,8 +534,8 @@ EOS key.create_key true allow(rest).to receive(:put).with(url, key.to_hash).and_return({ "key" => "key_name", - "public_key" => public_key_string - }) + "public_key" => public_key_string, + },) end diff --git a/spec/unit/knife/client_create_spec.rb b/spec/unit/knife/client_create_spec.rb index a1dcc564e2..9066505dfd 100644 --- a/spec/unit/knife/client_create_spec.rb +++ b/spec/unit/knife/client_create_spec.rb @@ -29,7 +29,7 @@ describe Chef::Knife::ClientCreate do { "name" => "adam", "validator" => false, - "admin" => false + "admin" => false, } end diff --git a/spec/unit/knife/client_edit_spec.rb b/spec/unit/knife/client_edit_spec.rb index ad56d9212d..75b0ef8c92 100644 --- a/spec/unit/knife/client_edit_spec.rb +++ b/spec/unit/knife/client_edit_spec.rb @@ -33,7 +33,7 @@ describe Chef::Knife::ClientEdit do "validator" => false, "admin" => false, "chef_type" => "client", - "create_key" => true + "create_key" => true, } } diff --git a/spec/unit/knife/cookbook_create_spec.rb b/spec/unit/knife/cookbook_create_spec.rb index 3354432d39..8619c8f64b 100644 --- a/spec/unit/knife/cookbook_create_spec.rb +++ b/spec/unit/knife/cookbook_create_spec.rb @@ -56,7 +56,7 @@ describe Chef::Knife::CookbookCreate do @dir = Dir.tmpdir @knife.config = { :cookbook_path => @dir, - :cookbook_copyright => "Opscode, Inc" + :cookbook_copyright => "Opscode, Inc", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -71,7 +71,7 @@ describe Chef::Knife::CookbookCreate do @knife.config = { :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", - :cookbook_email => "nuo@opscode.com" + :cookbook_email => "nuo@opscode.com", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -87,7 +87,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "apachev2" + :cookbook_license => "apachev2", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "apachev2") @@ -103,7 +103,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => false + :cookbook_license => false, } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -119,7 +119,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "false" + :cookbook_license => "false", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none") @@ -135,7 +135,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "gplv2" + :cookbook_license => "gplv2", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv2") @@ -151,7 +151,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "gplv3" + :cookbook_license => "gplv3", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv3") @@ -167,7 +167,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_path => @dir, :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", - :cookbook_license => "mit" + :cookbook_license => "mit", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -184,7 +184,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "rdoc" + :readme_format => "rdoc", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -201,7 +201,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "mkd" + :readme_format => "mkd", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -218,7 +218,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "txt" + :readme_format => "txt", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") @@ -235,7 +235,7 @@ describe Chef::Knife::CookbookCreate do :cookbook_copyright => "Opscode, Inc", :cookbook_email => "nuo@opscode.com", :cookbook_license => "mit", - :readme_format => "foo" + :readme_format => "foo", } @knife.name_args=["foobar"] expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit") diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb index 8b85e52b75..64b754d173 100644 --- a/spec/unit/knife/cookbook_download_spec.rb +++ b/spec/unit/knife/cookbook_download_spec.rb @@ -52,18 +52,18 @@ describe Chef::Knife::CookbookDownload do {'path' => 'recipes/foo.rb', 'url' => 'http://example.org/files/foo.rb'}, {'path' => 'recipes/bar.rb', - 'url' => 'http://example.org/files/bar.rb'} + 'url' => 'http://example.org/files/bar.rb'}, ], :templates => [ {'path' => 'templates/default/foo.erb', 'url' => 'http://example.org/files/foo.erb'}, {'path' => 'templates/default/bar.erb', - 'url' => 'http://example.org/files/bar.erb'} + 'url' => 'http://example.org/files/bar.erb'}, ], :attributes => [ {'path' => 'attributes/default.rb', - 'url' => 'http://example.org/files/default.rb'} - ] + 'url' => 'http://example.org/files/default.rb'}, + ], } @cookbook_mock = double('cookbook') diff --git a/spec/unit/knife/cookbook_metadata_spec.rb b/spec/unit/knife/cookbook_metadata_spec.rb index 861d85f1f7..bd54d4278b 100644 --- a/spec/unit/knife/cookbook_metadata_spec.rb +++ b/spec/unit/knife/cookbook_metadata_spec.rb @@ -57,7 +57,7 @@ describe Chef::Knife::CookbookMetadata do @bar.version = '2.0.0' @cookbook_loader = { "foo" => @foo, - "bar" => @bar + "bar" => @bar, } expect(@cookbook_loader).to receive(:load_cookbooks).and_return(@cookbook_loader) expect(@knife).to receive(:generate_metadata).with('foo') @@ -123,7 +123,7 @@ describe Chef::Knife::CookbookMetadata do end { Chef::Exceptions::ObsoleteDependencySyntax => 'obsolote dependency', - Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint' + Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint', }.each_pair do |klass, description| it "should print an error and exit when an #{description} syntax exception is encountered" do exception = klass.new("#{description} blah") @@ -157,7 +157,7 @@ describe Chef::Knife::CookbookMetadata do end { Chef::Exceptions::ObsoleteDependencySyntax => 'obsolote dependency', - Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint' + Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint', }.each_pair do |klass, description| it "should print an error and exit when an #{description} syntax exception is encountered" do expect(File).to receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json"). diff --git a/spec/unit/knife/cookbook_show_spec.rb b/spec/unit/knife/cookbook_show_spec.rb index a06e53b9a1..6c77db013f 100644 --- a/spec/unit/knife/cookbook_show_spec.rb +++ b/spec/unit/knife/cookbook_show_spec.rb @@ -49,8 +49,8 @@ describe Chef::Knife::CookbookShow do "versions" => [ { "version" => "0.10.0", "url" => "http://url/cookbooks/cookbook_name/0.10.0" }, { "version" => "0.9.0", "url" => "http://url/cookbookx/cookbook_name/0.9.0" }, - { "version" => "0.8.0", "url" => "http://url/cookbooks/cookbook_name/0.8.0" } - ] + { "version" => "0.8.0", "url" => "http://url/cookbooks/cookbook_name/0.8.0" }, + ], } } end @@ -92,8 +92,8 @@ describe Chef::Knife::CookbookShow do :name => "default.rb", :path => "recipes/default.rb", :checksum => "1234", - :url => "http://example.org/files/default.rb" - } + :url => "http://example.org/files/default.rb", + }, ] } @cookbook_response.manifest = @manifest @@ -117,8 +117,8 @@ describe Chef::Knife::CookbookShow do :name => "default.rb", :path => "recipes/default.rb", :checksum => "1234", - :url => "http://example.org/files/default.rb" - } + :url => "http://example.org/files/default.rb", + }, ] } @response = "Example recipe text" @@ -143,28 +143,28 @@ describe Chef::Knife::CookbookShow do :path => "files/host-examplehost.example.org/afile.rb", :checksum => "1111", :specificity => "host-examplehost.example.org", - :url => "http://example.org/files/1111" + :url => "http://example.org/files/1111", }, { :name => "afile.rb", :path => "files/ubuntu-9.10/afile.rb", :checksum => "2222", :specificity => "ubuntu-9.10", - :url => "http://example.org/files/2222" + :url => "http://example.org/files/2222", }, { :name => "afile.rb", :path => "files/ubuntu/afile.rb", :checksum => "3333", :specificity => "ubuntu", - :url => "http://example.org/files/3333" + :url => "http://example.org/files/3333", }, { :name => "afile.rb", :path => "files/default/afile.rb", :checksum => "4444", :specificity => "default", - :url => "http://example.org/files/4444" + :url => "http://example.org/files/4444", }, ] } diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb index 1b2ffd10fb..14ade10e09 100644 --- a/spec/unit/knife/cookbook_site_share_spec.rb +++ b/spec/unit/knife/cookbook_site_share_spec.rb @@ -55,13 +55,13 @@ describe Chef::Knife::CookbookSiteShare do allow(@knife).to receive(:do_upload).and_return(true) @category_response = { "name" => "cookbook_name", - "category" => "Testing Category" + "category" => "Testing Category", } @bad_category_response = { "error_code" => "NOT_FOUND", "error_messages" => [ "Resource does not exist." - ] + ], } end diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb index fb94886cad..ecee34f308 100644 --- a/spec/unit/knife/cookbook_upload_spec.rb +++ b/spec/unit/knife/cookbook_upload_spec.rb @@ -134,7 +134,7 @@ E { 'test_cookbook1' => Chef::CookbookVersion.new('test_cookbook1', '/tmp/blah'), 'test_cookbook2' => Chef::CookbookVersion.new('test_cookbook2', '/tmp/blah'), - 'test_cookbook3' => Chef::CookbookVersion.new('test_cookbook3', '/tmp/blah') + 'test_cookbook3' => Chef::CookbookVersion.new('test_cookbook3', '/tmp/blah'), } end diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index ac44e2915f..1d93f64e32 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -26,7 +26,7 @@ describe Chef::Knife::Core::BootstrapContext do { :validation_key => File.join(CHEF_SPEC_DATA, 'ssl', 'private_key.pem'), :chef_server_url => 'http://chef.example.com:4444', - :validation_client_name => 'chef-validator-testing' + :validation_client_name => 'chef-validator-testing', } end diff --git a/spec/unit/knife/core/gem_glob_loader_spec.rb b/spec/unit/knife/core/gem_glob_loader_spec.rb index 465eea2656..89de9f98e4 100644 --- a/spec/unit/knife/core/gem_glob_loader_spec.rb +++ b/spec/unit/knife/core/gem_glob_loader_spec.rb @@ -47,7 +47,7 @@ describe Chef::Knife::SubcommandLoader::GemGlobLoader do gems = [ double('knife-ec2-0.5.12') ] gem_files = [ '/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_base.rb', - '/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_otherstuff.rb' + '/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_otherstuff.rb', ] expect($LOAD_PATH).to receive(:map).and_return([]) if Gem::Specification.respond_to? :latest_specs @@ -135,7 +135,7 @@ describe Chef::Knife::SubcommandLoader::GemGlobLoader do # `SubcommandLoader::MATCHES_CHEF_GEM` should make it clear why we want # to test these two cases. "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-bar-1.0.0/lib/chef/knife/chef-bar.rb", - "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb" + "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb", ] end @@ -153,7 +153,7 @@ describe Chef::Knife::SubcommandLoader::GemGlobLoader do "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-foo-#{Chef::VERSION}/lib/chef/knife/chef-foo.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/foo-chef-#{Chef::VERSION}/lib/chef/knife/foo-chef.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-bar-1.0.0/lib/chef/knife/chef-bar.rb", - "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb" + "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb", ] end diff --git a/spec/unit/knife/core/hashed_command_loader_spec.rb b/spec/unit/knife/core/hashed_command_loader_spec.rb index 00e7ba377b..1a6c2f42b7 100644 --- a/spec/unit/knife/core/hashed_command_loader_spec.rb +++ b/spec/unit/knife/core/hashed_command_loader_spec.rb @@ -27,7 +27,7 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do "_autogenerated_command_paths" => { "plugins_paths" => { "cool_a" => ["/file/for/plugin/a"], - "cooler_b" => ["/file/for/plugin/b"] + "cooler_b" => ["/file/for/plugin/b"], }, "plugins_by_category" => { "cool" => [ @@ -35,8 +35,8 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do ], "cooler" => [ "cooler_b" - ] - } + ], + }, } } } diff --git a/spec/unit/knife/core/object_loader_spec.rb b/spec/unit/knife/core/object_loader_spec.rb index 67fa858029..0b572cc1f0 100644 --- a/spec/unit/knife/core/object_loader_spec.rb +++ b/spec/unit/knife/core/object_loader_spec.rb @@ -41,7 +41,7 @@ describe Chef::Knife::Core::ObjectLoader do { 'nodes' => Chef::Node, 'roles' => Chef::Role, - 'environments' => Chef::Environment + 'environments' => Chef::Environment, }.each do |repo_location, chef_class| describe "when the file is a #{chef_class}" do diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb index ab420518a3..2c3b067e4f 100644 --- a/spec/unit/knife/core/ui_spec.rb +++ b/spec/unit/knife/core/ui_spec.rb @@ -405,8 +405,8 @@ EOM "versions" => [ { "version" => "3.0.0", "url" => "http://url/cookbooks/3.0.0" }, { "version" => "2.0.0", "url" => "http://url/cookbooks/2.0.0" }, - { "version" => "1.0.0", "url" => "http://url/cookbooks/1.0.0" } - ] + { "version" => "1.0.0", "url" => "http://url/cookbooks/1.0.0" }, + ], } } end diff --git a/spec/unit/knife/data_bag_from_file_spec.rb b/spec/unit/knife/data_bag_from_file_spec.rb index dc65a3e64c..ddf877d9f7 100644 --- a/spec/unit/knife/data_bag_from_file_spec.rb +++ b/spec/unit/knife/data_bag_from_file_spec.rb @@ -75,7 +75,7 @@ describe Chef::Knife::DataBagFromFile do let(:plain_data) { { "id" => "item_name", "greeting" => "hello", - "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }} + "nested" => { "a1" => [1, 2, 3], "a2" => { "b1" => true }}, } } let(:enc_data) { Chef::EncryptedDataBagItem.encrypt_data_bag_item(plain_data, secret) } diff --git a/spec/unit/knife/environment_compare_spec.rb b/spec/unit/knife/environment_compare_spec.rb index 81ec19d7af..14dc5c52cf 100644 --- a/spec/unit/knife/environment_compare_spec.rb +++ b/spec/unit/knife/environment_compare_spec.rb @@ -24,14 +24,14 @@ describe Chef::Knife::EnvironmentCompare do @environments = { "cita" => "http://localhost:4000/environments/cita", - "citm" => "http://localhost:4000/environments/citm" + "citm" => "http://localhost:4000/environments/citm", } allow(@knife).to receive(:environment_list).and_return(@environments) @constraints = { "cita" => { "foo" => "= 1.0.1", "bar" => "= 0.0.4" }, - "citm" => { "foo" => "= 1.0.1", "bar" => "= 0.0.2" } + "citm" => { "foo" => "= 1.0.1", "bar" => "= 0.0.2" }, } allow(@knife).to receive(:constraint_list).and_return(@constraints) diff --git a/spec/unit/knife/environment_list_spec.rb b/spec/unit/knife/environment_list_spec.rb index 6488a073b6..1d5462257d 100644 --- a/spec/unit/knife/environment_list_spec.rb +++ b/spec/unit/knife/environment_list_spec.rb @@ -28,7 +28,7 @@ describe Chef::Knife::EnvironmentList do @environments = { "production" => "http://localhost:4000/environments/production", "development" => "http://localhost:4000/environments/development", - "testing" => "http://localhost:4000/environments/testing" + "testing" => "http://localhost:4000/environments/testing", } allow(Chef::Environment).to receive(:list).and_return @environments end diff --git a/spec/unit/knife/index_rebuild_spec.rb b/spec/unit/knife/index_rebuild_spec.rb index d8a0dd72d7..6c1ff7b98e 100644 --- a/spec/unit/knife/index_rebuild_spec.rb +++ b/spec/unit/knife/index_rebuild_spec.rb @@ -93,7 +93,7 @@ describe Chef::Knife::IndexRebuild do let(:api_info) do {"flavor" => "osc", "version" => "11.0.0", - "erchef" => "1.2.3" + "erchef" => "1.2.3", } end let(:server_specific_stubs!) do diff --git a/spec/unit/knife/key_create_spec.rb b/spec/unit/knife/key_create_spec.rb index 5998e10274..039dba7a44 100644 --- a/spec/unit/knife/key_create_spec.rb +++ b/spec/unit/knife/key_create_spec.rb @@ -125,7 +125,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo actor_field_name => "charmander", "public_key" => public_key, "expiration_date" => valid_expiration_date, - "key_name" => key_name + "key_name" => key_name, } } before do @@ -144,7 +144,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "public_key" => public_key + "public_key" => public_key, } } before do @@ -162,7 +162,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo { actor_field_name => "charmander", "name" => "charmander-key", - "create_key" => true + "create_key" => true, } } before do @@ -180,7 +180,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo { actor_field_name => "charmander", "public_key" => public_key, - "private_key" => "super_private" + "private_key" => "super_private", } } diff --git a/spec/unit/knife/key_edit_spec.rb b/spec/unit/knife/key_edit_spec.rb index 538b91de2d..06b31ce71c 100644 --- a/spec/unit/knife/key_edit_spec.rb +++ b/spec/unit/knife/key_edit_spec.rb @@ -130,7 +130,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "name" => new_keyname + "name" => new_keyname, } } before do @@ -161,7 +161,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo actor_field_name => "charmander", "public_key" => public_key, "name" => new_keyname, - "expiration_date" => "infinity" + "expiration_date" => "infinity", } } before do @@ -181,7 +181,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "create_key" => true + "create_key" => true, } } @@ -200,7 +200,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo let(:expected_hash) { { actor_field_name => "charmander", - "public_key" => public_key + "public_key" => public_key, } } before do @@ -219,7 +219,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo { actor_field_name => "charmander", "public_key" => public_key, - "private_key" => "super_private" + "private_key" => "super_private", } } diff --git a/spec/unit/knife/key_list_spec.rb b/spec/unit/knife/key_list_spec.rb index aabe02ac02..775a7cdfb1 100644 --- a/spec/unit/knife/key_list_spec.rb +++ b/spec/unit/knife/key_list_spec.rb @@ -195,7 +195,7 @@ describe Chef::Knife::KeyList do [ {"uri"=>"https://api.opscode.piab/users/charmander/keys/non-expired1", "name"=>"non-expired1", "expired"=>false}, {"uri"=>"https://api.opscode.piab/users/charmander/keys/non-expired2", "name"=>"non-expired2", "expired"=>false}, - {"uri"=>"https://api.opscode.piab/users/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true} + {"uri"=>"https://api.opscode.piab/users/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true}, ] } end @@ -208,7 +208,7 @@ describe Chef::Knife::KeyList do [ {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/charmander/keys/non-expired1", "name"=>"non-expired1", "expired"=>false}, {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/charmander/keys/non-expired2", "name"=>"non-expired2", "expired"=>false}, - {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true} + {"uri"=>"https://api.opscode.piab/organizations/pokemon/clients/mary/keys/out-of-date", "name"=>"out-of-date", "expired"=>true}, ] } end diff --git a/spec/unit/knife/key_show_spec.rb b/spec/unit/knife/key_show_spec.rb index 5a0d839e4f..f4923ef235 100644 --- a/spec/unit/knife/key_show_spec.rb +++ b/spec/unit/knife/key_show_spec.rb @@ -83,7 +83,7 @@ describe Chef::Knife::KeyShow do actor_field_name => "charmander", "name" => "charmander-key", "public_key" => "some-public-key", - "expiration_date" => "infinity" + "expiration_date" => "infinity", } } diff --git a/spec/unit/knife/node_edit_spec.rb b/spec/unit/knife/node_edit_spec.rb index 58e2da2a1c..be42a15ee7 100644 --- a/spec/unit/knife/node_edit_spec.rb +++ b/spec/unit/knife/node_edit_spec.rb @@ -32,7 +32,7 @@ describe Chef::Knife::NodeEdit do @knife.config = { :editor => 'cat', :attribute => nil, - :print_after => nil + :print_after => nil, } @knife.name_args = [ "adam" ] @node = Chef::Node.new() diff --git a/spec/unit/knife/node_list_spec.rb b/spec/unit/knife/node_list_spec.rb index 71edea78f7..ec694cb040 100644 --- a/spec/unit/knife/node_list_spec.rb +++ b/spec/unit/knife/node_list_spec.rb @@ -26,7 +26,7 @@ describe Chef::Knife::NodeList do allow(@knife).to receive(:output).and_return(true) @list = { "foo" => "http://example.com/foo", - "bar" => "http://example.com/foo" + "bar" => "http://example.com/foo", } allow(Chef::Node).to receive(:list).and_return(@list) allow(Chef::Node).to receive(:list_by_environment).and_return(@list) diff --git a/spec/unit/knife/role_list_spec.rb b/spec/unit/knife/role_list_spec.rb index 808a04d204..65c4f94ff2 100644 --- a/spec/unit/knife/role_list_spec.rb +++ b/spec/unit/knife/role_list_spec.rb @@ -25,7 +25,7 @@ describe Chef::Knife::RoleList do allow(@knife).to receive(:output).and_return(true) @list = { "foo" => "http://example.com/foo", - "bar" => "http://example.com/foo" + "bar" => "http://example.com/foo", } allow(Chef::Role).to receive(:list).and_return(@list) end diff --git a/spec/unit/knife/ssh_spec.rb b/spec/unit/knife/ssh_spec.rb index 723280bead..197dc4ca77 100644 --- a/spec/unit/knife/ssh_spec.rb +++ b/spec/unit/knife/ssh_spec.rb @@ -71,7 +71,7 @@ describe Chef::Knife::Ssh do configure_query([@node_foo, @node_bar]) expect(@knife).to receive(:session_from_list).with([ ['foo.example.org', nil], - ['bar.example.org', nil] + ['bar.example.org', nil], ]) @knife.configure_session end @@ -87,7 +87,7 @@ describe Chef::Knife::Ssh do configure_query([@node_foo, @node_bar]) expect(@knife).to receive(:session_from_list).with([ ['ec2-10-0-0-1.compute-1.amazonaws.com', nil], - ['ec2-10-0-0-2.compute-1.amazonaws.com', nil] + ['ec2-10-0-0-2.compute-1.amazonaws.com', nil], ]) @knife.configure_session end @@ -105,7 +105,7 @@ describe Chef::Knife::Ssh do configure_query([@node_foo, @node_bar]) expect(@knife).to receive(:session_from_list).with([ ['foo.example.org', nil], - ['bar.example.org', nil] + ['bar.example.org', nil], ]) @knife.configure_session end diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb index c2127fdfd5..55b4f5c88a 100644 --- a/spec/unit/knife_spec.rb +++ b/spec/unit/knife_spec.rb @@ -156,7 +156,7 @@ describe Chef::Knife do "Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3", 'X-Chef-Version' => Chef::VERSION, "Host"=>"api.opscode.piab", - "X-REMOTE-REQUEST-ID"=>request_id + "X-REMOTE-REQUEST-ID"=>request_id, }} let(:request_id) {"1234"} diff --git a/spec/unit/mixin/api_version_request_handling_spec.rb b/spec/unit/mixin/api_version_request_handling_spec.rb index cc5340e424..fc42d76d72 100644 --- a/spec/unit/mixin/api_version_request_handling_spec.rb +++ b/spec/unit/mixin/api_version_request_handling_spec.rb @@ -54,7 +54,7 @@ describe Chef::Mixin::ApiVersionRequestHandling do let(:return_hash) { { "min_version" => min_server_version, - "max_version" => max_server_version + "max_version" => max_server_version, } } diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 3724bbf583..99d5230a75 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -63,7 +63,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => String } - } + }, ) }.not_to raise_error @@ -74,7 +74,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => Array } - } + }, ) }.to raise_error(ArgumentError) end @@ -87,7 +87,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :required => true } - } + }, ) }.not_to raise_error @@ -98,7 +98,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :required => true } - } + }, ) }.to raise_error(ArgumentError) @@ -109,7 +109,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :required => false } - } + }, ) }.not_to raise_error end @@ -122,7 +122,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => "validate" } - } + }, ) }.not_to raise_error @@ -133,7 +133,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => "monkey" } - } + }, ) }.to raise_error(ArgumentError) end @@ -146,7 +146,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => ["validate", "music"] } - } + }, ) }.not_to raise_error @@ -157,7 +157,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :respond_to => ["monkey", "validate"] } - } + }, ) }.to raise_error(ArgumentError) end @@ -168,7 +168,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :default => "is the loneliest number" } - }) + },) expect(arguments[:one]).to eq("is the loneliest number") end @@ -180,7 +180,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :regex => /^is good$/ } - } + }, ) }.not_to raise_error @@ -191,7 +191,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :regex => /^is bad$/ } - } + }, ) }.to raise_error(ArgumentError) end @@ -205,10 +205,10 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be equal to is good" => lambda { |a| a == "is good" - }, + } } } - } + }, ) }.not_to raise_error @@ -220,10 +220,10 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be equal to 'is good'" => lambda { |a| a == "is good" - }, + } } } - } + }, ) }.to raise_error(ArgumentError) end @@ -243,14 +243,14 @@ describe Chef::Mixin::ParamsValidate do a == "is good" } }, - :required => true + :required => true, }, :two => { :kind_of => String, - :required => false + :required => false, }, - :three => { :default => "neato mosquito" } - } + :three => { :default => "neato mosquito" }, + }, ) }.not_to raise_error expect(args[:three]).to eq("neato mosquito") @@ -267,14 +267,14 @@ describe Chef::Mixin::ParamsValidate do a == "is good" } }, - :required => true + :required => true, }, :two => { :kind_of => Hash, - :required => false + :required => false, }, - :three => { :default => "neato mosquito" } - } + :three => { :default => "neato mosquito" }, + }, ) }.to raise_error(ArgumentError) end @@ -286,7 +286,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :busted => "check" } - } + }, ) }.to raise_error(ArgumentError) end @@ -305,7 +305,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => [ String, Array ] } - } + }, ) }.not_to raise_error expect { @@ -315,7 +315,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => [ String, Array ] } - } + }, ) }.not_to raise_error expect { @@ -325,7 +325,7 @@ describe Chef::Mixin::ParamsValidate do :one => { :kind_of => [ String, Array ] } - } + }, ) }.to raise_error(ArgumentError) end diff --git a/spec/unit/mixin/powershell_out_spec.rb b/spec/unit/mixin/powershell_out_spec.rb index 0fede582fa..79faf8127d 100644 --- a/spec/unit/mixin/powershell_out_spec.rb +++ b/spec/unit/mixin/powershell_out_spec.rb @@ -31,7 +31,7 @@ describe Chef::Mixin::PowershellOut do ret = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - {} + {}, ).and_return(ret) expect(object.powershell_out("Get-Process")).to eql(ret) end @@ -40,7 +40,7 @@ describe Chef::Mixin::PowershellOut do ret = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - timeout: 600 + timeout: 600, ).and_return(ret) expect(object.powershell_out("Get-Process", timeout: 600)).to eql(ret) end @@ -51,7 +51,7 @@ describe Chef::Mixin::PowershellOut do mixlib_shellout = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - {} + {}, ).and_return(mixlib_shellout) expect(mixlib_shellout).to receive(:error!) expect(object.powershell_out!("Get-Process")).to eql(mixlib_shellout) @@ -61,7 +61,7 @@ describe Chef::Mixin::PowershellOut do mixlib_shellout = double("Mixlib::ShellOut") expect(object).to receive(:shell_out).with( "powershell.exe #{flags} -Command \"Get-Process\"", - timeout: 600 + timeout: 600, ).and_return(mixlib_shellout) expect(mixlib_shellout).to receive(:error!) expect(object.powershell_out!("Get-Process", timeout: 600)).to eql(mixlib_shellout) diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb index beaf624ddb..c22d45e5fd 100644 --- a/spec/unit/mixin/shell_out_spec.rb +++ b/spec/unit/mixin/shell_out_spec.rb @@ -143,8 +143,8 @@ describe Chef::Mixin::ShellOut do 'LC_ALL' => Chef::Config[:internal_locale], 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], - }, - }).and_return(true) + } + },).and_return(true) shell_out_obj.shell_out(cmd, options) end @@ -156,8 +156,8 @@ describe Chef::Mixin::ShellOut do 'LC_ALL' => Chef::Config[:internal_locale], 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], - }, - }).and_return(true) + } + },).and_return(true) shell_out_obj.shell_out(cmd, options) expect(options[:environment].has_key?('LC_ALL')).to be false end @@ -185,7 +185,7 @@ describe Chef::Mixin::ShellOut do 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], } - }).and_return(true) + },).and_return(true) shell_out_obj.shell_out(cmd, options) end @@ -198,7 +198,7 @@ describe Chef::Mixin::ShellOut do 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], } - }).and_return(true) + },).and_return(true) shell_out_obj.shell_out(cmd, options) expect(options[:env].has_key?('LC_ALL')).to be false end @@ -214,7 +214,7 @@ describe Chef::Mixin::ShellOut do 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], }, - }).and_return(true) + },).and_return(true) shell_out_obj.shell_out(cmd, options) end end @@ -227,8 +227,8 @@ describe Chef::Mixin::ShellOut do 'LC_ALL' => Chef::Config[:internal_locale], 'LANG' => Chef::Config[:internal_locale], 'LANGUAGE' => Chef::Config[:internal_locale], - }, - }).and_return(true) + } + },).and_return(true) shell_out_obj.shell_out(cmd) end end diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb index 250b8c630c..9956ef1ec9 100644 --- a/spec/unit/node/attribute_spec.rb +++ b/spec/unit/node/attribute_spec.rb @@ -188,7 +188,7 @@ describe Chef::Node::Attribute do "os_version"=>"9.7.0", "hostname"=>"latte", "macaddress"=>"00:23:6c:7f:67:6c", - "music" => { "jimmy_eat_world" => "nice", "apophis" => false } + "music" => { "jimmy_eat_world" => "nice", "apophis" => false }, } @default_hash = { "domain" => "opscode.com", @@ -198,8 +198,8 @@ describe Chef::Node::Attribute do "mastodon" => "rocks", "mars_volta" => "is loud and nutty", "deeper" => { "gates_of_ishtar" => nil }, - "this" => {"apparatus" => {"must" => "be unearthed"}} - } + "this" => {"apparatus" => {"must" => "be unearthed"}}, + }, } @override_hash = { "macaddress" => "00:00:00:00:00:00", @@ -207,7 +207,7 @@ describe Chef::Node::Attribute do "fire" => "still burn", "music" => { "mars_volta" => "cicatriz" - } + }, } @automatic_hash = {"week" => "friday"} @attributes = Chef::Node::Attribute.new(@attribute_hash, @default_hash, @override_hash, @automatic_hash) @@ -272,7 +272,7 @@ describe Chef::Node::Attribute do ["role_override", "role_override"], ["env_override", "env_override"], ["force_override", "force_override"], - ["automatic", "automatic"] + ["automatic", "automatic"], ] expect(@attributes.debug_value(:foo, :bar)).to eq(expected) end @@ -592,17 +592,17 @@ describe Chef::Node::Attribute do { "one" => { "two" => "three" }, "hut" => { "two" => "three" }, - "place" => { } + "place" => { }, }, { "one" => { "four" => "five" }, - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => { "six" => "seven" }, - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -644,13 +644,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -682,13 +682,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -718,13 +718,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -754,13 +754,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -798,13 +798,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) @empty = Chef::Node::Attribute.new({}, {}, {}, {}) end @@ -832,13 +832,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -852,7 +852,7 @@ describe Chef::Node::Attribute do "one" => "six", "hut" => "three", "snakes" => "on a plane", - "snack" => "cookies" + "snack" => "cookies", }.each do |k,v| expect(@attributes.fetch(k)).to eq(v) end @@ -889,13 +889,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -934,13 +934,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -975,13 +975,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -1011,13 +1011,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) end @@ -1046,7 +1046,7 @@ describe Chef::Node::Attribute do ["hut", "three"], ["one", "six"], ["snack", "cookies"], - ["snakes", "on a plane"] + ["snakes", "on a plane"], ] ) end @@ -1061,13 +1061,13 @@ describe Chef::Node::Attribute do }, { "one" => "four", - "snakes" => "on a plane" + "snakes" => "on a plane", }, { "one" => "six", - "snack" => "cookies" + "snack" => "cookies", }, - {} + {}, ) @empty = Chef::Node::Attribute.new({},{},{},{}) @@ -1117,11 +1117,11 @@ describe Chef::Node::Attribute do it "should output merged attributes" do default_hash = { "a" => 1, - "b" => 2 + "b" => 2, } override_hash = { "b" => 3, - "c" => 4 + "c" => 4, } attributes = Chef::Node::Attribute.new(nil, default_hash, override_hash, nil) expect(attributes.to_s).to eq('{"a"=>1, "b"=>3, "c"=>4}') diff --git a/spec/unit/node/immutable_collections_spec.rb b/spec/unit/node/immutable_collections_spec.rb index d0ec81c7f7..73165c1fba 100644 --- a/spec/unit/node/immutable_collections_spec.rb +++ b/spec/unit/node/immutable_collections_spec.rb @@ -24,7 +24,7 @@ describe Chef::Node::ImmutableMash do @data_in = {:top => {:second_level => "some value"}, "top_level_2" => %w[array of values], :top_level_3 => [{:hash_array => 1, :hash_array_b => 2}], - :top_level_4 => {:level2 => {:key => "value"}} + :top_level_4 => {:level2 => {:key => "value"}}, } @immutable_mash = Chef::Node::ImmutableMash.new(@data_in) end @@ -94,7 +94,7 @@ describe Chef::Node::ImmutableMash do :reject!, :replace, :select!, - :shift + :shift, ].each do |mutator| it "doesn't allow mutation via `#{mutator}'" do expect { @immutable_mash.send(mutator) }.to raise_error @@ -151,7 +151,7 @@ describe Chef::Node::ImmutableArray do :sort!, :sort_by!, :uniq!, - :unshift + :unshift, ].each do |mutator| it "does not allow mutation via `#{mutator}" do expect { @immutable_array.send(mutator)}.to raise_error diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index d7cee80d40..39ef684f31 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -438,13 +438,13 @@ describe Chef::Node do context "with real arrays" do before do node.role_default["mysql"]["server"] = [ { - "port" => 1234, + "port" => 1234 } ] node.normal["mysql"]["server"] = [ { - "port" => 2345, + "port" => 2345 } ] node.override["mysql"]["server"] = [ { - "port" => 3456, + "port" => 3456 } ] end @@ -610,12 +610,12 @@ describe Chef::Node do node.force_default["mysql"]["server"]["port"] = 2345 node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql", - }) + "data_dir" => "/my_raid_volume/lib/mysql" + },) end it "removes all values from the precedence level when setting" do @@ -624,14 +624,14 @@ describe Chef::Node do node.force_default["mysql"]["server"]["port"] = 3456 node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["port"] ).to be_nil expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql", - }) + "data_dir" => "/my_raid_volume/lib/mysql" + },) end it "higher precedence levels are not removed" do @@ -641,7 +641,7 @@ describe Chef::Node do node.override["mysql"]["server"]["service_name"] = "fancypants-sql" node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["port"] ).to be_nil @@ -649,12 +649,12 @@ describe Chef::Node do expect( node["mysql"]["server"] ).to eql({ "service_name" => "fancypants-sql", "data_dir" => "/my_raid_volume/lib/mysql", - }) + },) end it "will autovivify" do node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") end @@ -666,7 +666,7 @@ describe Chef::Node do node.default["mysql"]["server"]["service_name"] = "fancypants-sql" node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["port"] ).to be_nil @@ -674,14 +674,14 @@ describe Chef::Node do expect( node["mysql"]["server"] ).to eql({ "service_name" => "fancypants-sql", "data_dir" => "/my_raid_volume/lib/mysql", - }) + },) end it "when overwriting a non-hash/array" do node.override["mysql"] = false node.force_override["mysql"] = true node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") end @@ -689,11 +689,11 @@ describe Chef::Node do it "when overwriting an array with a hash" do node.force_override["mysql"][0] = true node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql", + "data_dir" => "/my_raid_volume/lib/mysql" } expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql", - }) + "data_dir" => "/my_raid_volume/lib/mysql" + },) end end @@ -1359,21 +1359,21 @@ describe Chef::Node do it "should only save whitelisted attributes (and subattributes)" do Chef::Config[:automatic_attribute_whitelist] = [ ["filesystem", "/dev/disk0s2"], - "network/interfaces/eth0" + "network/interfaces/eth0", ] data = { "automatic" => { "filesystem" => { "/dev/disk0s2" => { "size" => "10mb" }, - "map - autohome" => { "size" => "10mb" } + "map - autohome" => { "size" => "10mb" }, }, "network" => { "interfaces" => { "eth0" => {}, - "eth1" => {} + "eth1" => {}, } - } + }, }, "default" => {}, "normal" => {}, "override" => {} } @@ -1387,7 +1387,7 @@ describe Chef::Node do "interfaces" => { "eth0" => {} } - } + }, }, "default" => {}, "normal" => {}, "override" => {} } @@ -1407,11 +1407,11 @@ describe Chef::Node do "default" => { "foo" => { "bar" => { - "baz" => false, + "baz" => false }, "other" => { - "stuff" => true, - } + "stuff" => true + }, } } } @@ -1420,7 +1420,7 @@ describe Chef::Node do "default" => { "foo" => { "bar" => { - "baz" => false, + "baz" => false } } } @@ -1439,7 +1439,7 @@ describe Chef::Node do "automatic" => { "filesystem" => { "/dev/disk0s2" => { "size" => "10mb" }, - "map - autohome" => { "size" => "10mb" } + "map - autohome" => { "size" => "10mb" }, } }, "default" => {}, "normal" => {}, "override" => {} diff --git a/spec/unit/platform_spec.rb b/spec/unit/platform_spec.rb index 34b46f657f..d16294a8aa 100644 --- a/spec/unit/platform_spec.rb +++ b/spec/unit/platform_spec.rb @@ -38,20 +38,20 @@ describe Chef::Platform do }, "9.2.2" => { :file => "darwinian", - :else => "thing" + :else => "thing", }, :default => { :file => "old school", - :snicker => "snack" - } + :snicker => "snack", + }, }, :mars_volta => { }, :default => { :file => Chef::Provider::File, :pax => "brittania", - :cat => "nice" - } + :cat => "nice", + }, } @events = Chef::EventDispatch::Dispatcher.new end @@ -183,18 +183,18 @@ describe Chef::Platform do :platform => :darwin, :version => "9.2.2", :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:darwin]["9.2.2"][:file]).to eql("masterful") Chef::Platform.set( :platform => :darwin, :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:darwin][:default][:file]).to eql("masterful") Chef::Platform.set( :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:default][:file]).to eql("masterful") @@ -202,13 +202,13 @@ describe Chef::Platform do :platform => :hero, :version => "9.2.2", :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:hero]["9.2.2"][:file]).to eql("masterful") Chef::Platform.set( :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:default][:file]).to eql("masterful") @@ -216,7 +216,7 @@ describe Chef::Platform do Chef::Platform.set( :resource => :file, - :provider => "masterful" + :provider => "masterful", ) expect(Chef::Platform.platforms[:default][:file]).to eql("masterful") @@ -230,7 +230,7 @@ describe Chef::Platform do Chef::Platform.set( :resource => :file, :platform => :default, - :provider => "new school" + :provider => "new school", ) expect(Chef::Platform.platforms[:default][:file]).to eql("new school") expect(Chef::Platform.platforms[:default][:cat]).to eql("nice") diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb index 3dfa8d9802..98515a4102 100644 --- a/spec/unit/policy_builder/policyfile_spec.rb +++ b/spec/unit/policy_builder/policyfile_spec.rb @@ -56,8 +56,8 @@ describe Chef::PolicyBuilder::Policyfile do "scm_identifier"=> { "vcs"=> "git", "rev_id"=> "9d5b09026470c322c3cb5ca8a4157c4d2f16cef3", - "remote"=> nil - } + "remote"=> nil, + }, } end @@ -67,7 +67,7 @@ describe Chef::PolicyBuilder::Policyfile do "version" => "4.2.0", # NOTE: for compatibility mode we include the dotted id in the policyfile to enhance discoverability. "dotted_decimal_identifier" => id_to_dotted("feab40e1fca77c7360ccca1481bb8ba5f919ce3a"), - "source" => { "api" => "https://community.getchef.com/api/v1/cookbooks/example2" } + "source" => { "api" => "https://community.getchef.com/api/v1/cookbooks/example2" }, } end @@ -85,11 +85,11 @@ describe Chef::PolicyBuilder::Policyfile do "cookbook_locks" => { "example1" => example1_lock_data, - "example2" => example2_lock_data + "example2" => example2_lock_data, }, "default_attributes" => policyfile_default_attributes, - "override_attributes" => policyfile_override_attributes + "override_attributes" => policyfile_override_attributes, } end @@ -286,7 +286,7 @@ describe Chef::PolicyBuilder::Policyfile do it "extracts the cookbooks and versions for display from the policyfile" do expected = [ "example1::default@2.3.5 (168d210)", - "example2::server@4.2.0 (feab40e)" + "example2::server@4.2.0 (feab40e)", ] expect(policy_builder.run_list_with_versions_for_display).to eq(expected) @@ -357,7 +357,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:json_attribs) do { "policy_name" => "policy_name_from_node_json", - "policy_group" => "policy_group_from_node_json" + "policy_group" => "policy_group_from_node_json", } end @@ -378,7 +378,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:extra_chef_config) do { policy_name: "policy_name_from_config", - policy_group: "policy_group_from_config" + policy_group: "policy_group_from_config", } end @@ -419,7 +419,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:extra_chef_config) do { policy_name: "policy_name_from_config", - policy_group: "policy_group_from_config" + policy_group: "policy_group_from_config", } end @@ -435,7 +435,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:json_attribs) do { "policy_name" => "policy_name_from_node_json", - "policy_group" => "policy_group_from_node_json" + "policy_group" => "policy_group_from_node_json", } end @@ -465,7 +465,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:json_attribs) do { "policy_name" => "policy_name_from_node_json", - "policy_group" => "policy_group_from_node_json" + "policy_group" => "policy_group_from_node_json", } end @@ -480,7 +480,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:extra_chef_config) do { policy_name: "policy_name_from_config", - policy_group: "policy_group_from_config" + policy_group: "policy_group_from_config", } end diff --git a/spec/unit/property/state_spec.rb b/spec/unit/property/state_spec.rb index e7fee0387f..032b0aba52 100644 --- a/spec/unit/property/state_spec.rb +++ b/spec/unit/property/state_spec.rb @@ -91,7 +91,7 @@ describe "Chef::Resource#identity and #state" do resource.y 'bar' expect(resource_class.state_properties).to eq [ resource_class.properties[:x], - resource_class.properties[:y] + resource_class.properties[:y], ] expect(resource.state_for_resource_reporter).to eq(x: 'foo', y: 'bar') end @@ -141,7 +141,7 @@ describe "Chef::Resource#identity and #state" do it "The subclass's identity includes both x and y" do expect(subresource_class.identity_properties).to eq [ subresource_class.properties[:x], - subresource_class.properties[:y] + subresource_class.properties[:y], ] subresource.x 'foo' subresource.y 'bar' @@ -162,7 +162,7 @@ describe "Chef::Resource#identity and #state" do expect(subresource.state_for_resource_reporter).to eq(x: 'foo', y: 'bar') expect(subresource_class.state_properties).to eq [ subresource_class.properties[:x], - subresource_class.properties[:y] + subresource_class.properties[:y], ] end it "y is the identity" do @@ -304,7 +304,7 @@ describe "Chef::Resource#identity and #state" do expect(resource_class.state_properties).to eq [ resource_class.properties[:x], resource_class.properties[:y], - resource_class.properties[:z] + resource_class.properties[:z], ] expect(resource.state_for_resource_reporter).to eq(x: 1, y: 2, z: 3) end @@ -323,7 +323,7 @@ describe "Chef::Resource#identity and #state" do resource.z 3 expect(resource_class.state_properties).to eq [ resource_class.properties[:x], - resource_class.properties[:z] + resource_class.properties[:z], ] expect(resource.state_for_resource_reporter).to eq(x: 1, z: 3) end diff --git a/spec/unit/property/validation_spec.rb b/spec/unit/property/validation_spec.rb index a54a38eb85..fef983ccf4 100644 --- a/spec/unit/property/validation_spec.rb +++ b/spec/unit/property/validation_spec.rb @@ -464,7 +464,7 @@ describe "Chef::Resource.property validation" do validation_test 'respond_to: [ :to_s, :split ]', [ 'hi' ], - [ 1, ], + [ 1 ], [ nil ] validation_test 'respond_to: []', diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb index 3af35a17ca..8a55025d9e 100644 --- a/spec/unit/provider/execute_spec.rb +++ b/spec/unit/provider/execute_spec.rb @@ -33,7 +33,7 @@ describe Chef::Provider::Execute do timeout: 3600, returns: 0, log_level: :info, - log_tag: new_resource.to_s + log_tag: new_resource.to_s, } end diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index 0106244665..41536a450f 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -224,7 +224,7 @@ SHAS { :user => deploy_user, :environment => { "GIT_SSH" => wrapper, "HOME" => "/home/deployNinja" }, - :log_tag => "git[web2.0 app]" + :log_tag => "git[web2.0 app]", } end before do @@ -254,7 +254,7 @@ SHAS { :user => deploy_user, :environment => { "GIT_SSH" => wrapper, "HOME" => "/home/masterNinja" }, - :log_tag => "git[web2.0 app]" + :log_tag => "git[web2.0 app]", } end before do diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb index a11d790d07..6c4c4d2e07 100644 --- a/spec/unit/provider/group/usermod_spec.rb +++ b/spec/unit/provider/group/usermod_spec.rb @@ -52,7 +52,7 @@ describe Chef::Provider::Group::Usermod do "suse" => "-a -G", "opensuse" => "-a -G", "smartos" => "-G", - "omnios" => "-G" + "omnios" => "-G", } before do diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb index b36bfe364b..55a2f97aa5 100644 --- a/spec/unit/provider/group_spec.rb +++ b/spec/unit/provider/group_spec.rb @@ -39,7 +39,7 @@ describe Chef::Provider::User do @pw_group = double("Struct::Group", :name => "wheel", :gid => 20, - :mem => [ "root", "aj" ] + :mem => [ "root", "aj" ], ) allow(Etc).to receive(:getgrnam).with('wheel').and_return(@pw_group) end diff --git a/spec/unit/provider/ohai_spec.rb b/spec/unit/provider/ohai_spec.rb index 45688cedb7..4072487f35 100644 --- a/spec/unit/provider/ohai_spec.rb +++ b/spec/unit/provider/ohai_spec.rb @@ -38,8 +38,8 @@ describe Chef::Provider::Ohai do }, :data2 => { :origdata => "somevalue", - :newdata => "somevalue" - } + :newdata => "somevalue", + }, } allow(mock_ohai).to receive(:all_plugins).and_return(true) allow(mock_ohai).to receive(:data).and_return(mock_ohai[:data], diff --git a/spec/unit/provider/osx_profile_spec.rb b/spec/unit/provider/osx_profile_spec.rb index 85f9d56e16..2e87faeb48 100644 --- a/spec/unit/provider/osx_profile_spec.rb +++ b/spec/unit/provider/osx_profile_spec.rb @@ -67,7 +67,7 @@ describe Chef::Provider::OsxProfile do "ProfileType"=>"Configuration", "ProfileUUID"=>"6e95927c-f200-54b4-85c7-52ab99b61c47", "ProfileVerificationState"=>"unsigned", - "ProfileVersion"=>1}], + "ProfileVersion"=>1}] } end # If anything is changed within this profile, be sure to update the @@ -95,14 +95,14 @@ describe Chef::Provider::OsxProfile do 'Forced' => [ { 'mcx_preference_settings' => { - 'idleTime' => 0, + 'idleTime' => 0 } - } + }, ] } - } - } - ] + }, + }, + ], } end let(:no_profiles) do @@ -232,7 +232,7 @@ describe Chef::Provider::OsxProfile do "ProfileType"=>"Configuration", "ProfileUUID"=>"1781fbec-3325-565f-9022-8aa28135c3cc", "ProfileVerificationState"=>"unsigned", - "ProfileVersion"=>1}], + "ProfileVersion"=>1}] } end before(:each) do diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb index 8528480689..f1845abfb1 100644 --- a/spec/unit/provider/package/apt_spec.rb +++ b/spec/unit/provider/package/apt_spec.rb @@ -52,7 +52,7 @@ irssi: it "should create a current resource with the name of the new_resource" do expect(@provider).to receive(:shell_out!).with( "apt-cache policy #{@new_resource.package_name}", - :timeout => @timeout + :timeout => @timeout, ).and_return(@shell_out) @provider.load_current_resource @@ -95,7 +95,7 @@ libmysqlclient15-dev: virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache policy libmysqlclient15-dev", - :timeout => @timeout + :timeout => @timeout, ).and_return(virtual_package) showpkg_out =<<-SHOWPKG_STDOUT Package: libmysqlclient15-dev @@ -118,7 +118,7 @@ libmysqlclient-dev 5.1.41-3ubuntu12 showpkg = double(:stdout => showpkg_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache showpkg libmysqlclient15-dev", - :timeout => @timeout + :timeout => @timeout, ).and_return(showpkg) real_package_out=<<-RPKG_STDOUT libmysqlclient-dev: @@ -136,7 +136,7 @@ libmysqlclient-dev: real_package = double(:stdout => real_package_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache policy libmysqlclient-dev", - :timeout => @timeout + :timeout => @timeout, ).and_return(real_package) @provider.load_current_resource end @@ -152,7 +152,7 @@ mp3-decoder: virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache policy mp3-decoder", - :timeout => @timeout + :timeout => @timeout, ).and_return(virtual_package) showpkg_out=<<-SHOWPKG_STDOUT Package: mp3-decoder @@ -178,7 +178,7 @@ mpg123 1.12.1-0ubuntu1 showpkg = double(:stdout => showpkg_out,:exitstatus => 0) expect(@provider).to receive(:shell_out!).with( "apt-cache showpkg mp3-decoder", - :timeout => @timeout + :timeout => @timeout, ).and_return(showpkg) expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package) end @@ -191,7 +191,7 @@ mpg123 1.12.1-0ubuntu1 allow(@new_resource).to receive(:provider).and_return(nil) expect(@provider).to receive(:shell_out!).with( "apt-cache -o APT::Default-Release=lenny-backports policy irssi", - :timeout => @timeout + :timeout => @timeout, ).and_return(@shell_out) @provider.load_current_resource end @@ -200,7 +200,7 @@ mpg123 1.12.1-0ubuntu1 @new_resource.source "pluto" expect(@provider).to receive(:shell_out!).with( "apt-cache policy #{@new_resource.package_name}", - :timeout => @timeout + :timeout => @timeout, ).and_return(@shell_out) @provider.load_current_resource @provider.define_resource_requirements @@ -220,7 +220,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!). with( "apt-get -q -y install irssi=0.8.12-7", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package("irssi", "0.8.12-7") end @@ -229,7 +229,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y --force-yes install irssi=0.8.12-7", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @new_resource.options("--force-yes") @provider.install_package("irssi", "0.8.12-7") @@ -245,7 +245,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y -o APT::Default-Release=lenny-backports install irssi=0.8.12-7", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package("irssi", "0.8.12-7") @@ -266,7 +266,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y remove irssi", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) @provider.remove_package("irssi", "0.8.12-7") end @@ -275,7 +275,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y --force-yes remove irssi", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @new_resource.options("--force-yes") @@ -289,7 +289,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y purge irssi", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.purge_package("irssi", "0.8.12-7") end @@ -298,7 +298,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y --force-yes purge irssi", :env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @new_resource.options("--force-yes") @@ -317,7 +317,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "debconf-set-selections /tmp/irssi-0.8.12-7.seed", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) @provider.preseed_package(file) @@ -327,7 +327,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "debconf-set-selections /tmp/irssi-0.8.12-7.seed", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil}, - :timeout => @timeout + :timeout => @timeout, ) file = @provider.get_preseed_file("irssi", "0.8.12-7") @provider.preseed_package(file) @@ -348,7 +348,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "dpkg-reconfigure irssi", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.reconfig_package("irssi", "0.8.12-7") end @@ -360,7 +360,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y install libmysqlclient-dev", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package("libmysqlclient-dev", "not_a_real_version") end @@ -374,7 +374,7 @@ mpg123 1.12.1-0ubuntu1 expect(@provider).to receive(:shell_out!).with( "apt-get -q -y install libmysqlclient-dev irssi=0.8.12-7", :env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil }, - :timeout => @timeout + :timeout => @timeout, ) @provider.install_package(["libmysqlclient-dev", "irssi"], ["not_a_real_version", "0.8.12-7"]) end diff --git a/spec/unit/provider/package/easy_install_spec.rb b/spec/unit/provider/package/easy_install_spec.rb index b734bc57cf..4ac325e7d4 100644 --- a/spec/unit/provider/package/easy_install_spec.rb +++ b/spec/unit/provider/package/easy_install_spec.rb @@ -63,14 +63,14 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install \"boto==1.8d\"" - }) + },) @provider.install_package("boto", "1.8d") end it "should run easy_install with the package name and version and specified options" do expect(@provider).to receive(:run_command).with({ :command => "easy_install --always-unzip \"boto==1.8d\"" - }) + },) allow(@new_resource).to receive(:options).and_return("--always-unzip") @provider.install_package("boto", "1.8d") end @@ -78,21 +78,21 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install \"boto==1.8d\"" - }) + },) @provider.upgrade_package("boto", "1.8d") end it "should run easy_install -m with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install -m boto" - }) + },) @provider.remove_package("boto", "1.8d") end it "should run easy_install -m with the package name and version and specified options" do expect(@provider).to receive(:run_command).with({ :command => "easy_install -x -m boto" - }) + },) allow(@new_resource).to receive(:options).and_return("-x") @provider.remove_package("boto", "1.8d") end @@ -100,7 +100,7 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install -m with the package name and version" do expect(@provider).to receive(:run_command).with({ :command => "easy_install -m boto" - }) + },) @provider.purge_package("boto", "1.8d") end diff --git a/spec/unit/provider/package/homebrew_spec.rb b/spec/unit/provider/package/homebrew_spec.rb index d01d455b09..926c1a0ff0 100644 --- a/spec/unit/provider/package/homebrew_spec.rb +++ b/spec/unit/provider/package/homebrew_spec.rb @@ -38,7 +38,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3', 'bottle' => false, 'devel' => nil, - 'head' => nil + 'head' => nil, }, 'revision' => 0, 'installed' => [], @@ -47,7 +47,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => nil, - 'options' => [] + 'options' => [], } end @@ -59,7 +59,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3', 'bottle' => false, 'devel' => nil, - 'head' => 'HEAD' + 'head' => 'HEAD', }, 'revision' => 0, 'installed' => [{ 'version' => '24.3' }], @@ -68,7 +68,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => '', - 'options' => [] + 'options' => [], } end @@ -80,7 +80,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3-keggy', 'bottle' => false, 'devel' => nil, - 'head' => 'HEAD' + 'head' => 'HEAD', }, 'revision' => 0, 'installed' => [{ 'version' => '24.3-keggy' }], @@ -89,7 +89,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => '', - 'options' => [] + 'options' => [], } end @@ -101,7 +101,7 @@ describe Chef::Provider::Package::Homebrew do 'stable' => '24.3-keggy', 'bottle' => false, 'devel' => nil, - 'head' => 'HEAD' + 'head' => 'HEAD', }, 'revision' => 0, 'installed' => [], @@ -110,7 +110,7 @@ describe Chef::Provider::Package::Homebrew do 'dependencies' => [], 'conflicts_with' => [], 'caveats' => '', - 'options' => [] + 'options' => [], } end diff --git a/spec/unit/provider/package/windows/exe_spec.rb b/spec/unit/provider/package/windows/exe_spec.rb index 677ab87f29..6756ffa9e0 100644 --- a/spec/unit/provider/package/windows/exe_spec.rb +++ b/spec/unit/provider/package/windows/exe_spec.rb @@ -42,7 +42,7 @@ describe Chef::Provider::Package::Windows::Exe do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => File.join("uninst_dir", "uninst_file") + 'UninstallString' => File.join("uninst_dir", "uninst_file"), }] end let(:uninstall_entry) do @@ -122,12 +122,12 @@ describe Chef::Provider::Package::Windows::Exe do [ { 'DisplayVersion' => 'v1', - 'UninstallString' => File.join("uninst_dir1", "uninst_file1") + 'UninstallString' => File.join("uninst_dir1", "uninst_file1"), }, { 'DisplayVersion' => 'v2', - 'UninstallString' => File.join("uninst_dir2", "uninst_file2") - } + 'UninstallString' => File.join("uninst_dir2", "uninst_file2"), + }, ] end diff --git a/spec/unit/provider/package/windows/msi_spec.rb b/spec/unit/provider/package/windows/msi_spec.rb index 9377dcaad9..835bd4ad19 100644 --- a/spec/unit/provider/package/windows/msi_spec.rb +++ b/spec/unit/provider/package/windows/msi_spec.rb @@ -35,7 +35,7 @@ describe Chef::Provider::Package::Windows::MSI do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => "MsiExec.exe /X{guid}" + 'UninstallString' => "MsiExec.exe /X{guid}", }] end let(:uninstall_entry) do @@ -130,12 +130,12 @@ describe Chef::Provider::Package::Windows::MSI do [ { 'DisplayVersion' => 'outdated', - 'UninstallString' => "MsiExec.exe /X{guid}" + 'UninstallString' => "MsiExec.exe /X{guid}", }, { 'DisplayVersion' => 'really_outdated', - 'UninstallString' => "MsiExec.exe /X{guid2}" - } + 'UninstallString' => "MsiExec.exe /X{guid2}", + }, ] end diff --git a/spec/unit/provider/package/windows_spec.rb b/spec/unit/provider/package/windows_spec.rb index 6952a91d92..200cc9888a 100644 --- a/spec/unit/provider/package/windows_spec.rb +++ b/spec/unit/provider/package/windows_spec.rb @@ -171,7 +171,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => "blah blah" + 'UninstallString' => "blah blah", }] end let(:uninstall_key) { "blah" } @@ -192,7 +192,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => "MsiExec.exe /X{guid}" + 'UninstallString' => "MsiExec.exe /X{guid}", }] end @@ -205,7 +205,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:uninstall_hash) do [{ 'DisplayVersion' => 'outdated', - 'UninstallString' => %q{"c:/hfhfheru/uninst.exe"} + 'UninstallString' => %q{"c:/hfhfheru/uninst.exe"}, }] end diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb index 41118b70fb..70ab257a54 100644 --- a/spec/unit/provider/package/yum_spec.rb +++ b/spec/unit/provider/package/yum_spec.rb @@ -36,7 +36,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :allow_multi_install => [ "kernel" ], :package_repository => "base", - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -172,7 +172,7 @@ describe Chef::Provider::Package::Yum do allow(@yum_cache).to receive(:package_available?) { |pkg| pkg == 'cups' ? true : false } allow(@yum_cache).to receive(:packages_from_require) do |pkg| [Chef::Provider::Package::Yum::RPMDbPackage.new("cups", "1.2.4-11.18.el5_2.3", "noarch", [], false, true, "base"), - Chef::Provider::Package::Yum::RPMDbPackage.new("cups", "1.2.4-11.18.el5_2.2", "noarch", [], false, true, "base"),] + Chef::Provider::Package::Yum::RPMDbPackage.new("cups", "1.2.4-11.18.el5_2.2", "noarch", [], false, true, "base")] end expect(Chef::Log).to receive(:debug).exactly(1).times.with(%r{checking yum info}) expect(Chef::Log).to receive(:debug).exactly(1).times.with(%r{installed version}) @@ -320,7 +320,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "2.0.1.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) } @@ -395,7 +395,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "2.0.1.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -417,7 +417,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -440,7 +440,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "2.0.1.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -465,7 +465,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -485,7 +485,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -510,7 +510,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5", :package_available? => false, :version_available? => true, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -580,7 +580,7 @@ describe Chef::Provider::Package::Yum do :candidate_version => "1.2.4-11.18.el5_2.3", :package_available? => true, :version_available? => nil, - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -599,7 +599,7 @@ describe Chef::Provider::Package::Yum do :package_available? => true, :version_available? => true, :allow_multi_install => [ "kernel" ], - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -619,7 +619,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :allow_multi_install => [ "cups" ], :package_repository => "base", - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -643,7 +643,7 @@ describe Chef::Provider::Package::Yum do :version_available? => true, :allow_multi_install => [], :package_repository => "base", - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -710,7 +710,7 @@ describe Chef::Provider::Package::Yum do :package_available? => true, :version_available? => true, :allow_multi_install => [ "kernel" ], - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") @@ -726,7 +726,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:candidate_version).and_return('11') expect(@provider).to receive(:upgrade_package).with( "cups", - "11" + "11", ) @provider.run_action(:upgrade) end @@ -745,7 +745,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:candidate_version).and_return('11') expect(@provider).to receive(:upgrade_package).with( "cups", - "11" + "11", ) @provider.run_action(:upgrade) end @@ -792,7 +792,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) @provider.yum_command("-d0 -e0 -y install emacs-1.0") end @@ -802,7 +802,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) expect { @provider.yum_command("-d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec) end @@ -813,7 +813,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) # will still raise an exception, can't stub out the subsequent call expect { @provider.yum_command("-d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec) @@ -825,7 +825,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).twice.with( "yum -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) # will still raise an exception, can't stub out the subsequent call expect { @provider.yum_command("-d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec) @@ -839,7 +839,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:shell_out).and_return(@status) expect(@provider).to receive(:shell_out).once.with( "yum-deprecated -d0 -e0 -y install emacs-1.0", - {:timeout => Chef::Config[:yum_timeout]} + {:timeout => Chef::Config[:yum_timeout]}, ) @provider.yum_command("-d0 -e0 -y install emacs-1.0") end @@ -856,7 +856,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "0:3.3", [ 0, "3.3", nil ] ], [ "9:1.7.3", [ 9, "1.7.3", nil ] ], - [ "15:20020927", [ 15, "20020927", nil ] ] + [ "15:20020927", [ 15, "20020927", nil ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -866,7 +866,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ ":3.3", [ 0, "3.3", nil ] ], [ "-1:1.7.3", [ nil, nil, "1:1.7.3" ] ], - [ "-:20020927", [ nil, nil, ":20020927" ] ] + [ "-:20020927", [ nil, nil, ":20020927" ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -876,7 +876,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3.3", [ nil, "3.3", nil ] ], [ "1.7.3", [ nil, "1.7.3", nil ] ], - [ "20020927", [ nil, "20020927", nil ] ] + [ "20020927", [ nil, "20020927", nil ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -886,7 +886,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3..3", [ nil, "3..3", nil ] ], [ "0001.7.3", [ nil, "0001.7.3", nil ] ], - [ "20020927,3", [ nil, "20020927,3", nil ] ] + [ "20020927,3", [ nil, "20020927,3", nil ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -896,7 +896,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3.3-0.pre3.1.60.el5_5.1", [ nil, "3.3", "0.pre3.1.60.el5_5.1" ] ], [ "1.7.3-1jpp.2.el5", [ nil, "1.7.3", "1jpp.2.el5" ] ], - [ "20020927-46.el5", [ nil, "20020927", "46.el5" ] ] + [ "20020927-46.el5", [ nil, "20020927", "46.el5" ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -906,7 +906,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ [ "3.3-", [ nil, "3.3", nil ] ], [ "-1jpp.2.el5", [ nil, nil, "1jpp.2.el5" ] ], - [ "-0020020927-46.el5", [ nil, "-0020020927", "46.el5" ] ] + [ "-0020020927-46.el5", [ nil, "-0020020927", "46.el5" ] ], ].each do |x, y| expect(@rpmutils.version_parse(x)).to eq(y) end @@ -982,7 +982,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do [ nil, "1.0.1", -1 ], [ "1.0.1", "", 1 ], [ "", "", 0 ], - [ "", "1.0.1", -1 ] + [ "", "1.0.1", -1 ], ].each do |x, y, result| expect(@rpmutils.rpmvercmp(x,y)).to eq(result) end @@ -1001,7 +1001,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do end it "tests isalpha good input" do - [ 'a', 'z', 'A', 'Z', ].each do |t| + [ 'a', 'z', 'A', 'Z' ].each do |t| expect(@rpmutils.isalpha(t)).to eq(true) end end @@ -1013,7 +1013,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do end it "tests isdigit good input" do - [ '0', '9', ].each do |t| + [ '0', '9' ].each do |t| expect(@rpmutils.isdigit(t)).to eq(true) end end @@ -1102,7 +1102,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "0:1.4.10-7.20090624svn.el5", "0:1.4.10-7.20090625svn.el5" ], [ "0:2.3.4-2.el5", - "0:2.3.4-2.el6" ] + "0:2.3.4-2.el6" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1128,7 +1128,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "0:1.9", "3:1.9" ], [ "2.3-2.el5", - "2.3-2.el6" ] + "2.3-2.el6" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1145,7 +1145,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "0:2.3-15.el5", "0:2.3-15.el5" ], [ "0:alpha9.8-27.2", - "0:alpha9.8-27.2" ] + "0:alpha9.8-27.2" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1160,7 +1160,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do [ "2.3-15.el5", "2.3-15.el5" ], [ "alpha9.8-3", - "alpha9.8-3" ] + "alpha9.8-3" ], ].each do |smaller, larger| sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller) lg = Chef::Provider::Package::Yum::RPMVersion.new(larger) @@ -1460,7 +1460,7 @@ describe Chef::Provider::Package::Yum::RPMDependency do [ "=", :== ], [ "==", :== ], [ "<=", :<= ], - [ "<", :< ] + [ "<", :< ], ].each do |before, after| @rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing #{before} 1:1.1-1") expect(@rpmdep.flag).to eq(after) @@ -1474,7 +1474,7 @@ describe Chef::Provider::Package::Yum::RPMDependency do [ ">>", :== ], [ "<<", :== ], [ "!", :== ], - [ "~", :== ] + [ "~", :== ], ].each do |before, after| @rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing #{before} 1:1.1-1") expect(@rpmdep.name).to eq("testing #{before} 1:1.1-1") @@ -1549,12 +1549,12 @@ describe Chef::Provider::Package::Yum::RPMDb do # name, version, arch, installed, available deps_v = [ Chef::Provider::Package::Yum::RPMDependency.parse("libz.so.1()(64bit)"), - Chef::Provider::Package::Yum::RPMDependency.parse("test-package-a = 0:1.6.5-9.36.el5") + Chef::Provider::Package::Yum::RPMDependency.parse("test-package-a = 0:1.6.5-9.36.el5"), ] deps_z = [ Chef::Provider::Package::Yum::RPMDependency.parse("libz.so.1()(64bit)"), Chef::Provider::Package::Yum::RPMDependency.parse("config(test) = 0:1.6.5-9.36.el5"), - Chef::Provider::Package::Yum::RPMDependency.parse("test-package-c = 0:1.6.5-9.36.el5") + Chef::Provider::Package::Yum::RPMDependency.parse("test-package-c = 0:1.6.5-9.36.el5"), ] @rpm_v = Chef::Provider::Package::Yum::RPMDbPackage.new("test-package-a", "0:1.6.5-9.36.el5", "i386", deps_v, true, false, "base") @rpm_w = Chef::Provider::Package::Yum::RPMDbPackage.new("test-package-b", "0:1.6.5-9.36.el5", "i386", [], true, true, "extras") @@ -2127,7 +2127,7 @@ describe "Chef::Provider::Package::Yum - Multi" do :version_available? => true, :allow_multi_install => [ 'kernel' ], :package_repository => 'base', - :disable_extra_repo_control => true + :disable_extra_repo_control => true, ) allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache) allow(@yum_cache).to receive(:yum_binary=).with("yum") diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb index f77c2b5d0d..cf905aeab7 100644 --- a/spec/unit/provider/package_spec.rb +++ b/spec/unit/provider/package_spec.rb @@ -58,7 +58,7 @@ describe Chef::Provider::Package do new_resource.response_file("foo") expect(provider).to receive(:get_preseed_file).with( new_resource.name, - provider.candidate_version + provider.candidate_version, ).and_return("/var/cache/preseed-test") expect(provider).to receive(:preseed_package).with( @@ -75,7 +75,7 @@ describe Chef::Provider::Package do it "should install the package at the candidate_version if it is not already installed" do expect(provider).to receive(:install_package).with( new_resource.name, - provider.candidate_version + provider.candidate_version, ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -85,7 +85,7 @@ describe Chef::Provider::Package do new_resource.version("1.0") expect(provider).to receive(:install_package).with( new_resource.name, - new_resource.version + new_resource.version, ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -96,7 +96,7 @@ describe Chef::Provider::Package do allow(current_resource).to receive(:version).and_return("0.99") expect(provider).to receive(:install_package).with( new_resource.name, - new_resource.version + new_resource.version, ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -144,7 +144,7 @@ describe Chef::Provider::Package do it "should upgrade the package if the current version is not the candidate version" do expect(provider).to receive(:upgrade_package).with( new_resource.name, - provider.candidate_version + provider.candidate_version, ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -468,7 +468,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:install_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -481,7 +481,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:install_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated_by_last_action @@ -494,7 +494,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:upgrade_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -507,7 +507,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:upgrade_package).with( [ "vim" ], - [ "1.0" ] + [ "1.0" ], ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -521,7 +521,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:remove_package).with( [ "vim" ], - [ nil ] + [ nil ], ).and_return(true) provider.run_action(:remove) expect(new_resource).to be_updated_by_last_action @@ -535,7 +535,7 @@ describe "Subclass with use_multipackage_api" do provider.candidate_version = [ "1.0" ] expect(provider).to receive(:purge_package).with( [ "vim" ], - [ nil ] + [ nil ], ).and_return(true) provider.run_action(:purge) expect(new_resource).to be_updated_by_last_action @@ -582,7 +582,7 @@ describe "Chef::Provider::Package - Multi" do it "installs the candidate versions when none are installed" do expect(provider).to receive(:install_package).with( ["emacs", "vi"], - ["1.0", "6.2"] + ["1.0", "6.2"], ).and_return(true) provider.run_action(:install) expect(new_resource).to be_updated @@ -591,7 +591,7 @@ describe "Chef::Provider::Package - Multi" do it "installs the candidate versions when some are installed" do expect(provider).to receive(:install_package).with( [ 'vi' ], - [ '6.2' ] + [ '6.2' ], ).and_return(true) current_resource.version(['1.0', nil]) provider.run_action(:install) @@ -675,7 +675,7 @@ describe "Chef::Provider::Package - Multi" do current_resource.version ['0.9', '6.1'] expect(provider).to receive(:upgrade_package).with( new_resource.package_name, - provider.candidate_version + provider.candidate_version, ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action @@ -685,7 +685,7 @@ describe "Chef::Provider::Package - Multi" do current_resource.version ['1.0', '6.1'] expect(provider).to receive(:upgrade_package).with( ["vi"], - ["6.2"] + ["6.2"], ).and_return(true) provider.run_action(:upgrade) expect(new_resource).to be_updated_by_last_action diff --git a/spec/unit/provider/remote_file/content_spec.rb b/spec/unit/provider/remote_file/content_spec.rb index ce18d23a09..2639c39faa 100644 --- a/spec/unit/provider/remote_file/content_spec.rb +++ b/spec/unit/provider/remote_file/content_spec.rb @@ -180,7 +180,7 @@ describe Chef::Provider::RemoteFile::Content do Timeout::Error, Net::HTTPServerException, Net::HTTPFatalError, - Net::FTPError + Net::FTPError, ].each do |exception| describe "with an exception of #{exception}" do before do diff --git a/spec/unit/provider/service/debian_service_spec.rb b/spec/unit/provider/service/debian_service_spec.rb index a4667e8ce8..346e349db7 100644 --- a/spec/unit/provider/service/debian_service_spec.rb +++ b/spec/unit/provider/service/debian_service_spec.rb @@ -134,12 +134,12 @@ describe Chef::Provider::Service::Debian do "3"=>[:start, "20"], "4"=>[:start, "20"], "5"=>[:start, "20"], - "6"=>[:stop, "20"] - } + "6"=>[:stop, "20"], + }, }, "not linked" => { "stdout" => " Removing any system startup links for /etc/init.d/chef ...", - "stderr" => "" + "stderr" => "", }, }, "Debian/Squeeze and earlier" => { @@ -162,13 +162,13 @@ insserv: remove service /etc/init.d/../rc0.d/K20chef-client "3"=>[:start, "20"], "4"=>[:start, "20"], "5"=>[:start, "20"], - "6"=>[:stop, "20"] - } + "6"=>[:stop, "20"], + }, }, "not linked" => { "stdout" => "update-rc.d: using dependency based boot sequencing", - "stderr" => "" - } + "stderr" => "", + }, }, "Debian/Wheezy and earlier, a service only starting at run level S" => { "linked" => { @@ -184,14 +184,14 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop "0"=>[:stop, "06"], "1"=>[:stop, "06"], "6"=>[:stop, "06"], - "S"=>[:start, "13"] - } + "S"=>[:start, "13"], + }, }, "not linked" => { "stdout" => "", - "stderr" => "insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop" - } - } + "stderr" => "insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop", + }, + }, }.each do |model, expected_results| context "on #{model}" do context "when update-rc.d shows init linked to rc*.d/" do @@ -311,7 +311,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d 'service_name' defaults" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d #{service_name} defaults" + "/usr/sbin/update-rc.d #{service_name} defaults", ]) @provider.enable_service end @@ -325,7 +325,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d 'service_name' defaults" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d #{service_name} defaults 75 25" + "/usr/sbin/update-rc.d #{service_name} defaults 75 25", ]) @provider.enable_service end @@ -339,7 +339,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d 'service_name' with those priorities" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d #{service_name} start 20 2 . stop 55 3 . " + "/usr/sbin/update-rc.d #{service_name} start 20 2 . stop 55 3 . ", ]) @provider.enable_service end @@ -352,7 +352,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d -f 'service_name' remove + stop with default priority" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d -f #{service_name} stop 80 2 3 4 5 ." + "/usr/sbin/update-rc.d -f #{service_name} stop 80 2 3 4 5 .", ]) @provider.disable_service end @@ -366,7 +366,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop it "calls update-rc.d -f 'service_name' remove + stop with the specified priority" do expect_commands(@provider, [ "/usr/sbin/update-rc.d -f #{service_name} remove", - "/usr/sbin/update-rc.d -f #{service_name} stop #{100 - @new_resource.priority} 2 3 4 5 ." + "/usr/sbin/update-rc.d -f #{service_name} stop #{100 - @new_resource.priority} 2 3 4 5 .", ]) @provider.disable_service end diff --git a/spec/unit/provider/service/solaris_smf_service_spec.rb b/spec/unit/provider/service/solaris_smf_service_spec.rb index 62c3ac6c6e..4ff3e89ae3 100644 --- a/spec/unit/provider/service/solaris_smf_service_spec.rb +++ b/spec/unit/provider/service/solaris_smf_service_spec.rb @@ -42,7 +42,7 @@ describe Chef::Provider::Service::Solaris do 'logfile /var/svc/log/application-chef:default.log', 'restarter svc:/system/svc/restarter:default', 'contract_id 1115271', - 'dependency require_all/error svc:/milestone/multi-user:default (online)' + 'dependency require_all/error svc:/milestone/multi-user:default (online)', ].join("\n") # disabled / stopped service (svcs -l chef) @@ -56,7 +56,7 @@ describe Chef::Provider::Service::Solaris do 'logfile /var/svc/log/application-chef:default.log', 'restarter svc:/system/svc/restarter:default', 'contract_id 1115271', - 'dependency require_all/error svc:/milestone/multi-user:default (online)' + 'dependency require_all/error svc:/milestone/multi-user:default (online)', ].join("\n") # disabled / stopped service (svcs -l chef) @@ -70,7 +70,7 @@ describe Chef::Provider::Service::Solaris do 'logfile /var/svc/log/application-chef:default.log', 'restarter svc:/system/svc/restarter:default', 'contract_id 1115271', - 'dependency require_all/error svc:/milestone/multi-user:default (online)' + 'dependency require_all/error svc:/milestone/multi-user:default (online)', ].join("\n") # shell_out! return value for a service that is running diff --git a/spec/unit/provider/user/pw_spec.rb b/spec/unit/provider/user/pw_spec.rb index b225972e87..6683a75f42 100644 --- a/spec/unit/provider/user/pw_spec.rb +++ b/spec/unit/provider/user/pw_spec.rb @@ -52,7 +52,7 @@ describe Chef::Provider::User::Pw do 'home' => "-d", 'gid' => "-g", 'uid' => "-u", - 'shell' => "-s" + 'shell' => "-s", } field_list.each do |attribute, option| it "should check for differences in #{attribute} between the new and current resources" do diff --git a/spec/unit/provider/user/useradd_spec.rb b/spec/unit/provider/user/useradd_spec.rb index b9f6ee0d86..a295dff679 100644 --- a/spec/unit/provider/user/useradd_spec.rb +++ b/spec/unit/provider/user/useradd_spec.rb @@ -34,7 +34,7 @@ describe Chef::Provider::User::Useradd do 'gid' => "-g", 'uid' => "-u", 'shell' => "-s", - 'password' => "-p" + 'password' => "-p", } include_examples "a useradd-based user provider", supported_useradd_options diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb index bd24a6a01e..c38abcc049 100644 --- a/spec/unit/provider/user_spec.rb +++ b/spec/unit/provider/user_spec.rb @@ -114,7 +114,7 @@ describe Chef::Provider::User do :gid => :gid, :comment => :gecos, :home => :dir, - :shell => :shell + :shell => :shell, } user_attrib_map.each do |user_attrib, getpwnam_attrib| it "should set the current resources #{user_attrib} based on getpwnam #{getpwnam_attrib}" do @@ -198,7 +198,7 @@ describe Chef::Provider::User do 'gid' => [1000, 1001], 'home' => ["/home/adam", "/Users/adam"], 'shell'=> ["/usr/bin/zsh", "/bin/bash"], - 'password'=> ["abcd","12345"] + 'password'=> ["abcd","12345"], } } diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index 8c087cf3f3..cee097e715 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -259,7 +259,7 @@ describe Chef::ProviderResolver do Chef::Provider::Service::Invokercd, ) expect(provider_resolver.supported_handlers).to_not include( - Chef::Provider::Service::Upstart, + Chef::Provider::Service::Upstart ) end @@ -314,7 +314,7 @@ describe Chef::ProviderResolver do it "supports only the upstart handler" do expect(provider_resolver.supported_handlers).to include( - Chef::Provider::Service::Upstart, + Chef::Provider::Service::Upstart ) expect(provider_resolver.supported_handlers).to_not include( Chef::Provider::Service::Debian, @@ -591,35 +591,35 @@ describe Chef::ProviderResolver do # service: [ Chef::Resource::InsservService, Chef::Provider::Service::Insserv ], }, "5.0" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] }, }, "gcel" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - }, + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + } }, "linaro" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - }, + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + } }, "linuxmint" => { "3.1.4" => { ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], # service: [ Chef::Resource::UpstartService, Chef::Provider::Service::Upstart ], - }, + } }, "raspbian" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], - }, + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + } }, "ubuntu" => { "11.10" => { }, "10.04" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] }, }, }, @@ -640,7 +640,7 @@ describe Chef::ProviderResolver do "freebsd" => { "3.1.4" => { - }, + } }, }, "suse" => { @@ -649,7 +649,7 @@ describe Chef::ProviderResolver do "12.0" => { }, %w(11.1 11.2 11.3) => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ], + group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ] }, }, "opensuse" => { @@ -659,7 +659,7 @@ describe Chef::ProviderResolver do "12.3" => { }, "12.2" => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ], + group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ] }, }, }, @@ -672,7 +672,7 @@ describe Chef::ProviderResolver do "gentoo" => { "3.1.4" => { - }, + } }, }, @@ -684,7 +684,7 @@ describe Chef::ProviderResolver do %w(amazon xcp xenserver ibm_powerkvm cloudlinux parallels) => { "3.1.4" => { # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], - }, + } }, %w(redhat centos scientific oracle) => { "7.0" => { @@ -713,9 +713,9 @@ describe Chef::ProviderResolver do "mac_os_x" => { "10.9.2" => { - }, + } }, - }, + } }, "windows" => { @@ -734,8 +734,8 @@ describe Chef::ProviderResolver do "windows" => { %w(mswin mingw32 windows) => { "10.9.2" => { - }, - }, + } + } }, }, @@ -754,8 +754,8 @@ describe Chef::ProviderResolver do "aix" => { "aix" => { "5.6" => { - }, - }, + } + } }, }, @@ -773,10 +773,10 @@ describe Chef::ProviderResolver do "netbsd" => { "netbsd" => { "3.1.4" => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ], - }, - }, - }, + group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ] + } + } + } }, "openbsd" => { @@ -786,8 +786,8 @@ describe Chef::ProviderResolver do "openbsd" => { "openbsd" => { "3.1.4" => { - }, - }, + } + } }, }, @@ -804,32 +804,32 @@ describe Chef::ProviderResolver do "smartos" => { "3.1.4" => { - }, + } }, }, "solaris2" => { "nexentacore" => { "3.1.4" => { - }, + } }, "omnios" => { "3.1.4" => { - user: [ Chef::Resource::User, Chef::Provider::User::Solaris ], + user: [ Chef::Resource::User, Chef::Provider::User::Solaris ] } }, "openindiana" => { "3.1.4" => { - }, + } }, "opensolaris" => { "3.1.4" => { - }, + } }, "solaris2" => { user: [ Chef::Resource::User, Chef::Provider::User::Solaris ], "5.11" => { - package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ], + package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ] }, "5.9" => { }, @@ -842,9 +842,9 @@ describe Chef::ProviderResolver do "solaris" => { "solaris" => { "3.1.4" => { - }, - }, - }, + } + } + } }, "exherbo" => { @@ -856,7 +856,7 @@ describe Chef::ProviderResolver do } } } - } + }, } def self.create_provider_tests(providers, test, expected, filter) diff --git a/spec/unit/resource/rpm_package_spec.rb b/spec/unit/resource/rpm_package_spec.rb index d3b505fff5..b2e06f7f68 100644 --- a/spec/unit/resource/rpm_package_spec.rb +++ b/spec/unit/resource/rpm_package_spec.rb @@ -27,7 +27,7 @@ describe Chef::Resource::RpmPackage, "initialize" do provider: Chef::Provider::Package::Rpm, name: :rpm_package, action: :install, - os: os + os: os, ) end diff --git a/spec/unit/resource/windows_package_spec.rb b/spec/unit/resource/windows_package_spec.rb index 6aa5d357ea..3623c24e29 100644 --- a/spec/unit/resource/windows_package_spec.rb +++ b/spec/unit/resource/windows_package_spec.rb @@ -28,7 +28,7 @@ describe Chef::Resource::WindowsPackage, "initialize" do provider: Chef::Provider::Package::Windows, os: "windows", name: :windows_package, - action: :start + action: :start, ) let(:resource) { Chef::Resource::WindowsPackage.new("solitaire.msi") } diff --git a/spec/unit/resource/windows_service_spec.rb b/spec/unit/resource/windows_service_spec.rb index 45a295c24e..64bb05afc4 100644 --- a/spec/unit/resource/windows_service_spec.rb +++ b/spec/unit/resource/windows_service_spec.rb @@ -24,7 +24,7 @@ describe Chef::Resource::WindowsService, "initialize" do provider: Chef::Provider::Service::Windows, os: "windows", name: :windows_service, - action: :start + action: :start, ) let(:resource) { Chef::Resource::WindowsService.new("BITS") } diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index da29cdcc02..34d4b23106 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -696,8 +696,8 @@ describe Chef::ResourceReporter do expect(@rest_client).to receive(:raw_request).ordered do |method, url, headers, data| expect(method).to eq(:POST) expect(headers).to eq({'Content-Encoding' => 'gzip', - 'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION - }) + 'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION, + },) data_stream = Zlib::GzipReader.new(StringIO.new(data)) data = data_stream.read expect(data).to eq(Chef::JSONCompat.to_json(@expected_data)) diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 856ec07b9e..82d224e810 100644 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -820,7 +820,7 @@ describe Chef::Resource do runner = Chef::Runner.new(run_context) Chef::Platform.set( :resource => :cat, - :provider => Chef::Provider::SnakeOil + :provider => Chef::Provider::SnakeOil, ) resource1.only_if { snitch_var1 = 1 } diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index 3eee997c50..3ecbbd14b8 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -292,7 +292,7 @@ describe Chef::REST do 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, 'Host' => host_header, 'X-REMOTE-REQUEST-ID' => request_id, - 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION + 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION, } end @@ -341,7 +341,7 @@ describe Chef::REST do let(:custom_headers) do { 'X-Custom-ChefSecret' => 'sharpknives', - 'X-Custom-RequestPriority' => 'extremely low' + 'X-Custom-RequestPriority' => 'extremely low', } end @@ -575,7 +575,7 @@ describe Chef::REST do 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, 'Host' => host_header, 'X-REMOTE-REQUEST-ID'=> request_id, - 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION + 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION, } expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock) rest.streaming_request(url, {}) @@ -587,7 +587,7 @@ describe Chef::REST do 'Accept-Encoding' => Chef::REST::RESTRequest::ENCODING_GZIP_DEFLATE, 'Host' => host_header, 'X-REMOTE-REQUEST-ID'=> request_id, - 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION + 'X-Ops-Server-API-Version' => Chef::HTTP::Authenticator::DEFAULT_SERVER_API_VERSION, } expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock) rest.streaming_request(url, {}) diff --git a/spec/unit/run_context_spec.rb b/spec/unit/run_context_spec.rb index 99801575ef..efc2a6f63f 100644 --- a/spec/unit/run_context_spec.rb +++ b/spec/unit/run_context_spec.rb @@ -57,33 +57,33 @@ describe Chef::RunContext do expect(run_context.node[:cookbooks]).to eql( { "circular-dep1" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "circular-dep2" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "dependency1" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "dependency2" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "include" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "no-default-attr" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "test" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "test-with-circular-deps" => { - "version" => "0.0.0", + "version" => "0.0.0" }, "test-with-deps" => { - "version" => "0.0.0", + "version" => "0.0.0" }, - } + }, ) end diff --git a/spec/unit/run_list/versioned_recipe_list_spec.rb b/spec/unit/run_list/versioned_recipe_list_spec.rb index be57d6c944..356b9d682c 100644 --- a/spec/unit/run_list/versioned_recipe_list_spec.rb +++ b/spec/unit/run_list/versioned_recipe_list_spec.rb @@ -87,7 +87,7 @@ describe Chef::RunList::VersionedRecipeList do [ {:name => "apt", :version => "1.0.0"}, {:name => "god", :version => nil}, - {:name => "apache2", :version => "0.0.1"} + {:name => "apache2", :version => "0.0.1"}, ] end it "should return an array of hashes with :name and :version" do @@ -108,7 +108,7 @@ describe Chef::RunList::VersionedRecipeList do [ {:name => "apt", :version => "~> 1.2.0"}, {:name => "god", :version => nil}, - {:name => "apache2", :version => "0.0.1"} + {:name => "apache2", :version => "0.0.1"}, ] end diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb index b30f818da1..46074728c2 100644 --- a/spec/unit/runner_spec.rb +++ b/spec/unit/runner_spec.rb @@ -104,7 +104,7 @@ describe Chef::Runner do # set up old Chef::Platform resolution instead of provider_resolver Chef::Platform.set( :resource => :cat, - :provider => Chef::Provider::SnakeOil + :provider => Chef::Provider::SnakeOil, ) allow(Chef::ProviderResolver).to receive(:new).and_return(provider_resolver) allow(provider_resolver).to receive(:maybe_dynamic_provider_resolution).with(first_resource, anything()).and_return(nil) diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb index c390f658bc..d54e8b5391 100644 --- a/spec/unit/search/query_spec.rb +++ b/spec/unit/search/query_spec.rb @@ -30,7 +30,7 @@ describe Chef::Search::Query do let(:filter_hash) { { 'env' => [ 'chef_environment' ], - 'ruby_plat' => [ 'languages', 'ruby', 'platform' ] + 'ruby_plat' => [ 'languages', 'ruby', 'platform' ], } } let(:response) { @@ -39,30 +39,30 @@ describe Chef::Search::Query do { "url" => "#{server_url}/my-name-is-node", "data" => { "env" => "elysium", - "ruby_plat" => "nudibranch" - } + "ruby_plat" => "nudibranch", + }, }, { "url" => "#{server_url}/my-name-is-jonas", "data" => { "env" => "hades", - "ruby_plat" => "i386-mingw32" - } + "ruby_plat" => "i386-mingw32", + }, }, { "url" => "#{server_url}/my-name-is-flipper", "data" => { "env" => "elysium", - "ruby_plat" => "centos" - } + "ruby_plat" => "centos", + }, }, { "url" => "#{server_url}/my-name-is-butters", "data" => { "env" => "moon", "ruby_plat" => "solaris2", - } - } + }, + }, ], "start" => 0, - "total" => 4 + "total" => 4, } } let(:response_rows) { @@ -70,7 +70,7 @@ describe Chef::Search::Query do { "env" => "elysium", "ruby_plat" => "nudibranch" }, { "env" => "hades", "ruby_plat" => "i386-mingw32"}, { "env" => "elysium", "ruby_plat" => "centos"}, - { "env" => "moon", "ruby_plat" => "solaris2"} + { "env" => "moon", "ruby_plat" => "solaris2"}, ] } end @@ -97,10 +97,10 @@ describe Chef::Search::Query do "ruby" => { "platform" => "nudibranch", "version" => "1.9.3", - "target" => "ming-the-merciless" + "target" => "ming-the-merciless", } } - } + }, }, { "name" => "my-name-is-jonas", "chef_environment" => "hades", @@ -111,10 +111,10 @@ describe Chef::Search::Query do "ruby" => { "platform" => "i386-mingw32", "version" => "1.9.3", - "target" => "bilbo" + "target" => "bilbo", } } - } + }, }, { "name" => "my-name-is-flipper", "chef_environment" => "elysium", @@ -125,10 +125,10 @@ describe Chef::Search::Query do "ruby" => { "platform" => "centos", "version" => "2.0.0", - "target" => "uno" + "target" => "uno", } } - } + }, }, { "name" => "my-name-is-butters", "chef_environment" => "moon", @@ -139,14 +139,14 @@ describe Chef::Search::Query do "ruby" => { "platform" => "solaris2", "version" => "2.1.2", - "target" => "random" + "target" => "random", } } - } + }, }, ], "start" => 0, - "total" => 4 + "total" => 4, } } let(:big_response) { @@ -159,7 +159,7 @@ describe Chef::Search::Query do { "start" => 0, "total" => 8, - "rows" => [] + "rows" => [], } } diff --git a/spec/unit/user_v1_spec.rb b/spec/unit/user_v1_spec.rb index a981de1d8c..d2ba0cf4de 100644 --- a/spec/unit/user_v1_spec.rb +++ b/spec/unit/user_v1_spec.rb @@ -261,7 +261,7 @@ describe Chef::UserV1 do "password" => "password", "public_key" => "turtles", "private_key" => "pandas", - "create_key" => false + "create_key" => false, } @user = Chef::UserV1.from_json(Chef::JSONCompat.to_json(user)) end @@ -341,7 +341,7 @@ describe Chef::UserV1 do :middle_name => "some_middle_name", :last_name => "some_last_name", :email => "some_email", - :password => "some_password" + :password => "some_password", } } @@ -364,7 +364,7 @@ describe Chef::UserV1 do :last_name => "some_last_name", :email => "some_email", :password => "some_password", - :public_key => "some_public_key" + :public_key => "some_public_key", } } @@ -450,7 +450,7 @@ describe Chef::UserV1 do :first_name => "some_first_name", :last_name => "some_last_name", :email => "some_email", - :password => "some_password" + :password => "some_password", } } before do @@ -509,7 +509,7 @@ describe Chef::UserV1 do describe "reregister" do let(:payload) { { - "username" => "some_username", + "username" => "some_username" } } diff --git a/spec/unit/util/dsc/resource_store.rb b/spec/unit/util/dsc/resource_store.rb index a89e73fcaa..181ac2bb6c 100644 --- a/spec/unit/util/dsc/resource_store.rb +++ b/spec/unit/util/dsc/resource_store.rb @@ -24,14 +24,14 @@ describe Chef::Util::DSC::ResourceStore do let(:resource_a) { { 'ResourceType' => 'AFoo', 'Name' => 'Foo', - 'Module' => {'Name' => 'ModuleA'} + 'Module' => {'Name' => 'ModuleA'}, } } let(:resource_b) { { 'ResourceType' => 'BFoo', 'Name' => 'Foo', - 'Module' => {'Name' => 'ModuleB'} + 'Module' => {'Name' => 'ModuleB'}, } } diff --git a/spec/unit/version_class_spec.rb b/spec/unit/version_class_spec.rb index fe1488550b..f1f55c7b05 100644 --- a/spec/unit/version_class_spec.rb +++ b/spec/unit/version_class_spec.rb @@ -90,7 +90,7 @@ describe Chef::Version do ["1.2", "1.3.0"], ["1.2", "1.3"], ["1.2", "2.1.1"], - ["1.2", "2.1"] + ["1.2", "2.1"], ] examples.each do |smaller, larger| sm = Chef::Version.new(smaller) @@ -158,7 +158,7 @@ describe Chef::Version do [ "1.2.2", :>=, "1.2.1", true ], [ "1.2.2", :==, "1.2.1", false ], [ "1.2.2", :<=, "1.2.1", false ], - [ "1.2.2", :<, "1.2.1", false ] + [ "1.2.2", :<, "1.2.1", false ], ].each do |spec| it "(#{spec.first(3).join(' ')}) should be #{spec[3]}" do got = Chef::Version.new(spec[0]).send(spec[1], diff --git a/spec/unit/windows_service_spec.rb b/spec/unit/windows_service_spec.rb index 031a3124f8..adc128c9d8 100644 --- a/spec/unit/windows_service_spec.rb +++ b/spec/unit/windows_service_spec.rb @@ -26,14 +26,14 @@ describe "Chef::Application::WindowsService", :windows_only do { log_location: STDOUT, config_file: "test_config_file", - log_level: :info + log_level: :info, } end let(:timeout) { 7200 } let(:shellout_options) do { :timeout => timeout, - :logger => Chef::Log + :logger => Chef::Log, } end @@ -52,7 +52,7 @@ describe "Chef::Application::WindowsService", :windows_only do it "passes DEFAULT_LOG_LOCATION to chef-client instead of STDOUT" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file -L #{Chef::Application::WindowsService::DEFAULT_LOG_LOCATION}", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end @@ -63,7 +63,7 @@ describe "Chef::Application::WindowsService", :windows_only do { log_location: tempfile.path, config_file: "test_config_file", - log_level: :info + log_level: :info, } end @@ -74,7 +74,7 @@ describe "Chef::Application::WindowsService", :windows_only do it "uses the configured log location" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file -L #{tempfile.path}", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end @@ -84,14 +84,14 @@ describe "Chef::Application::WindowsService", :windows_only do { log_location: Chef::Log::WinEvt.new, config_file: "test_config_file", - log_level: :info + log_level: :info, } end it "does not pass log location to new process" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end @@ -108,7 +108,7 @@ describe "Chef::Application::WindowsService", :windows_only do it "passes watchdog timeout to new process" do expect(subject).to receive(:shell_out).with( "chef-client --no-fork -c test_config_file -L #{Chef::Application::WindowsService::DEFAULT_LOG_LOCATION}", - shellout_options + shellout_options, ).and_return(shell_out_result) subject.service_main end |