chef 11.10.0.rc.0-x86-mingw32 → 11.10.0.rc.1-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +0 -75
- data/distro/common/html/_sources/ctl_chef_client.txt +36 -0
- data/distro/common/html/_sources/ctl_chef_server.txt +26 -0
- data/distro/common/html/_sources/ctl_chef_shell.txt +15 -0
- data/distro/common/html/_sources/ctl_chef_solo.txt +25 -0
- data/distro/common/html/_sources/index.txt +126 -0
- data/distro/common/html/_sources/knife.txt +74 -0
- data/distro/common/html/_sources/knife_bootstrap.txt +56 -0
- data/distro/common/html/_sources/knife_client.txt +151 -0
- data/distro/common/html/_sources/knife_common_options.txt +6 -0
- data/distro/common/html/_sources/knife_configure.txt +29 -0
- data/distro/common/html/_sources/knife_cookbook.txt +236 -0
- data/distro/common/html/_sources/knife_cookbook_site.txt +157 -0
- data/distro/common/html/_sources/knife_data_bag.txt +160 -0
- data/distro/common/html/_sources/knife_delete.txt +26 -0
- data/distro/common/html/_sources/knife_deps.txt +61 -0
- data/distro/common/html/_sources/knife_diff.txt +34 -0
- data/distro/common/html/_sources/knife_download.txt +44 -0
- data/distro/common/html/_sources/knife_edit.txt +26 -0
- data/distro/common/html/_sources/knife_environment.txt +158 -0
- data/distro/common/html/_sources/knife_exec.txt +47 -0
- data/distro/common/html/_sources/knife_index_rebuild.txt +21 -0
- data/distro/common/html/_sources/knife_list.txt +33 -0
- data/distro/common/html/_sources/knife_node.txt +250 -0
- data/distro/common/html/_sources/knife_raw.txt +35 -0
- data/distro/common/html/_sources/knife_recipe_list.txt +23 -0
- data/distro/common/html/_sources/knife_role.txt +157 -0
- data/distro/common/html/_sources/knife_search.txt +53 -0
- data/distro/common/html/_sources/knife_show.txt +27 -0
- data/distro/common/html/_sources/knife_ssh.txt +43 -0
- data/distro/common/html/_sources/knife_status.txt +37 -0
- data/distro/common/html/_sources/knife_tag.txt +69 -0
- data/distro/common/html/_sources/knife_upload.txt +49 -0
- data/distro/common/html/_sources/knife_user.txt +127 -0
- data/distro/common/html/_sources/knife_using.txt +43 -0
- data/distro/common/html/_sources/knife_xargs.txt +30 -0
- data/distro/common/html/_static/ajax-loader.gif +0 -0
- data/distro/common/html/_static/basic.css +540 -0
- data/distro/common/html/_static/chef.css +507 -0
- data/distro/common/html/_static/chef.ico +0 -0
- data/distro/common/html/_static/chef_html_logo.png +0 -0
- data/distro/common/html/_static/chef_logo.png +0 -0
- data/distro/common/html/_static/comment-bright.png +0 -0
- data/distro/common/html/_static/comment-close.png +0 -0
- data/distro/common/html/_static/comment.png +0 -0
- data/distro/common/html/_static/contents.png +0 -0
- data/distro/common/html/_static/doctools.js +247 -0
- data/distro/common/html/_static/down-pressed.png +0 -0
- data/distro/common/html/_static/down.png +0 -0
- data/distro/common/html/_static/file.png +0 -0
- data/distro/common/html/_static/guide.css +505 -0
- data/distro/common/html/_static/jquery.js +154 -0
- data/distro/common/html/_static/minus.png +0 -0
- data/distro/common/html/_static/navigation.png +0 -0
- data/distro/common/html/_static/plus.png +0 -0
- data/distro/common/html/_static/pygments.css +62 -0
- data/distro/common/html/_static/searchtools.js +560 -0
- data/distro/common/html/_static/underscore.js +23 -0
- data/distro/common/html/_static/up-pressed.png +0 -0
- data/distro/common/html/_static/up.png +0 -0
- data/distro/common/html/_static/websupport.js +808 -0
- data/distro/common/html/ctl_chef_client.html +219 -0
- data/distro/common/html/ctl_chef_server.html +111 -0
- data/distro/common/html/ctl_chef_shell.html +120 -0
- data/distro/common/html/ctl_chef_solo.html +144 -0
- data/distro/common/html/index.html +185 -0
- data/distro/common/html/knife.html +172 -0
- data/distro/common/html/knife_bootstrap.html +250 -0
- data/distro/common/html/knife_client.html +283 -0
- data/distro/common/html/knife_common_options.html +98 -0
- data/distro/common/html/knife_configure.html +107 -0
- data/distro/common/html/knife_cookbook.html +481 -0
- data/distro/common/html/knife_cookbook_site.html +372 -0
- data/distro/common/html/knife_data_bag.html +359 -0
- data/distro/common/html/knife_delete.html +95 -0
- data/distro/common/html/knife_deps.html +145 -0
- data/distro/common/html/knife_diff.html +125 -0
- data/distro/common/html/knife_download.html +147 -0
- data/distro/common/html/knife_edit.html +91 -0
- data/distro/common/html/knife_environment.html +328 -0
- data/distro/common/html/knife_exec.html +222 -0
- data/distro/common/html/knife_index_rebuild.html +85 -0
- data/distro/common/html/knife_list.html +116 -0
- data/distro/common/html/knife_node.html +450 -0
- data/distro/common/html/knife_raw.html +112 -0
- data/distro/common/html/knife_recipe_list.html +93 -0
- data/distro/common/html/knife_role.html +295 -0
- data/distro/common/html/knife_search.html +204 -0
- data/distro/common/html/knife_show.html +106 -0
- data/distro/common/html/knife_ssh.html +179 -0
- data/distro/common/html/knife_status.html +142 -0
- data/distro/common/html/knife_tag.html +140 -0
- data/distro/common/html/knife_upload.html +155 -0
- data/distro/common/html/knife_user.html +244 -0
- data/distro/common/html/knife_using.html +211 -0
- data/distro/common/html/knife_xargs.html +115 -0
- data/distro/common/html/objects.inv +0 -0
- data/distro/common/html/search.html +84 -0
- data/distro/common/html/searchindex.js +1 -0
- data/distro/common/man/man1/chef-shell.1 +5 -5
- data/distro/common/man/man1/knife-bootstrap.1 +6 -9
- data/distro/common/man/man1/knife-client.1 +1 -9
- data/distro/common/man/man1/knife-configure.1 +10 -6
- data/distro/common/man/man1/knife-cookbook-site.1 +1 -9
- data/distro/common/man/man1/knife-cookbook.1 +11 -21
- data/distro/common/man/man1/knife-data-bag.1 +8 -22
- data/distro/common/man/man1/knife-delete.1 +1 -1
- data/distro/common/man/man1/knife-deps.1 +4 -12
- data/distro/common/man/man1/knife-diff.1 +1 -1
- data/distro/common/man/man1/knife-download.1 +2 -2
- data/distro/common/man/man1/knife-edit.1 +1 -1
- data/distro/common/man/man1/knife-environment.1 +108 -9
- data/distro/common/man/man1/knife-exec.1 +1 -15
- data/distro/common/man/man1/knife-index-rebuild.1 +1 -1
- data/distro/common/man/man1/knife-list.1 +1 -1
- data/distro/common/man/man1/knife-node.1 +3 -13
- data/distro/common/man/man1/knife-raw.1 +1 -1
- data/distro/common/man/man1/knife-recipe-list.1 +1 -1
- data/distro/common/man/man1/knife-role.1 +2 -12
- data/distro/common/man/man1/knife-search.1 +5 -5
- data/distro/common/man/man1/knife-show.1 +1 -3
- data/distro/common/man/man1/knife-ssh.1 +1 -5
- data/distro/common/man/man1/knife-status.1 +1 -1
- data/distro/common/man/man1/knife-tag.1 +1 -9
- data/distro/common/man/man1/knife-upload.1 +7 -9
- data/distro/common/man/man1/knife-user.1 +3 -17
- data/distro/common/man/man1/knife-xargs.1 +1 -3
- data/distro/common/man/man8/chef-client.8 +18 -18
- data/distro/common/man/man8/chef-solo.8 +12 -6
- data/lib/chef/client.rb +9 -5
- data/lib/chef/cookbook_uploader.rb +1 -1
- data/lib/chef/dsl/recipe.rb +119 -38
- data/lib/chef/exceptions.rb +4 -0
- data/lib/chef/policy_builder/expand_node_object.rb +11 -4
- data/lib/chef/policy_builder/policyfile.rb +7 -1
- data/lib/chef/provider/file.rb +1 -0
- data/lib/chef/resource_platform_map.rb +1 -1
- data/lib/chef/resource_reporter.rb +2 -2
- data/lib/chef/version.rb +1 -1
- data/spec/functional/knife/cookbook_delete_spec.rb +9 -9
- data/spec/functional/knife/ssh_spec.rb +1 -1
- data/spec/functional/resource/link_spec.rb +6 -6
- data/spec/functional/resource/registry_spec.rb +7 -7
- data/spec/functional/run_lock_spec.rb +1 -1
- data/spec/integration/knife/download_spec.rb +1 -1
- data/spec/integration/solo/solo_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- data/spec/stress/win32/file_spec.rb +6 -0
- data/spec/support/lib/chef/resource/zen_master.rb +1 -1
- data/spec/support/mock/platform.rb +1 -1
- data/spec/support/shared/functional/file_resource.rb +0 -2
- data/spec/support/shared/functional/securable_resource.rb +2 -2
- data/spec/support/shared/unit/api_error_inspector.rb +7 -7
- data/spec/support/shared/unit/provider/file.rb +47 -8
- data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +23 -23
- data/spec/unit/api_client/registration_spec.rb +5 -5
- data/spec/unit/api_client_spec.rb +2 -2
- data/spec/unit/application/apply.rb +6 -6
- data/spec/unit/application/client_spec.rb +6 -6
- data/spec/unit/application/knife_spec.rb +5 -5
- data/spec/unit/application/solo_spec.rb +13 -13
- data/spec/unit/application_spec.rb +19 -19
- data/spec/unit/checksum/storage/filesystem_spec.rb +2 -2
- data/spec/unit/client_spec.rb +23 -23
- data/spec/unit/config_spec.rb +4 -4
- data/spec/unit/cookbook/metadata_spec.rb +22 -22
- data/spec/unit/cookbook/synchronizer_spec.rb +17 -17
- data/spec/unit/daemon_spec.rb +21 -22
- data/spec/unit/data_bag_item_spec.rb +8 -8
- data/spec/unit/data_bag_spec.rb +6 -6
- data/spec/unit/deprecation_spec.rb +1 -1
- data/spec/unit/dsl/data_query_spec.rb +1 -1
- data/spec/unit/environment_spec.rb +5 -5
- data/spec/unit/file_access_control_spec.rb +5 -5
- data/spec/unit/file_cache_spec.rb +1 -1
- data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +1 -1
- data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +12 -12
- data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +4 -4
- data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +4 -4
- data/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +1 -1
- data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +6 -6
- data/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +4 -4
- data/spec/unit/handler/json_file_spec.rb +1 -1
- data/spec/unit/handler_spec.rb +3 -3
- data/spec/unit/knife/bootstrap_spec.rb +17 -17
- data/spec/unit/knife/client_bulk_delete_spec.rb +4 -4
- data/spec/unit/knife/client_create_spec.rb +7 -7
- data/spec/unit/knife/client_reregister_spec.rb +2 -2
- data/spec/unit/knife/client_show_spec.rb +1 -1
- data/spec/unit/knife/config_file_selection_spec.rb +4 -4
- data/spec/unit/knife/configure_client_spec.rb +4 -4
- data/spec/unit/knife/configure_spec.rb +16 -16
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +10 -10
- data/spec/unit/knife/cookbook_create_spec.rb +5 -5
- data/spec/unit/knife/cookbook_delete_spec.rb +6 -6
- data/spec/unit/knife/cookbook_download_spec.rb +10 -10
- data/spec/unit/knife/cookbook_list_spec.rb +3 -3
- data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +2 -2
- data/spec/unit/knife/cookbook_metadata_spec.rb +8 -8
- data/spec/unit/knife/cookbook_show_spec.rb +4 -4
- data/spec/unit/knife/cookbook_site_download_spec.rb +3 -3
- data/spec/unit/knife/cookbook_site_install_spec.rb +8 -8
- data/spec/unit/knife/cookbook_site_share_spec.rb +22 -22
- data/spec/unit/knife/cookbook_site_unshare_spec.rb +8 -8
- data/spec/unit/knife/cookbook_test_spec.rb +7 -7
- data/spec/unit/knife/cookbook_upload_spec.rb +20 -20
- data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +6 -6
- data/spec/unit/knife/core/object_loader_spec.rb +1 -1
- data/spec/unit/knife/core/ui_spec.rb +19 -21
- data/spec/unit/knife/data_bag_create_spec.rb +4 -4
- data/spec/unit/knife/data_bag_edit_spec.rb +7 -7
- data/spec/unit/knife/data_bag_from_file_spec.rb +15 -15
- data/spec/unit/knife/data_bag_show_spec.rb +5 -5
- data/spec/unit/knife/environment_create_spec.rb +6 -6
- data/spec/unit/knife/environment_delete_spec.rb +6 -6
- data/spec/unit/knife/environment_edit_spec.rb +5 -5
- data/spec/unit/knife/environment_from_file_spec.rb +7 -7
- data/spec/unit/knife/environment_list_spec.rb +4 -4
- data/spec/unit/knife/environment_show_spec.rb +4 -4
- data/spec/unit/knife/index_rebuild_spec.rb +2 -2
- data/spec/unit/knife/knife_help.rb +11 -11
- data/spec/unit/knife/node_bulk_delete_spec.rb +4 -4
- data/spec/unit/knife/node_delete_spec.rb +5 -5
- data/spec/unit/knife/node_edit_spec.rb +2 -2
- data/spec/unit/knife/node_from_file_spec.rb +5 -5
- data/spec/unit/knife/node_list_spec.rb +3 -3
- data/spec/unit/knife/node_run_list_add_spec.rb +3 -3
- data/spec/unit/knife/node_run_list_remove_spec.rb +4 -4
- data/spec/unit/knife/node_run_list_set_spec.rb +5 -5
- data/spec/unit/knife/node_show_spec.rb +2 -2
- data/spec/unit/knife/role_bulk_delete_spec.rb +4 -4
- data/spec/unit/knife/role_create_spec.rb +5 -5
- data/spec/unit/knife/role_delete_spec.rb +5 -5
- data/spec/unit/knife/role_edit_spec.rb +5 -5
- data/spec/unit/knife/role_from_file_spec.rb +5 -5
- data/spec/unit/knife/role_list_spec.rb +2 -2
- data/spec/unit/knife/ssh_spec.rb +6 -6
- data/spec/unit/knife/status_spec.rb +4 -4
- data/spec/unit/knife/tag_create_spec.rb +3 -3
- data/spec/unit/knife/tag_delete_spec.rb +3 -3
- data/spec/unit/knife/tag_list_spec.rb +2 -2
- data/spec/unit/knife/user_create_spec.rb +7 -7
- data/spec/unit/knife/user_reregister_spec.rb +3 -3
- data/spec/unit/knife/user_show_spec.rb +1 -1
- data/spec/unit/knife_spec.rb +29 -29
- data/spec/unit/lwrp_spec.rb +2 -2
- data/spec/unit/mixin/checksum_spec.rb +2 -2
- data/spec/unit/mixin/command_spec.rb +1 -1
- data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +4 -4
- data/spec/unit/mixin/params_validate_spec.rb +17 -17
- data/spec/unit/mixin/path_sanity_spec.rb +8 -8
- data/spec/unit/mixin/securable_spec.rb +87 -87
- data/spec/unit/mixin/shell_out_spec.rb +1 -1
- data/spec/unit/mixin/template_spec.rb +2 -2
- data/spec/unit/node/attribute_spec.rb +3 -3
- data/spec/unit/node_spec.rb +12 -12
- data/spec/unit/platform_spec.rb +1 -1
- data/spec/unit/policy_builder/expand_node_object_spec.rb +16 -0
- data/spec/unit/policy_builder/policyfile_spec.rb +4 -0
- data/spec/unit/provider/breakpoint_spec.rb +8 -8
- data/spec/unit/provider/cookbook_file/content_spec.rb +4 -4
- data/spec/unit/provider/cookbook_file_spec.rb +1 -1
- data/spec/unit/provider/cron/unix_spec.rb +11 -11
- data/spec/unit/provider/cron_spec.rb +40 -40
- data/spec/unit/provider/deploy/revision_spec.rb +11 -12
- data/spec/unit/provider/deploy/timestamped_spec.rb +3 -3
- data/spec/unit/provider/deploy_spec.rb +50 -50
- data/spec/unit/provider/directory_spec.rb +18 -18
- data/spec/unit/provider/env_spec.rb +15 -15
- data/spec/unit/provider/erl_call_spec.rb +1 -1
- data/spec/unit/provider/execute_spec.rb +5 -5
- data/spec/unit/provider/file/content_spec.rb +5 -5
- data/spec/unit/provider/file_spec.rb +1 -1
- data/spec/unit/provider/git_spec.rb +47 -47
- data/spec/unit/provider/group/dscl_spec.rb +16 -15
- data/spec/unit/provider/group/gpasswd_spec.rb +6 -5
- data/spec/unit/provider/group/groupadd_spec.rb +10 -10
- data/spec/unit/provider/group/groupmod_spec.rb +3 -3
- data/spec/unit/provider/group/pw_spec.rb +9 -8
- data/spec/unit/provider/group/usermod_spec.rb +13 -12
- data/spec/unit/provider/group/windows_spec.rb +9 -9
- data/spec/unit/provider/group_spec.rb +31 -31
- data/spec/unit/provider/http_request_spec.rb +3 -3
- data/spec/unit/provider/ifconfig/aix_spec.rb +7 -7
- data/spec/unit/provider/ifconfig/debian_spec.rb +3 -3
- data/spec/unit/provider/ifconfig/redhat_spec.rb +5 -5
- data/spec/unit/provider/ifconfig_spec.rb +13 -13
- data/spec/unit/provider/link_spec.rb +33 -33
- data/spec/unit/provider/mdadm_spec.rb +4 -4
- data/spec/unit/provider/mount/aix_spec.rb +5 -5
- data/spec/unit/provider/mount/mount_spec.rb +49 -50
- data/spec/unit/provider/mount/windows_spec.rb +18 -18
- data/spec/unit/provider/mount_spec.rb +12 -12
- data/spec/unit/provider/ohai_spec.rb +6 -6
- data/spec/unit/provider/package/aix_spec.rb +14 -14
- data/spec/unit/provider/package/apt_spec.rb +10 -10
- data/spec/unit/provider/package/dpkg_spec.rb +13 -13
- data/spec/unit/provider/package/easy_install_spec.rb +6 -6
- data/spec/unit/provider/package/freebsd_spec.rb +29 -29
- data/spec/unit/provider/package/ips_spec.rb +4 -4
- data/spec/unit/provider/package/macports_spec.rb +6 -6
- data/spec/unit/provider/package/pacman_spec.rb +17 -17
- data/spec/unit/provider/package/portage_spec.rb +18 -18
- data/spec/unit/provider/package/rpm_spec.rb +7 -7
- data/spec/unit/provider/package/rubygems_spec.rb +31 -31
- data/spec/unit/provider/package/smartos_spec.rb +4 -4
- data/spec/unit/provider/package/solaris_spec.rb +15 -15
- data/spec/unit/provider/package/yum_spec.rb +100 -100
- data/spec/unit/provider/package/zypper_spec.rb +10 -10
- data/spec/unit/provider/package_spec.rb +21 -21
- data/spec/unit/provider/registry_key_spec.rb +2 -2
- data/spec/unit/provider/remote_file/content_spec.rb +31 -31
- data/spec/unit/provider/remote_file/fetcher_spec.rb +8 -8
- data/spec/unit/provider/remote_file/ftp_spec.rb +10 -10
- data/spec/unit/provider/remote_file/http_spec.rb +4 -4
- data/spec/unit/provider/remote_file/local_file_spec.rb +2 -2
- data/spec/unit/provider/remote_file_spec.rb +1 -1
- data/spec/unit/provider/route_spec.rb +23 -23
- data/spec/unit/provider/script_spec.rb +5 -5
- data/spec/unit/provider/service/arch_service_spec.rb +41 -41
- data/spec/unit/provider/service/debian_service_spec.rb +23 -23
- data/spec/unit/provider/service/freebsd_service_spec.rb +33 -33
- data/spec/unit/provider/service/gentoo_service_spec.rb +16 -16
- data/spec/unit/provider/service/init_service_spec.rb +13 -13
- data/spec/unit/provider/service/insserv_service_spec.rb +4 -4
- data/spec/unit/provider/service/invokercd_service_spec.rb +12 -12
- data/spec/unit/provider/service/macosx_spec.rb +20 -20
- data/spec/unit/provider/service/redhat_spec.rb +15 -15
- data/spec/unit/provider/service/simple_service_spec.rb +9 -9
- data/spec/unit/provider/service/solaris_smf_service_spec.rb +13 -13
- data/spec/unit/provider/service/systemd_service_spec.rb +28 -28
- data/spec/unit/provider/service/upstart_service_spec.rb +41 -41
- data/spec/unit/provider/service/windows_spec.rb +37 -37
- data/spec/unit/provider/service_spec.rb +9 -9
- data/spec/unit/provider/subversion_spec.rb +36 -36
- data/spec/unit/provider/template/content_spec.rb +8 -8
- data/spec/unit/provider/template_spec.rb +1 -1
- data/spec/unit/provider/user/dscl_spec.rb +9 -9
- data/spec/unit/provider/user/pw_spec.rb +20 -20
- data/spec/unit/provider/user/solaris_spec.rb +5 -5
- data/spec/unit/provider/user/windows_spec.rb +8 -8
- data/spec/unit/provider/user_spec.rb +34 -34
- data/spec/unit/provider_spec.rb +3 -3
- data/spec/unit/recipe_spec.rb +79 -4
- data/spec/unit/registry_helper_spec.rb +2 -2
- data/spec/unit/resource/cron_spec.rb +2 -2
- data/spec/unit/resource/directory_spec.rb +5 -5
- data/spec/unit/resource/env_spec.rb +2 -2
- data/spec/unit/resource/erl_call_spec.rb +1 -1
- data/spec/unit/resource/file_spec.rb +8 -8
- data/spec/unit/resource/group_spec.rb +3 -3
- data/spec/unit/resource/link_spec.rb +8 -8
- data/spec/unit/resource/mdadm_spec.rb +3 -3
- data/spec/unit/resource/mount_spec.rb +3 -3
- data/spec/unit/resource/route_spec.rb +2 -2
- data/spec/unit/resource/user_spec.rb +2 -2
- data/spec/unit/resource/yum_package_spec.rb +2 -2
- data/spec/unit/resource_collection_spec.rb +1 -1
- data/spec/unit/resource_definition_spec.rb +2 -2
- data/spec/unit/resource_reporter_spec.rb +71 -16
- data/spec/unit/resource_spec.rb +3 -3
- data/spec/unit/rest/auth_credentials_spec.rb +2 -2
- data/spec/unit/rest_spec.rb +3 -40
- data/spec/unit/run_list/run_list_expansion_spec.rb +3 -3
- data/spec/unit/run_list_spec.rb +9 -9
- data/spec/unit/run_status_spec.rb +1 -1
- data/spec/unit/runner_spec.rb +8 -8
- data/spec/unit/scan_access_control_spec.rb +3 -3
- data/spec/unit/search/query_spec.rb +7 -7
- data/spec/unit/shell/model_wrapper_spec.rb +2 -2
- data/spec/unit/shell/shell_ext_spec.rb +15 -15
- data/spec/unit/shell/shell_session_spec.rb +9 -9
- data/spec/unit/shell_spec.rb +1 -2
- data/spec/unit/user_spec.rb +4 -4
- data/spec/unit/util/backup_spec.rb +1 -1
- data/spec/unit/util/selinux_spec.rb +7 -7
- metadata +106 -51
- data/distro/common/html/chef-client.8.html +0 -145
- data/distro/common/html/chef-expander.8.html +0 -164
- data/distro/common/html/chef-expanderctl.8.html +0 -146
- data/distro/common/html/chef-server-webui.8.html +0 -185
- data/distro/common/html/chef-server.8.html +0 -182
- data/distro/common/html/chef-shell.1.html +0 -286
- data/distro/common/html/chef-solo.8.html +0 -185
- data/distro/common/html/chef-solr.8.html +0 -165
- data/distro/common/html/knife-bootstrap.1.html +0 -241
- data/distro/common/html/knife-client.1.html +0 -219
- data/distro/common/html/knife-configure.1.html +0 -170
- data/distro/common/html/knife-cookbook-site.1.html +0 -241
- data/distro/common/html/knife-cookbook.1.html +0 -381
- data/distro/common/html/knife-data-bag.1.html +0 -235
- data/distro/common/html/knife-environment.1.html +0 -265
- data/distro/common/html/knife-exec.1.html +0 -134
- data/distro/common/html/knife-index.1.html +0 -125
- data/distro/common/html/knife-node.1.html +0 -250
- data/distro/common/html/knife-role.1.html +0 -200
- data/distro/common/html/knife-search.1.html +0 -288
- data/distro/common/html/knife-ssh.1.html +0 -156
- data/distro/common/html/knife-status.1.html +0 -128
- data/distro/common/html/knife-tag.1.html +0 -137
- data/distro/common/html/knife.1.html +0 -315
@@ -189,8 +189,8 @@ describe Chef::ApiClient do
|
|
189
189
|
|
190
190
|
describe "when requesting a new key" do
|
191
191
|
before do
|
192
|
-
@http_client =
|
193
|
-
Chef::REST.stub
|
192
|
+
@http_client = double("Chef::REST mock")
|
193
|
+
Chef::REST.stub(:new).and_return(@http_client)
|
194
194
|
end
|
195
195
|
|
196
196
|
context "and the client does not exist on the server" do
|
@@ -21,7 +21,7 @@ describe Chef::Application::Apply do
|
|
21
21
|
|
22
22
|
before do
|
23
23
|
@app = Chef::Application::Recipe.new
|
24
|
-
@app.stub
|
24
|
+
@app.stub(:configure_logging).and_return(true)
|
25
25
|
@recipe_text = "package 'nyancat'"
|
26
26
|
Chef::Config[:solo] = true
|
27
27
|
end
|
@@ -36,10 +36,10 @@ describe Chef::Application::Apply do
|
|
36
36
|
before do
|
37
37
|
@recipe_file_name = "foo.rb"
|
38
38
|
@recipe_path = File.expand_path("foo.rb")
|
39
|
-
@recipe_file =
|
40
|
-
@app.stub
|
41
|
-
File.stub
|
42
|
-
Chef::Application.stub
|
39
|
+
@recipe_file = double("Tempfile (mock)", :read => @recipe_text)
|
40
|
+
@app.stub(:open).with(@recipe_path).and_return(@recipe_file)
|
41
|
+
File.stub(:exist?).with("foo.rb").and_return(true)
|
42
|
+
Chef::Application.stub(:fatal!).and_return(true)
|
43
43
|
end
|
44
44
|
it "should read text properly" do
|
45
45
|
@app.read_recipe_file(@recipe_file_name)[0].should == @recipe_text
|
@@ -49,7 +49,7 @@ describe Chef::Application::Apply do
|
|
49
49
|
end
|
50
50
|
describe "when recipe doesn't exist" do
|
51
51
|
before do
|
52
|
-
File.stub
|
52
|
+
File.stub(:exist?).with(@recipe_file_name).and_return(false)
|
53
53
|
end
|
54
54
|
it "should raise a fatal" do
|
55
55
|
Chef::Application.should_receive(:fatal!)
|
@@ -23,9 +23,9 @@ describe Chef::Application::Client, "reconfigure" do
|
|
23
23
|
ARGV.clear
|
24
24
|
|
25
25
|
@app = Chef::Application::Client.new
|
26
|
-
@app.stub
|
27
|
-
@app.stub
|
28
|
-
@app.stub
|
26
|
+
@app.stub(:configure_opt_parser).and_return(true)
|
27
|
+
@app.stub(:configure_chef).and_return(true)
|
28
|
+
@app.stub(:configure_logging).and_return(true)
|
29
29
|
@app.cli_arguments = []
|
30
30
|
Chef::Config[:interval] = 10
|
31
31
|
|
@@ -91,9 +91,9 @@ describe Chef::Application::Client, "setup_application" do
|
|
91
91
|
before do
|
92
92
|
@app = Chef::Application::Client.new
|
93
93
|
# this is all stuff the reconfigure method needs
|
94
|
-
@app.stub
|
95
|
-
@app.stub
|
96
|
-
@app.stub
|
94
|
+
@app.stub(:configure_opt_parser).and_return(true)
|
95
|
+
@app.stub(:configure_chef).and_return(true)
|
96
|
+
@app.stub(:configure_logging).and_return(true)
|
97
97
|
end
|
98
98
|
|
99
99
|
it "should change privileges" do
|
@@ -35,8 +35,8 @@ describe Chef::Application::Knife do
|
|
35
35
|
|
36
36
|
before(:each) do
|
37
37
|
@knife = Chef::Application::Knife.new
|
38
|
-
@knife.stub
|
39
|
-
Chef::Knife.stub
|
38
|
+
@knife.stub(:puts)
|
39
|
+
Chef::Knife.stub(:list_commands)
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should exit 1 and print the options if no arguments are given at all" do
|
@@ -54,7 +54,7 @@ describe Chef::Application::Knife do
|
|
54
54
|
|
55
55
|
it "should run a sub command with the applications command line option prototype" do
|
56
56
|
with_argv(*%w{noop knife command with some args}) do
|
57
|
-
knife =
|
57
|
+
knife = double(Chef::Knife)
|
58
58
|
Chef::Knife.should_receive(:run).with(ARGV, @knife.options).and_return(knife)
|
59
59
|
@knife.should_receive(:exit).with(0)
|
60
60
|
@knife.run
|
@@ -76,7 +76,7 @@ describe Chef::Application::Knife do
|
|
76
76
|
describe "when given a path to the client key" do
|
77
77
|
it "expands a relative path relative to the CWD" do
|
78
78
|
relative_path = '.chef/client.pem'
|
79
|
-
Dir.stub
|
79
|
+
Dir.stub(:pwd).and_return(CHEF_SPEC_DATA)
|
80
80
|
with_argv(*%W{noop knife command -k #{relative_path}}) do
|
81
81
|
@knife.should_receive(:exit).with(0)
|
82
82
|
@knife.run
|
@@ -158,7 +158,7 @@ describe Chef::Application::Knife do
|
|
158
158
|
|
159
159
|
it "should run a sub command with the applications command line option prototype" do
|
160
160
|
with_argv(*%w{noop knife command with some args}) do
|
161
|
-
knife =
|
161
|
+
knife = double(Chef::Knife)
|
162
162
|
Chef::Knife.should_receive(:run).with(ARGV, @knife.options).and_return(knife)
|
163
163
|
@knife.should_receive(:exit).with(0)
|
164
164
|
@knife.run
|
@@ -20,9 +20,9 @@ require 'spec_helper'
|
|
20
20
|
describe Chef::Application::Solo do
|
21
21
|
before do
|
22
22
|
@app = Chef::Application::Solo.new
|
23
|
-
@app.stub
|
24
|
-
@app.stub
|
25
|
-
@app.stub
|
23
|
+
@app.stub(:configure_opt_parser).and_return(true)
|
24
|
+
@app.stub(:configure_chef).and_return(true)
|
25
|
+
@app.stub(:configure_logging).and_return(true)
|
26
26
|
Chef::Config[:recipe_url] = false
|
27
27
|
Chef::Config[:json_attribs] = false
|
28
28
|
Chef::Config[:solo] = true
|
@@ -70,14 +70,14 @@ describe Chef::Application::Solo do
|
|
70
70
|
before do
|
71
71
|
Chef::Config[:cookbook_path] = "#{Dir.tmpdir}/chef-solo/cookbooks"
|
72
72
|
Chef::Config[:recipe_url] = "http://junglist.gen.nz/recipes.tgz"
|
73
|
-
FileUtils.stub
|
73
|
+
FileUtils.stub(:mkdir_p).and_return(true)
|
74
74
|
@tarfile = StringIO.new("remote_tarball_content")
|
75
|
-
@app.stub
|
75
|
+
@app.stub(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile)
|
76
76
|
|
77
77
|
@target_file = StringIO.new
|
78
|
-
File.stub
|
78
|
+
File.stub(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(@target_file)
|
79
79
|
|
80
|
-
Chef::Mixin::Command.stub
|
80
|
+
Chef::Mixin::Command.stub(:run_command).and_return(true)
|
81
81
|
end
|
82
82
|
|
83
83
|
it "should create the recipes path based on the parent of the cookbook path" do
|
@@ -107,14 +107,14 @@ describe Chef::Application::Solo do
|
|
107
107
|
before do
|
108
108
|
Chef::Config[:solo] = true
|
109
109
|
|
110
|
-
Chef::Daemon.stub
|
111
|
-
@chef_client =
|
112
|
-
Chef::Client.stub
|
110
|
+
Chef::Daemon.stub(:change_privilege)
|
111
|
+
@chef_client = double("Chef::Client")
|
112
|
+
Chef::Client.stub(:new).and_return(@chef_client)
|
113
113
|
@app = Chef::Application::Solo.new
|
114
114
|
# this is all stuff the reconfigure method needs
|
115
|
-
@app.stub
|
116
|
-
@app.stub
|
117
|
-
@app.stub
|
115
|
+
@app.stub(:configure_opt_parser).and_return(true)
|
116
|
+
@app.stub(:configure_chef).and_return(true)
|
117
|
+
@app.stub(:configure_logging).and_return(true)
|
118
118
|
end
|
119
119
|
|
120
120
|
it "should change privileges" do
|
@@ -24,8 +24,8 @@ describe Chef::Application do
|
|
24
24
|
ARGV.clear
|
25
25
|
Chef::Log.logger = Logger.new(StringIO.new)
|
26
26
|
@app = Chef::Application.new
|
27
|
-
Dir.stub
|
28
|
-
@app.stub
|
27
|
+
Dir.stub(:chdir).and_return(0)
|
28
|
+
@app.stub(:reconfigure)
|
29
29
|
Chef::Log.init(STDERR)
|
30
30
|
end
|
31
31
|
|
@@ -36,8 +36,8 @@ describe Chef::Application do
|
|
36
36
|
describe "reconfigure" do
|
37
37
|
before do
|
38
38
|
@app = Chef::Application.new
|
39
|
-
@app.stub
|
40
|
-
@app.stub
|
39
|
+
@app.stub(:configure_chef).and_return(true)
|
40
|
+
@app.stub(:configure_logging).and_return(true)
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should configure chef" do
|
@@ -59,10 +59,10 @@ describe Chef::Application do
|
|
59
59
|
|
60
60
|
describe "run" do
|
61
61
|
before do
|
62
|
-
@app.stub
|
63
|
-
@app.stub
|
64
|
-
@app.stub
|
65
|
-
@app.stub
|
62
|
+
@app.stub(:setup_application).and_return(true)
|
63
|
+
@app.stub(:run_application).and_return(true)
|
64
|
+
@app.stub(:configure_chef).and_return(true)
|
65
|
+
@app.stub(:configure_logging).and_return(true)
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should reconfigure the application before running" do
|
@@ -85,8 +85,8 @@ describe Chef::Application do
|
|
85
85
|
describe "configure_chef" do
|
86
86
|
before do
|
87
87
|
@app = Chef::Application.new
|
88
|
-
#Chef::Config.stub
|
89
|
-
@app.stub
|
88
|
+
#Chef::Config.stub(:merge!).and_return(true)
|
89
|
+
@app.stub(:parse_options).and_return(true)
|
90
90
|
end
|
91
91
|
|
92
92
|
it "should parse the commandline options" do
|
@@ -152,12 +152,12 @@ describe Chef::Application do
|
|
152
152
|
describe "when configuring the logger" do
|
153
153
|
before do
|
154
154
|
@app = Chef::Application.new
|
155
|
-
Chef::Log.stub
|
155
|
+
Chef::Log.stub(:init)
|
156
156
|
end
|
157
157
|
|
158
158
|
it "should initialise the chef logger" do
|
159
|
-
Chef::Log.stub
|
160
|
-
@monologger =
|
159
|
+
Chef::Log.stub(:level=)
|
160
|
+
@monologger = double("Monologger")
|
161
161
|
MonoLogger.should_receive(:new).with(Chef::Config[:log_location]).and_return(@monologger)
|
162
162
|
Chef::Log.should_receive(:init).with(@monologger)
|
163
163
|
@app.configure_logging
|
@@ -173,7 +173,7 @@ describe Chef::Application do
|
|
173
173
|
shared_examples_for "log_level_is_auto" do
|
174
174
|
context "when STDOUT is to a tty" do
|
175
175
|
before do
|
176
|
-
STDOUT.stub
|
176
|
+
STDOUT.stub(:tty?).and_return(true)
|
177
177
|
end
|
178
178
|
|
179
179
|
it "configures the log level to :warn" do
|
@@ -195,7 +195,7 @@ describe Chef::Application do
|
|
195
195
|
|
196
196
|
context "when STDOUT is not to a tty" do
|
197
197
|
before do
|
198
|
-
STDOUT.stub
|
198
|
+
STDOUT.stub(:tty?).and_return(false)
|
199
199
|
end
|
200
200
|
|
201
201
|
it "configures the log level to :info" do
|
@@ -230,9 +230,9 @@ describe Chef::Application do
|
|
230
230
|
|
231
231
|
describe "class method: fatal!" do
|
232
232
|
before do
|
233
|
-
STDERR.stub
|
234
|
-
Chef::Log.stub
|
235
|
-
Process.stub
|
233
|
+
STDERR.stub(:puts).with("FATAL: blah").and_return(true)
|
234
|
+
Chef::Log.stub(:fatal).and_return(true)
|
235
|
+
Process.stub(:exit).and_return(true)
|
236
236
|
end
|
237
237
|
|
238
238
|
it "should log an error message to the logger" do
|
@@ -281,7 +281,7 @@ describe Chef::Application do
|
|
281
281
|
@app.config[:config_file] = "/tmp/non-existing-dir/file"
|
282
282
|
config_file_regexp = Regexp.new @app.config[:config_file]
|
283
283
|
Chef::Log.should_receive(:warn).at_least(:once).with(config_file_regexp).and_return(true)
|
284
|
-
Chef::Log.
|
284
|
+
Chef::Log.stub(:warn).and_return(true)
|
285
285
|
@app.configure_chef
|
286
286
|
end
|
287
287
|
end
|
@@ -26,8 +26,8 @@ describe Chef::Checksum::Storage::Filesystem do
|
|
26
26
|
|
27
27
|
@now = Time.now
|
28
28
|
|
29
|
-
Time.stub
|
30
|
-
Chef::Config.stub
|
29
|
+
Time.stub(:now).and_return(@now)
|
30
|
+
Chef::Config.stub(:checksum_path).and_return("/var/chef/checksums")
|
31
31
|
|
32
32
|
@checksum_of_the_file = "3fafecfb15585ede6b840158cbc2f399"
|
33
33
|
@storage = Chef::Checksum::Storage::Filesystem.new("/not/used/path", @checksum_of_the_file)
|
data/spec/unit/client_spec.rb
CHANGED
@@ -37,9 +37,9 @@ shared_examples_for Chef::Client do
|
|
37
37
|
:platform => 'example-platform',
|
38
38
|
:platform_version => 'example-platform-1.0',
|
39
39
|
:data => {} }
|
40
|
-
ohai_data.stub
|
41
|
-
ohai_data.stub
|
42
|
-
Ohai::System.stub
|
40
|
+
ohai_data.stub(:all_plugins).and_return(true)
|
41
|
+
ohai_data.stub(:data).and_return(ohai_data)
|
42
|
+
Ohai::System.stub(:new).and_return(ohai_data)
|
43
43
|
|
44
44
|
@node = Chef::Node.new
|
45
45
|
@node.name(@fqdn)
|
@@ -81,7 +81,7 @@ shared_examples_for Chef::Client do
|
|
81
81
|
|
82
82
|
context "and STDOUT is a TTY" do
|
83
83
|
before do
|
84
|
-
STDOUT.stub
|
84
|
+
STDOUT.stub(:tty?).and_return(true)
|
85
85
|
end
|
86
86
|
|
87
87
|
it "configures the :doc formatter" do
|
@@ -104,7 +104,7 @@ shared_examples_for Chef::Client do
|
|
104
104
|
|
105
105
|
context "and STDOUT is not a TTY" do
|
106
106
|
before do
|
107
|
-
STDOUT.stub
|
107
|
+
STDOUT.stub(:tty?).and_return(false)
|
108
108
|
end
|
109
109
|
|
110
110
|
it "configures the :null formatter" do
|
@@ -168,10 +168,10 @@ shared_examples_for Chef::Client do
|
|
168
168
|
describe "run" do
|
169
169
|
|
170
170
|
it "should identify the node and run ohai, then register the client" do
|
171
|
-
mock_chef_rest_for_node =
|
172
|
-
mock_chef_rest_for_cookbook_sync =
|
173
|
-
mock_chef_rest_for_node_save =
|
174
|
-
mock_chef_runner =
|
171
|
+
mock_chef_rest_for_node = double("Chef::REST (node)")
|
172
|
+
mock_chef_rest_for_cookbook_sync = double("Chef::REST (cookbook sync)")
|
173
|
+
mock_chef_rest_for_node_save = double("Chef::REST (node save)")
|
174
|
+
mock_chef_runner = double("Chef::Runner")
|
175
175
|
|
176
176
|
# --Client.register
|
177
177
|
# Make sure Client#register thinks the client key doesn't
|
@@ -253,15 +253,15 @@ shared_examples_for Chef::Client do
|
|
253
253
|
end
|
254
254
|
|
255
255
|
it "should remove the run_lock on failure of #load_node" do
|
256
|
-
@run_lock =
|
257
|
-
Chef::RunLock.stub
|
256
|
+
@run_lock = double("Chef::RunLock", :acquire => true)
|
257
|
+
Chef::RunLock.stub(:new).and_return(@run_lock)
|
258
258
|
|
259
|
-
@events =
|
260
|
-
Chef::EventDispatch::Dispatcher.stub
|
259
|
+
@events = double("Chef::EventDispatch::Dispatcher").as_null_object
|
260
|
+
Chef::EventDispatch::Dispatcher.stub(:new).and_return(@events)
|
261
261
|
|
262
262
|
# @events is created on Chef::Client.new, so we need to recreate it after mocking
|
263
263
|
@client = Chef::Client.new
|
264
|
-
@client.stub
|
264
|
+
@client.stub(:load_node).and_raise(Exception)
|
265
265
|
@run_lock.should_receive(:release)
|
266
266
|
if(Chef::Config[:client_fork] && !windows?)
|
267
267
|
@client.should_receive(:fork) do |&block|
|
@@ -274,8 +274,8 @@ shared_examples_for Chef::Client do
|
|
274
274
|
describe "when notifying other objects of the status of the chef run" do
|
275
275
|
before do
|
276
276
|
Chef::Client.clear_notifications
|
277
|
-
Chef::Node.stub
|
278
|
-
@node.stub
|
277
|
+
Chef::Node.stub(:find_or_create).and_return(@node)
|
278
|
+
@node.stub(:save)
|
279
279
|
@client.load_node
|
280
280
|
@client.build_node
|
281
281
|
end
|
@@ -324,7 +324,7 @@ shared_examples_for Chef::Client do
|
|
324
324
|
|
325
325
|
# build_node will call Node#expand! with server, which will
|
326
326
|
# eventually hit the server to expand the included role.
|
327
|
-
mock_chef_rest =
|
327
|
+
mock_chef_rest = double("Chef::REST")
|
328
328
|
mock_chef_rest.should_receive(:get_rest).with("roles/role_containing_cookbook1").and_return(role_containing_cookbook1)
|
329
329
|
Chef::REST.should_receive(:new).and_return(mock_chef_rest)
|
330
330
|
|
@@ -332,7 +332,7 @@ shared_examples_for Chef::Client do
|
|
332
332
|
@node[:roles].should be_nil
|
333
333
|
@node[:recipes].should be_nil
|
334
334
|
|
335
|
-
@client.policy_builder.stub
|
335
|
+
@client.policy_builder.stub(:node).and_return(@node)
|
336
336
|
|
337
337
|
# chefspec and possibly others use the return value of this method
|
338
338
|
@client.build_node.should == @node
|
@@ -385,7 +385,7 @@ shared_examples_for Chef::Client do
|
|
385
385
|
|
386
386
|
context "fatal admin check is configured" do
|
387
387
|
it "should not raise an exception" do
|
388
|
-
@client.do_windows_admin_check.should_not raise_error
|
388
|
+
@client.do_windows_admin_check.should_not raise_error
|
389
389
|
end
|
390
390
|
end
|
391
391
|
end
|
@@ -402,7 +402,7 @@ shared_examples_for Chef::Client do
|
|
402
402
|
|
403
403
|
context "fatal admin check is configured" do
|
404
404
|
it "should raise an exception" do
|
405
|
-
@client.do_windows_admin_check.should_not raise_error
|
405
|
+
@client.do_windows_admin_check.should_not raise_error
|
406
406
|
end
|
407
407
|
end
|
408
408
|
end
|
@@ -422,7 +422,7 @@ shared_examples_for Chef::Client do
|
|
422
422
|
@client = Chef::Client.new(nil, :override_runlist => 'role[a], role[b]')
|
423
423
|
end
|
424
424
|
|
425
|
-
it "should override the run list and
|
425
|
+
it "should override the run list and skip the final node save" do
|
426
426
|
@client = Chef::Client.new(nil, :override_runlist => 'role[test_role]')
|
427
427
|
@client.node = @node
|
428
428
|
|
@@ -434,11 +434,11 @@ shared_examples_for Chef::Client do
|
|
434
434
|
|
435
435
|
original_runlist = @node.run_list.dup
|
436
436
|
|
437
|
-
mock_chef_rest =
|
437
|
+
mock_chef_rest = double("Chef::REST")
|
438
438
|
mock_chef_rest.should_receive(:get_rest).with("roles/test_role").and_return(override_role)
|
439
439
|
Chef::REST.should_receive(:new).and_return(mock_chef_rest)
|
440
440
|
|
441
|
-
@node.
|
441
|
+
@node.should_not_receive(:save)
|
442
442
|
|
443
443
|
@client.policy_builder.stub(:node).and_return(@node)
|
444
444
|
@client.policy_builder.build_node
|
data/spec/unit/config_spec.rb
CHANGED
@@ -99,8 +99,8 @@ describe Chef::Config do
|
|
99
99
|
|
100
100
|
describe "class method: manage_secret_key" do
|
101
101
|
before do
|
102
|
-
Chef::FileCache.stub
|
103
|
-
Chef::FileCache.stub
|
102
|
+
Chef::FileCache.stub(:load).and_return(true)
|
103
|
+
Chef::FileCache.stub(:has_key?).with("chef_server_cookie_id").and_return(false)
|
104
104
|
end
|
105
105
|
|
106
106
|
it "should generate and store a chef server cookie id" do
|
@@ -110,7 +110,7 @@ describe Chef::Config do
|
|
110
110
|
|
111
111
|
describe "when the filecache has a chef server cookie id key" do
|
112
112
|
before do
|
113
|
-
Chef::FileCache.stub
|
113
|
+
Chef::FileCache.stub(:has_key?).with("chef_server_cookie_id").and_return(true)
|
114
114
|
end
|
115
115
|
|
116
116
|
it "should not generate and store a chef server cookie id" do
|
@@ -132,7 +132,7 @@ describe Chef::Config do
|
|
132
132
|
it "should return a windows path on windows systems" do
|
133
133
|
platform_mock :windows do
|
134
134
|
path = "/etc/chef/cookbooks"
|
135
|
-
ENV.stub
|
135
|
+
ENV.stub(:[]).with('SYSTEMDRIVE').and_return('C:')
|
136
136
|
# match on a regex that looks for the base path with an optional
|
137
137
|
# system drive at the beginning (c:)
|
138
138
|
# system drive is not hardcoded b/c it can change and b/c it is not present on linux systems
|
@@ -247,7 +247,7 @@ describe Chef::Cookbook::Metadata do
|
|
247
247
|
it "should not accept anything but a string for display_name" do
|
248
248
|
lambda {
|
249
249
|
@meta.grouping("db/mysql/databases", :title => "foo")
|
250
|
-
}.should_not raise_error
|
250
|
+
}.should_not raise_error
|
251
251
|
lambda {
|
252
252
|
@meta.grouping("db/mysql/databases", :title => Hash.new)
|
253
253
|
}.should raise_error(ArgumentError)
|
@@ -256,7 +256,7 @@ describe Chef::Cookbook::Metadata do
|
|
256
256
|
it "should not accept anything but a string for the description" do
|
257
257
|
lambda {
|
258
258
|
@meta.grouping("db/mysql/databases", :description => "foo")
|
259
|
-
}.should_not raise_error
|
259
|
+
}.should_not raise_error
|
260
260
|
lambda {
|
261
261
|
@meta.grouping("db/mysql/databases", :description => Hash.new)
|
262
262
|
}.should raise_error(ArgumentError)
|
@@ -281,7 +281,7 @@ describe Chef::Cookbook::Metadata do
|
|
281
281
|
it "should not accept anything but a string for display_name" do
|
282
282
|
lambda {
|
283
283
|
@meta.attribute("db/mysql/databases", :display_name => "foo")
|
284
|
-
}.should_not raise_error
|
284
|
+
}.should_not raise_error
|
285
285
|
lambda {
|
286
286
|
@meta.attribute("db/mysql/databases", :display_name => Hash.new)
|
287
287
|
}.should raise_error(ArgumentError)
|
@@ -290,7 +290,7 @@ describe Chef::Cookbook::Metadata do
|
|
290
290
|
it "should not accept anything but a string for the description" do
|
291
291
|
lambda {
|
292
292
|
@meta.attribute("db/mysql/databases", :description => "foo")
|
293
|
-
}.should_not raise_error
|
293
|
+
}.should_not raise_error
|
294
294
|
lambda {
|
295
295
|
@meta.attribute("db/mysql/databases", :description => Hash.new)
|
296
296
|
}.should raise_error(ArgumentError)
|
@@ -299,7 +299,7 @@ describe Chef::Cookbook::Metadata do
|
|
299
299
|
it "should not accept anything but an array of strings for choice" do
|
300
300
|
lambda {
|
301
301
|
@meta.attribute("db/mysql/databases", :choice => ['dedicated', 'shared'])
|
302
|
-
}.should_not raise_error
|
302
|
+
}.should_not raise_error
|
303
303
|
lambda {
|
304
304
|
@meta.attribute("db/mysql/databases", :choice => [10, 'shared'])
|
305
305
|
}.should raise_error(ArgumentError)
|
@@ -316,10 +316,10 @@ describe Chef::Cookbook::Metadata do
|
|
316
316
|
it "should let calculated be true or false" do
|
317
317
|
lambda {
|
318
318
|
@meta.attribute("db/mysql/databases", :calculated => true)
|
319
|
-
}.should_not raise_error
|
319
|
+
}.should_not raise_error
|
320
320
|
lambda {
|
321
321
|
@meta.attribute("db/mysql/databases", :calculated => false)
|
322
|
-
}.should_not raise_error
|
322
|
+
}.should_not raise_error
|
323
323
|
lambda {
|
324
324
|
@meta.attribute("db/mysql/databases", :calculated => Hash.new)
|
325
325
|
}.should raise_error(ArgumentError)
|
@@ -333,13 +333,13 @@ describe Chef::Cookbook::Metadata do
|
|
333
333
|
it "accepts String for the attribute type" do
|
334
334
|
lambda {
|
335
335
|
@meta.attribute("db/mysql/databases", :type => "string")
|
336
|
-
}.should_not raise_error
|
336
|
+
}.should_not raise_error
|
337
337
|
end
|
338
338
|
|
339
339
|
it "accepts Array for the attribute type" do
|
340
340
|
lambda {
|
341
341
|
@meta.attribute("db/mysql/databases", :type => "array")
|
342
|
-
}.should_not raise_error
|
342
|
+
}.should_not raise_error
|
343
343
|
lambda {
|
344
344
|
@meta.attribute("db/mysql/databases", :type => Array.new)
|
345
345
|
}.should raise_error(ArgumentError)
|
@@ -348,38 +348,38 @@ describe Chef::Cookbook::Metadata do
|
|
348
348
|
it "accepts symbol for the attribute type" do
|
349
349
|
lambda {
|
350
350
|
@meta.attribute("db/mysql/databases", :type => "symbol")
|
351
|
-
}.should_not raise_error
|
351
|
+
}.should_not raise_error
|
352
352
|
end
|
353
353
|
|
354
354
|
it "should let type be hash (backwards compatability only)" do
|
355
355
|
lambda {
|
356
356
|
@meta.attribute("db/mysql/databases", :type => "hash")
|
357
|
-
}.should_not raise_error
|
357
|
+
}.should_not raise_error
|
358
358
|
end
|
359
359
|
|
360
360
|
it "should let required be required, recommended or optional" do
|
361
361
|
lambda {
|
362
362
|
@meta.attribute("db/mysql/databases", :required => 'required')
|
363
|
-
}.should_not raise_error
|
363
|
+
}.should_not raise_error
|
364
364
|
lambda {
|
365
365
|
@meta.attribute("db/mysql/databases", :required => 'recommended')
|
366
|
-
}.should_not raise_error
|
366
|
+
}.should_not raise_error
|
367
367
|
lambda {
|
368
368
|
@meta.attribute("db/mysql/databases", :required => 'optional')
|
369
|
-
}.should_not raise_error
|
369
|
+
}.should_not raise_error
|
370
370
|
end
|
371
371
|
|
372
372
|
it "should convert required true to required" do
|
373
373
|
lambda {
|
374
374
|
@meta.attribute("db/mysql/databases", :required => true)
|
375
|
-
}.should_not raise_error
|
375
|
+
}.should_not raise_error
|
376
376
|
#attrib = @meta.attributes["db/mysql/databases"][:required].should == "required"
|
377
377
|
end
|
378
378
|
|
379
379
|
it "should convert required false to optional" do
|
380
380
|
lambda {
|
381
381
|
@meta.attribute("db/mysql/databases", :required => false)
|
382
|
-
}.should_not raise_error
|
382
|
+
}.should_not raise_error
|
383
383
|
#attrib = @meta.attributes["db/mysql/databases"][:required].should == "optional"
|
384
384
|
end
|
385
385
|
|
@@ -391,7 +391,7 @@ describe Chef::Cookbook::Metadata do
|
|
391
391
|
it "should make sure recipes is an array" do
|
392
392
|
lambda {
|
393
393
|
@meta.attribute("db/mysql/databases", :recipes => [])
|
394
|
-
}.should_not raise_error
|
394
|
+
}.should_not raise_error
|
395
395
|
lambda {
|
396
396
|
@meta.attribute("db/mysql/databases", :required => Hash.new)
|
397
397
|
}.should raise_error(ArgumentError)
|
@@ -405,13 +405,13 @@ describe Chef::Cookbook::Metadata do
|
|
405
405
|
it "should allow the default value to be a string, array, or hash" do
|
406
406
|
lambda {
|
407
407
|
@meta.attribute("db/mysql/databases", :default => [])
|
408
|
-
}.should_not raise_error
|
408
|
+
}.should_not raise_error
|
409
409
|
lambda {
|
410
410
|
@meta.attribute("db/mysql/databases", :default => {})
|
411
|
-
}.should_not raise_error
|
411
|
+
}.should_not raise_error
|
412
412
|
lambda {
|
413
413
|
@meta.attribute("db/mysql/databases", :default => "alice in chains")
|
414
|
-
}.should_not raise_error
|
414
|
+
}.should_not raise_error
|
415
415
|
lambda {
|
416
416
|
@meta.attribute("db/mysql/databases", :required => :not_gonna_do_it)
|
417
417
|
}.should raise_error(ArgumentError)
|
@@ -441,14 +441,14 @@ describe Chef::Cookbook::Metadata do
|
|
441
441
|
:default => "b"
|
442
442
|
}
|
443
443
|
@meta.attribute("db/mysql/databases", attrs)
|
444
|
-
}.should_not raise_error
|
444
|
+
}.should_not raise_error
|
445
445
|
lambda {
|
446
446
|
attrs = {
|
447
447
|
:choice => [ "a", "b", "c", "d", "e"],
|
448
448
|
:default => ["b", "d"]
|
449
449
|
}
|
450
450
|
@meta.attribute("db/mysql/databases", attrs)
|
451
|
-
}.should_not raise_error
|
451
|
+
}.should_not raise_error
|
452
452
|
end
|
453
453
|
|
454
454
|
it "should error if default is not a choice" do
|