chefspec 5.0.0 → 7.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +17 -25
- data/CHANGELOG.md +506 -371
- data/Gemfile +9 -0
- data/README.md +118 -75
- data/chefspec.gemspec +4 -5
- data/examples/apt_package/recipes/purge.rb +2 -2
- data/examples/apt_package/recipes/reconfig.rb +2 -2
- data/examples/apt_package/recipes/remove.rb +2 -2
- data/examples/apt_package/recipes/upgrade.rb +2 -2
- data/examples/apt_package/spec/install_spec.rb +4 -1
- data/examples/apt_package/spec/purge_spec.rb +4 -1
- data/examples/apt_package/spec/reconfig_spec.rb +4 -1
- data/examples/apt_package/spec/remove_spec.rb +4 -1
- data/examples/apt_package/spec/upgrade_spec.rb +4 -1
- data/examples/apt_repository/spec/add_spec.rb +4 -1
- data/examples/apt_repository/spec/remove_spec.rb +4 -1
- data/examples/apt_update/recipes/periodic.rb +1 -1
- data/examples/apt_update/spec/periodic_spec.rb +5 -2
- data/examples/apt_update/spec/update_spec.rb +4 -1
- data/examples/attributes/spec/default_spec.rb +1 -1
- data/examples/batch/recipes/run.rb +0 -4
- data/examples/batch/spec/run_spec.rb +4 -10
- data/examples/bff_package/recipes/install.rb +13 -0
- data/examples/bff_package/recipes/purge.rb +13 -0
- data/examples/bff_package/recipes/remove.rb +13 -0
- data/examples/bff_package/recipes/upgrade.rb +13 -0
- data/examples/bff_package/spec/install_spec.rb +23 -0
- data/examples/bff_package/spec/purge_spec.rb +19 -0
- data/examples/bff_package/spec/remove_spec.rb +19 -0
- data/examples/bff_package/spec/upgrade_spec.rb +19 -0
- data/examples/cab_package/recipes/install.rb +13 -0
- data/examples/cab_package/recipes/remove.rb +13 -0
- data/examples/cab_package/spec/install_spec.rb +26 -0
- data/examples/cab_package/spec/remove_spec.rb +22 -0
- data/examples/cached/spec/default_spec.rb +1 -1
- data/examples/chef_gem/spec/install_spec.rb +1 -1
- data/examples/chef_gem/spec/purge_spec.rb +1 -1
- data/examples/chef_gem/spec/reconfig_spec.rb +1 -1
- data/examples/chef_gem/spec/remove_spec.rb +1 -1
- data/examples/chef_gem/spec/upgrade_spec.rb +1 -1
- data/examples/chocolatey_package/spec/install_spec.rb +4 -6
- data/examples/chocolatey_package/spec/remove_spec.rb +4 -6
- data/examples/chocolatey_package/spec/upgrade_spec.rb +4 -6
- data/examples/compile_time/spec/default_spec.rb +1 -1
- data/examples/cookbook_file/spec/create_if_missing_spec.rb +3 -3
- data/examples/cookbook_file/spec/create_spec.rb +3 -3
- data/examples/cookbook_file/spec/delete_spec.rb +1 -1
- data/examples/cookbook_file/spec/touch_spec.rb +1 -1
- data/examples/cron/spec/create_spec.rb +1 -1
- data/examples/cron/spec/delete_spec.rb +1 -1
- data/examples/custom_matcher/providers/thing.rb +1 -1
- data/examples/custom_matcher/spec/install_spec.rb +1 -1
- data/examples/custom_matcher/spec/remove_spec.rb +1 -1
- data/examples/custom_resource/libraries/matchers.rb +5 -0
- data/examples/custom_resource/recipes/default.rb +1 -0
- data/examples/custom_resource/resources/custom_resource.rb +9 -0
- data/examples/custom_resource/spec/default_spec.rb +18 -0
- data/examples/deploy/spec/deploy_spec.rb +1 -1
- data/examples/deploy/spec/force_deploy_spec.rb +1 -1
- data/examples/deploy/spec/rollback_spec.rb +1 -1
- data/examples/directory/spec/create_spec.rb +4 -4
- data/examples/directory/spec/delete_spec.rb +3 -3
- data/examples/dnf_package/recipes/install.rb +13 -0
- data/examples/dnf_package/recipes/purge.rb +13 -0
- data/examples/dnf_package/recipes/remove.rb +13 -0
- data/examples/dnf_package/recipes/upgrade.rb +13 -0
- data/examples/dnf_package/spec/install_spec.rb +26 -0
- data/examples/dnf_package/spec/purge_spec.rb +22 -0
- data/examples/dnf_package/spec/remove_spec.rb +22 -0
- data/examples/dnf_package/spec/upgrade_spec.rb +22 -0
- data/examples/do_nothing/spec/default_spec.rb +1 -1
- data/examples/dpkg_package/spec/install_spec.rb +4 -6
- data/examples/dpkg_package/spec/purge_spec.rb +4 -6
- data/examples/dpkg_package/spec/remove_spec.rb +4 -6
- data/examples/dsc_resource/recipes/{default.rb → run.rb} +6 -6
- data/examples/dsc_resource/spec/{default_spec.rb → run_spec.rb} +8 -10
- data/examples/dsc_script/recipes/run.rb +12 -0
- data/examples/dsc_script/spec/run_spec.rb +16 -0
- data/examples/env/spec/create_spec.rb +4 -6
- data/examples/env/spec/delete_spec.rb +4 -6
- data/examples/env/spec/modify_spec.rb +4 -6
- data/examples/erl_call/spec/run_spec.rb +1 -1
- data/examples/execute/spec/run_spec.rb +1 -1
- data/examples/expect_exception/spec/compile_error_spec.rb +1 -1
- data/examples/expect_exception/spec/converge_error_spec.rb +1 -1
- data/examples/expect_exception/spec/no_error_spec.rb +1 -1
- data/examples/file/spec/create_if_missing_spec.rb +3 -3
- data/examples/file/spec/create_spec.rb +3 -3
- data/examples/file/spec/delete_spec.rb +1 -1
- data/examples/file/spec/touch_spec.rb +1 -1
- data/examples/freebsd_package/spec/install_spec.rb +4 -1
- data/examples/freebsd_package/spec/remove_spec.rb +4 -1
- data/examples/gem_package/spec/install_spec.rb +1 -1
- data/examples/gem_package/spec/purge_spec.rb +1 -1
- data/examples/gem_package/spec/reconfig_spec.rb +1 -1
- data/examples/gem_package/spec/remove_spec.rb +1 -1
- data/examples/gem_package/spec/upgrade_spec.rb +1 -1
- data/examples/git/spec/checkout_spec.rb +1 -1
- data/examples/git/spec/export_spec.rb +1 -1
- data/examples/git/spec/sync_spec.rb +1 -1
- data/examples/group/spec/create_spec.rb +1 -1
- data/examples/group/spec/manage_spec.rb +1 -1
- data/examples/group/spec/modify_spec.rb +1 -1
- data/examples/group/spec/remove_spec.rb +1 -1
- data/examples/guards/spec/default_spec.rb +1 -1
- data/examples/heavy_provider_light_resource/libraries/resource_service.rb +1 -1
- data/examples/heavy_provider_light_resource/recipes/default.rb +1 -2
- data/examples/heavy_provider_light_resource/spec/provider_service_spec.rb +2 -2
- data/examples/homebrew_package/recipes/install.rb +13 -0
- data/examples/homebrew_package/recipes/purge.rb +13 -0
- data/examples/homebrew_package/recipes/remove.rb +13 -0
- data/examples/homebrew_package/recipes/upgrade.rb +13 -0
- data/examples/homebrew_package/spec/install_spec.rb +23 -0
- data/examples/homebrew_package/spec/purge_spec.rb +19 -0
- data/examples/homebrew_package/spec/remove_spec.rb +19 -0
- data/examples/homebrew_package/spec/upgrade_spec.rb +19 -0
- data/examples/http_request/spec/delete_spec.rb +1 -1
- data/examples/http_request/spec/get_spec.rb +1 -1
- data/examples/http_request/spec/head_spec.rb +1 -1
- data/examples/http_request/spec/options_spec.rb +1 -1
- data/examples/http_request/spec/post_spec.rb +1 -1
- data/examples/http_request/spec/put_spec.rb +1 -1
- data/examples/ifconfig/spec/add_spec.rb +1 -1
- data/examples/ifconfig/spec/delete_spec.rb +1 -1
- data/examples/ifconfig/spec/disable_spec.rb +1 -1
- data/examples/ifconfig/spec/enable_spec.rb +1 -1
- data/examples/include_recipe/spec/default_spec.rb +1 -1
- data/examples/ips_package/spec/install_spec.rb +4 -6
- data/examples/ips_package/spec/remove_spec.rb +4 -6
- data/examples/ips_package/spec/upgrade_spec.rb +4 -6
- data/examples/launchd/recipes/create.rb +5 -0
- data/examples/launchd/recipes/create_if_missing.rb +3 -0
- data/examples/launchd/recipes/delete.rb +3 -0
- data/examples/launchd/recipes/disable.rb +3 -0
- data/examples/launchd/recipes/enable.rb +3 -0
- data/examples/launchd/spec/create_if_missing_spec.rb +10 -0
- data/examples/launchd/spec/create_spec.rb +14 -0
- data/examples/launchd/spec/delete_spec.rb +10 -0
- data/examples/launchd/spec/disable_spec.rb +10 -0
- data/examples/launchd/spec/enable_spec.rb +10 -0
- data/examples/link/spec/create_spec.rb +1 -1
- data/examples/link/spec/delete_spec.rb +1 -1
- data/examples/link/spec/link_to_spec.rb +1 -1
- data/examples/log/spec/write_spec.rb +1 -1
- data/examples/macports_package/spec/install_spec.rb +1 -1
- data/examples/macports_package/spec/purge_spec.rb +1 -1
- data/examples/macports_package/spec/remove_spec.rb +1 -1
- data/examples/macports_package/spec/upgrade_spec.rb +1 -1
- data/examples/mdadm/spec/assemble_spec.rb +1 -1
- data/examples/mdadm/spec/create_spec.rb +1 -1
- data/examples/mdadm/spec/stop_spec.rb +1 -1
- data/examples/mount/spec/disable_spec.rb +1 -1
- data/examples/mount/spec/enable_spec.rb +1 -1
- data/examples/mount/spec/mount_spec.rb +1 -1
- data/examples/mount/spec/remount_spec.rb +1 -1
- data/examples/mount/spec/umount_spec.rb +1 -1
- data/examples/msu_package/recipes/install.rb +13 -0
- data/examples/msu_package/recipes/remove.rb +13 -0
- data/examples/msu_package/spec/install_spec.rb +26 -0
- data/examples/msu_package/spec/remove_spec.rb +22 -0
- data/examples/multiple_actions/recipes/reversed.rb +9 -0
- data/examples/multiple_actions/recipes/sequential.rb +5 -3
- data/examples/multiple_actions/spec/default_spec.rb +1 -1
- data/examples/multiple_actions/spec/reversed_spec.rb +17 -0
- data/examples/multiple_actions/spec/sequential_spec.rb +5 -4
- data/examples/multiple_run_action/recipes/default.rb +2 -2
- data/examples/multiple_run_action/spec/default_spec.rb +1 -1
- data/examples/notifications/spec/before_spec.rb +1 -1
- data/examples/notifications/spec/chained_spec.rb +1 -1
- data/examples/notifications/spec/default_spec.rb +1 -1
- data/examples/notifications/spec/delayed_spec.rb +1 -1
- data/examples/notifications/spec/immediately_spec.rb +1 -1
- data/examples/ohai/spec/reload_spec.rb +1 -1
- data/examples/openbsd_package/recipes/install.rb +13 -0
- data/examples/openbsd_package/recipes/purge.rb +13 -0
- data/examples/openbsd_package/recipes/remove.rb +13 -0
- data/examples/openbsd_package/recipes/upgrade.rb +13 -0
- data/examples/openbsd_package/spec/install_spec.rb +23 -0
- data/examples/openbsd_package/spec/purge_spec.rb +19 -0
- data/examples/openbsd_package/spec/remove_spec.rb +19 -0
- data/examples/openbsd_package/spec/upgrade_spec.rb +19 -0
- data/examples/osx_profile/recipes/install.rb +8 -0
- data/examples/osx_profile/recipes/remove.rb +8 -0
- data/examples/osx_profile/spec/install_spec.rb +15 -0
- data/examples/osx_profile/spec/remove_spec.rb +13 -0
- data/examples/package/recipes/install.rb +1 -1
- data/examples/package/recipes/purge.rb +1 -1
- data/examples/package/recipes/reconfig.rb +1 -1
- data/examples/package/recipes/remove.rb +1 -1
- data/examples/package/recipes/upgrade.rb +1 -1
- data/examples/package/spec/install_spec.rb +2 -2
- data/examples/package/spec/purge_spec.rb +2 -2
- data/examples/package/spec/reconfig_spec.rb +2 -2
- data/examples/package/spec/remove_spec.rb +2 -2
- data/examples/package/spec/upgrade_spec.rb +2 -2
- data/examples/pacman_package/spec/install_spec.rb +4 -6
- data/examples/pacman_package/spec/purge_spec.rb +4 -6
- data/examples/pacman_package/spec/remove_spec.rb +4 -6
- data/examples/pacman_package/spec/upgrade_spec.rb +4 -6
- data/examples/paludis_package/recipes/install.rb +13 -0
- data/examples/paludis_package/recipes/purge.rb +13 -0
- data/examples/paludis_package/recipes/remove.rb +13 -0
- data/examples/paludis_package/recipes/upgrade.rb +13 -0
- data/examples/paludis_package/spec/install_spec.rb +23 -0
- data/examples/paludis_package/spec/purge_spec.rb +19 -0
- data/examples/paludis_package/spec/remove_spec.rb +19 -0
- data/examples/paludis_package/spec/upgrade_spec.rb +19 -0
- data/examples/portage_package/spec/install_spec.rb +4 -1
- data/examples/portage_package/spec/purge_spec.rb +4 -1
- data/examples/portage_package/spec/remove_spec.rb +4 -1
- data/examples/portage_package/spec/upgrade_spec.rb +4 -1
- data/examples/powershell_script/recipes/run.rb +0 -4
- data/examples/powershell_script/spec/run_spec.rb +4 -10
- data/examples/reboot/spec/cancel_spec.rb +1 -2
- data/examples/reboot/spec/now_spec.rb +1 -2
- data/examples/reboot/spec/request_spec.rb +1 -2
- data/examples/registry_key/spec/create_if_missing_spec.rb +4 -1
- data/examples/registry_key/spec/create_spec.rb +4 -1
- data/examples/registry_key/spec/delete_key_spec.rb +4 -1
- data/examples/registry_key/spec/delete_spec.rb +4 -1
- data/examples/remote_directory/spec/create_if_missing_spec.rb +1 -1
- data/examples/remote_directory/spec/create_spec.rb +1 -1
- data/examples/remote_directory/spec/delete_spec.rb +1 -1
- data/examples/remote_file/spec/create_if_missing_spec.rb +1 -1
- data/examples/remote_file/spec/create_spec.rb +1 -1
- data/examples/remote_file/spec/delete_spec.rb +1 -1
- data/examples/remote_file/spec/touch_spec.rb +1 -1
- data/examples/render_file/spec/default_spec.rb +1 -1
- data/examples/render_file/spec/template_helpers_spec.rb +1 -1
- data/examples/roles/roles/role.rb +4 -4
- data/examples/roles/spec/default_spec.rb +1 -1
- data/examples/route/spec/add_spec.rb +1 -1
- data/examples/route/spec/delete_spec.rb +1 -1
- data/examples/rpm_package/spec/install_spec.rb +4 -6
- data/examples/rpm_package/spec/remove_spec.rb +4 -6
- data/examples/rpm_package/spec/upgrade_spec.rb +4 -6
- data/examples/ruby_block/recipes/create.rb +8 -0
- data/examples/ruby_block/spec/create_spec.rb +13 -0
- data/examples/ruby_block/spec/run_spec.rb +1 -1
- data/examples/script/recipes/run_bash.rb +0 -4
- data/examples/script/recipes/run_csh.rb +0 -4
- data/examples/script/recipes/run_ksh.rb +9 -0
- data/examples/script/recipes/run_perl.rb +0 -4
- data/examples/script/recipes/run_python.rb +0 -4
- data/examples/script/recipes/run_ruby.rb +0 -4
- data/examples/script/recipes/run_script.rb +0 -4
- data/examples/script/spec/run_bash_spec.rb +1 -5
- data/examples/script/spec/run_csh_spec.rb +1 -5
- data/examples/script/spec/run_ksh_spec.rb +19 -0
- data/examples/script/spec/run_perl_spec.rb +1 -5
- data/examples/script/spec/run_python_spec.rb +1 -5
- data/examples/script/spec/run_ruby_spec.rb +1 -5
- data/examples/script/spec/run_script_spec.rb +1 -5
- data/examples/server/spec/client_spec.rb +2 -2
- data/examples/server/spec/data_bag_spec.rb +9 -11
- data/examples/server/spec/environment_spec.rb +1 -1
- data/examples/server/spec/exotic_port_spec.rb +17 -0
- data/examples/server/spec/node_spec.rb +6 -6
- data/examples/server/spec/render_with_cached_spec.rb +1 -1
- data/examples/server/spec/role_spec.rb +1 -1
- data/examples/server/spec/search_spec.rb +2 -2
- data/examples/service/recipes/disable.rb +1 -1
- data/examples/service/recipes/enable.rb +1 -1
- data/examples/service/recipes/reload.rb +1 -1
- data/examples/service/recipes/restart.rb +1 -1
- data/examples/service/recipes/start.rb +1 -1
- data/examples/service/recipes/stop.rb +1 -1
- data/examples/service/spec/disable_spec.rb +1 -1
- data/examples/service/spec/enable_spec.rb +1 -1
- data/examples/service/spec/reload_spec.rb +1 -1
- data/examples/service/spec/restart_spec.rb +1 -1
- data/examples/service/spec/start_spec.rb +1 -1
- data/examples/service/spec/stop_spec.rb +1 -1
- data/examples/smartos_package/spec/install_spec.rb +4 -1
- data/examples/smartos_package/spec/remove_spec.rb +4 -1
- data/examples/smartos_package/spec/upgrade_spec.rb +4 -1
- data/examples/solaris_package/recipes/upgrade.rb +13 -0
- data/examples/solaris_package/spec/install_spec.rb +4 -1
- data/examples/solaris_package/spec/remove_spec.rb +4 -1
- data/examples/solaris_package/spec/upgrade_spec.rb +22 -0
- data/examples/state_attrs/providers/lwrp.rb +0 -1
- data/examples/state_attrs/spec/default_spec.rb +1 -1
- data/examples/step_into/spec/default_spec.rb +4 -4
- data/examples/stub_command/spec/default_spec.rb +3 -3
- data/examples/stub_data_bag/spec/default_spec.rb +3 -3
- data/examples/stub_data_bag_item/spec/default_spec.rb +5 -5
- data/examples/stub_search/recipes/block.rb +3 -0
- data/examples/stub_search/recipes/default.rb +2 -5
- data/examples/stub_search/spec/block_spec.rb +27 -0
- data/examples/stub_search/spec/default_spec.rb +5 -5
- data/examples/subscribes/spec/before_spec.rb +1 -1
- data/examples/subscribes/spec/chained_spec.rb +1 -1
- data/examples/subscribes/spec/default_spec.rb +1 -2
- data/examples/subscribes/spec/delayed_spec.rb +1 -1
- data/examples/subscribes/spec/immediately_spec.rb +1 -1
- data/examples/subversion/spec/checkout_spec.rb +1 -1
- data/examples/subversion/spec/export_spec.rb +1 -1
- data/examples/subversion/spec/force_export_spec.rb +1 -1
- data/examples/subversion/spec/sync_spec.rb +1 -1
- data/examples/systemd_unit/recipes/create.rb +3 -0
- data/examples/systemd_unit/recipes/delete.rb +3 -0
- data/examples/systemd_unit/recipes/disable.rb +3 -0
- data/examples/systemd_unit/recipes/enable.rb +3 -0
- data/examples/systemd_unit/recipes/mask.rb +3 -0
- data/examples/systemd_unit/recipes/reload_or_restart.rb +3 -0
- data/examples/systemd_unit/recipes/reload_or_try_restart.rb +3 -0
- data/examples/systemd_unit/recipes/restart.rb +3 -0
- data/examples/systemd_unit/recipes/start.rb +3 -0
- data/examples/systemd_unit/recipes/stop.rb +3 -0
- data/examples/systemd_unit/recipes/try_restart.rb +3 -0
- data/examples/systemd_unit/recipes/unmask.rb +3 -0
- data/examples/systemd_unit/spec/create_spec.rb +10 -0
- data/examples/systemd_unit/spec/delete_spec.rb +10 -0
- data/examples/systemd_unit/spec/disable_spec.rb +10 -0
- data/examples/systemd_unit/spec/enable_spec.rb +10 -0
- data/examples/systemd_unit/spec/mask_spec.rb +10 -0
- data/examples/systemd_unit/spec/reload_or_restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/reload_or_try_restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/start_spec.rb +10 -0
- data/examples/systemd_unit/spec/stop_spec.rb +10 -0
- data/examples/systemd_unit/spec/try_restart_spec.rb +10 -0
- data/examples/systemd_unit/spec/unmask_spec.rb +10 -0
- data/examples/template/spec/create_if_missing_spec.rb +3 -3
- data/examples/template/spec/create_spec.rb +3 -3
- data/examples/template/spec/delete_spec.rb +1 -1
- data/examples/template/spec/touch_spec.rb +1 -1
- data/examples/use_inline_resources/spec/default_spec.rb +3 -3
- data/examples/user/spec/create_spec.rb +4 -1
- data/examples/user/spec/lock_spec.rb +4 -1
- data/examples/user/spec/manage_spec.rb +4 -1
- data/examples/user/spec/modify_spec.rb +4 -1
- data/examples/user/spec/remove_spec.rb +4 -1
- data/examples/user/spec/unlock_spec.rb +4 -1
- data/examples/windows_package/spec/install_spec.rb +4 -6
- data/examples/windows_package/spec/remove_spec.rb +4 -6
- data/examples/windows_service/spec/configure_startup_spec.rb +4 -6
- data/examples/windows_service/spec/disable_spec.rb +4 -6
- data/examples/windows_service/spec/enable_spec.rb +4 -6
- data/examples/windows_service/spec/reload_spec.rb +4 -6
- data/examples/windows_service/spec/restart_spec.rb +4 -6
- data/examples/windows_service/spec/start_spec.rb +4 -6
- data/examples/windows_service/spec/stop_spec.rb +4 -6
- data/examples/yum_package/spec/install_spec.rb +4 -1
- data/examples/yum_package/spec/purge_spec.rb +4 -1
- data/examples/yum_package/spec/remove_spec.rb +4 -1
- data/examples/yum_package/spec/upgrade_spec.rb +4 -1
- data/examples/yum_repository/recipes/add.rb +8 -0
- data/examples/yum_repository/recipes/create.rb +8 -0
- data/examples/yum_repository/recipes/delete.rb +3 -0
- data/examples/yum_repository/recipes/makecache.rb +3 -0
- data/examples/yum_repository/recipes/remove.rb +7 -0
- data/examples/yum_repository/spec/add_spec.rb +12 -0
- data/examples/yum_repository/spec/create_spec.rb +17 -0
- data/examples/yum_repository/spec/delete_spec.rb +12 -0
- data/examples/yum_repository/spec/makecache_spec.rb +12 -0
- data/examples/yum_repository/spec/remove_spec.rb +12 -0
- data/examples/zypper_package/recipes/install.rb +13 -0
- data/examples/zypper_package/recipes/purge.rb +13 -0
- data/examples/zypper_package/recipes/remove.rb +13 -0
- data/examples/zypper_package/recipes/upgrade.rb +13 -0
- data/examples/zypper_package/spec/install_spec.rb +23 -0
- data/examples/zypper_package/spec/purge_spec.rb +19 -0
- data/examples/zypper_package/spec/remove_spec.rb +19 -0
- data/examples/zypper_package/spec/upgrade_spec.rb +19 -0
- data/features/apt_repository.feature +15 -0
- data/features/apt_update.feature +13 -0
- data/features/attributes.feature +1 -1
- data/features/bff_package.feature +12 -0
- data/features/cab_package.feature +21 -0
- data/features/chocolatey_package.feature +1 -6
- data/features/compile_time.feature +1 -1
- data/features/custom_resource.feature +7 -0
- data/features/dnf_package.feature +26 -0
- data/features/dsc_resource.feature +5 -4
- data/features/dsc_script.feature +10 -0
- data/features/exotic_zero_port.feature +7 -0
- data/features/homebrew_package.feature +12 -0
- data/features/launchd.feature +17 -0
- data/features/msu_package.feature +23 -0
- data/features/multiple_actions.feature +1 -0
- data/features/notifications.feature +0 -7
- data/features/openbsd_package.feature +12 -0
- data/features/osx_profile.feature +13 -0
- data/features/paludis_package.feature +12 -0
- data/features/roles.feature +1 -1
- data/features/ruby_block.feature +1 -0
- data/features/script.feature +1 -0
- data/features/server_on_disk.feature +16 -0
- data/features/solaris_package.feature +1 -0
- data/features/stub_search.feature +1 -1
- data/features/subscribes.feature +0 -7
- data/features/support/env.rb +8 -0
- data/features/support/exotic_zero_port.rb +3 -0
- data/features/support/on_disk.rb +7 -0
- data/features/systemd_unit.feature +27 -0
- data/features/windows_package.feature +0 -4
- data/features/yum_repository.feature +23 -0
- data/features/{easy_install_package.feature → zypper_package.feature} +2 -2
- data/lib/chefspec/api/bff_package.rb +154 -0
- data/lib/chefspec/api/cab_package.rb +80 -0
- data/lib/chefspec/api/dnf_package.rb +154 -0
- data/lib/chefspec/api/dsc_script.rb +37 -0
- data/lib/chefspec/api/homebrew_package.rb +154 -0
- data/lib/chefspec/api/launchd.rb +151 -0
- data/lib/chefspec/api/msu_package.rb +81 -0
- data/lib/chefspec/api/openbsd_package.rb +155 -0
- data/lib/chefspec/api/osx_profile.rb +63 -0
- data/lib/chefspec/api/paludis_package.rb +155 -0
- data/lib/chefspec/api/ruby_block.rb +31 -0
- data/lib/chefspec/api/script.rb +39 -0
- data/lib/chefspec/api/solaris_package.rb +37 -0
- data/lib/chefspec/api/systemd_unit.rb +353 -0
- data/lib/chefspec/api/yum_repository.rb +130 -0
- data/lib/chefspec/api/zypper_package.rb +154 -0
- data/lib/chefspec/api.rb +15 -0
- data/lib/chefspec/coverage.rb +25 -7
- data/lib/chefspec/extensions/chef/data_query.rb +6 -1
- data/lib/chefspec/extensions/chef/lwrp_base.rb +21 -35
- data/lib/chefspec/macros.rb +1 -1
- data/lib/chefspec/matchers/resource_matcher.rb +20 -27
- data/lib/chefspec/rspec.rb +3 -0
- data/lib/chefspec/server_methods.rb +9 -12
- data/lib/chefspec/server_runner.rb +2 -42
- data/lib/chefspec/solo_runner.rb +11 -10
- data/lib/chefspec/version.rb +1 -1
- data/lib/chefspec/zero_server.rb +140 -0
- data/lib/chefspec.rb +0 -1
- data/spec/unit/macros_spec.rb +2 -2
- data/spec/unit/solo_runner_spec.rb +3 -2
- data/templates/errors/may_need_to_specify_platform.erb +1 -1
- metadata +195 -26
- data/examples/easy_install_package/recipes/install.rb +0 -13
- data/examples/easy_install_package/recipes/purge.rb +0 -13
- data/examples/easy_install_package/recipes/remove.rb +0 -13
- data/examples/easy_install_package/recipes/upgrade.rb +0 -13
- data/examples/easy_install_package/spec/install_spec.rb +0 -23
- data/examples/easy_install_package/spec/purge_spec.rb +0 -19
- data/examples/easy_install_package/spec/remove_spec.rb +0 -19
- data/examples/easy_install_package/spec/upgrade_spec.rb +0 -19
- data/gemfiles/chefspec.gemfile +0 -15
- data/lib/chefspec/chef_backwards_compat.rb +0 -79
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
module ChefSpec::API
|
|
2
|
+
# @since 5.1.0
|
|
3
|
+
module HomebrewPackageMatchers
|
|
4
|
+
ChefSpec.define_matcher :homebrew_package
|
|
5
|
+
|
|
6
|
+
#
|
|
7
|
+
# Assert that a +homebrew_package+ resource exists in the Chef run with the
|
|
8
|
+
# action +:install+. Given a Chef Recipe that installs "community-zero" as a
|
|
9
|
+
# +homebrew_package+:
|
|
10
|
+
#
|
|
11
|
+
# homebrew_package 'community-zero' do
|
|
12
|
+
# action :install
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
# The Examples section demonstrates the different ways to test a
|
|
16
|
+
# +homebrew_package+ resource with ChefSpec.
|
|
17
|
+
#
|
|
18
|
+
# @example Assert that a +homebrew_package+ was installed
|
|
19
|
+
# expect(chef_run).to install_homebrew_package('community-zero')
|
|
20
|
+
#
|
|
21
|
+
# @example Assert that a +homebrew_package+ was installed with predicate matchers
|
|
22
|
+
# expect(chef_run).to install_homebrew_package('community-zero').with_version('1.2.3')
|
|
23
|
+
#
|
|
24
|
+
# @example Assert that a +homebrew_package+ was installed with attributes
|
|
25
|
+
# expect(chef_run).to install_homebrew_package('community-zero').with(version: '1.2.3')
|
|
26
|
+
#
|
|
27
|
+
# @example Assert that a +homebrew_package+ was installed using a regex
|
|
28
|
+
# expect(chef_run).to install_homebrew_package('community-zero').with(version: /(\d+\.){2}\.\d+/)
|
|
29
|
+
#
|
|
30
|
+
# @example Assert that a +homebrew_package+ was _not_ installed
|
|
31
|
+
# expect(chef_run).to_not install_homebrew_package('community-zero')
|
|
32
|
+
#
|
|
33
|
+
#
|
|
34
|
+
# @param [String, Regex] resource_name
|
|
35
|
+
# the name of the resource to match
|
|
36
|
+
#
|
|
37
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
38
|
+
#
|
|
39
|
+
def install_homebrew_package(resource_name)
|
|
40
|
+
ChefSpec::Matchers::ResourceMatcher.new(:homebrew_package, :install, resource_name)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
#
|
|
44
|
+
# Assert that a +homebrew_package+ resource exists in the Chef run with the
|
|
45
|
+
# action +:purge+. Given a Chef Recipe that purges "community-zero" as a
|
|
46
|
+
# +homebrew_package+:
|
|
47
|
+
#
|
|
48
|
+
# homebrew_package 'community-zero' do
|
|
49
|
+
# action :purge
|
|
50
|
+
# end
|
|
51
|
+
#
|
|
52
|
+
# The Examples section demonstrates the different ways to test a
|
|
53
|
+
# +homebrew_package+ resource with ChefSpec.
|
|
54
|
+
#
|
|
55
|
+
# @example Assert that a +homebrew_package+ was purgeed
|
|
56
|
+
# expect(chef_run).to purge_homebrew_package('community-zero')
|
|
57
|
+
#
|
|
58
|
+
# @example Assert that a +homebrew_package+ was purgeed with predicate matchers
|
|
59
|
+
# expect(chef_run).to purge_homebrew_package('community-zero').with_version('1.2.3')
|
|
60
|
+
#
|
|
61
|
+
# @example Assert that a +homebrew_package+ was purgeed with attributes
|
|
62
|
+
# expect(chef_run).to purge_homebrew_package('community-zero').with(version: '1.2.3')
|
|
63
|
+
#
|
|
64
|
+
# @example Assert that a +homebrew_package+ was purgeed using a regex
|
|
65
|
+
# expect(chef_run).to purge_homebrew_package('community-zero').with(version: /(\d+\.){2}\.\d+/)
|
|
66
|
+
#
|
|
67
|
+
# @example Assert that a +homebrew_package+ was _not_ purgeed
|
|
68
|
+
# expect(chef_run).to_not purge_homebrew_package('community-zero')
|
|
69
|
+
#
|
|
70
|
+
#
|
|
71
|
+
# @param [String, Regex] resource_name
|
|
72
|
+
# the name of the resource to match
|
|
73
|
+
#
|
|
74
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
75
|
+
#
|
|
76
|
+
def purge_homebrew_package(resource_name)
|
|
77
|
+
ChefSpec::Matchers::ResourceMatcher.new(:homebrew_package, :purge, resource_name)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
#
|
|
81
|
+
# Assert that a +homebrew_package+ resource exists in the Chef run with the
|
|
82
|
+
# action +:remove+. Given a Chef Recipe that removes "community-zero" as a
|
|
83
|
+
# +homebrew_package+:
|
|
84
|
+
#
|
|
85
|
+
# homebrew_package 'community-zero' do
|
|
86
|
+
# action :remove
|
|
87
|
+
# end
|
|
88
|
+
#
|
|
89
|
+
# The Examples section demonstrates the different ways to test a
|
|
90
|
+
# +homebrew_package+ resource with ChefSpec.
|
|
91
|
+
#
|
|
92
|
+
# @example Assert that a +homebrew_package+ was removeed
|
|
93
|
+
# expect(chef_run).to remove_homebrew_package('community-zero')
|
|
94
|
+
#
|
|
95
|
+
# @example Assert that a +homebrew_package+ was removeed with predicate matchers
|
|
96
|
+
# expect(chef_run).to remove_homebrew_package('community-zero').with_version('1.2.3')
|
|
97
|
+
#
|
|
98
|
+
# @example Assert that a +homebrew_package+ was removeed with attributes
|
|
99
|
+
# expect(chef_run).to remove_homebrew_package('community-zero').with(version: '1.2.3')
|
|
100
|
+
#
|
|
101
|
+
# @example Assert that a +homebrew_package+ was removeed using a regex
|
|
102
|
+
# expect(chef_run).to remove_homebrew_package('community-zero').with(version: /(\d+\.){2}\.\d+/)
|
|
103
|
+
#
|
|
104
|
+
# @example Assert that a +homebrew_package+ was _not_ removeed
|
|
105
|
+
# expect(chef_run).to_not remove_homebrew_package('community-zero')
|
|
106
|
+
#
|
|
107
|
+
#
|
|
108
|
+
# @param [String, Regex] resource_name
|
|
109
|
+
# the name of the resource to match
|
|
110
|
+
#
|
|
111
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
112
|
+
#
|
|
113
|
+
def remove_homebrew_package(resource_name)
|
|
114
|
+
ChefSpec::Matchers::ResourceMatcher.new(:homebrew_package, :remove, resource_name)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
#
|
|
118
|
+
# Assert that a +homebrew_package+ resource exists in the Chef run with the
|
|
119
|
+
# action +:upgrade+. Given a Chef Recipe that upgrades "community-zero" as a
|
|
120
|
+
# +homebrew_package+:
|
|
121
|
+
#
|
|
122
|
+
# homebrew_package 'community-zero' do
|
|
123
|
+
# action :upgrade
|
|
124
|
+
# end
|
|
125
|
+
#
|
|
126
|
+
# The Examples section demonstrates the different ways to test a
|
|
127
|
+
# +homebrew_package+ resource with ChefSpec.
|
|
128
|
+
#
|
|
129
|
+
# @example Assert that a +homebrew_package+ was upgradeed
|
|
130
|
+
# expect(chef_run).to upgrade_homebrew_package('community-zero')
|
|
131
|
+
#
|
|
132
|
+
# @example Assert that a +homebrew_package+ was upgradeed with predicate matchers
|
|
133
|
+
# expect(chef_run).to upgrade_homebrew_package('community-zero').with_version('1.2.3')
|
|
134
|
+
#
|
|
135
|
+
# @example Assert that a +homebrew_package+ was upgradeed with attributes
|
|
136
|
+
# expect(chef_run).to upgrade_homebrew_package('community-zero').with(version: '1.2.3')
|
|
137
|
+
#
|
|
138
|
+
# @example Assert that a +homebrew_package+ was upgradeed using a regex
|
|
139
|
+
# expect(chef_run).to upgrade_homebrew_package('community-zero').with(version: /(\d+\.){2}\.\d+/)
|
|
140
|
+
#
|
|
141
|
+
# @example Assert that a +homebrew_package+ was _not_ upgradeed
|
|
142
|
+
# expect(chef_run).to_not upgrade_homebrew_package('community-zero')
|
|
143
|
+
#
|
|
144
|
+
#
|
|
145
|
+
# @param [String, Regex] resource_name
|
|
146
|
+
# the name of the resource to match
|
|
147
|
+
#
|
|
148
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
149
|
+
#
|
|
150
|
+
def upgrade_homebrew_package(resource_name)
|
|
151
|
+
ChefSpec::Matchers::ResourceMatcher.new(:homebrew_package, :upgrade, resource_name)
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
module ChefSpec::API
|
|
2
|
+
# @since 5.1.0
|
|
3
|
+
module LaunchdMatchers
|
|
4
|
+
ChefSpec.define_matcher :launchd
|
|
5
|
+
|
|
6
|
+
#
|
|
7
|
+
# Assert that a +launchd+ resource exists in the Chef run with the
|
|
8
|
+
# action +:create+. Given a Chef Recipe that creates the launchd daemon
|
|
9
|
+
# "com.chef.every15":
|
|
10
|
+
#
|
|
11
|
+
# launchd 'com.chef.every15' do
|
|
12
|
+
# action :create
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
# The Examples section demonstrates the different ways to test a
|
|
16
|
+
# +launchd+ resource with ChefSpec.
|
|
17
|
+
#
|
|
18
|
+
# @example Assert that a +launchd+ was created
|
|
19
|
+
# expect(chef_run).to create_launchd('com.chef.every15')
|
|
20
|
+
#
|
|
21
|
+
# @example Assert that a +launchd+ was _not_ created
|
|
22
|
+
# expect(chef_run).to_not create_launchd('com.chef.every15')
|
|
23
|
+
#
|
|
24
|
+
#
|
|
25
|
+
# @param [String, Regex] resource_name
|
|
26
|
+
# the name of the resource to match
|
|
27
|
+
#
|
|
28
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
29
|
+
#
|
|
30
|
+
|
|
31
|
+
def create_launchd(resource_name)
|
|
32
|
+
ChefSpec::Matchers::ResourceMatcher.new(:launchd, :create, resource_name)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
#
|
|
36
|
+
# Assert that a +launchd+ resource exists in the Chef run with the
|
|
37
|
+
# action +:create_if_missing+. Given a Chef Recipe that creates if missing
|
|
38
|
+
# the launchd daemon "com.chef.every15":
|
|
39
|
+
#
|
|
40
|
+
# launchd 'com.chef.every15' do
|
|
41
|
+
# action :create_if_missing
|
|
42
|
+
# end
|
|
43
|
+
#
|
|
44
|
+
# The Examples section demonstrates the different ways to test a
|
|
45
|
+
# +launchd+ resource with ChefSpec.
|
|
46
|
+
#
|
|
47
|
+
# @example Assert that a +launchd+ was created
|
|
48
|
+
# expect(chef_run).to create_if_missing_launchd('com.chef.every15')
|
|
49
|
+
#
|
|
50
|
+
# @example Assert that a +launchd+ was _not_ created
|
|
51
|
+
# expect(chef_run).to_not create_if_missing_launchd('com.chef.every15')
|
|
52
|
+
#
|
|
53
|
+
#
|
|
54
|
+
# @param [String, Regex] resource_name
|
|
55
|
+
# the name of the resource to match
|
|
56
|
+
#
|
|
57
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
58
|
+
#
|
|
59
|
+
|
|
60
|
+
def create_if_missing_launchd(resource_name)
|
|
61
|
+
ChefSpec::Matchers::ResourceMatcher.new(:launchd, :create_if_missing, resource_name)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
#
|
|
65
|
+
# Assert that a +launchd+ resource exists in the Chef run with the
|
|
66
|
+
# action +:delete+. Given a Chef Recipe that deletes the launchd daemon
|
|
67
|
+
# "com.chef.every15":
|
|
68
|
+
#
|
|
69
|
+
# launchd 'com.chef.every15' do
|
|
70
|
+
# action :delete
|
|
71
|
+
# end
|
|
72
|
+
#
|
|
73
|
+
# The Examples section demonstrates the different ways to test a
|
|
74
|
+
# +launchd+ resource with ChefSpec.
|
|
75
|
+
#
|
|
76
|
+
# @example Assert that a +launchd+ was deleted
|
|
77
|
+
# expect(chef_run).to delete_launchd('com.chef.every15')
|
|
78
|
+
#
|
|
79
|
+
# @example Assert that a +launchd+ was _not_ deleted
|
|
80
|
+
# expect(chef_run).to_not delete_launchd('com.chef.every15')
|
|
81
|
+
#
|
|
82
|
+
#
|
|
83
|
+
# @param [String, Regex] resource_name
|
|
84
|
+
# the name of the resource to match
|
|
85
|
+
#
|
|
86
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
87
|
+
#
|
|
88
|
+
|
|
89
|
+
def delete_launchd(resource_name)
|
|
90
|
+
ChefSpec::Matchers::ResourceMatcher.new(:launchd, :delete, resource_name)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
#
|
|
94
|
+
# Assert that a +launchd+ resource exists in the Chef run with the
|
|
95
|
+
# action +:disable+. Given a Chef Recipe that disables the launchd daemon
|
|
96
|
+
# "com.chef.every15":
|
|
97
|
+
#
|
|
98
|
+
# launchd 'com.chef.every15' do
|
|
99
|
+
# action :disable
|
|
100
|
+
# end
|
|
101
|
+
#
|
|
102
|
+
# The Examples section demonstrates the different ways to test a
|
|
103
|
+
# +launchd+ resource with ChefSpec.
|
|
104
|
+
#
|
|
105
|
+
# @example Assert that a +launchd+ was disabled
|
|
106
|
+
# expect(chef_run).to disable_launchd('com.chef.every15')
|
|
107
|
+
#
|
|
108
|
+
# @example Assert that a +launchd+ was _not_ disabled
|
|
109
|
+
# expect(chef_run).to_not disable_launchd('com.chef.every15')
|
|
110
|
+
#
|
|
111
|
+
#
|
|
112
|
+
# @param [String, Regex] resource_name
|
|
113
|
+
# the name of the resource to match
|
|
114
|
+
#
|
|
115
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
116
|
+
#
|
|
117
|
+
|
|
118
|
+
def disable_launchd(resource_name)
|
|
119
|
+
ChefSpec::Matchers::ResourceMatcher.new(:launchd, :disable, resource_name)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
#
|
|
123
|
+
# Assert that a +launchd+ resource exists in the Chef run with the
|
|
124
|
+
# action +:enable+. Given a Chef Recipe that enables the launchd daemon
|
|
125
|
+
# "com.chef.every15":
|
|
126
|
+
#
|
|
127
|
+
# launchd 'com.chef.every15' do
|
|
128
|
+
# action :enables
|
|
129
|
+
# end
|
|
130
|
+
#
|
|
131
|
+
# The Examples section demonstrates the different ways to test a
|
|
132
|
+
# +launchd+ resource with ChefSpec.
|
|
133
|
+
#
|
|
134
|
+
# @example Assert that a +launchd+ was enabled
|
|
135
|
+
# expect(chef_run).to enable_launchd('com.chef.every15')
|
|
136
|
+
#
|
|
137
|
+
# @example Assert that a +launchd+ was _not_ enabled
|
|
138
|
+
# expect(chef_run).to_not enable_launchd('com.chef.every15')
|
|
139
|
+
#
|
|
140
|
+
#
|
|
141
|
+
# @param [String, Regex] resource_name
|
|
142
|
+
# the name of the resource to match
|
|
143
|
+
#
|
|
144
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
145
|
+
#
|
|
146
|
+
|
|
147
|
+
def enable_launchd(resource_name)
|
|
148
|
+
ChefSpec::Matchers::ResourceMatcher.new(:launchd, :enable, resource_name)
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
module ChefSpec::API
|
|
2
|
+
# @since 6.0.0
|
|
3
|
+
module MsuPackageMatchers
|
|
4
|
+
ChefSpec.define_matcher :msu_package
|
|
5
|
+
|
|
6
|
+
#
|
|
7
|
+
# Assert that a +msu_package+ resource exists in the Chef run with the
|
|
8
|
+
# action +:install+. Given a Chef Recipe that installs "KB2959977" as a
|
|
9
|
+
# +msu_package+:
|
|
10
|
+
#
|
|
11
|
+
# msu_package 'KB2959977' do
|
|
12
|
+
# source 'C:\Windows8.1-KB2959977-x64.msu'
|
|
13
|
+
# action :install
|
|
14
|
+
# end
|
|
15
|
+
#
|
|
16
|
+
# The Examples section demonstrates the different ways to test a
|
|
17
|
+
# +msu_package+ resource with ChefSpec.
|
|
18
|
+
#
|
|
19
|
+
# @example Assert that a +msu_package+ was installed
|
|
20
|
+
# expect(chef_run).to install_msu_package('KB2959977')
|
|
21
|
+
#
|
|
22
|
+
# @example Assert that a +msu_package+ was installed with predicate matchers
|
|
23
|
+
# expect(chef_run).to install_msu_package('KB2959977').with_source('C:\Windows8.1-KB2959977-x64.msu')
|
|
24
|
+
#
|
|
25
|
+
# @example Assert that a +msu_package+ was installed with attributes
|
|
26
|
+
# expect(chef_run).to install_msu_package('KB2959977').with(source: 'C:\Windows8.1-KB2959977-x64.msu')
|
|
27
|
+
#
|
|
28
|
+
# @example Assert that a +msu_package+ was installed using a regex
|
|
29
|
+
# expect(chef_run).to install_msu_package('KB2959977').with(source: /.*KB2959977.*/)
|
|
30
|
+
#
|
|
31
|
+
# @example Assert that a +msu_package+ was _not_ installed
|
|
32
|
+
# expect(chef_run).to_not install_msu_package('KB2959977')
|
|
33
|
+
#
|
|
34
|
+
#
|
|
35
|
+
# @param [String, Regex] resource_name
|
|
36
|
+
# the name of the resource to match
|
|
37
|
+
#
|
|
38
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
39
|
+
#
|
|
40
|
+
def install_msu_package(resource_name)
|
|
41
|
+
ChefSpec::Matchers::ResourceMatcher.new(:msu_package, :install, resource_name)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
#
|
|
45
|
+
# Assert that a +msu_package+ resource exists in the Chef run with the
|
|
46
|
+
# action +:remove+. Given a Chef Recipe that removes "KB2959977" as a
|
|
47
|
+
# +msu_package+:
|
|
48
|
+
#
|
|
49
|
+
# msu_package 'KB2959977' do
|
|
50
|
+
# action :remove
|
|
51
|
+
# end
|
|
52
|
+
#
|
|
53
|
+
# The Examples section demonstrates the different ways to test a
|
|
54
|
+
# +msu_package+ resource with ChefSpec.
|
|
55
|
+
#
|
|
56
|
+
# @example Assert that a +msu_package+ was removed
|
|
57
|
+
# expect(chef_run).to remove_msu_package('KB2959977')
|
|
58
|
+
#
|
|
59
|
+
# @example Assert that a +msu_package+ was removed with predicate matchers
|
|
60
|
+
# expect(chef_run).to remove_msu_package('KB2959977').with_source('C:\Windows8.1-KB2959977-x64.msu')
|
|
61
|
+
#
|
|
62
|
+
# @example Assert that a +msu_package+ was removed with attributes
|
|
63
|
+
# expect(chef_run).to remove_msu_package('KB2959977').with(source: 'C:\Windows8.1-KB2959977-x64.msu')
|
|
64
|
+
#
|
|
65
|
+
# @example Assert that a +msu_package+ was removed using a regex
|
|
66
|
+
# expect(chef_run).to remove_msu_package('KB2959977').with(source: /.*KB2959977.*/)
|
|
67
|
+
#
|
|
68
|
+
# @example Assert that a +msu_package+ was _not_ removed
|
|
69
|
+
# expect(chef_run).to_not remove_msu_package('KB2959977')
|
|
70
|
+
#
|
|
71
|
+
#
|
|
72
|
+
# @param [String, Regex] resource_name
|
|
73
|
+
# the name of the resource to match
|
|
74
|
+
#
|
|
75
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
76
|
+
#
|
|
77
|
+
def remove_msu_package(resource_name)
|
|
78
|
+
ChefSpec::Matchers::ResourceMatcher.new(:msu_package, :remove, resource_name)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
module ChefSpec::API
|
|
2
|
+
# @since 5.1.0
|
|
3
|
+
module OpenbsdPackageMatchers
|
|
4
|
+
ChefSpec.define_matcher :openbsd_package
|
|
5
|
+
|
|
6
|
+
#
|
|
7
|
+
# Assert that an +openbsd_package+ resource exists in the Chef run with the
|
|
8
|
+
# action +:install+. Given a Chef Recipe that installs "apache2" as an
|
|
9
|
+
# +openbsd_package+:
|
|
10
|
+
#
|
|
11
|
+
# openbsd_package 'apache2' do
|
|
12
|
+
# action :install
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
# The Examples section demonstrates the different ways to test an
|
|
16
|
+
# +openbsd_package+ resource with ChefSpec.
|
|
17
|
+
#
|
|
18
|
+
# @example Assert that an +openbsd_package+ was installed
|
|
19
|
+
# expect(chef_run).to install_openbsd_package('apache2')
|
|
20
|
+
#
|
|
21
|
+
# @example Assert that an +openbsd_package+ was installed with predicate matchers
|
|
22
|
+
# expect(chef_run).to install_openbsd_package('apache2').with_version('1.2.3')
|
|
23
|
+
#
|
|
24
|
+
# @example Assert that an +openbsd_package+ was installed with attributes
|
|
25
|
+
# expect(chef_run).to install_openbsd_package('apache2').with(version: '1.2.3')
|
|
26
|
+
#
|
|
27
|
+
# @example Assert that an +openbsd_package+ was installed using a regex
|
|
28
|
+
# expect(chef_run).to install_openbsd_package('apache2').with(version: /(\d+\.){2}\.\d+/)
|
|
29
|
+
#
|
|
30
|
+
# @example Assert that an +openbsd_package+ was _not_ installed
|
|
31
|
+
# expect(chef_run).to_not install_openbsd_package('apache2')
|
|
32
|
+
#
|
|
33
|
+
#
|
|
34
|
+
# @param [String, Regex] resource_name
|
|
35
|
+
# the name of the resource to match
|
|
36
|
+
#
|
|
37
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
38
|
+
#
|
|
39
|
+
def install_openbsd_package(resource_name)
|
|
40
|
+
ChefSpec::Matchers::ResourceMatcher.new(:openbsd_package, :install, resource_name)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
#
|
|
44
|
+
# Assert that an +openbsd_package+ resource exists in the Chef run with the
|
|
45
|
+
# action +:purge+. Given a Chef Recipe that purges "apache2" as an
|
|
46
|
+
# +openbsd_package+:
|
|
47
|
+
#
|
|
48
|
+
# openbsd_package 'apache2' do
|
|
49
|
+
# action :purge
|
|
50
|
+
# end
|
|
51
|
+
#
|
|
52
|
+
# The Examples section demonstrates the different ways to test an
|
|
53
|
+
# +openbsd_package+ resource with ChefSpec.
|
|
54
|
+
#
|
|
55
|
+
# @example Assert that an +openbsd_package+ was purged
|
|
56
|
+
# expect(chef_run).to purge_openbsd_package('apache2')
|
|
57
|
+
#
|
|
58
|
+
# @example Assert that an +openbsd_package+ was purged with predicate matchers
|
|
59
|
+
# expect(chef_run).to purge_openbsd_package('apache2').with_version('1.2.3')
|
|
60
|
+
#
|
|
61
|
+
# @example Assert that an +openbsd_package+ was purged with attributes
|
|
62
|
+
# expect(chef_run).to purge_openbsd_package('apache2').with(version: '1.2.3')
|
|
63
|
+
#
|
|
64
|
+
# @example Assert that an +openbsd_package+ was purged using a regex
|
|
65
|
+
# expect(chef_run).to purge_openbsd_package('apache2').with(version: /(\d+\.){2}\.\d+/)
|
|
66
|
+
#
|
|
67
|
+
# @example Assert that an +openbsd_package+ was _not_ purged
|
|
68
|
+
# expect(chef_run).to_not purge_openbsd_package('apache2')
|
|
69
|
+
#
|
|
70
|
+
#
|
|
71
|
+
# @param [String, Regex] resource_name
|
|
72
|
+
# the name of the resource to match
|
|
73
|
+
#
|
|
74
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
75
|
+
#
|
|
76
|
+
def purge_openbsd_package(resource_name)
|
|
77
|
+
ChefSpec::Matchers::ResourceMatcher.new(:openbsd_package, :purge, resource_name)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
#
|
|
81
|
+
# Assert that an +openbsd_package+ resource exists in the Chef run with the
|
|
82
|
+
# action +:remove+. Given a Chef Recipe that removes "apache2" as an
|
|
83
|
+
# +openbsd_package+:
|
|
84
|
+
#
|
|
85
|
+
# openbsd_package 'apache2' do
|
|
86
|
+
# action :remove
|
|
87
|
+
# end
|
|
88
|
+
#
|
|
89
|
+
# The Examples section demonstrates the different ways to test an
|
|
90
|
+
# +openbsd_package+ resource with ChefSpec.
|
|
91
|
+
#
|
|
92
|
+
# @example Assert that an +openbsd_package+ was removed
|
|
93
|
+
# expect(chef_run).to remove_openbsd_package('apache2')
|
|
94
|
+
#
|
|
95
|
+
# @example Assert that an +openbsd_package+ was removed with predicate matchers
|
|
96
|
+
# expect(chef_run).to remove_openbsd_package('apache2').with_version('1.2.3')
|
|
97
|
+
#
|
|
98
|
+
# @example Assert that an +openbsd_package+ was removed with attributes
|
|
99
|
+
# expect(chef_run).to remove_openbsd_package('apache2').with(version: '1.2.3')
|
|
100
|
+
#
|
|
101
|
+
# @example Assert that an +openbsd_package+ was removed using a regex
|
|
102
|
+
# expect(chef_run).to remove_openbsd_package('apache2').with(version: /(\d+\.){2}\.\d+/)
|
|
103
|
+
#
|
|
104
|
+
# @example Assert that an +openbsd_package+ was _not_ removed
|
|
105
|
+
# expect(chef_run).to_not remove_openbsd_package('apache2')
|
|
106
|
+
#
|
|
107
|
+
#
|
|
108
|
+
# @param [String, Regex] resource_name
|
|
109
|
+
# the name of the resource to match
|
|
110
|
+
#
|
|
111
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
112
|
+
#
|
|
113
|
+
def remove_openbsd_package(resource_name)
|
|
114
|
+
ChefSpec::Matchers::ResourceMatcher.new(:openbsd_package, :remove, resource_name)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
#
|
|
118
|
+
# Assert that an +openbsd_package+ resource exists in the Chef run with the
|
|
119
|
+
# action +:upgrade+. Given a Chef Recipe that upgrades "apache2" as an
|
|
120
|
+
# +openbsd_package+:
|
|
121
|
+
#
|
|
122
|
+
# openbsd_package 'apache2' do
|
|
123
|
+
# action :upgrade
|
|
124
|
+
# end
|
|
125
|
+
#
|
|
126
|
+
# The Examples section demonstrates the different ways to test an
|
|
127
|
+
# +openbsd_package+ resource with ChefSpec.
|
|
128
|
+
#
|
|
129
|
+
# @example Assert that an +openbsd_package+ was upgraded
|
|
130
|
+
# expect(chef_run).to upgrade_openbsd_package('apache2')
|
|
131
|
+
#
|
|
132
|
+
# @example Assert that an +openbsd_package+ was upgraded with predicate matchers
|
|
133
|
+
# expect(chef_run).to upgrade_openbsd_package('apache2').with_version('1.2.3')
|
|
134
|
+
#
|
|
135
|
+
# @example Assert that an +openbsd_package+ was upgraded with attributes
|
|
136
|
+
# expect(chef_run).to upgrade_openbsd_package('apache2').with(version: '1.2.3')
|
|
137
|
+
#
|
|
138
|
+
# @example Assert that an +openbsd_package+ was upgraded using a regex
|
|
139
|
+
# expect(chef_run).to upgrade_openbsd_package('apache2').with(version: /(\d+\.){2}\.\d+/)
|
|
140
|
+
#
|
|
141
|
+
# @example Assert that an +openbsd_package+ was _not_ upgraded
|
|
142
|
+
# expect(chef_run).to_not upgrade_openbsd_package('apache2')
|
|
143
|
+
#
|
|
144
|
+
#
|
|
145
|
+
# @param [String, Regex] resource_name
|
|
146
|
+
# the name of the resource to match
|
|
147
|
+
#
|
|
148
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
149
|
+
#
|
|
150
|
+
def upgrade_openbsd_package(resource_name)
|
|
151
|
+
ChefSpec::Matchers::ResourceMatcher.new(:openbsd_package, :upgrade, resource_name)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
module ChefSpec::API
|
|
2
|
+
# @since 5.1.0
|
|
3
|
+
module OsxProfileMatchers
|
|
4
|
+
ChefSpec.define_matcher :osx_profile
|
|
5
|
+
|
|
6
|
+
#
|
|
7
|
+
# Assert that an +osx_profile+ resource exists in the Chef run with the
|
|
8
|
+
# action +:install+. Given a Chef Recipe that installs "bsmith" as an
|
|
9
|
+
# +profile+:
|
|
10
|
+
#
|
|
11
|
+
# osx_profile 'bsmith' do
|
|
12
|
+
# action :install
|
|
13
|
+
# end
|
|
14
|
+
#
|
|
15
|
+
# The Examples section demonstrates the different ways to test an
|
|
16
|
+
# +osx_profile+ resource with ChefSpec.
|
|
17
|
+
#
|
|
18
|
+
# @example Assert that an +osx_profile+ was installed
|
|
19
|
+
# expect(chef_run).to install_osx_profile('bsmith')
|
|
20
|
+
#
|
|
21
|
+
# @example Assert that an +osx_profile+ was _not_ installed
|
|
22
|
+
# expect(chef_run).to_not install_osx_profile('bsmith')
|
|
23
|
+
#
|
|
24
|
+
#
|
|
25
|
+
# @param [String, Regex] resource_name
|
|
26
|
+
# the name of the resource to match
|
|
27
|
+
#
|
|
28
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
29
|
+
#
|
|
30
|
+
def install_osx_profile(resource_name)
|
|
31
|
+
ChefSpec::Matchers::ResourceMatcher.new(:osx_profile, :install, resource_name)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
#
|
|
35
|
+
# Assert that an +osx_profile+ resource exists in the Chef run with the
|
|
36
|
+
# action +:remove+. Given a Chef Recipe that removes "bsmith" as an
|
|
37
|
+
# +profile+:
|
|
38
|
+
#
|
|
39
|
+
# osx_profile 'bsmith' do
|
|
40
|
+
# action :remove
|
|
41
|
+
# end
|
|
42
|
+
#
|
|
43
|
+
# The Examples section demonstrates the different ways to test an
|
|
44
|
+
# +osx_profile+ resource with ChefSpec.
|
|
45
|
+
#
|
|
46
|
+
# @example Assert that an +osx_profile+ was removed
|
|
47
|
+
# expect(chef_run).to remove_osx_profile('bsmith')
|
|
48
|
+
#
|
|
49
|
+
# @example Assert that an +osx_profile+ was _not_ removed
|
|
50
|
+
# expect(chef_run).to_not remove_osx_profile('bsmith')
|
|
51
|
+
#
|
|
52
|
+
#
|
|
53
|
+
# @param [String, Regex] resource_name
|
|
54
|
+
# the name of the resource to match
|
|
55
|
+
#
|
|
56
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
|
57
|
+
#
|
|
58
|
+
def remove_osx_profile(resource_name)
|
|
59
|
+
ChefSpec::Matchers::ResourceMatcher.new(:osx_profile, :remove, resource_name)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
end
|