chef 12.13.37-universal-mingw32 → 12.14.60-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +48 -95
- data/Gemfile +6 -1
- data/README.md +9 -11
- data/VERSION +1 -1
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +0 -1
- data/acceptance/Gemfile +4 -7
- data/acceptance/Gemfile.lock +59 -92
- data/acceptance/basics/test/integration/helpers/serverspec/Gemfile +8 -0
- data/acceptance/data-collector/test/integration/helpers/serverspec/Gemfile +8 -0
- data/acceptance/fips/test/integration/fips-integration/serverspec/Gemfile +6 -0
- data/acceptance/fips/test/integration/fips-unit-functional/serverspec/Gemfile +4 -0
- data/chef.gemspec +3 -2
- data/lib/chef/application/client.rb +4 -4
- data/lib/chef/application/solo.rb +2 -2
- data/lib/chef/chef_fs/command_line.rb +36 -34
- data/lib/chef/chef_fs/data_handler/data_handler_base.rb +2 -2
- data/lib/chef/chef_fs/file_pattern.rb +1 -1
- data/lib/chef/chef_fs/file_system.rb +139 -137
- data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +2 -6
- data/lib/chef/cookbook/cookbook_version_loader.rb +27 -22
- data/lib/chef/cookbook/metadata.rb +1 -1
- data/lib/chef/cookbook/synchronizer.rb +3 -3
- data/lib/chef/cookbook_site_streaming_uploader.rb +3 -3
- data/lib/chef/cookbook_uploader.rb +1 -1
- data/lib/chef/cookbook_version.rb +6 -6
- data/lib/chef/dsl/powershell.rb +1 -1
- data/lib/chef/event_dispatch/base.rb +2 -2
- data/lib/chef/exceptions.rb +1 -1
- data/lib/chef/file_cache.rb +1 -1
- data/lib/chef/formatters/base.rb +2 -2
- data/lib/chef/formatters/doc.rb +2 -2
- data/lib/chef/http.rb +48 -18
- data/lib/chef/http/auth_credentials.rb +1 -1
- data/lib/chef/http/basic_client.rb +11 -2
- data/lib/chef/http/socketless_chef_zero_client.rb +2 -2
- data/lib/chef/key.rb +55 -56
- data/lib/chef/knife.rb +70 -61
- data/lib/chef/knife/client_delete.rb +2 -2
- data/lib/chef/knife/cookbook_bulk_delete.rb +1 -1
- data/lib/chef/knife/cookbook_show.rb +1 -1
- data/lib/chef/knife/core/gem_glob_loader.rb +3 -3
- data/lib/chef/knife/search.rb +2 -2
- data/lib/chef/knife/ssh.rb +19 -21
- data/lib/chef/knife/status.rb +2 -2
- data/lib/chef/mixin/command/unix.rb +2 -2
- data/lib/chef/mixin/powershell_type_coercions.rb +1 -1
- data/lib/chef/mixin/properties.rb +3 -0
- data/lib/chef/mixin/securable.rb +2 -2
- data/lib/chef/mixin/shell_out.rb +30 -0
- data/lib/chef/mixin/uris.rb +2 -1
- data/lib/chef/mixin/windows_architecture_helper.rb +3 -4
- data/lib/chef/monkey_patches/webrick-utils.rb +2 -2
- data/lib/chef/monologger.rb +1 -1
- data/lib/chef/node.rb +2 -2
- data/lib/chef/node/attribute.rb +3 -3
- data/lib/chef/platform/provider_mapping.rb +5 -2
- data/lib/chef/property.rb +14 -3
- data/lib/chef/provider/apt_repository.rb +3 -7
- data/lib/chef/provider/apt_update.rb +4 -6
- data/lib/chef/provider/cron.rb +1 -2
- data/lib/chef/provider/dsc_script.rb +4 -4
- data/lib/chef/provider/group/usermod.rb +1 -1
- data/lib/chef/provider/link.rb +10 -3
- data/lib/chef/provider/osx_profile.rb +10 -10
- data/lib/chef/provider/package.rb +2 -12
- data/lib/chef/provider/package/rubygems.rb +17 -16
- data/lib/chef/provider/package/windows.rb +2 -0
- data/lib/chef/provider/package/windows/exe.rb +1 -1
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +0 -2
- data/lib/chef/provider/package/yum/rpm_utils.rb +8 -8
- data/lib/chef/provider/package/yum/yum_cache.rb +1 -1
- data/lib/chef/provider/remote_file/ftp.rb +2 -2
- data/lib/chef/provider/remote_file/sftp.rb +2 -2
- data/lib/chef/provider/service/debian.rb +2 -2
- data/lib/chef/provider/service/simple.rb +4 -3
- data/lib/chef/provider/service/solaris.rb +1 -1
- data/lib/chef/provider/service/systemd.rb +2 -2
- data/lib/chef/provider/service/upstart.rb +8 -5
- data/lib/chef/provider/support/yum_repo.erb +125 -0
- data/lib/chef/provider/systemd_unit.rb +11 -2
- data/lib/chef/provider/template_finder.rb +1 -1
- data/lib/chef/provider/user.rb +20 -16
- data/lib/chef/provider/user/aix.rb +5 -2
- data/lib/chef/provider/user/dscl.rb +1 -0
- data/lib/chef/provider/user/linux.rb +128 -0
- data/lib/chef/provider/user/pw.rb +2 -1
- data/lib/chef/provider/user/solaris.rb +3 -2
- data/lib/chef/provider/user/useradd.rb +5 -4
- data/lib/chef/provider/user/windows.rb +1 -1
- data/lib/chef/provider/windows_script.rb +5 -2
- data/lib/chef/provider/yum_repository.rb +121 -0
- data/lib/chef/providers.rb +4 -2
- data/lib/chef/resource.rb +7 -9
- data/lib/chef/resource/conditional.rb +9 -1
- data/lib/chef/resource/launchd.rb +1 -1
- data/lib/chef/resource/user.rb +3 -3
- data/lib/chef/resource/user/aix_user.rb +31 -0
- data/lib/chef/resource/user/dscl_user.rb +31 -0
- data/lib/chef/resource/user/linux_user.rb +51 -0
- data/lib/chef/resource/user/pw_user.rb +31 -0
- data/lib/chef/resource/user/solaris_user.rb +31 -0
- data/lib/chef/resource/user/windows_user.rb +31 -0
- data/lib/chef/resource/yum_package.rb +13 -12
- data/lib/chef/resource/yum_repository.rb +76 -0
- data/lib/chef/resource_builder.rb +1 -1
- data/lib/chef/resource_collection/stepable_iterator.rb +1 -3
- data/lib/chef/resource_reporter.rb +5 -5
- data/lib/chef/resources.rb +7 -0
- data/lib/chef/run_context.rb +5 -3
- data/lib/chef/run_context/cookbook_compiler.rb +3 -2
- data/lib/chef/run_list.rb +2 -2
- data/lib/chef/search/query.rb +11 -8
- data/lib/chef/shell/ext.rb +2 -2
- data/lib/chef/shell/shell_session.rb +1 -1
- data/lib/chef/util/dsc/configuration_generator.rb +1 -1
- data/lib/chef/util/powershell/cmdlet.rb +5 -2
- data/lib/chef/util/selinux.rb +1 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/version_class.rb +2 -2
- data/lib/chef/version_constraint.rb +2 -2
- data/lib/chef/win32/api/error.rb +2 -2
- data/lib/chef/win32/api/net.rb +1 -1
- data/lib/chef/win32/eventlog.rb +1 -1
- data/lib/chef/win32/net.rb +1 -1
- data/lib/chef/win32/security/sid.rb +1 -1
- data/spec/functional/assets/testchefsubsys +2 -3
- data/spec/functional/event_loggers/windows_eventlog_spec.rb +11 -8
- data/spec/functional/file_content_management/deploy_strategies_spec.rb +1 -1
- data/spec/functional/http/simple_spec.rb +2 -2
- data/spec/functional/knife/cookbook_delete_spec.rb +5 -5
- data/spec/functional/knife/exec_spec.rb +6 -6
- data/spec/functional/knife/ssh_spec.rb +4 -4
- data/spec/functional/notifications_spec.rb +2 -2
- data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +2 -2
- data/spec/functional/rebooter_spec.rb +5 -5
- data/spec/functional/resource/bash_spec.rb +2 -2
- data/spec/functional/resource/deploy_revision_spec.rb +1 -1
- data/spec/functional/resource/dpkg_package_spec.rb +2 -2
- data/spec/functional/resource/dsc_resource_spec.rb +5 -5
- data/spec/functional/resource/dsc_script_spec.rb +27 -22
- data/spec/functional/resource/env_spec.rb +4 -4
- data/spec/functional/resource/execute_spec.rb +4 -4
- data/spec/functional/resource/group_spec.rb +20 -8
- data/spec/functional/resource/link_spec.rb +34 -0
- data/spec/functional/resource/ohai_spec.rb +6 -6
- data/spec/functional/resource/reboot_spec.rb +2 -2
- data/spec/functional/resource/remote_file_spec.rb +16 -7
- data/spec/functional/resource/user/dscl_spec.rb +3 -3
- data/spec/functional/resource/user/useradd_spec.rb +32 -26
- data/spec/functional/resource/windows_service_spec.rb +15 -15
- data/spec/functional/rest_spec.rb +2 -2
- data/spec/functional/run_lock_spec.rb +9 -9
- data/spec/functional/tiny_server_spec.rb +9 -8
- data/spec/functional/win32/crypto_spec.rb +1 -1
- data/spec/functional/win32/security_spec.rb +8 -8
- data/spec/integration/client/client_spec.rb +6 -4
- data/spec/integration/knife/chef_repo_path_spec.rb +70 -1
- data/spec/integration/knife/upload_spec.rb +1 -1
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +6 -6
- data/spec/integration/recipes/noop_resource_spec.rb +4 -4
- data/spec/integration/recipes/provider_choice.rb +3 -3
- data/spec/integration/recipes/recipe_dsl_spec.rb +318 -317
- data/spec/integration/recipes/resource_action_spec.rb +50 -54
- data/spec/integration/recipes/resource_converge_if_changed_spec.rb +34 -34
- data/spec/integration/recipes/resource_load_spec.rb +24 -24
- data/spec/integration/solo/solo_spec.rb +21 -30
- data/spec/scripts/ssl-serve.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/stress/win32/security_spec.rb +4 -4
- data/spec/support/chef_helpers.rb +22 -0
- data/spec/support/platform_helpers.rb +5 -1
- data/spec/support/shared/context/client.rb +3 -2
- data/spec/support/shared/functional/file_resource.rb +5 -4
- data/spec/support/shared/functional/http.rb +16 -16
- data/spec/support/shared/functional/securable_resource.rb +5 -5
- data/spec/support/shared/functional/win32_service.rb +5 -7
- data/spec/support/shared/integration/app_server_support.rb +1 -3
- data/spec/support/shared/integration/knife_support.rb +0 -2
- data/spec/support/shared/shared_examples.rb +2 -2
- data/spec/support/shared/unit/api_versioning.rb +2 -2
- data/spec/support/shared/unit/application_dot_d.rb +9 -6
- data/spec/support/shared/unit/provider/file.rb +2 -2
- data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +49 -80
- data/spec/support/shared/unit/resource/static_provider_resolution.rb +2 -2
- data/spec/support/shared/unit/script_resource.rb +4 -4
- data/spec/support/shared/unit/user_and_client_shared.rb +4 -4
- data/spec/tiny_server.rb +51 -66
- data/spec/unit/api_client_v1_spec.rb +2 -2
- data/spec/unit/application_spec.rb +1 -1
- data/spec/unit/audit/audit_event_proxy_spec.rb +34 -27
- data/spec/unit/audit/audit_reporter_spec.rb +32 -23
- data/spec/unit/audit/control_group_data_spec.rb +19 -14
- data/spec/unit/chef_class_spec.rb +1 -1
- data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +1 -1
- data/spec/unit/chef_fs/diff_spec.rb +4 -4
- data/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb +4 -4
- data/spec/unit/chef_fs/file_system_spec.rb +2 -2
- data/spec/unit/chef_fs/parallelizer.rb +5 -7
- data/spec/unit/cookbook/metadata_spec.rb +98 -98
- data/spec/unit/cookbook/synchronizer_spec.rb +7 -0
- data/spec/unit/cookbook_loader_spec.rb +24 -24
- data/spec/unit/cookbook_version_file_specificity_spec.rb +8 -8
- data/spec/unit/daemon_spec.rb +1 -1
- data/spec/unit/data_bag_item_spec.rb +18 -18
- data/spec/unit/data_bag_spec.rb +2 -2
- data/spec/unit/data_collector/messages/helpers_spec.rb +9 -9
- data/spec/unit/data_collector/messages_spec.rb +2 -2
- data/spec/unit/data_collector_spec.rb +19 -19
- data/spec/unit/dsl/audit_spec.rb +3 -3
- data/spec/unit/dsl/data_query_spec.rb +3 -2
- data/spec/unit/dsl/declare_resource_spec.rb +10 -10
- data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +3 -2
- data/spec/unit/encrypted_data_bag_item_spec.rb +3 -2
- data/spec/unit/environment_spec.rb +6 -6
- data/spec/unit/event_dispatch/dispatcher_spec.rb +2 -2
- data/spec/unit/file_access_control_spec.rb +3 -3
- data/spec/unit/file_content_management/tempfile_spec.rb +2 -2
- data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +2 -2
- data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +2 -2
- data/spec/unit/http/basic_client_spec.rb +20 -0
- data/spec/unit/http/validate_content_length_spec.rb +8 -8
- data/spec/unit/http_spec.rb +14 -0
- data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +2 -2
- data/spec/unit/knife/bootstrap/client_builder_spec.rb +2 -2
- data/spec/unit/knife/bootstrap_spec.rb +8 -6
- data/spec/unit/knife/client_bulk_delete_spec.rb +8 -8
- data/spec/unit/knife/client_edit_spec.rb +2 -2
- data/spec/unit/knife/configure_client_spec.rb +2 -2
- data/spec/unit/knife/cookbook_metadata_spec.rb +4 -4
- data/spec/unit/knife/cookbook_site_install_spec.rb +6 -5
- data/spec/unit/knife/cookbook_site_share_spec.rb +2 -2
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +5 -4
- data/spec/unit/knife/core/node_editor_spec.rb +3 -3
- data/spec/unit/knife/core/ui_spec.rb +2 -2
- data/spec/unit/knife/data_bag_from_file_spec.rb +4 -3
- data/spec/unit/knife/data_bag_show_spec.rb +3 -2
- data/spec/unit/knife/key_create_spec.rb +14 -14
- data/spec/unit/knife/key_delete_spec.rb +2 -2
- data/spec/unit/knife/key_edit_spec.rb +16 -16
- data/spec/unit/knife/key_list_spec.rb +6 -6
- data/spec/unit/knife/key_show_spec.rb +4 -4
- data/spec/unit/knife/status_spec.rb +3 -2
- data/spec/unit/knife/user_create_spec.rb +4 -4
- data/spec/unit/knife_spec.rb +7 -6
- data/spec/unit/lwrp_spec.rb +6 -6
- data/spec/unit/mixin/api_version_request_handling_spec.rb +2 -2
- data/spec/unit/mixin/command_spec.rb +17 -14
- data/spec/unit/mixin/deprecation_spec.rb +1 -1
- data/spec/unit/mixin/homebrew_user_spec.rb +2 -2
- data/spec/unit/mixin/params_validate_spec.rb +53 -52
- data/spec/unit/mixin/powershell_out_spec.rb +2 -2
- data/spec/unit/mixin/powershell_type_coercions_spec.rb +2 -2
- data/spec/unit/mixin/shell_out_spec.rb +1 -1
- data/spec/unit/mixin/xml_escape_spec.rb +3 -3
- data/spec/unit/node_spec.rb +2 -2
- data/spec/unit/platform/query_helpers_spec.rb +3 -3
- data/spec/unit/property_spec.rb +4 -4
- data/spec/unit/provider/cookbook_file_spec.rb +4 -4
- data/spec/unit/provider/cron/unix_spec.rb +4 -4
- data/spec/unit/provider/cron_spec.rb +2 -2
- data/spec/unit/provider/deploy_spec.rb +8 -8
- data/spec/unit/provider/dsc_resource_spec.rb +11 -10
- data/spec/unit/provider/dsc_script_spec.rb +9 -9
- data/spec/unit/provider/env/windows_spec.rb +8 -8
- data/spec/unit/provider/file/content_spec.rb +6 -6
- data/spec/unit/provider/file_spec.rb +4 -4
- data/spec/unit/provider/launchd_spec.rb +2 -1
- data/spec/unit/provider/link_spec.rb +155 -0
- data/spec/unit/provider/mount/mount_spec.rb +5 -5
- data/spec/unit/provider/mount/solaris_spec.rb +48 -48
- data/spec/unit/provider/osx_profile_spec.rb +6 -0
- data/spec/unit/provider/package/chocolatey_spec.rb +4 -4
- data/spec/unit/provider/package/freebsd/port_spec.rb +4 -4
- data/spec/unit/provider/package/rubygems_spec.rb +50 -44
- data/spec/unit/provider/package/windows/exe_spec.rb +9 -0
- data/spec/unit/provider/package/yum_spec.rb +61 -60
- data/spec/unit/provider/package_spec.rb +2 -2
- data/spec/unit/provider/powershell_script_spec.rb +4 -4
- data/spec/unit/provider/remote_directory_spec.rb +1 -1
- data/spec/unit/provider/remote_file/ftp_spec.rb +4 -4
- data/spec/unit/provider/remote_file/local_file_spec.rb +4 -2
- data/spec/unit/provider/remote_file/sftp_spec.rb +4 -4
- data/spec/unit/provider/remote_file_spec.rb +4 -4
- data/spec/unit/provider/script_spec.rb +4 -4
- data/spec/unit/provider/service/debian_service_spec.rb +4 -4
- data/spec/unit/provider/service/freebsd_service_spec.rb +12 -8
- data/spec/unit/provider/service/openbsd_service_spec.rb +12 -8
- data/spec/unit/provider/service/systemd_service_spec.rb +4 -4
- data/spec/unit/provider/service/upstart_service_spec.rb +27 -12
- data/spec/unit/provider/service/windows_spec.rb +10 -10
- data/spec/unit/provider/systemd_unit_spec.rb +2 -2
- data/spec/unit/provider/template/content_spec.rb +8 -8
- data/spec/unit/provider/template_spec.rb +8 -8
- data/spec/unit/provider/user/dscl_spec.rb +51 -51
- data/spec/unit/provider/user/linux_spec.rb +76 -0
- data/spec/unit/provider/user/pw_spec.rb +3 -6
- data/spec/unit/provider/user/solaris_spec.rb +5 -5
- data/spec/unit/provider/user/windows_spec.rb +3 -3
- data/spec/unit/provider/user_spec.rb +2 -2
- data/spec/unit/provider/yum_repository_spec.rb +35 -0
- data/spec/unit/provider_resolver_spec.rb +306 -264
- data/spec/unit/recipe_spec.rb +8 -7
- data/spec/unit/resource/apt_repository_spec.rb +4 -4
- data/spec/unit/resource/apt_update_spec.rb +4 -4
- data/spec/unit/resource/conditional_spec.rb +46 -0
- data/spec/unit/resource/dsc_resource_spec.rb +8 -8
- data/spec/unit/resource/dsc_script_spec.rb +4 -4
- data/spec/unit/resource/freebsd_package_spec.rb +6 -6
- data/spec/unit/resource/launchd_spec.rb +3 -2
- data/spec/unit/resource/osx_profile_spec.rb +3 -2
- data/spec/unit/resource/remote_file_spec.rb +6 -6
- data/spec/unit/resource/service_spec.rb +14 -14
- data/spec/unit/resource/user_spec.rb +1 -1
- data/spec/unit/resource/yum_repository_spec.rb +49 -0
- data/spec/unit/resource_collection_spec.rb +4 -4
- data/spec/unit/resource_definition_spec.rb +11 -11
- data/spec/unit/resource_reporter_spec.rb +4 -4
- data/spec/unit/resource_resolver_spec.rb +6 -6
- data/spec/unit/resource_spec.rb +36 -16
- data/spec/unit/run_context/child_run_context_spec.rb +4 -4
- data/spec/unit/run_context/cookbook_compiler_spec.rb +43 -1
- data/spec/unit/run_context_spec.rb +8 -8
- data/spec/unit/run_list/run_list_expansion_spec.rb +2 -2
- data/spec/unit/runner_spec.rb +2 -2
- data/spec/unit/search/query_spec.rb +15 -14
- data/spec/unit/user_v1_spec.rb +8 -8
- data/spec/unit/util/dsc/configuration_generator_spec.rb +12 -12
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +12 -9
- data/spec/unit/util/dsc/resource_store.rb +8 -6
- data/spec/unit/util/editor_spec.rb +6 -6
- data/spec/unit/util/powershell/cmdlet_spec.rb +10 -10
- data/tasks/bin/bundle-platform +1 -0
- data/tasks/bin/bundler_patch.rb +27 -0
- data/tasks/cbgb.rb +2 -2
- data/tasks/maintainers.rb +2 -2
- metadata +37 -8
- data/spec/unit/provider/user/useradd_spec.rb +0 -51
@@ -414,6 +414,13 @@ describe Chef::CookbookSynchronizer do
|
|
414
414
|
and_return("/file-cache/cookbooks/cookbook_a/templates/default/apache2.conf.erb")
|
415
415
|
end
|
416
416
|
|
417
|
+
describe "#server_api" do
|
418
|
+
it "sets keepalive to true" do
|
419
|
+
expect(Chef::ServerAPI).to receive(:new).with(Chef::Config[:chef_server_url], keepalives: true)
|
420
|
+
synchronizer.server_api
|
421
|
+
end
|
422
|
+
end
|
423
|
+
|
417
424
|
describe "when syncing cookbooks with the server" do
|
418
425
|
let(:server_api) { double("Chef::ServerAPI (mock)") }
|
419
426
|
|
@@ -112,63 +112,63 @@ describe Chef::CookbookLoader do
|
|
112
112
|
end
|
113
113
|
|
114
114
|
it "should allow you to override an attribute file via cookbook_path" do
|
115
|
-
expect(cookbook_loader[:openldap].attribute_filenames.detect
|
115
|
+
expect(cookbook_loader[:openldap].attribute_filenames.detect do |f|
|
116
116
|
f =~ /cookbooks\/openldap\/attributes\/default.rb/
|
117
|
-
|
118
|
-
expect(cookbook_loader[:openldap].attribute_filenames.detect
|
117
|
+
end).not_to eql(nil)
|
118
|
+
expect(cookbook_loader[:openldap].attribute_filenames.detect do |f|
|
119
119
|
f =~ /kitchen\/openldap\/attributes\/default.rb/
|
120
|
-
|
120
|
+
end).to eql(nil)
|
121
121
|
end
|
122
122
|
|
123
123
|
it "should load different attribute files from deeper paths" do
|
124
|
-
expect(cookbook_loader[:openldap].attribute_filenames.detect
|
124
|
+
expect(cookbook_loader[:openldap].attribute_filenames.detect do |f|
|
125
125
|
f =~ /kitchen\/openldap\/attributes\/robinson.rb/
|
126
|
-
|
126
|
+
end).not_to eql(nil)
|
127
127
|
end
|
128
128
|
|
129
129
|
it "should allow you to override a definition file via cookbook_path" do
|
130
|
-
expect(cookbook_loader[:openldap].definition_filenames.detect
|
130
|
+
expect(cookbook_loader[:openldap].definition_filenames.detect do |f|
|
131
131
|
f =~ /cookbooks\/openldap\/definitions\/client.rb/
|
132
|
-
|
133
|
-
expect(cookbook_loader[:openldap].definition_filenames.detect
|
132
|
+
end).not_to eql(nil)
|
133
|
+
expect(cookbook_loader[:openldap].definition_filenames.detect do |f|
|
134
134
|
f =~ /kitchen\/openldap\/definitions\/client.rb/
|
135
|
-
|
135
|
+
end).to eql(nil)
|
136
136
|
end
|
137
137
|
|
138
138
|
it "should load definition files from deeper paths" do
|
139
|
-
expect(cookbook_loader[:openldap].definition_filenames.detect
|
139
|
+
expect(cookbook_loader[:openldap].definition_filenames.detect do |f|
|
140
140
|
f =~ /kitchen\/openldap\/definitions\/drewbarrymore.rb/
|
141
|
-
|
141
|
+
end).not_to eql(nil)
|
142
142
|
end
|
143
143
|
|
144
144
|
it "should allow you to override a recipe file via cookbook_path" do
|
145
|
-
expect(cookbook_loader[:openldap].recipe_filenames.detect
|
145
|
+
expect(cookbook_loader[:openldap].recipe_filenames.detect do |f|
|
146
146
|
f =~ /cookbooks\/openldap\/recipes\/gigantor.rb/
|
147
|
-
|
148
|
-
expect(cookbook_loader[:openldap].recipe_filenames.detect
|
147
|
+
end).not_to eql(nil)
|
148
|
+
expect(cookbook_loader[:openldap].recipe_filenames.detect do |f|
|
149
149
|
f =~ /kitchen\/openldap\/recipes\/gigantor.rb/
|
150
|
-
|
150
|
+
end).to eql(nil)
|
151
151
|
end
|
152
152
|
|
153
153
|
it "should load recipe files from deeper paths" do
|
154
|
-
expect(cookbook_loader[:openldap].recipe_filenames.detect
|
154
|
+
expect(cookbook_loader[:openldap].recipe_filenames.detect do |f|
|
155
155
|
f =~ /kitchen\/openldap\/recipes\/woot.rb/
|
156
|
-
|
156
|
+
end).not_to eql(nil)
|
157
157
|
end
|
158
158
|
|
159
159
|
it "should allow you to have an 'ignore' file, which skips loading files in later cookbooks" do
|
160
|
-
expect(cookbook_loader[:openldap].recipe_filenames.detect
|
160
|
+
expect(cookbook_loader[:openldap].recipe_filenames.detect do |f|
|
161
161
|
f =~ /kitchen\/openldap\/recipes\/ignoreme.rb/
|
162
|
-
|
162
|
+
end).to eql(nil)
|
163
163
|
end
|
164
164
|
|
165
165
|
it "should find files that start with a ." do
|
166
|
-
expect(cookbook_loader[:openldap].file_filenames.detect
|
166
|
+
expect(cookbook_loader[:openldap].file_filenames.detect do |f|
|
167
167
|
f =~ /\.dotfile$/
|
168
|
-
|
169
|
-
expect(cookbook_loader[:openldap].file_filenames.detect
|
168
|
+
end).to match(/\.dotfile$/)
|
169
|
+
expect(cookbook_loader[:openldap].file_filenames.detect do |f|
|
170
170
|
f =~ /\.ssh\/id_rsa$/
|
171
|
-
|
171
|
+
end).to match(/\.ssh\/id_rsa$/)
|
172
172
|
end
|
173
173
|
|
174
174
|
it "should load the metadata for the cookbook" do
|
@@ -304,24 +304,24 @@ describe Chef::CookbookVersion, "file specificity" do
|
|
304
304
|
it "should raise a FileNotFound exception without match" do
|
305
305
|
node = Chef::Node.new
|
306
306
|
|
307
|
-
expect
|
307
|
+
expect do
|
308
308
|
@cookbook.preferred_manifest_record(node, :files, "doesn't_exist.rb")
|
309
|
-
|
309
|
+
end.to raise_error(Chef::Exceptions::FileNotFound)
|
310
310
|
end
|
311
311
|
it "should raise a FileNotFound exception consistently without match" do
|
312
312
|
node = Chef::Node.new
|
313
313
|
|
314
|
-
expect
|
314
|
+
expect do
|
315
315
|
@cookbook.preferred_manifest_record(node, :files, "doesn't_exist.rb")
|
316
|
-
|
316
|
+
end.to raise_error(Chef::Exceptions::FileNotFound)
|
317
317
|
|
318
|
-
expect
|
318
|
+
expect do
|
319
319
|
@cookbook.preferred_manifest_record(node, :files, "doesn't_exist.rb")
|
320
|
-
|
320
|
+
end.to raise_error(Chef::Exceptions::FileNotFound)
|
321
321
|
|
322
|
-
expect
|
322
|
+
expect do
|
323
323
|
@cookbook.preferred_manifest_record(node, :files, "doesn't_exist.rb")
|
324
|
-
|
324
|
+
end.to raise_error(Chef::Exceptions::FileNotFound)
|
325
325
|
end
|
326
326
|
|
327
327
|
describe "when fetching the contents of a directory by file specificity" do
|
data/spec/unit/daemon_spec.rb
CHANGED
@@ -22,7 +22,7 @@ describe Chef::Daemon do
|
|
22
22
|
before do
|
23
23
|
if windows?
|
24
24
|
mock_struct = #Struct::Passwd.new(nil, nil, 111, 111)
|
25
|
-
|
25
|
+
mock_struct = OpenStruct.new(:uid => 2342, :gid => 2342)
|
26
26
|
allow(Etc).to receive(:getpwnam).and_return mock_struct
|
27
27
|
allow(Etc).to receive(:getgrnam).and_return mock_struct
|
28
28
|
# mock unimplemented methods
|
@@ -91,12 +91,12 @@ describe Chef::DataBagItem do
|
|
91
91
|
end
|
92
92
|
|
93
93
|
describe "object_name" do
|
94
|
-
let(:data_bag_item)
|
94
|
+
let(:data_bag_item) do
|
95
95
|
data_bag_item = Chef::DataBagItem.new
|
96
96
|
data_bag_item.data_bag("dreams")
|
97
97
|
data_bag_item.raw_data = { "id" => "the_beatdown" }
|
98
98
|
data_bag_item
|
99
|
-
|
99
|
+
end
|
100
100
|
|
101
101
|
it "should return an object name based on the bag name and the raw_data id" do
|
102
102
|
expect(data_bag_item.object_name).to eq("data_bag_item_dreams_the_beatdown")
|
@@ -110,12 +110,12 @@ describe Chef::DataBagItem do
|
|
110
110
|
end
|
111
111
|
|
112
112
|
describe "class method name" do
|
113
|
-
let(:data_bag_item)
|
113
|
+
let(:data_bag_item) do
|
114
114
|
data_bag_item = Chef::DataBagItem.new
|
115
115
|
data_bag_item.data_bag("dreams")
|
116
116
|
data_bag_item.raw_data = { "id" => "the_beatdown", "name" => "Bruce" }
|
117
117
|
data_bag_item
|
118
|
-
|
118
|
+
end
|
119
119
|
|
120
120
|
it "should return the object name" do
|
121
121
|
expect(data_bag_item.name).to eq(data_bag_item.object_name)
|
@@ -128,11 +128,11 @@ describe Chef::DataBagItem do
|
|
128
128
|
end
|
129
129
|
|
130
130
|
describe "when used like a Hash" do
|
131
|
-
let(:data_bag_item)
|
131
|
+
let(:data_bag_item) do
|
132
132
|
data_bag_item = Chef::DataBagItem.new
|
133
133
|
data_bag_item.raw_data = { "id" => "journey", "trials" => "been through" }
|
134
134
|
data_bag_item
|
135
|
-
|
135
|
+
end
|
136
136
|
|
137
137
|
it "responds to keys" do
|
138
138
|
expect(data_bag_item.keys).to include("id")
|
@@ -158,9 +158,9 @@ describe Chef::DataBagItem do
|
|
158
158
|
|
159
159
|
describe "from_hash" do
|
160
160
|
context "when hash contains raw_data" do
|
161
|
-
let(:data_bag_item)
|
161
|
+
let(:data_bag_item) do
|
162
162
|
Chef::DataBagItem.from_hash({ "raw_data" => { "id" => "whoa", "name" => "Bruce", "i_know" => "kung_fu" } })
|
163
|
-
|
163
|
+
end
|
164
164
|
|
165
165
|
it "should have the id key set" do
|
166
166
|
expect(data_bag_item["id"]).to eq("whoa")
|
@@ -172,9 +172,9 @@ describe Chef::DataBagItem do
|
|
172
172
|
end
|
173
173
|
|
174
174
|
context "when hash does not contain raw_data" do
|
175
|
-
let(:data_bag_item)
|
175
|
+
let(:data_bag_item) do
|
176
176
|
Chef::DataBagItem.from_hash({ "id" => "whoa", "name" => "Bruce", "i_know" => "kung_fu" })
|
177
|
-
|
177
|
+
end
|
178
178
|
|
179
179
|
it "should have the id key set" do
|
180
180
|
expect(data_bag_item["id"]).to eq("whoa")
|
@@ -187,12 +187,12 @@ describe Chef::DataBagItem do
|
|
187
187
|
end
|
188
188
|
|
189
189
|
describe "to_hash" do
|
190
|
-
let(:data_bag_item)
|
190
|
+
let(:data_bag_item) do
|
191
191
|
data_bag_item = Chef::DataBagItem.new
|
192
192
|
data_bag_item.data_bag("still_lost")
|
193
193
|
data_bag_item.raw_data = { "id" => "whoa", "name" => "Bruce", "i_know" => "kung_fu" }
|
194
194
|
data_bag_item
|
195
|
-
|
195
|
+
end
|
196
196
|
|
197
197
|
let!(:original_data_bag_keys) { data_bag_item.keys }
|
198
198
|
|
@@ -223,12 +223,12 @@ describe Chef::DataBagItem do
|
|
223
223
|
end
|
224
224
|
|
225
225
|
describe "when deserializing from JSON" do
|
226
|
-
let(:data_bag_item)
|
226
|
+
let(:data_bag_item) do
|
227
227
|
data_bag_item = Chef::DataBagItem.new
|
228
228
|
data_bag_item.data_bag("mars_volta")
|
229
229
|
data_bag_item.raw_data = { "id" => "octahedron", "name" => "Bruce", "snooze" => { "finally" => :world_will } }
|
230
230
|
data_bag_item
|
231
|
-
|
231
|
+
end
|
232
232
|
|
233
233
|
let(:deserial) { Chef::DataBagItem.from_hash(Chef::JSONCompat.parse(Chef::JSONCompat.to_json(data_bag_item))) }
|
234
234
|
|
@@ -275,13 +275,13 @@ describe Chef::DataBagItem do
|
|
275
275
|
describe "save" do
|
276
276
|
let(:server) { instance_double(Chef::ServerAPI) }
|
277
277
|
|
278
|
-
let(:data_bag_item)
|
278
|
+
let(:data_bag_item) do
|
279
279
|
data_bag_item = Chef::DataBagItem.new
|
280
280
|
data_bag_item["id"] = "heart of darkness"
|
281
281
|
data_bag_item.raw_data = { "id" => "heart_of_darkness", "author" => "Conrad" }
|
282
282
|
data_bag_item.data_bag("books")
|
283
283
|
data_bag_item
|
284
|
-
|
284
|
+
end
|
285
285
|
|
286
286
|
before do
|
287
287
|
expect(Chef::ServerAPI).to receive(:new).and_return(server)
|
@@ -320,12 +320,12 @@ describe Chef::DataBagItem do
|
|
320
320
|
describe "destroy" do
|
321
321
|
let(:server) { instance_double(Chef::ServerAPI) }
|
322
322
|
|
323
|
-
let(:data_bag_item)
|
323
|
+
let(:data_bag_item) do
|
324
324
|
data_bag_item = Chef::DataBagItem.new
|
325
325
|
data_bag_item.data_bag("a_baggy_bag")
|
326
326
|
data_bag_item.raw_data = { "id" => "some_id" }
|
327
327
|
data_bag_item
|
328
|
-
|
328
|
+
end
|
329
329
|
|
330
330
|
it "should set default parameters" do
|
331
331
|
expect(Chef::ServerAPI).to receive(:new).and_return(server)
|
data/spec/unit/data_bag_spec.rb
CHANGED
@@ -241,9 +241,9 @@ describe Chef::DataBag do
|
|
241
241
|
it "should raise an error if the configured data_bag_path is invalid" do
|
242
242
|
file_dir_stub(@paths.first, false)
|
243
243
|
|
244
|
-
expect
|
244
|
+
expect do
|
245
245
|
Chef::DataBag.load("foo")
|
246
|
-
|
246
|
+
end.to raise_error Chef::Exceptions::InvalidDataBagPath, "Data bag path '/var/chef/data_bags' is invalid"
|
247
247
|
end
|
248
248
|
|
249
249
|
end
|
@@ -25,7 +25,7 @@ class TestMessage
|
|
25
25
|
end
|
26
26
|
|
27
27
|
describe Chef::DataCollector::Messages::Helpers do
|
28
|
-
describe
|
28
|
+
describe "#organization" do
|
29
29
|
context "when the run is a solo run" do
|
30
30
|
it "returns the data collector organization" do
|
31
31
|
allow(TestMessage).to receive(:solo_run?).and_return(true)
|
@@ -43,7 +43,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
describe
|
46
|
+
describe "#data_collector_organization" do
|
47
47
|
context "when the org is specified in the config" do
|
48
48
|
it "returns the org from the config" do
|
49
49
|
Chef::Config[:data_collector][:organization] = "org1"
|
@@ -58,7 +58,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
describe
|
61
|
+
describe "#chef_server_organization" do
|
62
62
|
context "when the URL is properly formatted" do
|
63
63
|
it "returns the org from the parsed URL" do
|
64
64
|
Chef::Config[:chef_server_url] = "http://mycompany.com/organizations/myorg"
|
@@ -74,7 +74,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
describe
|
77
|
+
describe "#collector_source" do
|
78
78
|
context "when the run is a solo run" do
|
79
79
|
it "returns chef_solo" do
|
80
80
|
allow(TestMessage).to receive(:solo_run?).and_return(true)
|
@@ -90,7 +90,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
describe
|
93
|
+
describe "#solo_run?" do
|
94
94
|
context "when :solo is set in Chef::Config" do
|
95
95
|
it "returns true" do
|
96
96
|
Chef::Config[:solo] = true
|
@@ -116,7 +116,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
describe
|
119
|
+
describe "#node_uuid" do
|
120
120
|
context "when the node UUID can be read" do
|
121
121
|
it "returns the read-in node UUID" do
|
122
122
|
allow(TestMessage).to receive(:read_node_uuid).and_return("read_uuid")
|
@@ -133,7 +133,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
describe
|
136
|
+
describe "#generate_node_uuid" do
|
137
137
|
it "generates a new UUID, stores it, and returns it" do
|
138
138
|
expect(SecureRandom).to receive(:uuid).and_return("generated_uuid")
|
139
139
|
expect(TestMessage).to receive(:update_metadata).with("node_uuid", "generated_uuid")
|
@@ -141,7 +141,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
describe
|
144
|
+
describe "#read_node_uuid" do
|
145
145
|
it "reads the node UUID from metadata" do
|
146
146
|
expect(TestMessage).to receive(:metadata).and_return({ "node_uuid" => "read_uuid" })
|
147
147
|
expect(TestMessage.read_node_uuid).to eq("read_uuid")
|
@@ -170,7 +170,7 @@ describe Chef::DataCollector::Messages::Helpers do
|
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
173
|
-
describe
|
173
|
+
describe "#update_metadata" do
|
174
174
|
it "updates the file" do
|
175
175
|
allow(TestMessage).to receive(:metadata_filename).and_return("fake_metadata_file.json")
|
176
176
|
allow(TestMessage).to receive(:metadata).and_return({ "key" => "current_value" })
|
@@ -22,7 +22,7 @@ require "ffi_yajl"
|
|
22
22
|
require "chef/data_collector/messages/helpers"
|
23
23
|
|
24
24
|
describe Chef::DataCollector::Messages do
|
25
|
-
describe
|
25
|
+
describe "#run_start_message" do
|
26
26
|
let(:run_status) { Chef::RunStatus.new(Chef::Node.new, Chef::EventDispatch::Dispatcher.new) }
|
27
27
|
let(:required_fields) do
|
28
28
|
%w{
|
@@ -61,7 +61,7 @@ describe Chef::DataCollector::Messages do
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
describe
|
64
|
+
describe "#run_end_message" do
|
65
65
|
let(:node) { Chef::Node.new }
|
66
66
|
let(:run_status) { Chef::RunStatus.new(node, Chef::EventDispatch::Dispatcher.new) }
|
67
67
|
let(:report1) { double("report1", report_data: { "status" => "updated" }) }
|
@@ -160,7 +160,7 @@ describe Chef::DataCollector::Reporter do
|
|
160
160
|
Chef::Config[:data_collector][:server_url] = "http://my-data-collector-server.mycompany.com"
|
161
161
|
end
|
162
162
|
|
163
|
-
describe
|
163
|
+
describe "#run_started" do
|
164
164
|
before do
|
165
165
|
allow(reporter).to receive(:update_run_status)
|
166
166
|
allow(reporter).to receive(:send_to_data_collector)
|
@@ -182,7 +182,7 @@ describe Chef::DataCollector::Reporter do
|
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
185
|
-
describe
|
185
|
+
describe "#run_completed" do
|
186
186
|
it "sends the run completion" do
|
187
187
|
node = Chef::Node.new
|
188
188
|
|
@@ -191,35 +191,35 @@ describe Chef::DataCollector::Reporter do
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
-
describe
|
194
|
+
describe "#run_failed" do
|
195
195
|
it "updates the exception and sends the run completion" do
|
196
196
|
expect(reporter).to receive(:send_run_completion).with(status: "failure")
|
197
197
|
reporter.run_failed("test_exception")
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|
201
|
-
describe
|
201
|
+
describe "#converge_start" do
|
202
202
|
it "stashes the run_context for later use" do
|
203
203
|
reporter.converge_start("test_context")
|
204
204
|
expect(reporter.run_context).to eq("test_context")
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
208
|
-
describe
|
208
|
+
describe "#converge_complete" do
|
209
209
|
it "detects and processes any unprocessed resources" do
|
210
210
|
expect(reporter).to receive(:detect_unprocessed_resources)
|
211
211
|
reporter.converge_complete
|
212
212
|
end
|
213
213
|
end
|
214
214
|
|
215
|
-
describe
|
215
|
+
describe "#converge_failed" do
|
216
216
|
it "detects and processes any unprocessed resources" do
|
217
217
|
expect(reporter).to receive(:detect_unprocessed_resources)
|
218
218
|
reporter.converge_failed("exception")
|
219
219
|
end
|
220
220
|
end
|
221
221
|
|
222
|
-
describe
|
222
|
+
describe "#resource_current_state_loaded" do
|
223
223
|
let(:new_resource) { double("new_resource") }
|
224
224
|
let(:action) { double("action") }
|
225
225
|
let(:current_resource) { double("current_resource") }
|
@@ -245,7 +245,7 @@ describe Chef::DataCollector::Reporter do
|
|
245
245
|
end
|
246
246
|
end
|
247
247
|
|
248
|
-
describe
|
248
|
+
describe "#resource_up_to_date" do
|
249
249
|
let(:new_resource) { double("new_resource") }
|
250
250
|
let(:action) { double("action") }
|
251
251
|
let(:resource_report) { double("resource_report") }
|
@@ -273,7 +273,7 @@ describe Chef::DataCollector::Reporter do
|
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
276
|
-
describe
|
276
|
+
describe "#resource_skipped" do
|
277
277
|
let(:new_resource) { double("new_resource") }
|
278
278
|
let(:action) { double("action") }
|
279
279
|
let(:conditional) { double("conditional") }
|
@@ -311,7 +311,7 @@ describe Chef::DataCollector::Reporter do
|
|
311
311
|
end
|
312
312
|
end
|
313
313
|
|
314
|
-
describe
|
314
|
+
describe "#resource_updated" do
|
315
315
|
let(:resource_report) { double("resource_report") }
|
316
316
|
|
317
317
|
before do
|
@@ -325,7 +325,7 @@ describe Chef::DataCollector::Reporter do
|
|
325
325
|
end
|
326
326
|
end
|
327
327
|
|
328
|
-
describe
|
328
|
+
describe "#resource_failed" do
|
329
329
|
let(:new_resource) { double("new_resource") }
|
330
330
|
let(:action) { double("action") }
|
331
331
|
let(:exception) { double("exception") }
|
@@ -368,7 +368,7 @@ describe Chef::DataCollector::Reporter do
|
|
368
368
|
end
|
369
369
|
end
|
370
370
|
|
371
|
-
describe
|
371
|
+
describe "#resource_completed" do
|
372
372
|
let(:new_resource) { double("new_resource") }
|
373
373
|
let(:resource_report) { double("resource_report") }
|
374
374
|
|
@@ -418,14 +418,14 @@ describe Chef::DataCollector::Reporter do
|
|
418
418
|
end
|
419
419
|
end
|
420
420
|
|
421
|
-
describe
|
421
|
+
describe "#run_list_expanded" do
|
422
422
|
it "sets the expanded run list" do
|
423
423
|
reporter.run_list_expanded("test_run_list")
|
424
424
|
expect(reporter.expanded_run_list).to eq("test_run_list")
|
425
425
|
end
|
426
426
|
end
|
427
427
|
|
428
|
-
describe
|
428
|
+
describe "#run_list_expand_failed" do
|
429
429
|
let(:node) { double("node") }
|
430
430
|
let(:error_mapper) { double("error_mapper") }
|
431
431
|
let(:exception) { double("exception") }
|
@@ -441,7 +441,7 @@ describe Chef::DataCollector::Reporter do
|
|
441
441
|
end
|
442
442
|
end
|
443
443
|
|
444
|
-
describe
|
444
|
+
describe "#cookbook_resolution_failed" do
|
445
445
|
let(:error_mapper) { double("error_mapper") }
|
446
446
|
let(:exception) { double("exception") }
|
447
447
|
let(:expanded_run_list) { double("expanded_run_list") }
|
@@ -458,7 +458,7 @@ describe Chef::DataCollector::Reporter do
|
|
458
458
|
|
459
459
|
end
|
460
460
|
|
461
|
-
describe
|
461
|
+
describe "#cookbook_sync_failed" do
|
462
462
|
let(:cookbooks) { double("cookbooks") }
|
463
463
|
let(:error_mapper) { double("error_mapper") }
|
464
464
|
let(:exception) { double("exception") }
|
@@ -474,7 +474,7 @@ describe Chef::DataCollector::Reporter do
|
|
474
474
|
end
|
475
475
|
end
|
476
476
|
|
477
|
-
describe
|
477
|
+
describe "#disable_reporter_on_error" do
|
478
478
|
context "when no exception is raise by the block" do
|
479
479
|
it "does not disable the reporter" do
|
480
480
|
expect(reporter).not_to receive(:disable_data_collector_reporter)
|
@@ -488,7 +488,7 @@ describe Chef::DataCollector::Reporter do
|
|
488
488
|
|
489
489
|
context "when an unexpected exception is raised by the block" do
|
490
490
|
it "re-raises the exception" do
|
491
|
-
expect { reporter.send(:disable_reporter_on_error) { raise
|
491
|
+
expect { reporter.send(:disable_reporter_on_error) { raise "bummer" } }.to raise_error(RuntimeError)
|
492
492
|
end
|
493
493
|
end
|
494
494
|
|
@@ -521,7 +521,7 @@ describe Chef::DataCollector::Reporter do
|
|
521
521
|
end
|
522
522
|
end
|
523
523
|
|
524
|
-
describe
|
524
|
+
describe "#validate_data_collector_server_url!" do
|
525
525
|
context "when server_url is empty" do
|
526
526
|
it "raises an exception" do
|
527
527
|
Chef::Config[:data_collector][:server_url] = ""
|