chef 12.6.0-universal-mingw32 → 12.7.2-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +26 -19
- data/README.md +26 -23
- data/Rakefile +28 -17
- data/VERSION +1 -0
- data/acceptance/.gitignore +1 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml +27 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +281 -0
- data/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml +49 -0
- data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +46 -0
- data/acceptance/.shared/kitchen_acceptance/metadata.rb +1 -0
- data/acceptance/Gemfile +11 -0
- data/acceptance/README.md +86 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb +3 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/basics/.kitchen.yml +4 -0
- data/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb +19 -0
- data/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb +6 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb +43 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb +21 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/metadata.rb +3 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/top-cookbooks/.gitignore +1 -0
- data/acceptance/top-cookbooks/.kitchen.git.yml +10 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml +4 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml +4 -0
- data/acceptance/top-cookbooks/.kitchen.learn-the-basics-windows.yml +4 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb +2 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/trivial/.kitchen.yml +7 -0
- data/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb +5 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore +2 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb +2 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
- data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
- data/acceptance/windows-service/.kitchen.yml +7 -0
- data/acceptance/windows-service/test/integration/chef-windows-service/inspec/chef_windows_service_spec.rb +58 -0
- data/bin/chef-apply +3 -3
- data/bin/chef-client +5 -5
- data/bin/chef-service-manager +7 -7
- data/bin/chef-shell +1 -1
- data/bin/chef-solo +4 -4
- data/bin/chef-windows-service +5 -5
- data/bin/knife +4 -5
- data/chef-windows.gemspec +5 -2
- data/chef.gemspec +13 -13
- data/distro/common/html/_static/basic.css +1 -1
- data/distro/common/html/_static/doctools.js +1 -1
- data/distro/common/html/_static/searchtools.js +1 -1
- data/distro/common/html/_static/websupport.js +1 -1
- data/ext/win32-eventlog/Rakefile +13 -14
- data/lib-backcompat/chef/chef_fs/file_system/acl_entry.rb +5 -0
- data/lib-backcompat/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +5 -0
- data/lib-backcompat/chef/chef_fs/file_system/chef_server_root_dir.rb +5 -0
- data/lib/chef.rb +17 -17
- data/lib/chef/api_client.rb +31 -30
- data/lib/chef/api_client/registration.rb +34 -10
- data/lib/chef/api_client_v1.rb +36 -36
- data/lib/chef/application.rb +32 -23
- data/lib/chef/application/apply.rb +20 -20
- data/lib/chef/application/client.rb +63 -43
- data/lib/chef/application/knife.rb +21 -15
- data/lib/chef/application/solo.rb +52 -41
- data/lib/chef/application/windows_service.rb +25 -25
- data/lib/chef/application/windows_service_manager.rb +22 -22
- data/lib/chef/applications.rb +4 -4
- data/lib/chef/audit/audit_event_proxy.rb +3 -3
- data/lib/chef/audit/audit_reporter.rb +8 -10
- data/lib/chef/audit/control_group_data.rb +9 -10
- data/lib/chef/audit/logger.rb +3 -3
- data/lib/chef/audit/rspec_formatter.rb +2 -2
- data/lib/chef/audit/runner.rb +15 -14
- data/lib/chef/chef_class.rb +10 -7
- data/lib/chef/chef_fs.rb +51 -1
- data/lib/chef/chef_fs/chef_fs_data_store.rb +320 -125
- data/lib/chef/chef_fs/command_line.rb +8 -8
- data/lib/chef/chef_fs/config.rb +52 -23
- data/lib/chef/chef_fs/data_handler/acl_data_handler.rb +10 -10
- data/lib/chef/chef_fs/data_handler/client_data_handler.rb +12 -12
- data/lib/chef/chef_fs/data_handler/container_data_handler.rb +6 -6
- data/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb +15 -15
- data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +11 -11
- data/lib/chef/chef_fs/data_handler/data_handler_base.rb +8 -8
- data/lib/chef/chef_fs/data_handler/environment_data_handler.rb +14 -14
- data/lib/chef/chef_fs/data_handler/group_data_handler.rb +18 -18
- data/lib/chef/chef_fs/data_handler/node_data_handler.rb +14 -14
- data/lib/chef/chef_fs/data_handler/organization_data_handler.rb +9 -9
- data/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb +2 -2
- data/lib/chef/chef_fs/data_handler/organization_members_data_handler.rb +2 -2
- data/lib/chef/chef_fs/data_handler/policy_data_handler.rb +30 -3
- data/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb +27 -0
- data/lib/chef/chef_fs/data_handler/role_data_handler.rb +16 -16
- data/lib/chef/chef_fs/data_handler/user_data_handler.rb +12 -12
- data/lib/chef/chef_fs/file_pattern.rb +25 -25
- data/lib/chef/chef_fs/file_system.rb +10 -10
- data/lib/chef/chef_fs/file_system/already_exists_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/base_fs_dir.rb +4 -4
- data/lib/chef/chef_fs/file_system/base_fs_object.rb +8 -8
- data/lib/chef/chef_fs/file_system/chef_server/acl_dir.rb +65 -0
- data/lib/chef/chef_fs/file_system/chef_server/acl_entry.rb +60 -0
- data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +75 -0
- data/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +196 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_acls_dir.rb → chef_server/cookbook_artifact_dir.rb} +13 -12
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +102 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +222 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +84 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb +61 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb +42 -0
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +102 -0
- data/lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb +71 -0
- data/lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb +69 -0
- data/lib/chef/chef_fs/file_system/chef_server/environments_dir.rb +57 -0
- data/lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb +53 -0
- data/lib/chef/chef_fs/file_system/chef_server/org_entry.rb +31 -0
- data/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb +61 -0
- data/lib/chef/chef_fs/file_system/chef_server/organization_members_entry.rb +60 -0
- data/lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb +41 -0
- data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +160 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb +137 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb +43 -0
- data/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb +34 -0
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +178 -0
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +187 -0
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb +45 -0
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +107 -0
- data/lib/chef/chef_fs/file_system/cookbook_frozen_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb +3 -7
- data/lib/chef/chef_fs/file_system/file_system_error.rb +14 -3
- data/lib/chef/chef_fs/file_system/memory/memory_dir.rb +53 -0
- data/lib/chef/chef_fs/file_system/memory/memory_file.rb +20 -0
- data/lib/chef/chef_fs/file_system/memory/memory_root.rb +23 -0
- data/lib/chef/chef_fs/file_system/multiplexed_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +4 -4
- data/lib/chef/chef_fs/file_system/not_found_error.rb +3 -6
- data/lib/chef/chef_fs/file_system/operation_failed_error.rb +5 -5
- data/lib/chef/chef_fs/file_system/operation_not_allowed_error.rb +16 -18
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb +39 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +41 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_policies_dir.rb → repository/chef_repository_file_system_cookbook_artifacts_dir.rb} +9 -13
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +95 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +82 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb +84 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_data_bags_dir.rb +38 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_entry.rb +83 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb +38 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +210 -0
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +42 -0
- data/lib/chef/chef_fs/file_system/{chef_repository_file_system_data_bags_dir.rb → repository/chef_repository_file_system_versioned_cookbooks_dir.rb} +9 -11
- data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +117 -0
- data/lib/chef/chef_fs/file_system/{file_system_root_dir.rb → repository/file_system_root_dir.rb} +8 -6
- data/lib/chef/chef_fs/knife.rb +16 -16
- data/lib/chef/chef_fs/parallelizer.rb +3 -3
- data/lib/chef/chef_fs/parallelizer/flatten_enumerable.rb +1 -1
- data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +3 -3
- data/lib/chef/chef_fs/path_utils.rb +11 -10
- data/lib/chef/client.rb +80 -71
- data/lib/chef/config.rb +10 -10
- data/lib/chef/config_fetcher.rb +12 -4
- data/lib/chef/constants.rb +2 -1
- data/lib/chef/cookbook/chefignore.rb +4 -5
- data/lib/chef/cookbook/cookbook_collection.rb +6 -6
- data/lib/chef/cookbook/cookbook_version_loader.rb +15 -15
- data/lib/chef/cookbook/file_system_file_vendor.rb +4 -4
- data/lib/chef/cookbook/file_vendor.rb +3 -4
- data/lib/chef/cookbook/metadata.rb +108 -107
- data/lib/chef/cookbook/remote_file_vendor.rb +7 -7
- data/lib/chef/cookbook/synchronizer.rb +11 -10
- data/lib/chef/cookbook/syntax_check.rb +14 -14
- data/lib/chef/cookbook_loader.rb +14 -14
- data/lib/chef/cookbook_manifest.rb +16 -15
- data/lib/chef/cookbook_site_streaming_uploader.rb +22 -22
- data/lib/chef/cookbook_uploader.rb +22 -21
- data/lib/chef/cookbook_version.rb +87 -87
- data/lib/chef/daemon.rb +6 -6
- data/lib/chef/data_bag.rb +32 -26
- data/lib/chef/data_bag_item.rb +43 -40
- data/lib/chef/delayed_evaluator.rb +1 -1
- data/lib/chef/deprecation/mixin/template.rb +4 -4
- data/lib/chef/deprecation/provider/cookbook_file.rb +2 -3
- data/lib/chef/deprecation/provider/file.rb +10 -10
- data/lib/chef/deprecation/provider/remote_directory.rb +5 -5
- data/lib/chef/deprecation/provider/remote_file.rb +3 -3
- data/lib/chef/deprecation/provider/template.rb +3 -3
- data/lib/chef/deprecation/warnings.rb +2 -2
- data/lib/chef/digester.rb +6 -6
- data/lib/chef/dsl.rb +6 -6
- data/lib/chef/dsl/audit.rb +4 -4
- data/lib/chef/dsl/chef_provisioning.rb +5 -5
- data/lib/chef/dsl/cheffish.rb +5 -5
- data/lib/chef/dsl/data_query.rb +10 -10
- data/lib/chef/dsl/declare_resource.rb +8 -8
- data/lib/chef/dsl/definitions.rb +1 -2
- data/lib/chef/dsl/include_attribute.rb +4 -6
- data/lib/chef/dsl/include_recipe.rb +4 -4
- data/lib/chef/dsl/platform_introspection.rb +8 -14
- data/lib/chef/dsl/powershell.rb +3 -3
- data/lib/chef/dsl/reboot_pending.rb +12 -13
- data/lib/chef/dsl/recipe.rb +20 -20
- data/lib/chef/dsl/registry_helper.rb +7 -3
- data/lib/chef/dsl/resources.rb +6 -5
- data/lib/chef/encrypted_data_bag_item.rb +10 -10
- data/lib/chef/encrypted_data_bag_item/assertions.rb +4 -4
- data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +3 -3
- data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/decryptor.rb +16 -14
- data/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryption_failure.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryptor.rb +20 -20
- data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +2 -2
- data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +2 -2
- data/lib/chef/environment.rb +41 -34
- data/lib/chef/event_dispatch/base.rb +2 -2
- data/lib/chef/event_dispatch/dispatcher.rb +2 -2
- data/lib/chef/event_dispatch/dsl.rb +6 -5
- data/lib/chef/event_loggers/base.rb +3 -3
- data/lib/chef/event_loggers/windows_eventlog.rb +11 -11
- data/lib/chef/exceptions.rb +23 -34
- data/lib/chef/file_access_control.rb +6 -6
- data/lib/chef/file_access_control/unix.rb +5 -5
- data/lib/chef/file_access_control/windows.rb +5 -5
- data/lib/chef/file_cache.rb +21 -21
- data/lib/chef/file_content_management/content_base.rb +2 -2
- data/lib/chef/file_content_management/deploy.rb +5 -6
- data/lib/chef/file_content_management/deploy/cp.rb +2 -2
- data/lib/chef/file_content_management/deploy/mv_unix.rb +2 -3
- data/lib/chef/file_content_management/deploy/mv_windows.rb +4 -6
- data/lib/chef/file_content_management/tempfile.rb +3 -3
- data/lib/chef/formatters/base.rb +8 -9
- data/lib/chef/formatters/doc.rb +7 -7
- data/lib/chef/formatters/error_descriptor.rb +5 -5
- data/lib/chef/formatters/error_inspectors.rb +5 -5
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +50 -15
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +11 -11
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +8 -8
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +8 -6
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +14 -13
- data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +19 -17
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +8 -11
- data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +15 -14
- data/lib/chef/formatters/error_mapper.rb +2 -2
- data/lib/chef/formatters/indentable_output_stream.rb +5 -5
- data/lib/chef/formatters/minimal.rb +7 -9
- data/lib/chef/guard_interpreter.rb +3 -3
- data/lib/chef/guard_interpreter/default_guard_interpreter.rb +3 -4
- data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +9 -9
- data/lib/chef/handler.rb +4 -4
- data/lib/chef/handler/error_report.rb +4 -4
- data/lib/chef/handler/json_file.rb +5 -5
- data/lib/chef/http.rb +32 -35
- data/lib/chef/http/auth_credentials.rb +12 -12
- data/lib/chef/http/authenticator.rb +17 -12
- data/lib/chef/http/basic_client.rb +20 -20
- data/lib/chef/http/cookie_jar.rb +7 -7
- data/lib/chef/http/cookie_manager.rb +8 -8
- data/lib/chef/http/decompressor.rb +7 -9
- data/lib/chef/http/http_request.rb +31 -32
- data/lib/chef/http/json_input.rb +9 -9
- data/lib/chef/http/json_output.rb +9 -9
- data/lib/chef/http/json_to_model_output.rb +4 -4
- data/lib/chef/http/remote_request_id.rb +6 -6
- data/lib/chef/http/simple.rb +23 -5
- data/lib/chef/http/simple_json.rb +43 -0
- data/lib/chef/http/socketless_chef_zero_client.rb +56 -57
- data/lib/chef/http/ssl_policies.rb +9 -9
- data/lib/chef/http/validate_content_length.rb +12 -12
- data/lib/chef/json_compat.rb +6 -6
- data/lib/chef/key.rb +44 -42
- data/lib/chef/knife.rb +47 -44
- data/lib/chef/knife/bootstrap.rb +32 -32
- data/lib/chef/knife/bootstrap/chef_vault_handler.rb +16 -23
- data/lib/chef/knife/bootstrap/client_builder.rb +15 -13
- data/lib/chef/knife/bootstrap/templates/chef-full.erb +1 -1
- data/lib/chef/knife/client_bulk_delete.rb +5 -5
- data/lib/chef/knife/client_create.rb +5 -5
- data/lib/chef/knife/client_delete.rb +6 -6
- data/lib/chef/knife/client_edit.rb +5 -5
- data/lib/chef/knife/client_key_create.rb +6 -6
- data/lib/chef/knife/client_key_delete.rb +6 -6
- data/lib/chef/knife/client_key_edit.rb +8 -9
- data/lib/chef/knife/client_key_list.rb +5 -5
- data/lib/chef/knife/client_key_show.rb +5 -5
- data/lib/chef/knife/client_list.rb +5 -5
- data/lib/chef/knife/client_reregister.rb +5 -5
- data/lib/chef/knife/client_show.rb +5 -5
- data/lib/chef/knife/configure.rb +14 -14
- data/lib/chef/knife/configure_client.rb +6 -6
- data/lib/chef/knife/cookbook_bulk_delete.rb +9 -10
- data/lib/chef/knife/cookbook_create.rb +12 -12
- data/lib/chef/knife/cookbook_delete.rb +10 -10
- data/lib/chef/knife/cookbook_download.rb +8 -10
- data/lib/chef/knife/cookbook_list.rb +5 -5
- data/lib/chef/knife/cookbook_metadata.rb +8 -8
- data/lib/chef/knife/cookbook_metadata_from_file.rb +5 -5
- data/lib/chef/knife/cookbook_show.rb +14 -18
- data/lib/chef/knife/cookbook_site_download.rb +22 -22
- data/lib/chef/knife/cookbook_site_install.rb +10 -10
- data/lib/chef/knife/cookbook_site_list.rb +6 -10
- data/lib/chef/knife/cookbook_site_search.rb +5 -10
- data/lib/chef/knife/cookbook_site_share.rb +17 -18
- data/lib/chef/knife/cookbook_site_show.rb +7 -12
- data/lib/chef/knife/cookbook_site_unshare.rb +6 -6
- data/lib/chef/knife/cookbook_site_vendor.rb +5 -5
- data/lib/chef/knife/cookbook_test.rb +6 -7
- data/lib/chef/knife/cookbook_upload.rb +19 -20
- data/lib/chef/knife/core/bootstrap_context.rb +25 -21
- data/lib/chef/knife/core/cookbook_scm_repo.rb +11 -12
- data/lib/chef/knife/core/custom_manifest_loader.rb +2 -2
- data/lib/chef/knife/core/gem_glob_loader.rb +11 -11
- data/lib/chef/knife/core/generic_presenter.rb +33 -34
- data/lib/chef/knife/core/hashed_command_loader.rb +6 -6
- data/lib/chef/knife/core/node_editor.rb +59 -38
- data/lib/chef/knife/core/node_presenter.rb +13 -14
- data/lib/chef/knife/core/object_loader.rb +9 -9
- data/lib/chef/knife/core/status_presenter.rb +17 -17
- data/lib/chef/knife/core/subcommand_loader.rb +19 -20
- data/lib/chef/knife/core/text_formatter.rb +13 -14
- data/lib/chef/knife/core/ui.rb +17 -18
- data/lib/chef/knife/data_bag_create.rb +11 -10
- data/lib/chef/knife/data_bag_delete.rb +6 -8
- data/lib/chef/knife/data_bag_edit.rb +8 -11
- data/lib/chef/knife/data_bag_from_file.rb +12 -11
- data/lib/chef/knife/data_bag_list.rb +4 -8
- data/lib/chef/knife/data_bag_secret_options.rb +6 -6
- data/lib/chef/knife/data_bag_show.rb +31 -31
- data/lib/chef/knife/delete.rb +6 -7
- data/lib/chef/knife/deps.rb +18 -18
- data/lib/chef/knife/diff.rb +8 -9
- data/lib/chef/knife/download.rb +11 -12
- data/lib/chef/knife/edit.rb +5 -6
- data/lib/chef/knife/environment_compare.rb +23 -23
- data/lib/chef/knife/environment_create.rb +5 -5
- data/lib/chef/knife/environment_delete.rb +5 -5
- data/lib/chef/knife/environment_edit.rb +5 -5
- data/lib/chef/knife/environment_from_file.rb +4 -5
- data/lib/chef/knife/environment_list.rb +5 -5
- data/lib/chef/knife/environment_show.rb +5 -5
- data/lib/chef/knife/exec.rb +7 -7
- data/lib/chef/knife/help.rb +7 -9
- data/lib/chef/knife/index_rebuild.rb +4 -5
- data/lib/chef/knife/key_create.rb +5 -5
- data/lib/chef/knife/key_create_base.rb +1 -1
- data/lib/chef/knife/key_delete.rb +2 -2
- data/lib/chef/knife/key_edit.rb +5 -5
- data/lib/chef/knife/key_edit_base.rb +1 -1
- data/lib/chef/knife/key_list.rb +12 -12
- data/lib/chef/knife/key_list_base.rb +1 -1
- data/lib/chef/knife/key_show.rb +4 -4
- data/lib/chef/knife/list.rb +14 -13
- data/lib/chef/knife/node_bulk_delete.rb +6 -12
- data/lib/chef/knife/node_create.rb +5 -8
- data/lib/chef/knife/node_delete.rb +5 -6
- data/lib/chef/knife/node_edit.rb +6 -8
- data/lib/chef/knife/node_environment_set.rb +4 -4
- data/lib/chef/knife/node_from_file.rb +10 -10
- data/lib/chef/knife/node_list.rb +5 -7
- data/lib/chef/knife/node_run_list_add.rb +8 -8
- data/lib/chef/knife/node_run_list_remove.rb +8 -8
- data/lib/chef/knife/node_run_list_set.rb +6 -6
- data/lib/chef/knife/node_show.rb +6 -7
- data/lib/chef/knife/osc_user_create.rb +5 -5
- data/lib/chef/knife/osc_user_delete.rb +5 -5
- data/lib/chef/knife/osc_user_edit.rb +5 -5
- data/lib/chef/knife/osc_user_list.rb +5 -5
- data/lib/chef/knife/osc_user_reregister.rb +5 -5
- data/lib/chef/knife/osc_user_show.rb +5 -5
- data/lib/chef/knife/raw.rb +18 -17
- data/lib/chef/knife/recipe_list.rb +4 -4
- data/lib/chef/knife/rehash.rb +9 -9
- data/lib/chef/knife/role_bulk_delete.rb +5 -10
- data/lib/chef/knife/role_create.rb +5 -7
- data/lib/chef/knife/role_delete.rb +5 -6
- data/lib/chef/knife/role_edit.rb +5 -8
- data/lib/chef/knife/role_env_run_list_add.rb +9 -9
- data/lib/chef/knife/role_env_run_list_clear.rb +4 -4
- data/lib/chef/knife/role_env_run_list_remove.rb +13 -13
- data/lib/chef/knife/role_env_run_list_replace.rb +6 -6
- data/lib/chef/knife/role_env_run_list_set.rb +6 -6
- data/lib/chef/knife/role_from_file.rb +6 -11
- data/lib/chef/knife/role_list.rb +5 -6
- data/lib/chef/knife/role_run_list_add.rb +9 -9
- data/lib/chef/knife/role_run_list_clear.rb +4 -4
- data/lib/chef/knife/role_run_list_remove.rb +13 -13
- data/lib/chef/knife/role_run_list_replace.rb +6 -6
- data/lib/chef/knife/role_run_list_set.rb +6 -6
- data/lib/chef/knife/role_show.rb +5 -8
- data/lib/chef/knife/search.rb +11 -11
- data/lib/chef/knife/serve.rb +10 -10
- data/lib/chef/knife/show.rb +4 -4
- data/lib/chef/knife/ssh.rb +34 -34
- data/lib/chef/knife/ssl_check.rb +12 -11
- data/lib/chef/knife/ssl_fetch.rb +13 -15
- data/lib/chef/knife/status.rb +10 -10
- data/lib/chef/knife/tag_create.rb +5 -5
- data/lib/chef/knife/tag_delete.rb +5 -5
- data/lib/chef/knife/tag_list.rb +5 -5
- data/lib/chef/knife/upload.rb +10 -11
- data/lib/chef/knife/user_create.rb +6 -8
- data/lib/chef/knife/user_delete.rb +6 -7
- data/lib/chef/knife/user_edit.rb +6 -7
- data/lib/chef/knife/user_key_create.rb +7 -7
- data/lib/chef/knife/user_key_delete.rb +6 -6
- data/lib/chef/knife/user_key_edit.rb +8 -9
- data/lib/chef/knife/user_key_list.rb +5 -5
- data/lib/chef/knife/user_key_show.rb +5 -5
- data/lib/chef/knife/user_list.rb +5 -5
- data/lib/chef/knife/user_reregister.rb +6 -7
- data/lib/chef/knife/user_show.rb +6 -6
- data/lib/chef/knife/xargs.rb +22 -23
- data/lib/chef/local_mode.rb +13 -11
- data/lib/chef/log.rb +10 -10
- data/lib/chef/log/syslog.rb +5 -6
- data/lib/chef/log/winevt.rb +12 -12
- data/lib/chef/mash.rb +6 -5
- data/lib/chef/mixin/api_version_request_handling.rb +1 -1
- data/lib/chef/mixin/checksum.rb +4 -4
- data/lib/chef/mixin/command.rb +13 -13
- data/lib/chef/mixin/command/unix.rb +7 -7
- data/lib/chef/mixin/command/windows.rb +6 -7
- data/lib/chef/mixin/convert_to_class_name.rb +11 -11
- data/lib/chef/mixin/create_path.rb +3 -3
- data/lib/chef/mixin/deep_merge.rb +3 -3
- data/lib/chef/mixin/deprecation.rb +24 -25
- data/lib/chef/mixin/descendants_tracker.rb +2 -3
- data/lib/chef/mixin/enforce_ownership_and_permissions.rb +3 -3
- data/lib/chef/mixin/file_class.rb +9 -11
- data/lib/chef/mixin/from_file.rb +3 -3
- data/lib/chef/mixin/get_source_from_package.rb +2 -3
- data/lib/chef/mixin/homebrew_user.rb +6 -6
- data/lib/chef/mixin/language.rb +5 -5
- data/lib/chef/mixin/language_include_attribute.rb +4 -5
- data/lib/chef/mixin/language_include_recipe.rb +4 -5
- data/lib/chef/mixin/params_validate.rb +38 -18
- data/lib/chef/mixin/path_sanity.rb +7 -7
- data/lib/chef/mixin/powershell_out.rb +5 -5
- data/lib/chef/mixin/powershell_type_coercions.rb +12 -10
- data/lib/chef/mixin/properties.rb +8 -8
- data/lib/chef/mixin/provides.rb +2 -2
- data/lib/chef/mixin/proxified_socket.rb +4 -4
- data/lib/chef/mixin/recipe_definition_dsl_core.rb +4 -4
- data/lib/chef/mixin/securable.rb +24 -27
- data/lib/chef/mixin/shell_out.rb +10 -10
- data/lib/chef/mixin/subclass_directive.rb +2 -2
- data/lib/chef/mixin/template.rb +8 -9
- data/lib/chef/mixin/unformatter.rb +1 -1
- data/lib/chef/mixin/uris.rb +2 -3
- data/lib/chef/mixin/which.rb +3 -3
- data/lib/chef/mixin/why_run.rb +6 -7
- data/lib/chef/mixin/wide_string.rb +7 -7
- data/lib/chef/mixin/windows_architecture_helper.rb +9 -10
- data/lib/chef/mixin/windows_env_helper.rb +10 -11
- data/lib/chef/mixin/xml_escape.rb +13 -13
- data/lib/chef/mixins.rb +13 -14
- data/lib/chef/monkey_patches/net-ssh-multi.rb +6 -6
- data/lib/chef/monkey_patches/net_http.rb +2 -2
- data/lib/chef/monkey_patches/webrick-utils.rb +6 -6
- data/lib/chef/monkey_patches/win32/registry.rb +6 -6
- data/lib/chef/monologger.rb +2 -4
- data/lib/chef/node.rb +66 -60
- data/lib/chef/node/attribute.rb +289 -289
- data/lib/chef/node/attribute_collections.rb +8 -8
- data/lib/chef/node/immutable_collections.rb +3 -3
- data/lib/chef/node_map.rb +11 -11
- data/lib/chef/null_logger.rb +3 -3
- data/lib/chef/org.rb +31 -30
- data/lib/chef/platform.rb +4 -4
- data/lib/chef/platform/handler_map.rb +2 -2
- data/lib/chef/platform/priority_map.rb +2 -2
- data/lib/chef/platform/provider_handler_map.rb +3 -3
- data/lib/chef/platform/provider_mapping.rb +33 -33
- data/lib/chef/platform/provider_priority_map.rb +2 -2
- data/lib/chef/platform/query_helpers.rb +10 -11
- data/lib/chef/platform/rebooter.rb +11 -11
- data/lib/chef/platform/resource_handler_map.rb +3 -3
- data/lib/chef/platform/resource_priority_map.rb +2 -2
- data/lib/chef/platform/service_helpers.rb +5 -5
- data/lib/chef/policy_builder.rb +5 -5
- data/lib/chef/policy_builder/dynamic.rb +10 -11
- data/lib/chef/policy_builder/expand_node_object.rb +24 -19
- data/lib/chef/policy_builder/policyfile.rb +13 -14
- data/lib/chef/property.rb +115 -49
- data/lib/chef/provider.rb +43 -43
- data/lib/chef/provider/apt_update.rb +79 -0
- data/lib/chef/provider/batch.rb +6 -6
- data/lib/chef/provider/breakpoint.rb +1 -1
- data/lib/chef/provider/cookbook_file.rb +5 -5
- data/lib/chef/provider/cookbook_file/content.rb +4 -4
- data/lib/chef/provider/cron.rb +8 -8
- data/lib/chef/provider/cron/aix.rb +1 -1
- data/lib/chef/provider/cron/solaris.rb +1 -1
- data/lib/chef/provider/cron/unix.rb +7 -7
- data/lib/chef/provider/deploy.rb +7 -8
- data/lib/chef/provider/deploy/revision.rb +9 -9
- data/lib/chef/provider/deploy/timestamped.rb +1 -1
- data/lib/chef/provider/directory.rb +8 -8
- data/lib/chef/provider/dsc_resource.rb +33 -27
- data/lib/chef/provider/dsc_script.rb +17 -17
- data/lib/chef/provider/env.rb +8 -8
- data/lib/chef/provider/env/windows.rb +3 -3
- data/lib/chef/provider/erl_call.rb +5 -5
- data/lib/chef/provider/execute.rb +8 -8
- data/lib/chef/provider/file.rb +24 -24
- data/lib/chef/provider/file/content.rb +4 -4
- data/lib/chef/provider/git.rb +33 -35
- data/lib/chef/provider/group.rb +7 -7
- data/lib/chef/provider/group/aix.rb +6 -6
- data/lib/chef/provider/group/dscl.rb +11 -11
- data/lib/chef/provider/group/gpasswd.rb +3 -3
- data/lib/chef/provider/group/groupadd.rb +8 -8
- data/lib/chef/provider/group/groupmod.rb +3 -3
- data/lib/chef/provider/group/pw.rb +2 -2
- data/lib/chef/provider/group/suse.rb +5 -5
- data/lib/chef/provider/group/usermod.rb +8 -8
- data/lib/chef/provider/group/windows.rb +5 -5
- data/lib/chef/provider/http_request.rb +15 -15
- data/lib/chef/provider/ifconfig.rb +15 -14
- data/lib/chef/provider/ifconfig/aix.rb +5 -4
- data/lib/chef/provider/ifconfig/debian.rb +6 -6
- data/lib/chef/provider/ifconfig/redhat.rb +3 -3
- data/lib/chef/provider/link.rb +13 -13
- data/lib/chef/provider/log.rb +1 -1
- data/lib/chef/provider/lwrp_base.rb +8 -8
- data/lib/chef/provider/mdadm.rb +4 -4
- data/lib/chef/provider/mount.rb +13 -13
- data/lib/chef/provider/mount/aix.rb +14 -14
- data/lib/chef/provider/mount/mount.rb +18 -18
- data/lib/chef/provider/mount/solaris.rb +30 -30
- data/lib/chef/provider/mount/windows.rb +4 -4
- data/lib/chef/provider/ohai.rb +2 -2
- data/lib/chef/provider/osx_profile.rb +256 -0
- data/lib/chef/provider/package.rb +19 -19
- data/lib/chef/provider/package/aix.rb +8 -9
- data/lib/chef/provider/package/apt.rb +12 -12
- data/lib/chef/provider/package/chocolatey.rb +277 -0
- data/lib/chef/provider/package/dpkg.rb +7 -7
- data/lib/chef/provider/package/easy_install.rb +14 -15
- data/lib/chef/provider/package/freebsd/base.rb +7 -7
- data/lib/chef/provider/package/freebsd/pkg.rb +8 -8
- data/lib/chef/provider/package/freebsd/pkgng.rb +6 -6
- data/lib/chef/provider/package/freebsd/port.rb +4 -4
- data/lib/chef/provider/package/homebrew.rb +16 -16
- data/lib/chef/provider/package/ips.rb +8 -8
- data/lib/chef/provider/package/macports.rb +1 -0
- data/lib/chef/provider/package/openbsd.rb +13 -13
- data/lib/chef/provider/package/pacman.rb +6 -9
- data/lib/chef/provider/package/paludis.rb +7 -10
- data/lib/chef/provider/package/portage.rb +10 -13
- data/lib/chef/provider/package/rpm.rb +7 -8
- data/lib/chef/provider/package/rubygems.rb +64 -64
- data/lib/chef/provider/package/smartos.rb +7 -10
- data/lib/chef/provider/package/solaris.rb +6 -11
- data/lib/chef/provider/package/windows.rb +38 -29
- data/lib/chef/provider/package/windows/exe.rb +9 -21
- data/lib/chef/provider/package/windows/msi.rb +12 -12
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +7 -7
- data/lib/chef/provider/package/yum-dump.py +1 -1
- data/lib/chef/provider/package/yum.rb +43 -44
- data/lib/chef/provider/package/zypper.rb +57 -47
- data/lib/chef/provider/powershell_script.rb +14 -14
- data/lib/chef/provider/reboot.rb +5 -5
- data/lib/chef/provider/registry_key.rb +16 -16
- data/lib/chef/provider/remote_directory.rb +15 -15
- data/lib/chef/provider/remote_file.rb +5 -5
- data/lib/chef/provider/remote_file/cache_control_data.rb +11 -12
- data/lib/chef/provider/remote_file/content.rb +11 -11
- data/lib/chef/provider/remote_file/fetcher.rb +2 -2
- data/lib/chef/provider/remote_file/ftp.rb +11 -11
- data/lib/chef/provider/remote_file/http.rb +9 -9
- data/lib/chef/provider/remote_file/local_file.rb +5 -5
- data/lib/chef/provider/remote_file/network_file.rb +4 -4
- data/lib/chef/provider/route.rb +188 -188
- data/lib/chef/provider/ruby_block.rb +3 -3
- data/lib/chef/provider/script.rb +5 -5
- data/lib/chef/provider/service.rb +30 -30
- data/lib/chef/provider/service/aix.rb +4 -4
- data/lib/chef/provider/service/aixinit.rb +12 -12
- data/lib/chef/provider/service/arch.rb +5 -5
- data/lib/chef/provider/service/debian.rb +12 -13
- data/lib/chef/provider/service/freebsd.rb +7 -7
- data/lib/chef/provider/service/gentoo.rb +5 -5
- data/lib/chef/provider/service/init.rb +4 -4
- data/lib/chef/provider/service/insserv.rb +4 -4
- data/lib/chef/provider/service/invokercd.rb +3 -3
- data/lib/chef/provider/service/macosx.rb +19 -19
- data/lib/chef/provider/service/openbsd.rb +14 -14
- data/lib/chef/provider/service/redhat.rb +6 -6
- data/lib/chef/provider/service/simple.rb +10 -9
- data/lib/chef/provider/service/solaris.rb +8 -8
- data/lib/chef/provider/service/systemd.rb +4 -4
- data/lib/chef/provider/service/upstart.rb +8 -8
- data/lib/chef/provider/service/windows.rb +32 -78
- data/lib/chef/provider/subversion.rb +13 -13
- data/lib/chef/provider/template.rb +7 -7
- data/lib/chef/provider/template/content.rb +4 -4
- data/lib/chef/provider/template_finder.rb +2 -1
- data/lib/chef/provider/user.rb +9 -10
- data/lib/chef/provider/user/aix.rb +4 -3
- data/lib/chef/provider/user/dscl.rb +39 -40
- data/lib/chef/provider/user/pw.rb +9 -9
- data/lib/chef/provider/user/solaris.rb +9 -9
- data/lib/chef/provider/user/useradd.rb +9 -9
- data/lib/chef/provider/user/windows.rb +13 -13
- data/lib/chef/provider/whyrun_safe_ruby_block.rb +1 -1
- data/lib/chef/provider/windows_script.rb +5 -5
- data/lib/chef/provider_resolver.rb +3 -3
- data/lib/chef/providers.rb +113 -110
- data/lib/chef/recipe.rb +13 -14
- data/lib/chef/request_id.rb +4 -4
- data/lib/chef/resource.rb +103 -93
- data/lib/chef/resource/action_class.rb +3 -3
- data/lib/chef/resource/apt_package.rb +6 -17
- data/lib/chef/{shell/shell_rest.rb → resource/apt_update.rb} +14 -9
- data/lib/chef/resource/bash.rb +5 -5
- data/lib/chef/resource/batch.rb +4 -4
- data/lib/chef/resource/bff_package.rb +3 -3
- data/lib/chef/resource/breakpoint.rb +3 -4
- data/lib/chef/resource/chef_gem.rb +9 -25
- data/lib/chef/resource/chocolatey_package.rb +39 -0
- data/lib/chef/resource/conditional.rb +8 -8
- data/lib/chef/resource/conditional_action_not_nothing.rb +1 -1
- data/lib/chef/resource/cookbook_file.rb +10 -10
- data/lib/chef/resource/cron.rb +33 -33
- data/lib/chef/resource/csh.rb +5 -5
- data/lib/chef/resource/deploy.rb +76 -76
- data/lib/chef/resource/deploy_revision.rb +1 -1
- data/lib/chef/resource/directory.rb +12 -12
- data/lib/chef/resource/dpkg_package.rb +5 -6
- data/lib/chef/resource/dsc_resource.rb +121 -120
- data/lib/chef/resource/dsc_script.rb +25 -25
- data/lib/chef/resource/easy_install_package.rb +6 -25
- data/lib/chef/resource/env.rb +9 -9
- data/lib/chef/resource/erl_call.rb +15 -15
- data/lib/chef/resource/execute.rb +28 -28
- data/lib/chef/resource/file.rb +20 -87
- data/lib/chef/resource/file/verification.rb +11 -11
- data/lib/chef/resource/freebsd_package.rb +10 -9
- data/lib/chef/resource/gem_package.rb +8 -23
- data/lib/chef/resource/git.rb +4 -4
- data/lib/chef/resource/group.rb +18 -19
- data/lib/chef/resource/homebrew_package.rb +7 -18
- data/lib/chef/resource/http_request.rb +12 -12
- data/lib/chef/resource/ifconfig.rb +28 -28
- data/lib/chef/resource/ips_package.rb +5 -16
- data/lib/chef/resource/ksh.rb +3 -3
- data/lib/chef/resource/link.rb +18 -17
- data/lib/chef/resource/log.rb +9 -9
- data/lib/chef/resource/lwrp_base.rb +10 -10
- data/lib/chef/resource/macosx_service.rb +7 -7
- data/lib/chef/resource/macports_package.rb +3 -2
- data/lib/chef/resource/mdadm.rb +18 -19
- data/lib/chef/resource/mount.rb +34 -34
- data/lib/chef/resource/ohai.rb +7 -7
- data/lib/chef/resource/openbsd_package.rb +7 -6
- data/lib/chef/resource/osx_profile.rb +74 -0
- data/lib/chef/resource/package.rb +15 -69
- data/lib/chef/resource/pacman_package.rb +3 -2
- data/lib/chef/resource/paludis_package.rb +5 -7
- data/lib/chef/resource/perl.rb +5 -5
- data/lib/chef/resource/portage_package.rb +5 -4
- data/lib/chef/resource/powershell_script.rb +7 -7
- data/lib/chef/resource/python.rb +5 -5
- data/lib/chef/resource/reboot.rb +6 -6
- data/lib/chef/resource/registry_key.rb +15 -15
- data/lib/chef/resource/remote_directory.rb +23 -24
- data/lib/chef/resource/remote_file.rb +21 -21
- data/lib/chef/resource/resource_notification.rb +2 -2
- data/lib/chef/resource/route.rb +26 -26
- data/lib/chef/resource/rpm_package.rb +5 -15
- data/lib/chef/resource/ruby.rb +5 -5
- data/lib/chef/resource/ruby_block.rb +8 -8
- data/lib/chef/resource/scm.rb +36 -37
- data/lib/chef/resource/script.rb +13 -13
- data/lib/chef/resource/service.rb +32 -32
- data/lib/chef/resource/smartos_package.rb +4 -3
- data/lib/chef/resource/solaris_package.rb +4 -3
- data/lib/chef/resource/subversion.rb +6 -6
- data/lib/chef/resource/template.rb +19 -19
- data/lib/chef/resource/timestamped_deploy.rb +1 -1
- data/lib/chef/resource/user.rb +31 -31
- data/lib/chef/resource/whyrun_safe_ruby_block.rb +1 -1
- data/lib/chef/resource/windows_package.rb +21 -66
- data/lib/chef/resource/windows_script.rb +8 -8
- data/lib/chef/resource/windows_service.rb +9 -9
- data/lib/chef/resource/yum_package.rb +18 -42
- data/lib/chef/resource/zypper_package.rb +3 -2
- data/lib/chef/resource_builder.rb +4 -4
- data/lib/chef/resource_collection.rb +11 -11
- data/lib/chef/resource_collection/resource_collection_serialization.rb +5 -5
- data/lib/chef/resource_collection/resource_list.rb +6 -6
- data/lib/chef/resource_collection/resource_set.rb +6 -6
- data/lib/chef/resource_collection/stepable_iterator.rb +4 -4
- data/lib/chef/resource_definition.rb +7 -7
- data/lib/chef/resource_definition_list.rb +5 -5
- data/lib/chef/resource_reporter.rb +14 -15
- data/lib/chef/resource_resolver.rb +4 -5
- data/lib/chef/resources.rb +71 -68
- data/lib/chef/rest.rb +23 -23
- data/lib/chef/role.rb +49 -43
- data/lib/chef/run_context.rb +21 -23
- data/lib/chef/run_context/cookbook_compiler.rb +10 -13
- data/lib/chef/run_list.rb +17 -17
- data/lib/chef/run_list/run_list_expansion.rb +22 -26
- data/lib/chef/run_list/run_list_item.rb +8 -9
- data/lib/chef/run_list/versioned_recipe_list.rb +13 -13
- data/lib/chef/run_lock.rb +12 -12
- data/lib/chef/run_status.rb +3 -3
- data/lib/chef/runner.rb +11 -12
- data/lib/chef/scan_access_control.rb +7 -7
- data/lib/chef/search/query.rb +30 -16
- data/lib/chef/server_api.rb +42 -10
- data/lib/chef/shell.rb +24 -25
- data/lib/chef/shell/ext.rb +31 -31
- data/lib/chef/shell/model_wrapper.rb +7 -8
- data/lib/chef/shell/shell_session.rb +20 -19
- data/lib/chef/shell_out.rb +2 -2
- data/lib/chef/tasks/chef_repo.rake +62 -63
- data/lib/chef/user.rb +38 -37
- data/lib/chef/user_v1.rb +53 -58
- data/lib/chef/util/backup.rb +6 -6
- data/lib/chef/util/diff.rb +8 -8
- data/lib/chef/util/dsc/configuration_generator.rb +11 -11
- data/lib/chef/util/dsc/lcm_output_parser.rb +8 -8
- data/lib/chef/util/dsc/local_configuration_manager.rb +9 -9
- data/lib/chef/util/dsc/resource_info.rb +15 -15
- data/lib/chef/util/dsc/resource_store.rb +73 -74
- data/lib/chef/util/editor.rb +1 -2
- data/lib/chef/util/file_edit.rb +5 -5
- data/lib/chef/util/path_helper.rb +2 -2
- data/lib/chef/util/powershell/cmdlet.rb +119 -119
- data/lib/chef/util/powershell/cmdlet_result.rb +36 -36
- data/lib/chef/util/powershell/ps_credential.rb +2 -2
- data/lib/chef/util/selinux.rb +6 -6
- data/lib/chef/util/threaded_job_queue.rb +2 -2
- data/lib/chef/util/windows.rb +1 -1
- data/lib/chef/util/windows/net_group.rb +84 -85
- data/lib/chef/util/windows/net_use.rb +6 -6
- data/lib/chef/util/windows/net_user.rb +9 -8
- data/lib/chef/util/windows/volume.rb +3 -3
- data/lib/chef/version.rb +2 -2
- data/lib/chef/version/platform.rb +5 -5
- data/lib/chef/version_class.rb +6 -6
- data/lib/chef/version_constraint.rb +13 -13
- data/lib/chef/version_constraint/platform.rb +3 -3
- data/lib/chef/whitelist.rb +2 -2
- data/lib/chef/win32/api.rb +13 -8
- data/lib/chef/win32/api/crypto.rb +63 -63
- data/lib/chef/win32/api/error.rb +11 -10
- data/lib/chef/win32/api/file.rb +17 -16
- data/lib/chef/win32/api/installer.rb +15 -16
- data/lib/chef/win32/api/memory.rb +4 -4
- data/lib/chef/win32/api/net.rb +111 -123
- data/lib/chef/win32/api/process.rb +4 -4
- data/lib/chef/win32/api/psapi.rb +4 -4
- data/lib/chef/win32/api/registry.rb +4 -4
- data/lib/chef/win32/api/security.rb +51 -26
- data/lib/chef/win32/api/synchronization.rb +4 -4
- data/lib/chef/win32/api/system.rb +4 -4
- data/lib/chef/win32/api/unicode.rb +4 -4
- data/lib/chef/win32/crypto.rb +50 -50
- data/lib/chef/win32/error.rb +18 -15
- data/lib/chef/win32/eventlog.rb +2 -2
- data/lib/chef/win32/file.rb +14 -14
- data/lib/chef/win32/file/info.rb +3 -4
- data/lib/chef/win32/file/version_info.rb +4 -4
- data/lib/chef/win32/handle.rb +6 -6
- data/lib/chef/win32/memory.rb +4 -4
- data/lib/chef/win32/mutex.rb +4 -4
- data/lib/chef/win32/net.rb +26 -59
- data/lib/chef/win32/process.rb +7 -7
- data/lib/chef/win32/registry.rb +19 -33
- data/lib/chef/win32/security.rb +82 -20
- data/lib/chef/win32/security/ace.rb +6 -6
- data/lib/chef/win32/security/acl.rb +8 -8
- data/lib/chef/win32/security/securable_object.rb +5 -5
- data/lib/chef/win32/security/security_descriptor.rb +5 -5
- data/lib/chef/win32/security/sid.rb +81 -43
- data/lib/chef/win32/security/token.rb +6 -6
- data/lib/chef/win32/system.rb +4 -4
- data/lib/chef/win32/unicode.rb +7 -7
- data/lib/chef/win32/version.rb +26 -26
- data/lib/chef/workstation_config_loader.rb +2 -2
- data/spec/data/apt/chef-integration-test-1.0/debian/copyright +2 -2
- data/spec/data/apt/chef-integration-test-1.1/debian/copyright +2 -2
- data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +2 -2
- data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +1 -1
- data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +5 -0
- data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +1 -1
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +1 -2
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +1 -1
- data/spec/functional/application_spec.rb +7 -7
- data/spec/functional/assets/chocolatey_feed/test-A.1.0.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-A.1.5.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-A.2.0.nupkg +0 -0
- data/spec/functional/assets/chocolatey_feed/test-B.1.0.nupkg +0 -0
- data/spec/functional/audit/rspec_formatter_spec.rb +8 -8
- data/spec/functional/audit/runner_spec.rb +9 -9
- data/spec/functional/dsl/reboot_pending_spec.rb +10 -15
- data/spec/functional/dsl/registry_helper_spec.rb +8 -10
- data/spec/functional/event_loggers/windows_eventlog_spec.rb +27 -22
- data/spec/functional/file_content_management/deploy_strategies_spec.rb +9 -10
- data/spec/functional/http/simple_spec.rb +11 -11
- data/spec/functional/knife/configure_spec.rb +5 -10
- data/spec/functional/knife/cookbook_delete_spec.rb +11 -11
- data/spec/functional/knife/exec_spec.rb +6 -6
- data/spec/functional/knife/smoke_test.rb +11 -3
- data/spec/functional/knife/ssh_spec.rb +22 -22
- data/spec/functional/mixin/powershell_out_spec.rb +3 -3
- data/spec/functional/mixin/shell_out_spec.rb +12 -12
- data/spec/functional/notifications_spec.rb +6 -7
- data/spec/functional/provider/remote_file/cache_control_data_spec.rb +11 -12
- data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +4 -4
- data/spec/functional/rebooter_spec.rb +12 -12
- data/spec/functional/resource/aix_service_spec.rb +7 -8
- data/spec/functional/resource/aixinit_service_spec.rb +20 -20
- data/spec/functional/resource/base.rb +1 -3
- data/spec/functional/resource/bash_spec.rb +6 -6
- data/spec/functional/resource/batch_spec.rb +5 -5
- data/spec/functional/resource/bff_spec.rb +10 -12
- data/spec/functional/resource/chocolatey_package_spec.rb +124 -0
- data/spec/functional/resource/cookbook_file_spec.rb +9 -9
- data/spec/functional/resource/cron_spec.rb +13 -13
- data/spec/functional/resource/deploy_revision_spec.rb +18 -18
- data/spec/functional/resource/directory_spec.rb +4 -4
- data/spec/functional/resource/dpkg_package_spec.rb +38 -38
- data/spec/functional/resource/dsc_resource_spec.rb +17 -22
- data/spec/functional/resource/dsc_script_spec.rb +104 -106
- data/spec/functional/resource/env_spec.rb +30 -30
- data/spec/functional/resource/execute_spec.rb +10 -10
- data/spec/functional/resource/file_spec.rb +12 -13
- data/spec/functional/resource/git_spec.rb +20 -20
- data/spec/functional/resource/group_spec.rb +21 -21
- data/spec/functional/resource/ifconfig_spec.rb +11 -11
- data/spec/functional/resource/link_spec.rb +140 -135
- data/spec/functional/resource/mount_spec.rb +17 -29
- data/spec/functional/resource/ohai_spec.rb +5 -8
- data/spec/functional/resource/package_spec.rb +11 -13
- data/spec/functional/resource/powershell_script_spec.rb +60 -60
- data/spec/functional/resource/reboot_spec.rb +12 -12
- data/spec/functional/resource/registry_spec.rb +71 -72
- data/spec/functional/resource/remote_directory_spec.rb +23 -23
- data/spec/functional/resource/remote_file_spec.rb +17 -17
- data/spec/functional/resource/rpm_spec.rb +14 -14
- data/spec/functional/resource/template_spec.rb +8 -8
- data/spec/functional/resource/user/dscl_spec.rb +3 -3
- data/spec/functional/resource/user/useradd_spec.rb +31 -37
- data/spec/functional/resource/user/windows_spec.rb +20 -20
- data/spec/functional/resource/windows_package_spec.rb +26 -35
- data/spec/functional/resource/windows_service_spec.rb +12 -8
- data/spec/functional/rest_spec.rb +6 -5
- data/spec/functional/run_lock_spec.rb +15 -14
- data/spec/functional/shell_spec.rb +11 -10
- data/spec/functional/tiny_server_spec.rb +18 -18
- data/spec/functional/util/path_helper_spec.rb +5 -5
- data/spec/functional/util/powershell/cmdlet_spec.rb +24 -27
- data/spec/functional/version_spec.rb +6 -6
- data/spec/functional/win32/crypto_spec.rb +7 -10
- data/spec/functional/win32/registry_spec.rb +105 -107
- data/spec/functional/win32/security_spec.rb +17 -17
- data/spec/functional/win32/service_manager_spec.rb +7 -8
- data/spec/functional/win32/sid_spec.rb +13 -13
- data/spec/functional/win32/version_info_spec.rb +7 -7
- data/spec/functional/win32/versions_spec.rb +13 -13
- data/spec/integration/client/client_spec.rb +65 -66
- data/spec/integration/client/ipv6_spec.rb +15 -16
- data/spec/integration/knife/chef_fs_data_store_spec.rb +432 -246
- data/spec/integration/knife/chef_repo_path_spec.rb +261 -261
- data/spec/integration/knife/chef_repository_file_system_spec.rb +84 -84
- data/spec/integration/knife/chefignore_spec.rb +82 -82
- data/spec/integration/knife/common_options_spec.rb +41 -41
- data/spec/integration/knife/cookbook_api_ipv6_spec.rb +9 -9
- data/spec/integration/knife/delete_spec.rb +262 -248
- data/spec/integration/knife/deps_spec.rb +301 -301
- data/spec/integration/knife/diff_spec.rb +237 -237
- data/spec/integration/knife/download_spec.rb +532 -401
- data/spec/integration/knife/list_spec.rb +310 -116
- data/spec/integration/knife/raw_spec.rb +39 -39
- data/spec/integration/knife/redirection_spec.rb +12 -12
- data/spec/integration/knife/serve_spec.rb +12 -12
- data/spec/integration/knife/show_spec.rb +59 -59
- data/spec/integration/knife/upload_spec.rb +661 -550
- data/spec/integration/recipes/lwrp_inline_resources_spec.rb +18 -18
- data/spec/integration/recipes/lwrp_spec.rb +7 -7
- data/spec/integration/recipes/provider_choice.rb +3 -2
- data/spec/integration/recipes/recipe_dsl_spec.rb +151 -124
- data/spec/integration/recipes/remote_directory.rb +2 -2
- data/spec/integration/recipes/resource_action_spec.rb +439 -328
- data/spec/integration/recipes/resource_converge_if_changed_spec.rb +12 -11
- data/spec/integration/recipes/resource_load_spec.rb +35 -33
- data/spec/integration/solo/solo_spec.rb +31 -32
- data/spec/scripts/ssl-serve.rb +12 -17
- data/spec/spec_helper.rb +48 -43
- data/spec/stress/win32/file_spec.rb +5 -5
- data/spec/stress/win32/memory_spec.rb +4 -4
- data/spec/stress/win32/security_spec.rb +8 -8
- data/spec/support/chef_helpers.rb +5 -6
- data/spec/support/key_helpers.rb +2 -2
- data/spec/support/lib/chef/provider/easy.rb +2 -2
- data/spec/support/lib/chef/provider/openldap_includer.rb +2 -2
- data/spec/support/lib/chef/provider/snakeoil.rb +2 -2
- data/spec/support/lib/chef/resource/cat.rb +4 -4
- data/spec/support/lib/chef/resource/one_two_three_four.rb +2 -2
- data/spec/support/lib/chef/resource/openldap_includer.rb +2 -3
- data/spec/support/lib/chef/resource/with_state.rb +4 -4
- data/spec/support/lib/chef/resource/zen_follower.rb +4 -4
- data/spec/support/lib/chef/resource/zen_master.rb +5 -6
- data/spec/support/lib/library_load_order.rb +0 -2
- data/spec/support/matchers/leak.rb +7 -5
- data/spec/support/mock/constant.rb +3 -3
- data/spec/support/mock/platform.rb +5 -5
- data/spec/support/platform_helpers.rb +36 -23
- data/spec/support/platforms/prof/gc.rb +2 -3
- data/spec/support/platforms/prof/win32.rb +3 -4
- data/spec/support/platforms/win32/spec_service.rb +3 -3
- data/spec/support/shared/context/client.rb +22 -14
- data/spec/support/shared/context/config.rb +3 -3
- data/spec/support/shared/context/win32.rb +9 -9
- data/spec/support/shared/examples/client.rb +4 -4
- data/spec/support/shared/functional/diff_disabled.rb +1 -1
- data/spec/support/shared/functional/directory_resource.rb +8 -8
- data/spec/support/shared/functional/file_resource.rb +20 -23
- data/spec/support/shared/functional/http.rb +33 -34
- data/spec/support/shared/functional/knife.rb +3 -3
- data/spec/support/shared/functional/securable_resource.rb +48 -48
- data/spec/support/shared/functional/securable_resource_with_reporting.rb +8 -12
- data/spec/support/shared/functional/win32_service.rb +3 -5
- data/spec/support/shared/functional/windows_script.rb +13 -13
- data/spec/support/shared/integration/app_server_support.rb +7 -7
- data/spec/support/shared/integration/integration_helper.rb +21 -21
- data/spec/support/shared/integration/knife_support.rb +13 -13
- data/spec/support/shared/matchers/exit_with_code.rb +2 -2
- data/spec/support/shared/matchers/match_environment_variable.rb +2 -2
- data/spec/support/shared/unit/api_error_inspector.rb +3 -5
- data/spec/support/shared/unit/api_versioning.rb +8 -8
- data/spec/support/shared/unit/execute_resource.rb +4 -4
- data/spec/support/shared/unit/file_system_support.rb +12 -13
- data/spec/support/shared/unit/knife_shared.rb +1 -2
- data/spec/support/shared/unit/mock_shellout.rb +5 -2
- data/spec/support/shared/unit/platform_introspector.rb +35 -37
- data/spec/support/shared/unit/provider/file.rb +29 -40
- data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +50 -51
- data/spec/support/shared/unit/resource/static_provider_resolution.rb +2 -5
- data/spec/support/shared/unit/script_resource.rb +10 -10
- data/spec/support/shared/unit/user_and_client_shared.rb +5 -6
- data/spec/support/shared/unit/windows_script_resource.rb +6 -7
- data/spec/tiny_server.rb +24 -24
- data/spec/unit/api_client/registration_spec.rb +41 -38
- data/spec/unit/api_client_spec.rb +13 -16
- data/spec/unit/api_client_v1_spec.rb +17 -19
- data/spec/unit/application/apply_spec.rb +3 -3
- data/spec/unit/application/client_spec.rb +12 -9
- data/spec/unit/application/knife_spec.rb +69 -17
- data/spec/unit/application/solo_spec.rb +29 -48
- data/spec/unit/application_spec.rb +171 -151
- data/spec/unit/audit/audit_event_proxy_spec.rb +13 -13
- data/spec/unit/audit/audit_reporter_spec.rb +18 -25
- data/spec/unit/audit/control_group_data_spec.rb +16 -17
- data/spec/unit/audit/logger_spec.rb +5 -5
- data/spec/unit/audit/rspec_formatter_spec.rb +4 -4
- data/spec/unit/audit/runner_spec.rb +11 -12
- data/spec/unit/chef_class_spec.rb +5 -5
- data/spec/unit/chef_fs/config_spec.rb +14 -18
- data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +17 -17
- data/spec/unit/chef_fs/diff_spec.rb +75 -75
- data/spec/unit/chef_fs/file_pattern_spec.rb +368 -369
- data/spec/unit/chef_fs/file_system/cookbook_subdir_spec.rb +9 -9
- data/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb +9 -9
- data/spec/unit/chef_fs/file_system_spec.rb +74 -74
- data/spec/unit/chef_fs/parallelizer.rb +63 -66
- data/spec/unit/chef_fs/path_util_spec.rb +45 -45
- data/spec/unit/chef_spec.rb +3 -3
- data/spec/unit/client_spec.rb +44 -44
- data/spec/unit/config_fetcher_spec.rb +56 -28
- data/spec/unit/config_spec.rb +2 -2
- data/spec/unit/cookbook/chefignore_spec.rb +12 -12
- data/spec/unit/cookbook/cookbook_version_loader_spec.rb +5 -6
- data/spec/unit/cookbook/file_vendor_spec.rb +8 -9
- data/spec/unit/cookbook/metadata_spec.rb +73 -76
- data/spec/unit/cookbook/synchronizer_spec.rb +31 -32
- data/spec/unit/cookbook/syntax_check_spec.rb +22 -22
- data/spec/unit/cookbook_loader_spec.rb +9 -10
- data/spec/unit/cookbook_manifest_spec.rb +27 -28
- data/spec/unit/cookbook_site_streaming_uploader_spec.rb +24 -24
- data/spec/unit/cookbook_spec.rb +3 -3
- data/spec/unit/cookbook_uploader_spec.rb +10 -11
- data/spec/unit/cookbook_version_file_specificity_spec.rb +49 -50
- data/spec/unit/cookbook_version_spec.rb +45 -48
- data/spec/unit/daemon_spec.rb +5 -5
- data/spec/unit/data_bag_item_spec.rb +29 -30
- data/spec/unit/data_bag_spec.rb +47 -47
- data/spec/unit/deprecation_spec.rb +11 -11
- data/spec/unit/digester_spec.rb +5 -6
- data/spec/unit/dsl/audit_spec.rb +5 -5
- data/spec/unit/dsl/data_query_spec.rb +12 -12
- data/spec/unit/dsl/platform_introspection_spec.rb +19 -20
- data/spec/unit/dsl/reboot_pending_spec.rb +17 -17
- data/spec/unit/dsl/recipe_spec.rb +4 -6
- data/spec/unit/dsl/regsitry_helper_spec.rb +9 -12
- data/spec/unit/dsl/resources_spec.rb +13 -13
- data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +7 -7
- data/spec/unit/encrypted_data_bag_item_spec.rb +11 -11
- data/spec/unit/environment_spec.rb +53 -53
- data/spec/unit/event_dispatch/dispatcher_spec.rb +3 -4
- data/spec/unit/event_dispatch/dsl_spec.rb +16 -16
- data/spec/unit/exceptions_spec.rb +10 -10
- data/spec/unit/file_access_control_spec.rb +32 -32
- data/spec/unit/file_cache_spec.rb +19 -19
- data/spec/unit/file_content_management/deploy/cp_spec.rb +3 -5
- data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +3 -5
- data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +5 -12
- data/spec/unit/formatters/base_spec.rb +29 -6
- data/spec/unit/formatters/doc_spec.rb +7 -7
- data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +9 -10
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +11 -11
- data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +4 -7
- data/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +3 -3
- data/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb +3 -4
- data/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb +3 -4
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +4 -6
- data/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +5 -7
- data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +9 -9
- data/spec/unit/guard_interpreter_spec.rb +3 -3
- data/spec/unit/handler/json_file_spec.rb +11 -12
- data/spec/unit/handler_spec.rb +7 -7
- data/spec/unit/http/authenticator_spec.rb +9 -7
- data/spec/unit/http/basic_client_spec.rb +3 -3
- data/spec/unit/http/http_request_spec.rb +22 -22
- data/spec/unit/http/json_input_spec.rb +7 -7
- data/spec/unit/http/simple_spec.rb +3 -3
- data/spec/unit/http/socketless_chef_zero_client_spec.rb +3 -4
- data/spec/unit/http/ssl_policies_spec.rb +18 -19
- data/spec/unit/http/validate_content_length_spec.rb +9 -9
- data/spec/unit/http_spec.rb +18 -18
- data/spec/unit/json_compat_spec.rb +16 -9
- data/spec/unit/key_spec.rb +41 -44
- data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +41 -42
- data/spec/unit/knife/bootstrap/client_builder_spec.rb +30 -28
- data/spec/unit/knife/bootstrap_spec.rb +75 -37
- data/spec/unit/knife/client_bulk_delete_spec.rb +6 -6
- data/spec/unit/knife/client_create_spec.rb +11 -12
- data/spec/unit/knife/client_delete_spec.rb +13 -13
- data/spec/unit/knife/client_edit_spec.rb +9 -9
- data/spec/unit/knife/client_list_spec.rb +5 -5
- data/spec/unit/knife/client_reregister_spec.rb +13 -13
- data/spec/unit/knife/client_show_spec.rb +12 -12
- data/spec/unit/knife/configure_client_spec.rb +19 -20
- data/spec/unit/knife/configure_spec.rb +37 -39
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +17 -19
- data/spec/unit/knife/cookbook_create_spec.rb +32 -32
- data/spec/unit/knife/cookbook_delete_spec.rb +79 -79
- data/spec/unit/knife/cookbook_download_spec.rb +84 -85
- data/spec/unit/knife/cookbook_list_spec.rb +26 -26
- data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +5 -5
- data/spec/unit/knife/cookbook_metadata_spec.rb +55 -55
- data/spec/unit/knife/cookbook_show_spec.rb +33 -34
- data/spec/unit/knife/cookbook_site_download_spec.rb +51 -53
- data/spec/unit/knife/cookbook_site_install_spec.rb +10 -8
- data/spec/unit/knife/cookbook_site_share_spec.rb +42 -42
- data/spec/unit/knife/cookbook_site_unshare_spec.rb +20 -20
- data/spec/unit/knife/cookbook_test_spec.rb +6 -6
- data/spec/unit/knife/cookbook_upload_spec.rb +69 -69
- data/spec/unit/knife/core/bootstrap_context_spec.rb +39 -33
- data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +32 -32
- data/spec/unit/knife/core/custom_manifest_loader_spec.rb +3 -3
- data/spec/unit/knife/core/gem_glob_loader_spec.rb +23 -24
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +8 -8
- data/spec/unit/knife/core/node_editor_spec.rb +211 -0
- data/spec/unit/knife/core/object_loader_spec.rb +12 -12
- data/spec/unit/knife/core/subcommand_loader_spec.rb +10 -10
- data/spec/unit/knife/core/ui_spec.rb +45 -45
- data/spec/unit/knife/data_bag_create_spec.rb +14 -14
- data/spec/unit/knife/data_bag_edit_spec.rb +12 -12
- data/spec/unit/knife/data_bag_from_file_spec.rb +9 -9
- data/spec/unit/knife/data_bag_secret_options_spec.rb +6 -6
- data/spec/unit/knife/data_bag_show_spec.rb +19 -19
- data/spec/unit/knife/environment_compare_spec.rb +32 -32
- data/spec/unit/knife/environment_create_spec.rb +2 -2
- data/spec/unit/knife/environment_delete_spec.rb +2 -2
- data/spec/unit/knife/environment_edit_spec.rb +2 -2
- data/spec/unit/knife/environment_from_file_spec.rb +5 -5
- data/spec/unit/knife/environment_list_spec.rb +4 -4
- data/spec/unit/knife/environment_show_spec.rb +2 -2
- data/spec/unit/knife/index_rebuild_spec.rb +14 -17
- data/spec/unit/knife/key_create_spec.rb +11 -12
- data/spec/unit/knife/key_delete_spec.rb +8 -10
- data/spec/unit/knife/key_edit_spec.rb +14 -17
- data/spec/unit/knife/key_helper.rb +2 -2
- data/spec/unit/knife/key_list_spec.rb +13 -13
- data/spec/unit/knife/key_show_spec.rb +11 -11
- data/spec/unit/knife/knife_help.rb +2 -2
- data/spec/unit/knife/node_bulk_delete_spec.rb +10 -13
- data/spec/unit/knife/node_delete_spec.rb +4 -4
- data/spec/unit/knife/node_edit_spec.rb +17 -18
- data/spec/unit/knife/node_environment_set_spec.rb +4 -4
- data/spec/unit/knife/node_from_file_spec.rb +5 -5
- data/spec/unit/knife/node_list_spec.rb +5 -6
- data/spec/unit/knife/node_run_list_add_spec.rb +5 -8
- data/spec/unit/knife/node_run_list_remove_spec.rb +27 -27
- data/spec/unit/knife/node_run_list_set_spec.rb +4 -4
- data/spec/unit/knife/node_show_spec.rb +6 -6
- data/spec/unit/knife/osc_user_create_spec.rb +7 -7
- data/spec/unit/knife/osc_user_delete_spec.rb +7 -7
- data/spec/unit/knife/osc_user_edit_spec.rb +6 -6
- data/spec/unit/knife/osc_user_list_spec.rb +3 -3
- data/spec/unit/knife/osc_user_reregister_spec.rb +10 -10
- data/spec/unit/knife/osc_user_show_spec.rb +8 -8
- data/spec/unit/knife/raw_spec.rb +6 -6
- data/spec/unit/knife/role_bulk_delete_spec.rb +4 -4
- data/spec/unit/knife/role_create_spec.rb +4 -4
- data/spec/unit/knife/role_delete_spec.rb +4 -4
- data/spec/unit/knife/role_edit_spec.rb +4 -6
- data/spec/unit/knife/role_env_run_list_add_spec.rb +9 -9
- data/spec/unit/knife/role_env_run_list_clear_spec.rb +38 -44
- data/spec/unit/knife/role_env_run_list_remove_spec.rb +46 -52
- data/spec/unit/knife/role_env_run_list_replace_spec.rb +49 -52
- data/spec/unit/knife/role_env_run_list_set_spec.rb +17 -20
- data/spec/unit/knife/role_from_file_spec.rb +7 -7
- data/spec/unit/knife/role_list_spec.rb +5 -7
- data/spec/unit/knife/role_run_list_add_spec.rb +7 -7
- data/spec/unit/knife/role_run_list_clear_spec.rb +28 -34
- data/spec/unit/knife/role_run_list_remove_spec.rb +36 -42
- data/spec/unit/knife/role_run_list_replace_spec.rb +42 -45
- data/spec/unit/knife/role_run_list_set_spec.rb +6 -9
- data/spec/unit/knife/role_show_spec.rb +14 -14
- data/spec/unit/knife/ssh_spec.rb +36 -36
- data/spec/unit/knife/ssl_check_spec.rb +7 -7
- data/spec/unit/knife/ssl_fetch_spec.rb +8 -8
- data/spec/unit/knife/status_spec.rb +5 -5
- data/spec/unit/knife/tag_create_spec.rb +1 -1
- data/spec/unit/knife/tag_delete_spec.rb +1 -1
- data/spec/unit/knife/tag_list_spec.rb +2 -2
- data/spec/unit/knife/user_create_spec.rb +30 -30
- data/spec/unit/knife/user_delete_spec.rb +11 -11
- data/spec/unit/knife/user_edit_spec.rb +9 -9
- data/spec/unit/knife/user_list_spec.rb +3 -3
- data/spec/unit/knife/user_reregister_spec.rb +13 -13
- data/spec/unit/knife/user_show_spec.rb +12 -12
- data/spec/unit/knife_spec.rb +61 -61
- data/spec/unit/lib_backcompat_spec.rb +34 -0
- data/spec/unit/log/syslog_spec.rb +3 -3
- data/spec/unit/log/winevt_spec.rb +3 -3
- data/spec/unit/log_spec.rb +5 -5
- data/spec/unit/lwrp_spec.rb +41 -43
- data/spec/unit/mash_spec.rb +8 -8
- data/spec/unit/mixin/api_version_request_handling_spec.rb +13 -14
- data/spec/unit/mixin/checksum_spec.rb +5 -6
- data/spec/unit/mixin/command_spec.rb +9 -9
- data/spec/unit/mixin/convert_to_class_name_spec.rb +2 -2
- data/spec/unit/mixin/deep_merge_spec.rb +107 -107
- data/spec/unit/mixin/deprecation_spec.rb +5 -5
- data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +9 -9
- data/spec/unit/mixin/homebrew_user_spec.rb +13 -13
- data/spec/unit/mixin/params_validate_spec.rb +71 -71
- data/spec/unit/mixin/path_sanity_spec.rb +16 -16
- data/spec/unit/mixin/powershell_out_spec.rb +9 -9
- data/spec/unit/mixin/powershell_type_coercions_spec.rb +34 -23
- data/spec/unit/mixin/properties_spec.rb +27 -27
- data/spec/unit/mixin/proxified_socket_spec.rb +6 -6
- data/spec/unit/mixin/securable_spec.rb +37 -37
- data/spec/unit/mixin/shell_out_spec.rb +68 -68
- data/spec/unit/mixin/subclass_directive_spec.rb +2 -2
- data/spec/unit/mixin/template_spec.rb +15 -12
- data/spec/unit/mixin/unformatter_spec.rb +3 -3
- data/spec/unit/mixin/uris_spec.rb +8 -8
- data/spec/unit/mixin/windows_architecture_helper_spec.rb +14 -17
- data/spec/unit/mixin/xml_escape_spec.rb +3 -3
- data/spec/unit/monkey_patches/uri_spec.rb +3 -3
- data/spec/unit/monologger_spec.rb +4 -4
- data/spec/unit/node/attribute_spec.rb +203 -248
- data/spec/unit/node/immutable_collections_spec.rb +20 -21
- data/spec/unit/node_map_spec.rb +5 -5
- data/spec/unit/node_spec.rb +165 -135
- data/spec/unit/org_spec.rb +17 -17
- data/spec/unit/platform/query_helpers_spec.rb +23 -23
- data/spec/unit/platform_spec.rb +17 -17
- data/spec/unit/policy_builder/dynamic_spec.rb +8 -10
- data/spec/unit/policy_builder/expand_node_object_spec.rb +16 -14
- data/spec/unit/policy_builder/policyfile_spec.rb +30 -37
- data/spec/unit/policy_builder_spec.rb +4 -4
- data/spec/unit/property/state_spec.rb +58 -56
- data/spec/unit/property/validation_spec.rb +255 -216
- data/spec/unit/property_spec.rb +206 -129
- data/spec/unit/provider/apt_update_spec.rb +113 -0
- data/spec/unit/provider/breakpoint_spec.rb +2 -3
- data/spec/unit/provider/cookbook_file/content_spec.rb +9 -10
- data/spec/unit/provider/cookbook_file_spec.rb +11 -11
- data/spec/unit/provider/cron/unix_spec.rb +7 -7
- data/spec/unit/provider/cron_spec.rb +67 -67
- data/spec/unit/provider/deploy/revision_spec.rb +6 -7
- data/spec/unit/provider/deploy/timestamped_spec.rb +2 -2
- data/spec/unit/provider/deploy_spec.rb +24 -25
- data/spec/unit/provider/directory_spec.rb +12 -12
- data/spec/unit/provider/dsc_resource_spec.rb +29 -27
- data/spec/unit/provider/dsc_script_spec.rb +47 -48
- data/spec/unit/provider/env/windows_spec.rb +21 -21
- data/spec/unit/provider/env_spec.rb +5 -5
- data/spec/unit/provider/erl_call_spec.rb +3 -4
- data/spec/unit/provider/execute_spec.rb +5 -5
- data/spec/unit/provider/file/content_spec.rb +4 -4
- data/spec/unit/provider/file_spec.rb +8 -9
- data/spec/unit/provider/git_spec.rb +64 -65
- data/spec/unit/provider/group/dscl_spec.rb +7 -7
- data/spec/unit/provider/group/gpasswd_spec.rb +3 -3
- data/spec/unit/provider/group/groupadd_spec.rb +9 -9
- data/spec/unit/provider/group/groupmod_spec.rb +12 -12
- data/spec/unit/provider/group/pw_spec.rb +3 -3
- data/spec/unit/provider/group/usermod_spec.rb +6 -6
- data/spec/unit/provider/group/windows_spec.rb +3 -3
- data/spec/unit/provider/group_spec.rb +16 -16
- data/spec/unit/provider/http_request_spec.rb +7 -7
- data/spec/unit/provider/ifconfig/aix_spec.rb +4 -5
- data/spec/unit/provider/ifconfig/debian_spec.rb +6 -6
- data/spec/unit/provider/ifconfig/redhat_spec.rb +3 -3
- data/spec/unit/provider/ifconfig_spec.rb +5 -5
- data/spec/unit/provider/link_spec.rb +12 -12
- data/spec/unit/provider/log_spec.rb +2 -2
- data/spec/unit/provider/mdadm_spec.rb +12 -12
- data/spec/unit/provider/mount/aix_spec.rb +7 -7
- data/spec/unit/provider/mount/mount_spec.rb +20 -20
- data/spec/unit/provider/mount/solaris_spec.rb +26 -26
- data/spec/unit/provider/mount/windows_spec.rb +8 -8
- data/spec/unit/provider/mount_spec.rb +7 -8
- data/spec/unit/provider/ohai_spec.rb +13 -13
- data/spec/unit/provider/osx_profile_spec.rb +249 -0
- data/spec/unit/provider/package/aix_spec.rb +5 -5
- data/spec/unit/provider/package/apt_spec.rb +49 -49
- data/spec/unit/provider/package/chocolatey_spec.rb +504 -0
- data/spec/unit/provider/package/dpkg_spec.rb +32 -36
- data/spec/unit/provider/package/easy_install_spec.rb +11 -15
- data/spec/unit/provider/package/freebsd/pkg_spec.rb +10 -10
- data/spec/unit/provider/package/freebsd/pkgng_spec.rb +12 -19
- data/spec/unit/provider/package/freebsd/port_spec.rb +12 -19
- data/spec/unit/provider/package/homebrew_spec.rb +139 -139
- data/spec/unit/provider/package/ips_spec.rb +10 -11
- data/spec/unit/provider/package/macports_spec.rb +3 -3
- data/spec/unit/provider/package/openbsd_spec.rb +38 -38
- data/spec/unit/provider/package/pacman_spec.rb +8 -9
- data/spec/unit/provider/package/paludis_spec.rb +9 -10
- data/spec/unit/provider/package/portage_spec.rb +2 -2
- data/spec/unit/provider/package/rpm_spec.rb +7 -11
- data/spec/unit/provider/package/rubygems_spec.rb +386 -289
- data/spec/unit/provider/package/smartos_spec.rb +8 -10
- data/spec/unit/provider/package/solaris_spec.rb +4 -4
- data/spec/unit/provider/package/windows/exe_spec.rb +17 -81
- data/spec/unit/provider/package/windows/msi_spec.rb +16 -16
- data/spec/unit/provider/package/windows_spec.rb +50 -40
- data/spec/unit/provider/package/yum_spec.rb +179 -181
- data/spec/unit/provider/package/zypper_spec.rb +53 -50
- data/spec/unit/provider/package_spec.rb +104 -104
- data/spec/unit/provider/powershell_script_spec.rb +20 -20
- data/spec/unit/provider/registry_key_spec.rb +3 -3
- data/spec/unit/provider/remote_directory_spec.rb +46 -46
- data/spec/unit/provider/remote_file/cache_control_data_spec.rb +9 -10
- data/spec/unit/provider/remote_file/content_spec.rb +5 -6
- data/spec/unit/provider/remote_file/fetcher_spec.rb +3 -3
- data/spec/unit/provider/remote_file/ftp_spec.rb +3 -3
- data/spec/unit/provider/remote_file/http_spec.rb +10 -12
- data/spec/unit/provider/remote_file/local_file_spec.rb +2 -2
- data/spec/unit/provider/remote_file/network_file_spec.rb +2 -2
- data/spec/unit/provider/remote_file_spec.rb +9 -11
- data/spec/unit/provider/route_spec.rb +26 -27
- data/spec/unit/provider/ruby_block_spec.rb +4 -5
- data/spec/unit/provider/script_spec.rb +11 -11
- data/spec/unit/provider/service/aix_service_spec.rb +5 -6
- data/spec/unit/provider/service/aixinit_service_spec.rb +26 -23
- data/spec/unit/provider/service/arch_service_spec.rb +15 -15
- data/spec/unit/provider/service/debian_service_spec.rb +37 -37
- data/spec/unit/provider/service/freebsd_service_spec.rb +9 -9
- data/spec/unit/provider/service/gentoo_service_spec.rb +4 -4
- data/spec/unit/provider/service/init_service_spec.rb +9 -9
- data/spec/unit/provider/service/insserv_service_spec.rb +3 -3
- data/spec/unit/provider/service/invokercd_service_spec.rb +9 -9
- data/spec/unit/provider/service/macosx_spec.rb +26 -26
- data/spec/unit/provider/service/openbsd_service_spec.rb +26 -26
- data/spec/unit/provider/service/redhat_spec.rb +16 -16
- data/spec/unit/provider/service/simple_service_spec.rb +5 -5
- data/spec/unit/provider/service/solaris_smf_service_spec.rb +51 -51
- data/spec/unit/provider/service/systemd_service_spec.rb +4 -4
- data/spec/unit/provider/service/upstart_service_spec.rb +13 -13
- data/spec/unit/provider/service/windows_spec.rb +28 -37
- data/spec/unit/provider/service_spec.rb +2 -3
- data/spec/unit/provider/subversion_spec.rb +27 -28
- data/spec/unit/provider/template/content_spec.rb +21 -21
- data/spec/unit/provider/template_spec.rb +15 -16
- data/spec/unit/provider/user/dscl_spec.rb +36 -37
- data/spec/unit/provider/user/pw_spec.rb +12 -12
- data/spec/unit/provider/user/solaris_spec.rb +31 -31
- data/spec/unit/provider/user/useradd_spec.rb +10 -10
- data/spec/unit/provider/user/windows_spec.rb +9 -9
- data/spec/unit/provider/user_spec.rb +19 -20
- data/spec/unit/provider/whyrun_safe_ruby_block_spec.rb +3 -4
- data/spec/unit/provider_resolver_spec.rb +63 -62
- data/spec/unit/provider_spec.rb +7 -8
- data/spec/unit/pure_application_spec.rb +3 -3
- data/spec/unit/recipe_spec.rb +13 -16
- data/spec/unit/resource/apt_package_spec.rb +4 -4
- data/spec/unit/resource/apt_update_spec.rb +38 -0
- data/spec/unit/resource/bash_spec.rb +3 -3
- data/spec/unit/resource/batch_spec.rb +5 -5
- data/spec/unit/resource/breakpoint_spec.rb +3 -3
- data/spec/unit/resource/chef_gem_spec.rb +5 -9
- data/spec/unit/resource/chocolatey_package_spec.rb +67 -0
- data/spec/unit/resource/conditional_action_not_nothing_spec.rb +2 -2
- data/spec/unit/resource/conditional_spec.rb +12 -12
- data/spec/unit/resource/cookbook_file_spec.rb +23 -24
- data/spec/unit/resource/cron_spec.rb +4 -4
- data/spec/unit/resource/csh_spec.rb +3 -3
- data/spec/unit/resource/deploy_revision_spec.rb +3 -3
- data/spec/unit/resource/deploy_spec.rb +23 -24
- data/spec/unit/resource/directory_spec.rb +4 -4
- data/spec/unit/resource/dpkg_package_spec.rb +5 -5
- data/spec/unit/resource/dsc_resource_spec.rb +11 -11
- data/spec/unit/resource/dsc_script_spec.rb +15 -15
- data/spec/unit/resource/easy_install_package_spec.rb +3 -3
- data/spec/unit/resource/env_spec.rb +5 -5
- data/spec/unit/resource/erl_call_spec.rb +3 -3
- data/spec/unit/resource/execute_spec.rb +4 -4
- data/spec/unit/resource/file/verification_spec.rb +11 -11
- data/spec/unit/resource/file_spec.rb +10 -10
- data/spec/unit/resource/freebsd_package_spec.rb +6 -9
- data/spec/unit/resource/gem_package_spec.rb +4 -4
- data/spec/unit/resource/git_spec.rb +3 -3
- data/spec/unit/resource/group_spec.rb +4 -4
- data/spec/unit/resource/homebrew_package_spec.rb +13 -13
- data/spec/unit/resource/http_request_spec.rb +5 -5
- data/spec/unit/resource/ifconfig_spec.rb +9 -9
- data/spec/unit/resource/ips_package_spec.rb +4 -4
- data/spec/unit/resource/ksh_spec.rb +2 -2
- data/spec/unit/resource/link_spec.rb +6 -6
- data/spec/unit/resource/log_spec.rb +3 -3
- data/spec/unit/resource/macports_package_spec.rb +3 -3
- data/spec/unit/resource/mdadm_spec.rb +3 -3
- data/spec/unit/resource/mount_spec.rb +7 -7
- data/spec/unit/resource/ohai_spec.rb +2 -3
- data/spec/unit/resource/openbsd_package_spec.rb +5 -6
- data/spec/unit/resource/osx_profile_spec.rb +61 -0
- data/spec/unit/resource/package_spec.rb +6 -6
- data/spec/unit/resource/pacman_package_spec.rb +3 -3
- data/spec/unit/resource/perl_spec.rb +3 -3
- data/spec/unit/resource/portage_package_spec.rb +2 -2
- data/spec/unit/resource/powershell_script_spec.rb +16 -16
- data/spec/unit/resource/python_spec.rb +3 -3
- data/spec/unit/resource/registry_key_spec.rb +21 -21
- data/spec/unit/resource/remote_directory_spec.rb +3 -3
- data/spec/unit/resource/remote_file_spec.rb +15 -15
- data/spec/unit/resource/resource_notification_spec.rb +18 -18
- data/spec/unit/resource/route_spec.rb +3 -3
- data/spec/unit/resource/rpm_package_spec.rb +4 -4
- data/spec/unit/resource/ruby_block_spec.rb +4 -4
- data/spec/unit/resource/ruby_spec.rb +3 -3
- data/spec/unit/resource/scm_spec.rb +8 -8
- data/spec/unit/resource/script_spec.rb +4 -4
- data/spec/unit/resource/service_spec.rb +4 -5
- data/spec/unit/resource/smartos_package_spec.rb +3 -3
- data/spec/unit/resource/solaris_package_spec.rb +3 -3
- data/spec/unit/resource/subversion_spec.rb +5 -5
- data/spec/unit/resource/template_spec.rb +7 -8
- data/spec/unit/resource/timestamped_deploy_spec.rb +4 -4
- data/spec/unit/resource/user_spec.rb +4 -4
- data/spec/unit/resource/windows_package_spec.rb +7 -7
- data/spec/unit/resource/windows_service_spec.rb +3 -3
- data/spec/unit/resource/yum_package_spec.rb +6 -6
- data/spec/unit/resource_collection/resource_list_spec.rb +7 -7
- data/spec/unit/resource_collection/resource_set_spec.rb +9 -9
- data/spec/unit/resource_collection/stepable_iterator_spec.rb +6 -6
- data/spec/unit/resource_collection_spec.rb +8 -9
- data/spec/unit/resource_definition_spec.rb +3 -3
- data/spec/unit/resource_reporter_spec.rb +56 -64
- data/spec/unit/resource_resolver_spec.rb +5 -6
- data/spec/unit/resource_spec.rb +80 -60
- data/spec/unit/rest/auth_credentials_spec.rb +39 -71
- data/spec/unit/rest_spec.rb +96 -90
- data/spec/unit/role_spec.rb +64 -68
- data/spec/unit/run_context/child_run_context_spec.rb +23 -23
- data/spec/unit/run_context/cookbook_compiler_spec.rb +5 -7
- data/spec/unit/run_context_spec.rb +19 -19
- data/spec/unit/run_list/run_list_expansion_spec.rb +24 -24
- data/spec/unit/run_list/run_list_item_spec.rb +28 -28
- data/spec/unit/run_list/versioned_recipe_list_spec.rb +22 -23
- data/spec/unit/run_list_spec.rb +37 -41
- data/spec/unit/run_lock_spec.rb +10 -10
- data/spec/unit/run_status_spec.rb +4 -5
- data/spec/unit/runner_spec.rb +8 -8
- data/spec/unit/scan_access_control_spec.rb +4 -5
- data/spec/unit/search/query_spec.rb +50 -46
- data/spec/unit/shell/model_wrapper_spec.rb +12 -13
- data/spec/unit/shell/shell_ext_spec.rb +5 -5
- data/spec/unit/shell/shell_session_spec.rb +8 -9
- data/spec/unit/shell_out_spec.rb +1 -1
- data/spec/unit/shell_spec.rb +9 -9
- data/spec/unit/user_spec.rb +14 -15
- data/spec/unit/user_v1_spec.rb +22 -23
- data/spec/unit/util/backup_spec.rb +17 -18
- data/spec/unit/util/diff_spec.rb +6 -9
- data/spec/unit/util/dsc/configuration_generator_spec.rb +48 -48
- data/spec/unit/util/dsc/lcm_output_parser_spec.rb +22 -22
- data/spec/unit/util/dsc/local_configuration_manager_spec.rb +30 -31
- data/spec/unit/util/dsc/resource_store.rb +22 -22
- data/spec/unit/util/editor_spec.rb +65 -65
- data/spec/unit/util/file_edit_spec.rb +7 -7
- data/spec/unit/util/powershell/cmdlet_spec.rb +27 -27
- data/spec/unit/util/powershell/ps_credential_spec.rb +13 -13
- data/spec/unit/util/selinux_spec.rb +8 -9
- data/spec/unit/util/threaded_job_queue_spec.rb +2 -2
- data/spec/unit/version/platform_spec.rb +5 -6
- data/spec/unit/version_class_spec.rb +8 -9
- data/spec/unit/version_constraint/platform_spec.rb +3 -4
- data/spec/unit/version_constraint_spec.rb +19 -19
- data/spec/unit/win32/registry_spec.rb +25 -25
- data/spec/unit/windows_service_spec.rb +20 -20
- data/tasks/cbgb.rb +84 -0
- data/tasks/external_tests.rb +12 -11
- data/tasks/maintainers.rb +15 -15
- data/tasks/rspec.rb +18 -15
- metadata +250 -67
- data/lib/chef/chef_fs/file_system/acl_dir.rb +0 -63
- data/lib/chef/chef_fs/file_system/acl_entry.rb +0 -58
- data/lib/chef/chef_fs/file_system/acls_dir.rb +0 -72
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_dir.rb +0 -102
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_entry.rb +0 -80
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbooks_dir.rb +0 -82
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_entry.rb +0 -81
- data/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +0 -196
- data/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +0 -165
- data/lib/chef/chef_fs/file_system/cookbook_dir.rb +0 -224
- data/lib/chef/chef_fs/file_system/cookbook_file.rb +0 -82
- data/lib/chef/chef_fs/file_system/cookbook_subdir.rb +0 -59
- data/lib/chef/chef_fs/file_system/cookbooks_acl_dir.rb +0 -41
- data/lib/chef/chef_fs/file_system/cookbooks_dir.rb +0 -156
- data/lib/chef/chef_fs/file_system/data_bag_dir.rb +0 -69
- data/lib/chef/chef_fs/file_system/data_bags_dir.rb +0 -71
- data/lib/chef/chef_fs/file_system/environments_dir.rb +0 -60
- data/lib/chef/chef_fs/file_system/file_system_entry.rb +0 -115
- data/lib/chef/chef_fs/file_system/memory_dir.rb +0 -51
- data/lib/chef/chef_fs/file_system/memory_file.rb +0 -17
- data/lib/chef/chef_fs/file_system/memory_root.rb +0 -21
- data/lib/chef/chef_fs/file_system/nodes_dir.rb +0 -55
- data/lib/chef/chef_fs/file_system/org_entry.rb +0 -34
- data/lib/chef/chef_fs/file_system/organization_invites_entry.rb +0 -59
- data/lib/chef/chef_fs/file_system/organization_members_entry.rb +0 -58
- data/lib/chef/chef_fs/file_system/rest_list_dir.rb +0 -110
- data/lib/chef/chef_fs/file_system/rest_list_entry.rb +0 -185
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: David Balatero (<dbalatero@gmail.com>)
|
3
|
-
# Copyright:: Copyright
|
3
|
+
# Copyright:: Copyright 2009-2016, Chef Software Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Chef::Provider::Package::Macports do
|
22
22
|
before(:each) do
|
@@ -70,7 +70,7 @@ describe Chef::Provider::Package::Macports do
|
|
70
70
|
|
71
71
|
describe "current_installed_version" do
|
72
72
|
it "should return the current version if the package is installed" do
|
73
|
-
stdout =
|
73
|
+
stdout = <<EOF
|
74
74
|
The following ports are currently installed:
|
75
75
|
openssl @0.9.8k_0 (active)
|
76
76
|
EOF
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Scott Bonds (scott@ggr.com)
|
3
|
-
# Copyright:: Copyright
|
3
|
+
# Copyright:: Copyright 2014-2016, Scott Bonds
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -16,14 +16,14 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
20
|
-
require
|
19
|
+
require "spec_helper"
|
20
|
+
require "ostruct"
|
21
21
|
|
22
22
|
describe Chef::Provider::Package::Openbsd do
|
23
23
|
|
24
24
|
let(:node) do
|
25
25
|
node = Chef::Node.new
|
26
|
-
node.default[
|
26
|
+
node.default["kernel"] = { "name" => "OpenBSD", "release" => "5.5", "machine" => "amd64" }
|
27
27
|
node
|
28
28
|
end
|
29
29
|
|
@@ -33,79 +33,79 @@ describe Chef::Provider::Package::Openbsd do
|
|
33
33
|
Chef::Provider::Package::Openbsd.new(new_resource, run_context)
|
34
34
|
end
|
35
35
|
|
36
|
-
let(:new_resource) { Chef::Resource::Package.new(name)}
|
36
|
+
let(:new_resource) { Chef::Resource::Package.new(name) }
|
37
37
|
|
38
38
|
before(:each) do
|
39
|
-
ENV[
|
39
|
+
ENV["PKG_PATH"] = nil
|
40
40
|
end
|
41
41
|
|
42
42
|
describe "install a package" do
|
43
|
-
let(:name) {
|
44
|
-
let(:version) {
|
43
|
+
let(:name) { "ihavetoes" }
|
44
|
+
let(:version) { "0.0" }
|
45
45
|
|
46
|
-
context
|
46
|
+
context "when not already installed" do
|
47
47
|
before do
|
48
|
-
allow(provider).to receive(:shell_out!).with("pkg_info -e \"#{name}->0\"", anything()).and_return(instance_double(
|
48
|
+
allow(provider).to receive(:shell_out!).with("pkg_info -e \"#{name}->0\"", anything()).and_return(instance_double("shellout", :stdout => ""))
|
49
49
|
end
|
50
50
|
|
51
|
-
context
|
51
|
+
context "when there is a single candidate" do
|
52
52
|
|
53
|
-
context
|
54
|
-
it
|
53
|
+
context "when source is not provided" do
|
54
|
+
it "should run the installation command" do
|
55
55
|
expect(provider).to receive(:shell_out!).with("pkg_info -I \"#{name}\"", anything()).and_return(
|
56
|
-
instance_double(
|
56
|
+
instance_double("shellout", :stdout => "#{name}-#{version}\n"))
|
57
57
|
expect(provider).to receive(:shell_out!).with(
|
58
58
|
"pkg_add -r #{name}-#{version}",
|
59
|
-
{:env => {"PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/"}, timeout: 900}
|
60
|
-
) {OpenStruct.new :status => true}
|
59
|
+
{ :env => { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }
|
60
|
+
) { OpenStruct.new :status => true }
|
61
61
|
provider.run_action(:install)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
context
|
67
|
-
let(:flavor_a) {
|
68
|
-
let(:flavor_b) {
|
66
|
+
context "when there are multiple candidates" do
|
67
|
+
let(:flavor_a) { "flavora" }
|
68
|
+
let(:flavor_b) { "flavorb" }
|
69
69
|
|
70
|
-
context
|
71
|
-
it
|
70
|
+
context "if no version is specified" do
|
71
|
+
it "should raise an exception" do
|
72
72
|
expect(provider).to receive(:shell_out!).with("pkg_info -I \"#{name}\"", anything()).and_return(
|
73
|
-
instance_double(
|
73
|
+
instance_double("shellout", :stdout => "#{name}-#{version}-#{flavor_a}\n#{name}-#{version}-#{flavor_b}\n"))
|
74
74
|
expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package, /multiple matching candidates/)
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
context
|
78
|
+
context "if a flavor is specified" do
|
79
79
|
|
80
|
-
let(:flavor) {
|
81
|
-
let(:package_name) {
|
80
|
+
let(:flavor) { "flavora" }
|
81
|
+
let(:package_name) { "ihavetoes" }
|
82
82
|
let(:name) { "#{package_name}--#{flavor}" }
|
83
83
|
|
84
|
-
context
|
85
|
-
it
|
86
|
-
expect(provider).to receive(:shell_out!).with("pkg_info -e \"#{package_name}->0\"", anything()).and_return(instance_double(
|
84
|
+
context "if no version is specified" do
|
85
|
+
it "should run the installation command" do
|
86
|
+
expect(provider).to receive(:shell_out!).with("pkg_info -e \"#{package_name}->0\"", anything()).and_return(instance_double("shellout", :stdout => ""))
|
87
87
|
expect(provider).to receive(:shell_out!).with("pkg_info -I \"#{name}\"", anything()).and_return(
|
88
|
-
instance_double(
|
88
|
+
instance_double("shellout", :stdout => "#{name}-#{version}-#{flavor}\n"))
|
89
89
|
expect(provider).to receive(:shell_out!).with(
|
90
90
|
"pkg_add -r #{name}-#{version}-#{flavor}",
|
91
|
-
{env: {"PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/"}, timeout: 900}
|
92
|
-
) {OpenStruct.new :status => true}
|
91
|
+
{ env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }
|
92
|
+
) { OpenStruct.new :status => true }
|
93
93
|
provider.run_action(:install)
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
97
|
end
|
98
98
|
|
99
|
-
context
|
100
|
-
it
|
99
|
+
context "if a version is specified" do
|
100
|
+
it "should use the flavor from the version" do
|
101
101
|
expect(provider).to receive(:shell_out!).with("pkg_info -I \"#{name}-#{version}-#{flavor_b}\"", anything()).and_return(
|
102
|
-
instance_double(
|
102
|
+
instance_double("shellout", :stdout => "#{name}-#{version}-#{flavor_a}\n"))
|
103
103
|
|
104
104
|
new_resource.version("#{version}-#{flavor_b}")
|
105
105
|
expect(provider).to receive(:shell_out!).with(
|
106
106
|
"pkg_add -r #{name}-#{version}-#{flavor_b}",
|
107
|
-
{env: {"PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/"}, timeout: 900}
|
108
|
-
) {OpenStruct.new :status => true}
|
107
|
+
{ env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }
|
108
|
+
) { OpenStruct.new :status => true }
|
109
109
|
provider.run_action(:install)
|
110
110
|
end
|
111
111
|
end
|
@@ -115,7 +115,7 @@ describe Chef::Provider::Package::Openbsd do
|
|
115
115
|
|
116
116
|
describe "delete a package" do
|
117
117
|
before do
|
118
|
-
@name =
|
118
|
+
@name = "ihavetoes"
|
119
119
|
@new_resource = Chef::Resource::Package.new(@name)
|
120
120
|
@current_resource = Chef::Resource::Package.new(@name)
|
121
121
|
@provider = Chef::Provider::Package::Openbsd.new(@new_resource, @run_context)
|
@@ -124,7 +124,7 @@ describe Chef::Provider::Package::Openbsd do
|
|
124
124
|
it "should run the command to delete the installed package" do
|
125
125
|
expect(@provider).to receive(:shell_out!).with(
|
126
126
|
"pkg_delete #{@name}", env: nil, timeout: 900
|
127
|
-
) {OpenStruct.new :status => true}
|
127
|
+
) { OpenStruct.new :status => true }
|
128
128
|
@provider.remove_package(@name, nil)
|
129
129
|
end
|
130
130
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Jan Zimmek (<jan.zimmek@web.de>)
|
3
|
-
# Copyright:: Copyright
|
3
|
+
# Copyright:: Copyright 2010-2016, Jan Zimmek
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Chef::Provider::Package::Pacman do
|
22
22
|
before(:each) do
|
@@ -51,7 +51,7 @@ ERR
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should run pacman query with the package name" do
|
54
|
-
expect(@provider).to receive(:shell_out).with("pacman -Qi #{@new_resource.package_name}", {timeout: 900}).and_return(@status)
|
54
|
+
expect(@provider).to receive(:shell_out).with("pacman -Qi #{@new_resource.package_name}", { timeout: 900 }).and_return(@status)
|
55
55
|
@provider.load_current_resource
|
56
56
|
end
|
57
57
|
|
@@ -62,7 +62,6 @@ ERR
|
|
62
62
|
|
63
63
|
it "should set the installed version to nil on the current resource if pacman installed version not exists" do
|
64
64
|
allow(@provider).to receive(:shell_out).and_return(@status)
|
65
|
-
expect(@current_resource).to receive(:version).with(nil).and_return(true)
|
66
65
|
@provider.load_current_resource
|
67
66
|
end
|
68
67
|
|
@@ -103,7 +102,7 @@ PACMAN
|
|
103
102
|
end
|
104
103
|
|
105
104
|
it "should use pacman.conf to determine valid repo names for package versions" do
|
106
|
-
|
105
|
+
@pacman_conf = <<-PACMAN_CONF
|
107
106
|
[options]
|
108
107
|
HoldPkg = pacman glibc
|
109
108
|
Architecture = auto
|
@@ -152,12 +151,12 @@ PACMAN_CONF
|
|
152
151
|
|
153
152
|
describe Chef::Provider::Package::Pacman, "install_package" do
|
154
153
|
it "should run pacman install with the package name and version" do
|
155
|
-
expect(@provider).to receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar nano", {timeout: 900})
|
154
|
+
expect(@provider).to receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar nano", { timeout: 900 })
|
156
155
|
@provider.install_package("nano", "1.0")
|
157
156
|
end
|
158
157
|
|
159
158
|
it "should run pacman install with the package name and version and options if specified" do
|
160
|
-
expect(@provider).to receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar --debug nano", {timeout: 900})
|
159
|
+
expect(@provider).to receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar --debug nano", { timeout: 900 })
|
161
160
|
allow(@new_resource).to receive(:options).and_return("--debug")
|
162
161
|
|
163
162
|
@provider.install_package("nano", "1.0")
|
@@ -173,12 +172,12 @@ PACMAN_CONF
|
|
173
172
|
|
174
173
|
describe Chef::Provider::Package::Pacman, "remove_package" do
|
175
174
|
it "should run pacman remove with the package name" do
|
176
|
-
expect(@provider).to receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar nano", {timeout: 900})
|
175
|
+
expect(@provider).to receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar nano", { timeout: 900 })
|
177
176
|
@provider.remove_package("nano", "1.0")
|
178
177
|
end
|
179
178
|
|
180
179
|
it "should run pacman remove with the package name and options if specified" do
|
181
|
-
expect(@provider).to receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar --debug nano", {timeout: 900})
|
180
|
+
expect(@provider).to receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar --debug nano", { timeout: 900 })
|
182
181
|
allow(@new_resource).to receive(:options).and_return("--debug")
|
183
182
|
|
184
183
|
@provider.remove_package("nano", "1.0")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Vasiliy Tolstov <v.tolstov@selfip.ru>
|
3
|
-
# Copyright:: Copyright
|
3
|
+
# Copyright:: Copyright 2014-2016, Chef Software Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -16,8 +16,8 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
20
|
-
require
|
19
|
+
require "spec_helper"
|
20
|
+
require "ostruct"
|
21
21
|
|
22
22
|
# based on the ips specs
|
23
23
|
|
@@ -33,7 +33,7 @@ describe Chef::Provider::Package::Paludis do
|
|
33
33
|
|
34
34
|
@stdin = StringIO.new
|
35
35
|
@stderr = StringIO.new
|
36
|
-
@stdout
|
36
|
+
@stdout = <<-PKG_STATUS
|
37
37
|
group/ntp 0 accounts
|
38
38
|
group/ntp 0 installed-accounts
|
39
39
|
net/ntp 4.2.6_p5-r2 arbor
|
@@ -42,7 +42,7 @@ user/ntp 0 installed-accounts
|
|
42
42
|
net/ntp 4.2.6_p5-r1 installed
|
43
43
|
PKG_STATUS
|
44
44
|
@pid = 12345
|
45
|
-
@shell_out = OpenStruct.new(:stdout => @stdout
|
45
|
+
@shell_out = OpenStruct.new(:stdout => @stdout, :stdin => @stdin, :stderr => @stderr, :status => @status, :exitstatus => 0)
|
46
46
|
end
|
47
47
|
|
48
48
|
context "when loading current resource" do
|
@@ -86,13 +86,12 @@ INSTALLED
|
|
86
86
|
|
87
87
|
context "when installing a package" do
|
88
88
|
it "should run pkg install with the package name and version" do
|
89
|
-
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", {:timeout
|
89
|
+
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", { :timeout => @new_resource.timeout })
|
90
90
|
@provider.install_package("net/ntp", "4.2.6_p5-r2")
|
91
91
|
end
|
92
92
|
|
93
|
-
|
94
93
|
it "should run pkg install with the package name and version and options if specified" do
|
95
|
-
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x --preserve-world \"=net/ntp-4.2.6_p5-r2\"", {:timeout
|
94
|
+
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x --preserve-world \"=net/ntp-4.2.6_p5-r2\"", { :timeout => @new_resource.timeout })
|
96
95
|
allow(@new_resource).to receive(:options).and_return("--preserve-world")
|
97
96
|
@provider.install_package("net/ntp", "4.2.6_p5-r2")
|
98
97
|
end
|
@@ -102,7 +101,7 @@ INSTALLED
|
|
102
101
|
sys-process/lsof 4.87 arbor
|
103
102
|
sys-process/lsof 4.87 x86_64
|
104
103
|
PKG_STATUS
|
105
|
-
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=sys-process/lsof-4.87\"", {:timeout
|
104
|
+
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=sys-process/lsof-4.87\"", { :timeout => @new_resource.timeout })
|
106
105
|
@provider.install_package("sys-process/lsof", "4.87")
|
107
106
|
end
|
108
107
|
|
@@ -120,7 +119,7 @@ PKG_STATUS
|
|
120
119
|
|
121
120
|
context "when upgrading a package" do
|
122
121
|
it "should run pkg install with the package name and version" do
|
123
|
-
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", {:timeout
|
122
|
+
expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", { :timeout => @new_resource.timeout })
|
124
123
|
@provider.upgrade_package("net/ntp", "4.2.6_p5-r2")
|
125
124
|
end
|
126
125
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Author:: Caleb Tennis (<caleb.tennis@gmail.com>)
|
3
|
-
# Copyright:: Copyright
|
3
|
+
# Copyright:: Copyright 2008-2016, Chef Software Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
require
|
18
|
+
require "spec_helper"
|
19
19
|
|
20
20
|
describe Chef::Provider::Package::Portage, "load_current_resource" do
|
21
21
|
before(:each) do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Joshua Timberman (<joshua@
|
3
|
-
# Author:: Daniel DeLeo (<dan@
|
4
|
-
# Copyright:: Copyright
|
2
|
+
# Author:: Joshua Timberman (<joshua@chef.io>)
|
3
|
+
# Author:: Daniel DeLeo (<dan@chef.io>)
|
4
|
+
# Copyright:: Copyright 2008-2016, Chef Software Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
|
-
require
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Chef::Provider::Package::Rpm do
|
22
22
|
let(:provider) { Chef::Provider::Package::Rpm.new(new_resource, run_context) }
|
@@ -35,10 +35,10 @@ describe Chef::Provider::Package::Rpm do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
# `rpm -qp [stuff] $source`
|
38
|
-
let(:rpm_qp_status) { instance_double(
|
38
|
+
let(:rpm_qp_status) { instance_double("Mixlib::ShellOut", exitstatus: rpm_qp_exitstatus, stdout: rpm_qp_stdout) }
|
39
39
|
|
40
40
|
# `rpm -q [stuff] $package_name`
|
41
|
-
let(:rpm_q_status) { instance_double(
|
41
|
+
let(:rpm_q_status) { instance_double("Mixlib::ShellOut", exitstatus: rpm_q_exitstatus, stdout: rpm_q_stdout) }
|
42
42
|
|
43
43
|
before(:each) do
|
44
44
|
allow(::File).to receive(:exists?).with("PLEASE STUB File.exists? EXACTLY").and_return(true)
|
@@ -116,7 +116,6 @@ describe Chef::Provider::Package::Rpm do
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
|
120
119
|
context "when the package is installed" do
|
121
120
|
|
122
121
|
let(:rpm_qp_stdout) { "ImageMagick-c++ 6.5.4.7-7.el6_5" }
|
@@ -237,7 +236,6 @@ describe Chef::Provider::Package::Rpm do
|
|
237
236
|
end
|
238
237
|
end
|
239
238
|
|
240
|
-
|
241
239
|
context "when the package name contains a tilde (chef#3503)" do
|
242
240
|
|
243
241
|
let(:package_name) { "supermarket" }
|
@@ -287,7 +285,7 @@ describe Chef::Provider::Package::Rpm do
|
|
287
285
|
provider.process_resource_requirements
|
288
286
|
end
|
289
287
|
|
290
|
-
%w
|
288
|
+
%w{http HTTP https HTTPS ftp FTP file FILE}.each do |scheme|
|
291
289
|
|
292
290
|
context "when the source URI uses protocol scheme '#{scheme}'" do
|
293
291
|
|
@@ -396,7 +394,6 @@ describe Chef::Provider::Package::Rpm do
|
|
396
394
|
|
397
395
|
end
|
398
396
|
|
399
|
-
|
400
397
|
end
|
401
398
|
end
|
402
399
|
|
@@ -429,5 +426,4 @@ describe Chef::Provider::Package::Rpm do
|
|
429
426
|
end
|
430
427
|
end
|
431
428
|
|
432
|
-
|
433
429
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# Author:: David Balatero (dbalatero@gmail.com)
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright
|
4
|
+
# Copyright:: Copyright 2009-2016, David Balatero
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
|
-
require
|
19
|
+
require "pp"
|
20
20
|
|
21
21
|
module GemspecBackcompatCreator
|
22
22
|
def gemspec(name, version)
|
@@ -28,8 +28,8 @@ module GemspecBackcompatCreator
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
require
|
32
|
-
require
|
31
|
+
require "spec_helper"
|
32
|
+
require "ostruct"
|
33
33
|
|
34
34
|
describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
|
35
35
|
include GemspecBackcompatCreator
|
@@ -43,18 +43,18 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "determines the installed versions of gems from Gem.source_index" do
|
46
|
-
gems = [gemspec(
|
47
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new(
|
48
|
-
expect(Gem::Specification).to receive(:find_all_by_name).with(
|
46
|
+
gems = [gemspec("rspec-core", Gem::Version.new("1.2.9")), gemspec("rspec-core", Gem::Version.new("1.3.0"))]
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.8.0")
|
48
|
+
expect(Gem::Specification).to receive(:find_all_by_name).with("rspec-core", Gem::Dependency.new("rspec-core").requirement).and_return(gems)
|
49
49
|
else
|
50
|
-
expect(Gem.source_index).to receive(:search).with(Gem::Dependency.new(
|
50
|
+
expect(Gem.source_index).to receive(:search).with(Gem::Dependency.new("rspec-core", nil)).and_return(gems)
|
51
51
|
end
|
52
|
-
expect(@gem_env.installed_versions(Gem::Dependency.new(
|
52
|
+
expect(@gem_env.installed_versions(Gem::Dependency.new("rspec-core", nil))).to eq(gems)
|
53
53
|
end
|
54
54
|
|
55
55
|
it "determines the installed versions of gems from the source index (part2: the unmockening)" do
|
56
|
-
expected = [
|
57
|
-
actual = @gem_env.installed_versions(Gem::Dependency.new(
|
56
|
+
expected = ["rspec-core", Gem::Version.new(RSpec::Core::Version::STRING)]
|
57
|
+
actual = @gem_env.installed_versions(Gem::Dependency.new("rspec-core", nil)).map { |spec| [spec.name, spec.version] }
|
58
58
|
expect(actual).to include(expected)
|
59
59
|
end
|
60
60
|
|
@@ -87,16 +87,16 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
it "finds a matching gem candidate version" do
|
90
|
-
dep = Gem::Dependency.new(
|
90
|
+
dep = Gem::Dependency.new("rspec", ">= 0")
|
91
91
|
dep_installer = Gem::DependencyInstaller.new
|
92
92
|
allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
|
93
93
|
latest = [[gemspec("rspec", Gem::Version.new("1.3.0")), "https://rubygems.org/"]]
|
94
94
|
expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(latest)
|
95
|
-
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new(
|
95
|
+
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new("rspec", ">= 0"))).to eq(Gem::Version.new("1.3.0"))
|
96
96
|
end
|
97
97
|
|
98
98
|
it "finds a matching gem candidate version on rubygems 2.0.0+" do
|
99
|
-
dep = Gem::Dependency.new(
|
99
|
+
dep = Gem::Dependency.new("rspec", ">= 0")
|
100
100
|
dep_installer = Gem::DependencyInstaller.new
|
101
101
|
allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
|
102
102
|
best_gem = double("best gem match", :spec => gemspec("rspec", Gem::Version.new("1.3.0")), :source => "https://rubygems.org")
|
@@ -104,62 +104,62 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
|
|
104
104
|
expect(available_set).to receive(:pick_best!)
|
105
105
|
expect(available_set).to receive(:set).and_return([best_gem])
|
106
106
|
expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(available_set)
|
107
|
-
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new(
|
107
|
+
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new("rspec", ">= 0"))).to eq(Gem::Version.new("1.3.0"))
|
108
108
|
end
|
109
109
|
|
110
110
|
it "gives the candidate version as nil if none is found" do
|
111
|
-
dep = Gem::Dependency.new(
|
111
|
+
dep = Gem::Dependency.new("rspec", ">= 0")
|
112
112
|
latest = []
|
113
113
|
dep_installer = Gem::DependencyInstaller.new
|
114
114
|
allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
|
115
115
|
expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(latest)
|
116
|
-
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new(
|
116
|
+
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new("rspec", ">= 0"))).to be_nil
|
117
117
|
end
|
118
118
|
|
119
119
|
it "finds a matching candidate version from a .gem file when the path to the gem is supplied" do
|
120
|
-
location = CHEF_SPEC_DATA +
|
121
|
-
expect(@gem_env.candidate_version_from_file(Gem::Dependency.new(
|
122
|
-
expect(@gem_env.candidate_version_from_file(Gem::Dependency.new(
|
120
|
+
location = CHEF_SPEC_DATA + "/gems/chef-integration-test-0.1.0.gem"
|
121
|
+
expect(@gem_env.candidate_version_from_file(Gem::Dependency.new("chef-integration-test", ">= 0"), location)).to eq(Gem::Version.new("0.1.0"))
|
122
|
+
expect(@gem_env.candidate_version_from_file(Gem::Dependency.new("chef-integration-test", ">= 0.2.0"), location)).to be_nil
|
123
123
|
end
|
124
124
|
|
125
125
|
it "finds a matching gem from a specific gemserver when explicit sources are given" do
|
126
|
-
dep = Gem::Dependency.new(
|
126
|
+
dep = Gem::Dependency.new("rspec", ">= 0")
|
127
127
|
latest = [[gemspec("rspec", Gem::Version.new("1.3.0")), "https://rubygems.org/"]]
|
128
128
|
|
129
|
-
expect(@gem_env).to receive(:with_gem_sources).with(
|
129
|
+
expect(@gem_env).to receive(:with_gem_sources).with("http://gems.example.com").and_yield
|
130
130
|
dep_installer = Gem::DependencyInstaller.new
|
131
131
|
allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
|
132
132
|
expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(latest)
|
133
|
-
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new(
|
133
|
+
expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new("rspec", ">=0"), "http://gems.example.com")).to eq(Gem::Version.new("1.3.0"))
|
134
134
|
end
|
135
135
|
|
136
136
|
it "installs a gem with a hash of options for the dependency installer" do
|
137
137
|
dep_installer = Gem::DependencyInstaller.new
|
138
|
-
expect(@gem_env).to receive(:dependency_installer).with(:install_dir =>
|
139
|
-
expect(@gem_env).to receive(:with_gem_sources).with(
|
140
|
-
expect(dep_installer).to receive(:install).with(Gem::Dependency.new(
|
141
|
-
@gem_env.install(Gem::Dependency.new(
|
138
|
+
expect(@gem_env).to receive(:dependency_installer).with(:install_dir => "/foo/bar").and_return(dep_installer)
|
139
|
+
expect(@gem_env).to receive(:with_gem_sources).with("http://gems.example.com").and_yield
|
140
|
+
expect(dep_installer).to receive(:install).with(Gem::Dependency.new("rspec", ">= 0"))
|
141
|
+
@gem_env.install(Gem::Dependency.new("rspec", ">= 0"), :install_dir => "/foo/bar", :sources => ["http://gems.example.com"])
|
142
142
|
end
|
143
143
|
|
144
144
|
it "builds an uninstaller for a gem with options set to avoid requiring user input" do
|
145
145
|
# default options for uninstaller should be:
|
146
146
|
# :ignore => true, :executables => true
|
147
|
-
expect(Gem::Uninstaller).to receive(:new).with(
|
148
|
-
@gem_env.uninstaller(
|
147
|
+
expect(Gem::Uninstaller).to receive(:new).with("rspec", :ignore => true, :executables => true)
|
148
|
+
@gem_env.uninstaller("rspec")
|
149
149
|
end
|
150
150
|
|
151
151
|
it "uninstalls all versions of a gem" do
|
152
|
-
uninstaller = double(
|
152
|
+
uninstaller = double("gem uninstaller")
|
153
153
|
expect(uninstaller).to receive(:uninstall)
|
154
|
-
expect(@gem_env).to receive(:uninstaller).with(
|
155
|
-
@gem_env.uninstall(
|
154
|
+
expect(@gem_env).to receive(:uninstaller).with("rspec", :all => true).and_return(uninstaller)
|
155
|
+
@gem_env.uninstall("rspec")
|
156
156
|
end
|
157
157
|
|
158
158
|
it "uninstalls a specific version of a gem" do
|
159
|
-
uninstaller = double(
|
159
|
+
uninstaller = double("gem uninstaller")
|
160
160
|
expect(uninstaller).to receive(:uninstall)
|
161
|
-
expect(@gem_env).to receive(:uninstaller).with(
|
162
|
-
@gem_env.uninstall(
|
161
|
+
expect(@gem_env).to receive(:uninstaller).with("rspec", :version => "1.2.3").and_return(uninstaller)
|
162
|
+
@gem_env.uninstall("rspec", "1.2.3")
|
163
163
|
end
|
164
164
|
|
165
165
|
end
|
@@ -170,72 +170,72 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do
|
|
170
170
|
before do
|
171
171
|
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache.clear
|
172
172
|
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache.clear
|
173
|
-
@gem_env = Chef::Provider::Package::Rubygems::AlternateGemEnvironment.new(
|
173
|
+
@gem_env = Chef::Provider::Package::Rubygems::AlternateGemEnvironment.new("/usr/weird/bin/gem")
|
174
174
|
end
|
175
175
|
|
176
176
|
it "determines the gem paths from shelling out to gem env" do
|
177
|
-
gem_env_output = [
|
177
|
+
gem_env_output = ["/path/to/gems", "/another/path/to/gems"].join(File::PATH_SEPARATOR)
|
178
178
|
shell_out_result = OpenStruct.new(:stdout => gem_env_output)
|
179
|
-
expect(@gem_env).to receive(:shell_out!).with(
|
180
|
-
expect(@gem_env.gem_paths).to eq([
|
179
|
+
expect(@gem_env).to receive(:shell_out!).with("/usr/weird/bin/gem env gempath").and_return(shell_out_result)
|
180
|
+
expect(@gem_env.gem_paths).to eq(["/path/to/gems", "/another/path/to/gems"])
|
181
181
|
end
|
182
182
|
|
183
183
|
it "caches the gempaths by gem_binary" do
|
184
|
-
gem_env_output = [
|
184
|
+
gem_env_output = ["/path/to/gems", "/another/path/to/gems"].join(File::PATH_SEPARATOR)
|
185
185
|
shell_out_result = OpenStruct.new(:stdout => gem_env_output)
|
186
|
-
expect(@gem_env).to receive(:shell_out!).with(
|
187
|
-
expected = [
|
188
|
-
expect(@gem_env.gem_paths).to eq([
|
189
|
-
expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache[
|
186
|
+
expect(@gem_env).to receive(:shell_out!).with("/usr/weird/bin/gem env gempath").and_return(shell_out_result)
|
187
|
+
expected = ["/path/to/gems", "/another/path/to/gems"]
|
188
|
+
expect(@gem_env.gem_paths).to eq(["/path/to/gems", "/another/path/to/gems"])
|
189
|
+
expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache["/usr/weird/bin/gem"]).to eq(expected)
|
190
190
|
end
|
191
191
|
|
192
192
|
it "uses the cached result for gem paths when available" do
|
193
193
|
expect(@gem_env).not_to receive(:shell_out!)
|
194
|
-
expected = [
|
195
|
-
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache[
|
196
|
-
expect(@gem_env.gem_paths).to eq([
|
194
|
+
expected = ["/path/to/gems", "/another/path/to/gems"]
|
195
|
+
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache["/usr/weird/bin/gem"] = expected
|
196
|
+
expect(@gem_env.gem_paths).to eq(["/path/to/gems", "/another/path/to/gems"])
|
197
197
|
end
|
198
198
|
|
199
199
|
it "builds the gems source index from the gem paths" do
|
200
|
-
allow(@gem_env).to receive(:gem_paths).and_return([
|
201
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new(
|
200
|
+
allow(@gem_env).to receive(:gem_paths).and_return(["/path/to/gems", "/another/path/to/gems"])
|
201
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.8.0")
|
202
202
|
@gem_env.gem_specification
|
203
|
-
expect(Gem::Specification.dirs).to eq([
|
203
|
+
expect(Gem::Specification.dirs).to eq([ "/path/to/gems/specifications", "/another/path/to/gems/specifications" ])
|
204
204
|
else
|
205
|
-
expect(Gem::SourceIndex).to receive(:from_gems_in).with(
|
205
|
+
expect(Gem::SourceIndex).to receive(:from_gems_in).with("/path/to/gems/specifications", "/another/path/to/gems/specifications")
|
206
206
|
@gem_env.gem_source_index
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
210
|
it "determines the installed versions of gems from the source index" do
|
211
|
-
gems = [gemspec(
|
212
|
-
rspec_dep = Gem::Dependency.new(
|
213
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new(
|
211
|
+
gems = [gemspec("rspec", Gem::Version.new("1.2.9")), gemspec("rspec", Gem::Version.new("1.3.0"))]
|
212
|
+
rspec_dep = Gem::Dependency.new("rspec", nil)
|
213
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new("1.8.0")
|
214
214
|
allow(@gem_env).to receive(:gem_specification).and_return(Gem::Specification)
|
215
215
|
expect(@gem_env.gem_specification).to receive(:find_all_by_name).with(rspec_dep.name, rspec_dep.requirement).and_return(gems)
|
216
216
|
else
|
217
217
|
allow(@gem_env).to receive(:gem_source_index).and_return(Gem.source_index)
|
218
218
|
expect(@gem_env.gem_source_index).to receive(:search).with(rspec_dep).and_return(gems)
|
219
219
|
end
|
220
|
-
expect(@gem_env.installed_versions(Gem::Dependency.new(
|
220
|
+
expect(@gem_env.installed_versions(Gem::Dependency.new("rspec", nil))).to eq(gems)
|
221
221
|
end
|
222
222
|
|
223
223
|
it "determines the installed versions of gems from the source index (part2: the unmockening)" do
|
224
224
|
allow($stdout).to receive(:write)
|
225
225
|
path_to_gem = if windows?
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
226
|
+
`where gem`.split[1]
|
227
|
+
else
|
228
|
+
`which gem`.strip
|
229
|
+
end
|
230
230
|
skip("cant find your gem executable") if path_to_gem.empty?
|
231
231
|
gem_env = Chef::Provider::Package::Rubygems::AlternateGemEnvironment.new(path_to_gem)
|
232
|
-
expected = [
|
233
|
-
actual = gem_env.installed_versions(Gem::Dependency.new(
|
232
|
+
expected = ["rspec-core", Gem::Version.new(RSpec::Core::Version::STRING)]
|
233
|
+
actual = gem_env.installed_versions(Gem::Dependency.new("rspec-core", nil)).map { |s| [s.name, s.version] }
|
234
234
|
expect(actual).to include(expected)
|
235
235
|
end
|
236
236
|
|
237
237
|
it "detects when the target gem environment is the jruby platform" do
|
238
|
-
gem_env_out
|
238
|
+
gem_env_out = <<-JRUBY_GEM_ENV
|
239
239
|
RubyGems Environment:
|
240
240
|
- RUBYGEMS VERSION: 1.3.6
|
241
241
|
- RUBY VERSION: 1.8.7 (2010-05-12 patchlevel 249) [java]
|
@@ -261,23 +261,23 @@ RubyGems Environment:
|
|
261
261
|
- REMOTE SOURCES:
|
262
262
|
- https://rubygems.org/
|
263
263
|
- http://gems.github.com/
|
264
|
-
JRUBY_GEM_ENV
|
265
|
-
expect(@gem_env).to receive(:shell_out!).with(
|
266
|
-
expected = [
|
264
|
+
JRUBY_GEM_ENV
|
265
|
+
expect(@gem_env).to receive(:shell_out!).with("/usr/weird/bin/gem env").and_return(double("jruby_gem_env", :stdout => gem_env_out))
|
266
|
+
expected = ["ruby", Gem::Platform.new("universal-java-1.6")]
|
267
267
|
expect(@gem_env.gem_platforms).to eq(expected)
|
268
268
|
# it should also cache the result
|
269
|
-
expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache[
|
269
|
+
expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache["/usr/weird/bin/gem"]).to eq(expected)
|
270
270
|
end
|
271
271
|
|
272
272
|
it "uses the cached result for gem platforms if available" do
|
273
273
|
expect(@gem_env).not_to receive(:shell_out!)
|
274
|
-
expected = [
|
275
|
-
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache[
|
274
|
+
expected = ["ruby", Gem::Platform.new("universal-java-1.6")]
|
275
|
+
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache["/usr/weird/bin/gem"] = expected
|
276
276
|
expect(@gem_env.gem_platforms).to eq(expected)
|
277
277
|
end
|
278
278
|
|
279
279
|
it "uses the current gem platforms when the target env is not jruby" do
|
280
|
-
gem_env_out
|
280
|
+
gem_env_out = <<-RBX_GEM_ENV
|
281
281
|
RubyGems Environment:
|
282
282
|
- RUBYGEMS VERSION: 1.3.6
|
283
283
|
- RUBY VERSION: 1.8.7 (2010-05-14 patchlevel 174) [x86_64-apple-darwin10.3.0]
|
@@ -303,23 +303,23 @@ RubyGems Environment:
|
|
303
303
|
- REMOTE SOURCES:
|
304
304
|
- https://rubygems.org/
|
305
305
|
- http://gems.github.com/
|
306
|
-
RBX_GEM_ENV
|
307
|
-
expect(@gem_env).to receive(:shell_out!).with(
|
306
|
+
RBX_GEM_ENV
|
307
|
+
expect(@gem_env).to receive(:shell_out!).with("/usr/weird/bin/gem env").and_return(double("rbx_gem_env", :stdout => gem_env_out))
|
308
308
|
expect(@gem_env.gem_platforms).to eq(Gem.platforms)
|
309
|
-
expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache[
|
309
|
+
expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache["/usr/weird/bin/gem"]).to eq(Gem.platforms)
|
310
310
|
end
|
311
311
|
|
312
312
|
it "yields to a block while masquerading as a different gems platform" do
|
313
313
|
original_platforms = Gem.platforms
|
314
314
|
platforms_in_block = nil
|
315
315
|
begin
|
316
|
-
@gem_env.with_gem_platforms([
|
316
|
+
@gem_env.with_gem_platforms(["ruby", Gem::Platform.new("sparc64-java-1.7")]) do
|
317
317
|
platforms_in_block = Gem.platforms
|
318
318
|
raise "gem platforms should get set to the correct value even when an error occurs"
|
319
319
|
end
|
320
320
|
rescue RuntimeError
|
321
321
|
end
|
322
|
-
expect(platforms_in_block).to eq([
|
322
|
+
expect(platforms_in_block).to eq(["ruby", Gem::Platform.new("sparc64-java-1.7")])
|
323
323
|
expect(Gem.platforms).to eq(original_platforms)
|
324
324
|
end
|
325
325
|
|
@@ -327,357 +327,454 @@ end
|
|
327
327
|
|
328
328
|
describe Chef::Provider::Package::Rubygems do
|
329
329
|
let(:target_version) { nil }
|
330
|
+
let(:gem_name) { "rspec-core" }
|
331
|
+
let(:gem_binary) { nil }
|
332
|
+
let(:bindir) { "/usr/bin/ruby" }
|
333
|
+
let(:options) { nil }
|
334
|
+
let(:source) { nil }
|
335
|
+
|
336
|
+
let(:new_resource) do
|
337
|
+
new_resource = Chef::Resource::GemPackage.new(gem_name)
|
338
|
+
new_resource.version(target_version)
|
339
|
+
new_resource.gem_binary(gem_binary) if gem_binary
|
340
|
+
new_resource.options(options) if options
|
341
|
+
new_resource.source(source) if source
|
342
|
+
new_resource
|
343
|
+
end
|
330
344
|
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
345
|
+
let (:current_resource) { nil }
|
346
|
+
|
347
|
+
let(:provider) do
|
348
|
+
run_context = Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
|
349
|
+
provider = Chef::Provider::Package::Rubygems.new(new_resource, run_context)
|
350
|
+
if current_resource
|
351
|
+
allow(provider).to receive(:load_current_resource)
|
352
|
+
provider.current_resource = current_resource
|
353
|
+
end
|
354
|
+
provider
|
355
|
+
end
|
356
|
+
|
357
|
+
let(:gem_dep) { Gem::Dependency.new(gem_name, target_version) }
|
337
358
|
|
359
|
+
before(:each) do
|
338
360
|
# We choose detect omnibus via RbConfig::CONFIG['bindir'] in Chef::Provider::Package::Rubygems.new
|
339
|
-
allow(RbConfig::CONFIG).to receive(:[]).with(
|
361
|
+
allow(RbConfig::CONFIG).to receive(:[]).with("bindir").and_return(bindir)
|
340
362
|
# Rubygems uses this interally
|
341
|
-
allow(RbConfig::CONFIG).to receive(:[]).with(
|
342
|
-
@provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
|
363
|
+
allow(RbConfig::CONFIG).to receive(:[]).with("arch").and_call_original
|
343
364
|
end
|
344
365
|
|
345
366
|
describe "when new_resource version is nil" do
|
346
367
|
let(:target_version) { nil }
|
347
368
|
|
348
369
|
it "target_version_already_installed? should return false so that we can search for candidates" do
|
349
|
-
|
350
|
-
expect(
|
370
|
+
provider.load_current_resource
|
371
|
+
expect(provider.target_version_already_installed?(provider.current_resource.version, new_resource.version)).to be_falsey
|
351
372
|
end
|
352
373
|
end
|
353
374
|
|
354
|
-
describe "when new_resource version is
|
355
|
-
let(:
|
375
|
+
describe "when new_resource version is an rspec version" do
|
376
|
+
let(:current_version) { RSpec::Core::Version::STRING }
|
377
|
+
let(:target_version) { current_version }
|
356
378
|
|
357
379
|
it "triggers a gem configuration load so a later one will not stomp its config values" do
|
380
|
+
_ = provider
|
358
381
|
# ugly, is there a better way?
|
359
382
|
expect(Gem.instance_variable_get(:@configuration)).not_to be_nil
|
360
383
|
end
|
361
384
|
|
362
385
|
it "uses the CurrentGemEnvironment implementation when no gem_binary_path is provided" do
|
363
|
-
expect(
|
386
|
+
expect(provider.gem_env).to be_a_kind_of(Chef::Provider::Package::Rubygems::CurrentGemEnvironment)
|
364
387
|
end
|
365
388
|
|
366
|
-
|
367
|
-
|
368
|
-
provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
|
369
|
-
expect(provider.gem_env.gem_binary_location).to eq('/usr/weird/bin/gem')
|
370
|
-
end
|
389
|
+
context "when a gem_binary_path is provided" do
|
390
|
+
let(:gem_binary) { "/usr/weird/bin/gem" }
|
371
391
|
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
expect(provider.is_omnibus?).to be true
|
376
|
-
end
|
392
|
+
it "uses the AlternateGemEnvironment implementation when a gem_binary_path is provided" do
|
393
|
+
expect(provider.gem_env.gem_binary_location).to eq(gem_binary)
|
394
|
+
end
|
377
395
|
|
378
|
-
|
379
|
-
|
380
|
-
provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
|
381
|
-
expect(provider.is_omnibus?).to be true
|
382
|
-
end
|
396
|
+
context "when you try to use a hash of install options" do
|
397
|
+
let(:options) { { :fail => :burger } }
|
383
398
|
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
399
|
+
it "smites you" do
|
400
|
+
expect { provider }.to raise_error(ArgumentError)
|
401
|
+
end
|
402
|
+
end
|
388
403
|
end
|
389
404
|
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
allow(File).to receive(:exists?).with('/usr/sbin/gem').and_return(true)
|
396
|
-
allow(File).to receive(:exists?).with('/opt/chef/embedded/bin/gem').and_return(true) # should not get here
|
397
|
-
provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
|
398
|
-
expect(provider.gem_env.gem_binary_location).to eq('/usr/sbin/gem')
|
405
|
+
context "when in omnibus opscode" do
|
406
|
+
let(:bindir) { "/opt/opscode/embedded/bin" }
|
407
|
+
|
408
|
+
it "recognizes opscode as omnibus" do
|
409
|
+
expect(provider.is_omnibus?).to be true
|
399
410
|
end
|
400
411
|
end
|
401
412
|
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
allow(File).to receive(:exists?).with('C:\\windows\\gem').and_return(false)
|
408
|
-
allow(File).to receive(:exists?).with('C:\\Ruby186\\bin\\gem').and_return(true)
|
409
|
-
allow(File).to receive(:exists?).with('d:\\opscode\\chef\\bin\\gem').and_return(false) # should not get here
|
410
|
-
allow(File).to receive(:exists?).with('d:\\opscode\\chef\\embedded\\bin\\gem').and_return(false) # should not get here
|
411
|
-
provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
|
412
|
-
expect(provider.gem_env.gem_binary_location).to eq('C:\Ruby186\bin\gem')
|
413
|
+
context "when in omnibus chefdk" do
|
414
|
+
let(:bindir) { "/opt/chefdk/embedded/bin" }
|
415
|
+
|
416
|
+
it "recognizes chefdk as omnibus" do
|
417
|
+
expect(provider.is_omnibus?).to be true
|
413
418
|
end
|
414
419
|
end
|
415
420
|
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
421
|
+
context "when in omnibus chef" do
|
422
|
+
let(:bindir) { "/opt/chef/embedded/bin" }
|
423
|
+
|
424
|
+
it "recognizes chef as omnibus" do
|
425
|
+
expect(provider.is_omnibus?).to be true
|
426
|
+
end
|
427
|
+
|
428
|
+
it "searches for a gem binary when running on Omnibus on Unix" do
|
429
|
+
platform_mock :unix do
|
430
|
+
allow(ENV).to receive(:[]).with("PATH").and_return("/usr/bin:/usr/sbin:/opt/chef/embedded/bin")
|
431
|
+
allow(File).to receive(:exists?).with("/usr/bin/gem").and_return(false)
|
432
|
+
allow(File).to receive(:exists?).with("/usr/sbin/gem").and_return(true)
|
433
|
+
allow(File).to receive(:exists?).with("/opt/chef/embedded/bin/gem").and_return(true) # should not get here
|
434
|
+
expect(provider.gem_env.gem_binary_location).to eq("/usr/sbin/gem")
|
435
|
+
end
|
436
|
+
end
|
437
|
+
|
438
|
+
context "when on Windows" do
|
439
|
+
let(:bindir) { "d:/opscode/chef/embedded/bin" }
|
440
|
+
|
441
|
+
it "searches for a gem binary when running on Omnibus on Windows" do
|
442
|
+
platform_mock :windows do
|
443
|
+
allow(ENV).to receive(:[]).with("PATH").and_return('C:\windows\system32;C:\windows;C:\Ruby186\bin;d:\opscode\chef\embedded\bin')
|
444
|
+
allow(File).to receive(:exists?).with('C:\\windows\\system32\\gem').and_return(false)
|
445
|
+
allow(File).to receive(:exists?).with('C:\\windows\\gem').and_return(false)
|
446
|
+
allow(File).to receive(:exists?).with('C:\\Ruby186\\bin\\gem').and_return(true)
|
447
|
+
allow(File).to receive(:exists?).with('d:\\opscode\\chef\\bin\\gem').and_return(false) # should not get here
|
448
|
+
allow(File).to receive(:exists?).with('d:\\opscode\\chef\\embedded\\bin\\gem').and_return(false) # should not get here
|
449
|
+
expect(provider.gem_env.gem_binary_location).to eq('C:\Ruby186\bin\gem')
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|
420
453
|
end
|
421
454
|
|
422
455
|
it "converts the new resource into a gem dependency" do
|
423
|
-
expect(
|
424
|
-
|
425
|
-
|
456
|
+
expect(provider.gem_dependency).to eq(gem_dep)
|
457
|
+
end
|
458
|
+
|
459
|
+
context "when the new resource is not the current version" do
|
460
|
+
let(:target_version) { "~> 9000.0.2" }
|
461
|
+
|
462
|
+
it "converts the new resource into a gem dependency" do
|
463
|
+
expect(provider.gem_dependency).to eq(gem_dep)
|
464
|
+
end
|
426
465
|
end
|
427
466
|
|
428
467
|
describe "when determining the currently installed version" do
|
468
|
+
before do
|
469
|
+
provider.load_current_resource
|
470
|
+
end
|
429
471
|
|
430
472
|
it "sets the current version to the version specified by the new resource if that version is installed" do
|
431
|
-
|
432
|
-
expect(@provider.current_resource.version).to eq(@spec_version)
|
473
|
+
expect(provider.current_resource.version).to eq(current_version)
|
433
474
|
end
|
434
475
|
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
476
|
+
context "if the requested version is not installed" do
|
477
|
+
let(:target_version) { "9000.0.2" }
|
478
|
+
|
479
|
+
it "sets the current version to the highest installed version if the requested version is not installed" do
|
480
|
+
expect(provider.current_resource.version).to eq(current_version)
|
481
|
+
end
|
439
482
|
end
|
440
483
|
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
484
|
+
context "if the package is not currently installed" do
|
485
|
+
let(:gem_name) { "no-such-gem-should-exist-with-this-name" }
|
486
|
+
|
487
|
+
it "leaves the current version at nil" do
|
488
|
+
expect(provider.current_resource.version).to be_nil
|
489
|
+
end
|
445
490
|
end
|
446
491
|
|
447
492
|
end
|
448
493
|
|
449
494
|
describe "when determining the candidate version to install" do
|
495
|
+
before do
|
496
|
+
provider.load_current_resource
|
497
|
+
end
|
450
498
|
|
451
499
|
it "does not query for available versions when the current version is the target version" do
|
452
|
-
|
453
|
-
expect(@provider.candidate_version).to be_nil
|
500
|
+
expect(provider.candidate_version).to be_nil
|
454
501
|
end
|
455
502
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
version
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
503
|
+
context "when the current version is not the target version" do
|
504
|
+
let(:target_version) { "9000.0.2" }
|
505
|
+
let(:source) { "http://mygems.example.com" }
|
506
|
+
|
507
|
+
it "determines the candidate version by querying the remote gem servers" do
|
508
|
+
expect(provider.gem_env).to receive(:candidate_version_from_remote).
|
509
|
+
with(gem_dep, source).
|
510
|
+
and_return(Gem::Version.new(target_version))
|
511
|
+
expect(provider.candidate_version).to eq(target_version)
|
512
|
+
end
|
465
513
|
end
|
466
514
|
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
515
|
+
context "when the requested source is a file" do
|
516
|
+
let (:gem_name) { "chef-integration-test" }
|
517
|
+
let (:source) { CHEF_SPEC_DATA + "/gems/chef-integration-test-0.1.0.gem" }
|
518
|
+
let (:target_version) { ">= 0" }
|
519
|
+
|
520
|
+
it "parses the gem's specification" do
|
521
|
+
expect(provider.candidate_version).to eq("0.1.0")
|
522
|
+
end
|
473
523
|
end
|
474
524
|
|
475
525
|
end
|
476
526
|
|
477
527
|
describe "when installing a gem" do
|
528
|
+
let(:target_version) { "9000.0.2" }
|
529
|
+
let(:current_version) { nil }
|
530
|
+
let(:candidate_version) { "9000.0.2" }
|
531
|
+
let(:current_resource) do
|
532
|
+
current_resource = Chef::Resource::GemPackage.new(gem_name)
|
533
|
+
current_resource.version(current_version)
|
534
|
+
current_resource
|
535
|
+
end
|
536
|
+
|
478
537
|
before do
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
allow(
|
538
|
+
version = Gem::Version.new(candidate_version)
|
539
|
+
args = [gem_dep]
|
540
|
+
args << source if source
|
541
|
+
allow(provider.gem_env).to receive(:candidate_version_from_remote).
|
542
|
+
with(*args).
|
543
|
+
and_return(version)
|
483
544
|
end
|
484
545
|
|
485
546
|
describe "in the current gem environment" do
|
486
547
|
it "installs the gem via the gems api when no explicit options are used" do
|
487
|
-
expect(
|
488
|
-
|
489
|
-
expect(
|
548
|
+
expect(provider.gem_env).to receive(:install).with(gem_dep, :sources => nil)
|
549
|
+
provider.run_action(:install)
|
550
|
+
expect(new_resource).to be_updated_by_last_action
|
490
551
|
end
|
491
552
|
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
553
|
+
context "when a remote source is provided" do
|
554
|
+
let(:source) { "http://gems.example.org" }
|
555
|
+
|
556
|
+
it "installs the gem via the gems api" do
|
557
|
+
expect(provider.gem_env).to receive(:install).with(gem_dep, :sources => [source])
|
558
|
+
provider.run_action(:install)
|
559
|
+
expect(new_resource).to be_updated_by_last_action
|
560
|
+
end
|
498
561
|
end
|
499
562
|
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
563
|
+
context "when source is a path" do
|
564
|
+
let(:source) { CHEF_SPEC_DATA + "/gems/chef-integration-test-0.1.0.gem" }
|
565
|
+
|
566
|
+
it "installs the gem from file via the gems api" do
|
567
|
+
expect(provider.gem_env).to receive(:install).with(source)
|
568
|
+
provider.run_action(:install)
|
569
|
+
expect(new_resource).to be_updated_by_last_action
|
570
|
+
end
|
505
571
|
end
|
506
572
|
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
573
|
+
context "when the gem name is a file path and source is nil" do
|
574
|
+
let(:gem_name) { CHEF_SPEC_DATA + "/gems/chef-integration-test-0.1.0.gem" }
|
575
|
+
|
576
|
+
it "installs the gem from file via the gems api" do
|
577
|
+
expect(new_resource.source).to eq(gem_name)
|
578
|
+
expect(provider.gem_env).to receive(:install).with(gem_name)
|
579
|
+
provider.run_action(:install)
|
580
|
+
expect(new_resource).to be_updated_by_last_action
|
581
|
+
end
|
515
582
|
end
|
516
583
|
|
517
584
|
# this catches 'gem_package "foo"' when "./foo" is a file in the cwd, and instead of installing './foo' it fetches the remote gem
|
518
585
|
it "installs the gem via the gems api, when the package has no file separator characters in it, but a matching file exists in cwd" do
|
519
586
|
allow(::File).to receive(:exists?).and_return(true)
|
520
|
-
|
521
|
-
expect(
|
522
|
-
|
523
|
-
expect(
|
587
|
+
new_resource.package_name("rspec-core")
|
588
|
+
expect(provider.gem_env).to receive(:install).with(gem_dep, :sources => nil)
|
589
|
+
provider.run_action(:install)
|
590
|
+
expect(new_resource).to be_updated_by_last_action
|
524
591
|
end
|
525
592
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
593
|
+
context "when options are provided as a String" do
|
594
|
+
let(:options) { "-i /alt/install/location" }
|
595
|
+
|
596
|
+
it "installs the gem by shelling out when options are provided as a String" do
|
597
|
+
expected = "gem install rspec-core -q --no-rdoc --no-ri -v \"#{target_version}\" #{options}"
|
598
|
+
expect(provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
|
599
|
+
provider.run_action(:install)
|
600
|
+
expect(new_resource).to be_updated_by_last_action
|
601
|
+
end
|
532
602
|
end
|
533
603
|
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
604
|
+
context "when another source and binary are provided" do
|
605
|
+
let(:source) { "http://mirror.ops.rhcloud.com/mirror/ruby" }
|
606
|
+
let(:gem_binary) { "/foo/bar" }
|
607
|
+
|
608
|
+
it "installs the gem with rubygems.org as an added source" do
|
609
|
+
expected = "#{gem_binary} install rspec-core -q --no-rdoc --no-ri -v \"#{target_version}\" --source=#{source} --source=https://rubygems.org"
|
610
|
+
expect(provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
|
611
|
+
provider.run_action(:install)
|
612
|
+
expect(new_resource).to be_updated_by_last_action
|
613
|
+
end
|
541
614
|
end
|
542
615
|
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
616
|
+
context "when we have cleared sources and an explict source is specified" do
|
617
|
+
let(:gem_binary) { "/foo/bar" }
|
618
|
+
let(:source) { "http://mirror.ops.rhcloud.com/mirror/ruby" }
|
619
|
+
|
620
|
+
it "installs the gem" do
|
621
|
+
new_resource.clear_sources(true)
|
622
|
+
expected = "#{gem_binary} install rspec-core -q --no-rdoc --no-ri -v \"#{target_version}\" --clear-sources --source=#{source}"
|
623
|
+
expect(provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
|
624
|
+
provider.run_action(:install)
|
625
|
+
expect(new_resource).to be_updated_by_last_action
|
626
|
+
end
|
551
627
|
end
|
552
628
|
|
553
629
|
context "when no version is given" do
|
554
630
|
let(:target_version) { nil }
|
631
|
+
let(:options) { "-i /alt/install/location" }
|
555
632
|
|
556
633
|
it "installs the gem by shelling out when options are provided but no version is given" do
|
557
|
-
|
558
|
-
expected
|
559
|
-
|
560
|
-
|
561
|
-
expect(@new_resource).to be_updated_by_last_action
|
634
|
+
expected = "gem install rspec-core -q --no-rdoc --no-ri -v \"#{candidate_version}\" #{options}"
|
635
|
+
expect(provider).to receive(:shell_out!).with(expected, env: nil, timeout: 900)
|
636
|
+
provider.run_action(:install)
|
637
|
+
expect(new_resource).to be_updated_by_last_action
|
562
638
|
end
|
563
639
|
end
|
564
640
|
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
641
|
+
context "when options are given as a Hash" do
|
642
|
+
let(:options) { { :install_dir => "/alt/install/location" } }
|
643
|
+
|
644
|
+
it "installs the gem via the gems api when options are given as a Hash" do
|
645
|
+
expect(provider.gem_env).to receive(:install).with(gem_dep, { :sources => nil }.merge(options))
|
646
|
+
provider.run_action(:install)
|
647
|
+
expect(new_resource).to be_updated_by_last_action
|
648
|
+
end
|
570
649
|
end
|
571
650
|
|
572
651
|
describe "at a specific version" do
|
573
|
-
|
574
|
-
@gem_dep = Gem::Dependency.new('rspec-core', @spec_version)
|
575
|
-
end
|
652
|
+
let(:target_version) { "9000.0.2" }
|
576
653
|
|
577
654
|
it "installs the gem via the gems api" do
|
578
|
-
expect(
|
579
|
-
|
580
|
-
expect(
|
655
|
+
expect(provider.gem_env).to receive(:install).with(gem_dep, :sources => nil)
|
656
|
+
provider.run_action(:install)
|
657
|
+
expect(new_resource).to be_updated_by_last_action
|
581
658
|
end
|
582
659
|
end
|
583
|
-
describe "at version specified with comparison operator" do
|
584
|
-
it "skips install if current version satisifies requested version" do
|
585
|
-
@current_resource.version("2.3.3")
|
586
|
-
@new_resource.version(">=2.3.0")
|
587
660
|
|
588
|
-
|
589
|
-
|
661
|
+
describe "at version specified with comparison operator" do
|
662
|
+
context "if current version satisifies requested version" do
|
663
|
+
let(:target_version) { ">=2.3.0" }
|
664
|
+
let(:current_version) { "2.3.3" }
|
665
|
+
|
666
|
+
it "skips the install" do
|
667
|
+
expect(provider.gem_env).not_to receive(:install)
|
668
|
+
provider.run_action(:install)
|
669
|
+
end
|
590
670
|
end
|
591
671
|
|
592
|
-
|
593
|
-
|
594
|
-
|
672
|
+
context "if the fuzzy operator is used" do
|
673
|
+
let(:target_version) { "~>2.3.0" }
|
674
|
+
let(:current_version) { "2.3.3" }
|
595
675
|
|
596
|
-
|
597
|
-
|
676
|
+
it "it matches an existing gem" do
|
677
|
+
expect(provider.gem_env).not_to receive(:install)
|
678
|
+
provider.run_action(:install)
|
679
|
+
end
|
598
680
|
end
|
599
681
|
end
|
600
682
|
end
|
601
683
|
|
602
684
|
describe "in an alternate gem environment" do
|
685
|
+
let(:gem_binary) { "/usr/weird/bin/gem" }
|
686
|
+
|
603
687
|
it "installs the gem by shelling out to gem install" do
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
expect(@new_resource).to be_updated_by_last_action
|
688
|
+
expect(provider).to receive(:shell_out!).with("#{gem_binary} install rspec-core -q --no-rdoc --no-ri -v \"#{target_version}\"", env: nil, timeout: 900)
|
689
|
+
provider.run_action(:install)
|
690
|
+
expect(new_resource).to be_updated_by_last_action
|
608
691
|
end
|
609
692
|
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
693
|
+
context "when source is a path" do
|
694
|
+
let(:source) { CHEF_SPEC_DATA + "/gems/chef-integration-test-0.1.0.gem" }
|
695
|
+
let(:target_version) { ">= 0" }
|
696
|
+
|
697
|
+
it "installs the gem by shelling out to gem install" do
|
698
|
+
expect(provider).to receive(:shell_out!).with("#{gem_binary} install #{source} -q --no-rdoc --no-ri -v \"#{target_version}\"", env: nil, timeout: 900)
|
699
|
+
provider.run_action(:install)
|
700
|
+
expect(new_resource).to be_updated_by_last_action
|
701
|
+
end
|
617
702
|
end
|
618
703
|
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
704
|
+
context "when the package is a path and source is nil" do
|
705
|
+
let(:gem_name) { CHEF_SPEC_DATA + "/gems/chef-integration-test-0.1.0.gem" }
|
706
|
+
let(:target_version) { ">= 0" }
|
707
|
+
|
708
|
+
it "installs the gem from file by shelling out to gem install when the package is a path and the source is nil" do
|
709
|
+
expect(new_resource.source).to eq(gem_name)
|
710
|
+
expect(provider).to receive(:shell_out!).with("#{gem_binary} install #{gem_name} -q --no-rdoc --no-ri -v \"#{target_version}\"", env: nil, timeout: 900)
|
711
|
+
provider.run_action(:install)
|
712
|
+
expect(new_resource).to be_updated_by_last_action
|
713
|
+
end
|
629
714
|
end
|
630
715
|
end
|
631
716
|
|
632
717
|
end
|
633
718
|
|
634
719
|
describe "when uninstalling a gem" do
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
720
|
+
let(:gem_name) { "rspec" }
|
721
|
+
let(:current_version) { "1.2.3" }
|
722
|
+
let(:target_version) { nil }
|
723
|
+
|
724
|
+
let(:current_resource) do
|
725
|
+
current_resource = Chef::Resource::GemPackage.new(gem_name)
|
726
|
+
current_resource.version(current_version)
|
727
|
+
current_resource
|
641
728
|
end
|
642
729
|
|
643
730
|
describe "in the current gem environment" do
|
644
731
|
it "uninstalls via the api when no explicit options are used" do
|
645
732
|
# pre-reqs for action_remove to actually remove the package:
|
646
|
-
expect(
|
647
|
-
expect(
|
733
|
+
expect(provider.new_resource.version).to be_nil
|
734
|
+
expect(provider.current_resource.version).not_to be_nil
|
648
735
|
# the behavior we're testing:
|
649
|
-
expect(
|
650
|
-
|
736
|
+
expect(provider.gem_env).to receive(:uninstall).with("rspec", nil)
|
737
|
+
provider.action_remove
|
651
738
|
end
|
652
739
|
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
740
|
+
context "when options are given as a Hash" do
|
741
|
+
let(:options) { { :install_dir => "/alt/install/location" } }
|
742
|
+
|
743
|
+
it "uninstalls via the api" do
|
744
|
+
# pre-reqs for action_remove to actually remove the package:
|
745
|
+
expect(provider.new_resource.version).to be_nil
|
746
|
+
expect(provider.current_resource.version).not_to be_nil
|
747
|
+
# the behavior we're testing:
|
748
|
+
expect(provider.gem_env).to receive(:uninstall).with("rspec", nil, options)
|
749
|
+
provider.action_remove
|
750
|
+
end
|
661
751
|
end
|
662
752
|
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
753
|
+
context "when options are given as a String" do
|
754
|
+
let(:options) { "-i /alt/install/location" }
|
755
|
+
|
756
|
+
it "uninstalls via the gem command" do
|
757
|
+
expect(provider).to receive(:shell_out!).with("gem uninstall rspec -q -x -I -a #{options}", env: nil, timeout: 900)
|
758
|
+
provider.action_remove
|
759
|
+
end
|
667
760
|
end
|
668
761
|
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
762
|
+
context "when a version is provided" do
|
763
|
+
let(:target_version) { "1.2.3" }
|
764
|
+
|
765
|
+
it "uninstalls a specific version of a gem" do
|
766
|
+
expect(provider.gem_env).to receive(:uninstall).with("rspec", "1.2.3")
|
767
|
+
provider.action_remove
|
768
|
+
end
|
673
769
|
end
|
674
770
|
end
|
675
771
|
|
676
772
|
describe "in an alternate gem environment" do
|
773
|
+
let(:gem_binary) { "/usr/weird/bin/gem" }
|
774
|
+
|
677
775
|
it "uninstalls via the gem command" do
|
678
|
-
|
679
|
-
|
680
|
-
@provider.action_remove
|
776
|
+
expect(provider).to receive(:shell_out!).with("#{gem_binary} uninstall rspec -q -x -I -a", env: nil, timeout: 900)
|
777
|
+
provider.action_remove
|
681
778
|
end
|
682
779
|
end
|
683
780
|
end
|