chefspec 7.3.2 → 7.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chefspec/extensions/.DS_Store +0 -0
- data/lib/chefspec/extensions/chef/.DS_Store +0 -0
- data/lib/chefspec/version.rb +1 -1
- metadata +7 -666
- data/.gitignore +0 -16
- data/.travis.yml +0 -48
- data/CHANGELOG.md +0 -819
- data/CONTRIBUTING.md +0 -52
- data/Gemfile +0 -23
- data/ISSUES.md +0 -41
- data/README.md +0 -571
- data/README_old.md +0 -1291
- data/Rakefile +0 -74
- data/chefspec.gemspec +0 -31
- data/examples/apt_package/recipes/install.rb +0 -13
- data/examples/apt_package/recipes/lock.rb +0 -13
- data/examples/apt_package/recipes/purge.rb +0 -13
- data/examples/apt_package/recipes/reconfig.rb +0 -13
- data/examples/apt_package/recipes/remove.rb +0 -13
- data/examples/apt_package/recipes/unlock.rb +0 -13
- data/examples/apt_package/recipes/upgrade.rb +0 -13
- data/examples/apt_package/spec/install_spec.rb +0 -26
- data/examples/apt_package/spec/lock_spec.rb +0 -22
- data/examples/apt_package/spec/purge_spec.rb +0 -22
- data/examples/apt_package/spec/reconfig_spec.rb +0 -22
- data/examples/apt_package/spec/remove_spec.rb +0 -22
- data/examples/apt_package/spec/unlock_spec.rb +0 -22
- data/examples/apt_package/spec/upgrade_spec.rb +0 -22
- data/examples/apt_repository/recipes/add.rb +0 -8
- data/examples/apt_repository/recipes/remove.rb +0 -4
- data/examples/apt_repository/spec/add_spec.rb +0 -17
- data/examples/apt_repository/spec/remove_spec.rb +0 -12
- data/examples/apt_update/recipes/periodic.rb +0 -5
- data/examples/apt_update/recipes/update.rb +0 -3
- data/examples/apt_update/spec/periodic_spec.rb +0 -17
- data/examples/apt_update/spec/update_spec.rb +0 -12
- data/examples/attributes/attributes/default.rb +0 -1
- data/examples/attributes/recipes/default.rb +0 -4
- data/examples/attributes/spec/default_spec.rb +0 -20
- data/examples/batch/recipes/run.rb +0 -9
- data/examples/batch/spec/run_spec.rb +0 -22
- data/examples/bff_package/recipes/install.rb +0 -13
- data/examples/bff_package/recipes/purge.rb +0 -13
- data/examples/bff_package/recipes/remove.rb +0 -13
- data/examples/bff_package/recipes/upgrade.rb +0 -13
- data/examples/bff_package/spec/install_spec.rb +0 -23
- data/examples/bff_package/spec/purge_spec.rb +0 -19
- data/examples/bff_package/spec/remove_spec.rb +0 -19
- data/examples/bff_package/spec/upgrade_spec.rb +0 -19
- data/examples/cab_package/recipes/install.rb +0 -13
- data/examples/cab_package/recipes/remove.rb +0 -13
- data/examples/cab_package/spec/install_spec.rb +0 -28
- data/examples/cab_package/spec/remove_spec.rb +0 -24
- data/examples/cached/recipes/default.rb +0 -1
- data/examples/cached/spec/default_spec.rb +0 -14
- data/examples/chef_gem/recipes/install.rb +0 -18
- data/examples/chef_gem/recipes/purge.rb +0 -16
- data/examples/chef_gem/recipes/reconfig.rb +0 -16
- data/examples/chef_gem/recipes/remove.rb +0 -16
- data/examples/chef_gem/recipes/upgrade.rb +0 -16
- data/examples/chef_gem/spec/install_spec.rb +0 -23
- data/examples/chef_gem/spec/purge_spec.rb +0 -19
- data/examples/chef_gem/spec/reconfig_spec.rb +0 -19
- data/examples/chef_gem/spec/remove_spec.rb +0 -19
- data/examples/chef_gem/spec/upgrade_spec.rb +0 -19
- data/examples/chocolatey_package/recipes/install.rb +0 -6
- data/examples/chocolatey_package/recipes/remove.rb +0 -8
- data/examples/chocolatey_package/recipes/upgrade.rb +0 -8
- data/examples/chocolatey_package/spec/install_spec.rb +0 -19
- data/examples/chocolatey_package/spec/remove_spec.rb +0 -18
- data/examples/chocolatey_package/spec/upgrade_spec.rb +0 -18
- data/examples/compile_time/recipes/default.rb +0 -3
- data/examples/compile_time/spec/default_spec.rb +0 -29
- data/examples/cookbook_file/recipes/create.rb +0 -15
- data/examples/cookbook_file/recipes/create_if_missing.rb +0 -15
- data/examples/cookbook_file/recipes/delete.rb +0 -15
- data/examples/cookbook_file/recipes/touch.rb +0 -15
- data/examples/cookbook_file/spec/create_if_missing_spec.rb +0 -28
- data/examples/cookbook_file/spec/create_spec.rb +0 -32
- data/examples/cookbook_file/spec/delete_spec.rb +0 -19
- data/examples/cookbook_file/spec/touch_spec.rb +0 -19
- data/examples/core/recipes/default.rb +0 -1
- data/examples/core/spec/default_spec.rb +0 -7
- data/examples/core/spec/non_recipe_spec.rb +0 -5
- data/examples/cron/recipes/create.rb +0 -10
- data/examples/cron/recipes/delete.rb +0 -9
- data/examples/cron/spec/create_spec.rb +0 -19
- data/examples/cron/spec/delete_spec.rb +0 -15
- data/examples/custom_matcher/libraries/matcher.rb +0 -1
- data/examples/custom_matcher/providers/thing.rb +0 -2
- data/examples/custom_matcher/recipes/install.rb +0 -13
- data/examples/custom_matcher/recipes/remove.rb +0 -13
- data/examples/custom_matcher/resources/thing.rb +0 -5
- data/examples/custom_matcher/spec/install_spec.rb +0 -27
- data/examples/custom_matcher/spec/remove_spec.rb +0 -23
- data/examples/custom_resource/recipes/default.rb +0 -1
- data/examples/custom_resource/resources/custom_resource.rb +0 -9
- data/examples/custom_resource/spec/default_spec.rb +0 -18
- data/examples/custom_resource_block/resources/default.rb +0 -3
- data/examples/custom_resource_block/spec/default_spec.rb +0 -10
- data/examples/directory/recipes/create.rb +0 -18
- data/examples/directory/recipes/delete.rb +0 -14
- data/examples/directory/spec/create_spec.rb +0 -34
- data/examples/directory/spec/delete_spec.rb +0 -26
- data/examples/dnf_package/recipes/install.rb +0 -13
- data/examples/dnf_package/recipes/purge.rb +0 -13
- data/examples/dnf_package/recipes/remove.rb +0 -13
- data/examples/dnf_package/recipes/upgrade.rb +0 -13
- data/examples/dnf_package/spec/install_spec.rb +0 -28
- data/examples/dnf_package/spec/purge_spec.rb +0 -24
- data/examples/dnf_package/spec/remove_spec.rb +0 -24
- data/examples/dnf_package/spec/upgrade_spec.rb +0 -24
- data/examples/do_nothing/recipes/default.rb +0 -3
- data/examples/do_nothing/spec/default_spec.rb +0 -15
- data/examples/dpkg_package/recipes/install.rb +0 -13
- data/examples/dpkg_package/recipes/purge.rb +0 -13
- data/examples/dpkg_package/recipes/remove.rb +0 -13
- data/examples/dpkg_package/spec/install_spec.rb +0 -26
- data/examples/dpkg_package/spec/purge_spec.rb +0 -22
- data/examples/dpkg_package/spec/remove_spec.rb +0 -22
- data/examples/dsc_resource/recipes/run.rb +0 -20
- data/examples/dsc_resource/spec/run_spec.rb +0 -38
- data/examples/dsc_script/recipes/run.rb +0 -12
- data/examples/dsc_script/spec/run_spec.rb +0 -16
- data/examples/env/recipes/create.rb +0 -13
- data/examples/env/recipes/delete.rb +0 -13
- data/examples/env/recipes/modify.rb +0 -13
- data/examples/env/spec/create_spec.rb +0 -26
- data/examples/env/spec/delete_spec.rb +0 -22
- data/examples/env/spec/modify_spec.rb +0 -22
- data/examples/execute/recipes/run.rb +0 -13
- data/examples/execute/spec/run_spec.rb +0 -23
- data/examples/expect_exception/recipes/compile_error.rb +0 -1
- data/examples/expect_exception/recipes/converge_error.rb +0 -5
- data/examples/expect_exception/recipes/no_error.rb +0 -1
- data/examples/expect_exception/spec/compile_error_spec.rb +0 -10
- data/examples/expect_exception/spec/converge_error_spec.rb +0 -10
- data/examples/expect_exception/spec/no_error_spec.rb +0 -10
- data/examples/file/recipes/create.rb +0 -15
- data/examples/file/recipes/create_if_missing.rb +0 -15
- data/examples/file/recipes/delete.rb +0 -15
- data/examples/file/recipes/touch.rb +0 -15
- data/examples/file/spec/create_if_missing_spec.rb +0 -28
- data/examples/file/spec/create_spec.rb +0 -32
- data/examples/file/spec/delete_spec.rb +0 -19
- data/examples/file/spec/touch_spec.rb +0 -19
- data/examples/freebsd_package/recipes/install.rb +0 -13
- data/examples/freebsd_package/recipes/remove.rb +0 -13
- data/examples/freebsd_package/spec/install_spec.rb +0 -26
- data/examples/freebsd_package/spec/remove_spec.rb +0 -22
- data/examples/gem_package/recipes/install.rb +0 -13
- data/examples/gem_package/recipes/purge.rb +0 -13
- data/examples/gem_package/recipes/reconfig.rb +0 -13
- data/examples/gem_package/recipes/remove.rb +0 -13
- data/examples/gem_package/recipes/upgrade.rb +0 -13
- data/examples/gem_package/spec/install_spec.rb +0 -23
- data/examples/gem_package/spec/purge_spec.rb +0 -19
- data/examples/gem_package/spec/reconfig_spec.rb +0 -19
- data/examples/gem_package/spec/remove_spec.rb +0 -19
- data/examples/gem_package/spec/upgrade_spec.rb +0 -19
- data/examples/git/recipes/checkout.rb +0 -13
- data/examples/git/recipes/export.rb +0 -13
- data/examples/git/recipes/sync.rb +0 -13
- data/examples/git/spec/checkout_spec.rb +0 -19
- data/examples/git/spec/export_spec.rb +0 -19
- data/examples/git/spec/sync_spec.rb +0 -23
- data/examples/group/recipes/create.rb +0 -13
- data/examples/group/recipes/manage.rb +0 -13
- data/examples/group/recipes/modify.rb +0 -13
- data/examples/group/recipes/remove.rb +0 -13
- data/examples/group/spec/create_spec.rb +0 -23
- data/examples/group/spec/manage_spec.rb +0 -19
- data/examples/group/spec/modify_spec.rb +0 -19
- data/examples/group/spec/remove_spec.rb +0 -18
- data/examples/guards/recipes/default.rb +0 -13
- data/examples/guards/spec/default_spec.rb +0 -17
- data/examples/heavy_provider_light_resource/libraries/resource_service.rb +0 -15
- data/examples/heavy_provider_light_resource/providers/service.rb +0 -9
- data/examples/heavy_provider_light_resource/recipes/default.rb +0 -3
- data/examples/heavy_provider_light_resource/spec/provider_service_spec.rb +0 -8
- data/examples/homebrew_package/recipes/install.rb +0 -13
- data/examples/homebrew_package/recipes/purge.rb +0 -13
- data/examples/homebrew_package/recipes/remove.rb +0 -13
- data/examples/homebrew_package/recipes/upgrade.rb +0 -13
- data/examples/homebrew_package/spec/install_spec.rb +0 -23
- data/examples/homebrew_package/spec/purge_spec.rb +0 -19
- data/examples/homebrew_package/spec/remove_spec.rb +0 -19
- data/examples/homebrew_package/spec/upgrade_spec.rb +0 -19
- data/examples/http_request/recipes/delete.rb +0 -13
- data/examples/http_request/recipes/get.rb +0 -13
- data/examples/http_request/recipes/head.rb +0 -13
- data/examples/http_request/recipes/options.rb +0 -13
- data/examples/http_request/recipes/post.rb +0 -13
- data/examples/http_request/recipes/put.rb +0 -13
- data/examples/http_request/spec/delete_spec.rb +0 -19
- data/examples/http_request/spec/get_spec.rb +0 -23
- data/examples/http_request/spec/head_spec.rb +0 -19
- data/examples/http_request/spec/options_spec.rb +0 -19
- data/examples/http_request/spec/post_spec.rb +0 -19
- data/examples/http_request/spec/put_spec.rb +0 -19
- data/examples/ifconfig/recipes/add.rb +0 -9
- data/examples/ifconfig/recipes/delete.rb +0 -8
- data/examples/ifconfig/recipes/disable.rb +0 -8
- data/examples/ifconfig/recipes/enable.rb +0 -8
- data/examples/ifconfig/spec/add_spec.rb +0 -19
- data/examples/ifconfig/spec/delete_spec.rb +0 -15
- data/examples/ifconfig/spec/disable_spec.rb +0 -15
- data/examples/ifconfig/spec/enable_spec.rb +0 -15
- data/examples/include_recipe/recipes/default.rb +0 -1
- data/examples/include_recipe/recipes/not.rb +0 -0
- data/examples/include_recipe/recipes/other.rb +0 -0
- data/examples/include_recipe/spec/default_spec.rb +0 -13
- data/examples/ips_package/recipes/install.rb +0 -13
- data/examples/ips_package/recipes/remove.rb +0 -13
- data/examples/ips_package/recipes/upgrade.rb +0 -13
- data/examples/ips_package/spec/install_spec.rb +0 -26
- data/examples/ips_package/spec/remove_spec.rb +0 -22
- data/examples/ips_package/spec/upgrade_spec.rb +0 -22
- data/examples/launchd/recipes/create.rb +0 -5
- data/examples/launchd/recipes/create_if_missing.rb +0 -3
- data/examples/launchd/recipes/delete.rb +0 -3
- data/examples/launchd/recipes/disable.rb +0 -3
- data/examples/launchd/recipes/enable.rb +0 -3
- data/examples/launchd/spec/create_if_missing_spec.rb +0 -10
- data/examples/launchd/spec/create_spec.rb +0 -14
- data/examples/launchd/spec/delete_spec.rb +0 -10
- data/examples/launchd/spec/disable_spec.rb +0 -10
- data/examples/launchd/spec/enable_spec.rb +0 -10
- data/examples/library_patch/libraries/default.rb +0 -5
- data/examples/library_patch/recipes/default.rb +0 -1
- data/examples/library_patch/spec/default_spec.rb +0 -14
- data/examples/link/recipes/create.rb +0 -13
- data/examples/link/recipes/delete.rb +0 -13
- data/examples/link/recipes/link_to.rb +0 -3
- data/examples/link/spec/create_spec.rb +0 -23
- data/examples/link/spec/delete_spec.rb +0 -19
- data/examples/link/spec/link_to_spec.rb +0 -11
- data/examples/log/recipes/write.rb +0 -13
- data/examples/log/spec/write_spec.rb +0 -24
- data/examples/macports_package/recipes/install.rb +0 -13
- data/examples/macports_package/recipes/purge.rb +0 -13
- data/examples/macports_package/recipes/remove.rb +0 -13
- data/examples/macports_package/recipes/upgrade.rb +0 -13
- data/examples/macports_package/spec/install_spec.rb +0 -23
- data/examples/macports_package/spec/purge_spec.rb +0 -19
- data/examples/macports_package/spec/remove_spec.rb +0 -19
- data/examples/macports_package/spec/upgrade_spec.rb +0 -19
- data/examples/mdadm/recipes/assemble.rb +0 -13
- data/examples/mdadm/recipes/create.rb +0 -13
- data/examples/mdadm/recipes/stop.rb +0 -13
- data/examples/mdadm/spec/assemble_spec.rb +0 -19
- data/examples/mdadm/spec/create_spec.rb +0 -23
- data/examples/mdadm/spec/stop_spec.rb +0 -19
- data/examples/mount/recipes/disable.rb +0 -8
- data/examples/mount/recipes/enable.rb +0 -8
- data/examples/mount/recipes/mount.rb +0 -9
- data/examples/mount/recipes/remount.rb +0 -8
- data/examples/mount/recipes/umount.rb +0 -8
- data/examples/mount/spec/disable_spec.rb +0 -15
- data/examples/mount/spec/enable_spec.rb +0 -15
- data/examples/mount/spec/mount_spec.rb +0 -19
- data/examples/mount/spec/remount_spec.rb +0 -15
- data/examples/mount/spec/umount_spec.rb +0 -15
- data/examples/msu_package/recipes/install.rb +0 -13
- data/examples/msu_package/recipes/remove.rb +0 -13
- data/examples/msu_package/spec/install_spec.rb +0 -28
- data/examples/msu_package/spec/remove_spec.rb +0 -24
- data/examples/multiple_actions/recipes/default.rb +0 -3
- data/examples/multiple_actions/recipes/reversed.rb +0 -9
- data/examples/multiple_actions/recipes/sequential.rb +0 -9
- data/examples/multiple_actions/spec/default_spec.rb +0 -14
- data/examples/multiple_actions/spec/reversed_spec.rb +0 -17
- data/examples/multiple_actions/spec/sequential_spec.rb +0 -17
- data/examples/multiple_run_action/recipes/default.rb +0 -5
- data/examples/multiple_run_action/spec/default_spec.rb +0 -18
- data/examples/nothing_matcher/recipes/default.rb +0 -13
- data/examples/nothing_matcher/spec/default_spec.rb +0 -20
- data/examples/notifications/recipes/before.rb +0 -7
- data/examples/notifications/recipes/chained.rb +0 -12
- data/examples/notifications/recipes/default.rb +0 -7
- data/examples/notifications/recipes/delayed.rb +0 -7
- data/examples/notifications/recipes/immediately.rb +0 -7
- data/examples/notifications/spec/before_spec.rb +0 -16
- data/examples/notifications/spec/chained_spec.rb +0 -21
- data/examples/notifications/spec/default_spec.rb +0 -16
- data/examples/notifications/spec/delayed_spec.rb +0 -16
- data/examples/notifications/spec/immediately_spec.rb +0 -16
- data/examples/ohai/recipes/reload.rb +0 -13
- data/examples/ohai/spec/reload_spec.rb +0 -23
- data/examples/openbsd_package/recipes/install.rb +0 -13
- data/examples/openbsd_package/recipes/purge.rb +0 -13
- data/examples/openbsd_package/recipes/remove.rb +0 -13
- data/examples/openbsd_package/recipes/upgrade.rb +0 -13
- data/examples/openbsd_package/spec/install_spec.rb +0 -23
- data/examples/openbsd_package/spec/purge_spec.rb +0 -19
- data/examples/openbsd_package/spec/remove_spec.rb +0 -19
- data/examples/openbsd_package/spec/upgrade_spec.rb +0 -19
- data/examples/osx_profile/recipes/install.rb +0 -8
- data/examples/osx_profile/recipes/remove.rb +0 -8
- data/examples/osx_profile/spec/install_spec.rb +0 -15
- data/examples/osx_profile/spec/remove_spec.rb +0 -13
- data/examples/package/recipes/install.rb +0 -17
- data/examples/package/recipes/lock.rb +0 -17
- data/examples/package/recipes/purge.rb +0 -17
- data/examples/package/recipes/reconfig.rb +0 -17
- data/examples/package/recipes/remove.rb +0 -17
- data/examples/package/recipes/unlock.rb +0 -17
- data/examples/package/recipes/upgrade.rb +0 -17
- data/examples/package/spec/install_spec.rb +0 -27
- data/examples/package/spec/lock_spec.rb +0 -23
- data/examples/package/spec/purge_spec.rb +0 -23
- data/examples/package/spec/reconfig_spec.rb +0 -23
- data/examples/package/spec/remove_spec.rb +0 -23
- data/examples/package/spec/unlock_spec.rb +0 -23
- data/examples/package/spec/upgrade_spec.rb +0 -23
- data/examples/pacman_package/recipes/install.rb +0 -13
- data/examples/pacman_package/recipes/purge.rb +0 -13
- data/examples/pacman_package/recipes/remove.rb +0 -13
- data/examples/pacman_package/recipes/upgrade.rb +0 -13
- data/examples/pacman_package/spec/install_spec.rb +0 -26
- data/examples/pacman_package/spec/purge_spec.rb +0 -22
- data/examples/pacman_package/spec/remove_spec.rb +0 -22
- data/examples/pacman_package/spec/upgrade_spec.rb +0 -22
- data/examples/paludis_package/recipes/install.rb +0 -13
- data/examples/paludis_package/recipes/purge.rb +0 -13
- data/examples/paludis_package/recipes/remove.rb +0 -13
- data/examples/paludis_package/recipes/upgrade.rb +0 -13
- data/examples/paludis_package/spec/install_spec.rb +0 -23
- data/examples/paludis_package/spec/purge_spec.rb +0 -19
- data/examples/paludis_package/spec/remove_spec.rb +0 -19
- data/examples/paludis_package/spec/upgrade_spec.rb +0 -19
- data/examples/portage_package/recipes/install.rb +0 -13
- data/examples/portage_package/recipes/purge.rb +0 -13
- data/examples/portage_package/recipes/remove.rb +0 -13
- data/examples/portage_package/recipes/upgrade.rb +0 -13
- data/examples/portage_package/spec/install_spec.rb +0 -26
- data/examples/portage_package/spec/purge_spec.rb +0 -22
- data/examples/portage_package/spec/remove_spec.rb +0 -22
- data/examples/portage_package/spec/upgrade_spec.rb +0 -22
- data/examples/powershell_script/recipes/run.rb +0 -9
- data/examples/powershell_script/spec/run_spec.rb +0 -22
- data/examples/reboot/recipes/cancel.rb +0 -3
- data/examples/reboot/recipes/now.rb +0 -3
- data/examples/reboot/recipes/request.rb +0 -3
- data/examples/reboot/spec/cancel_spec.rb +0 -9
- data/examples/reboot/spec/now_spec.rb +0 -9
- data/examples/reboot/spec/request_spec.rb +0 -9
- data/examples/recipe_block/metadata.rb +0 -1
- data/examples/recipe_block/spec/recipe_block_spec.rb +0 -34
- data/examples/recipe_block/templates/apache2.conf.erb +0 -1
- data/examples/registry_key/recipes/create.rb +0 -13
- data/examples/registry_key/recipes/create_if_missing.rb +0 -13
- data/examples/registry_key/recipes/delete.rb +0 -13
- data/examples/registry_key/recipes/delete_key.rb +0 -13
- data/examples/registry_key/spec/create_if_missing_spec.rb +0 -22
- data/examples/registry_key/spec/create_spec.rb +0 -26
- data/examples/registry_key/spec/delete_key_spec.rb +0 -22
- data/examples/registry_key/spec/delete_spec.rb +0 -22
- data/examples/remote_directory/recipes/create.rb +0 -13
- data/examples/remote_directory/recipes/create_if_missing.rb +0 -13
- data/examples/remote_directory/recipes/delete.rb +0 -13
- data/examples/remote_directory/spec/create_if_missing_spec.rb +0 -19
- data/examples/remote_directory/spec/create_spec.rb +0 -23
- data/examples/remote_directory/spec/delete_spec.rb +0 -19
- data/examples/remote_file/recipes/create.rb +0 -18
- data/examples/remote_file/recipes/create_if_missing.rb +0 -16
- data/examples/remote_file/recipes/delete.rb +0 -16
- data/examples/remote_file/recipes/touch.rb +0 -16
- data/examples/remote_file/spec/create_if_missing_spec.rb +0 -19
- data/examples/remote_file/spec/create_spec.rb +0 -23
- data/examples/remote_file/spec/delete_spec.rb +0 -19
- data/examples/remote_file/spec/touch_spec.rb +0 -19
- data/examples/render_file/files/default/cookbook_file +0 -1
- data/examples/render_file/recipes/default.rb +0 -15
- data/examples/render_file/recipes/template_helpers.rb +0 -9
- data/examples/render_file/spec/default_spec.rb +0 -166
- data/examples/render_file/spec/template_helpers_spec.rb +0 -10
- data/examples/render_file/templates/default/_partial.erb +0 -1
- data/examples/render_file/templates/default/partial.erb +0 -1
- data/examples/render_file/templates/default/template.erb +0 -1
- data/examples/render_file/templates/default/template_with_helper.erb +0 -1
- data/examples/roles/recipes/another.rb +0 -3
- data/examples/roles/recipes/default.rb +0 -1
- data/examples/roles/roles/role.rb +0 -9
- data/examples/roles/spec/default_spec.rb +0 -21
- data/examples/route/recipes/add.rb +0 -13
- data/examples/route/recipes/delete.rb +0 -13
- data/examples/route/spec/add_spec.rb +0 -23
- data/examples/route/spec/delete_spec.rb +0 -19
- data/examples/rpm_package/recipes/install.rb +0 -13
- data/examples/rpm_package/recipes/remove.rb +0 -13
- data/examples/rpm_package/recipes/upgrade.rb +0 -13
- data/examples/rpm_package/spec/install_spec.rb +0 -26
- data/examples/rpm_package/spec/remove_spec.rb +0 -22
- data/examples/rpm_package/spec/upgrade_spec.rb +0 -22
- data/examples/ruby_block/recipes/create.rb +0 -8
- data/examples/ruby_block/recipes/run.rb +0 -9
- data/examples/ruby_block/spec/create_spec.rb +0 -13
- data/examples/ruby_block/spec/run_spec.rb +0 -18
- data/examples/runner/recipes/default.rb +0 -1
- data/examples/runner/spec/default_spec.rb +0 -11
- data/examples/script/recipes/run_bash.rb +0 -9
- data/examples/script/recipes/run_csh.rb +0 -9
- data/examples/script/recipes/run_ksh.rb +0 -9
- data/examples/script/recipes/run_perl.rb +0 -9
- data/examples/script/recipes/run_python.rb +0 -9
- data/examples/script/recipes/run_ruby.rb +0 -9
- data/examples/script/recipes/run_script.rb +0 -9
- data/examples/script/spec/run_bash_spec.rb +0 -19
- data/examples/script/spec/run_csh_spec.rb +0 -19
- data/examples/script/spec/run_ksh_spec.rb +0 -19
- data/examples/script/spec/run_perl_spec.rb +0 -19
- data/examples/script/spec/run_python_spec.rb +0 -19
- data/examples/script/spec/run_ruby_spec.rb +0 -19
- data/examples/script/spec/run_script_spec.rb +0 -19
- data/examples/server/recipes/client.rb +0 -6
- data/examples/server/recipes/data_bag.rb +0 -7
- data/examples/server/recipes/environment.rb +0 -6
- data/examples/server/recipes/node.rb +0 -6
- data/examples/server/recipes/render_with_cached.rb +0 -3
- data/examples/server/recipes/role.rb +0 -6
- data/examples/server/recipes/search.rb +0 -5
- data/examples/server/spec/client_spec.rb +0 -18
- data/examples/server/spec/data_bag_spec.rb +0 -25
- data/examples/server/spec/environment_spec.rb +0 -18
- data/examples/server/spec/exotic_port_spec.rb +0 -30
- data/examples/server/spec/node_spec.rb +0 -49
- data/examples/server/spec/render_with_cached_spec.rb +0 -15
- data/examples/server/spec/role_spec.rb +0 -18
- data/examples/server/spec/search_spec.rb +0 -61
- data/examples/service/recipes/disable.rb +0 -13
- data/examples/service/recipes/enable.rb +0 -13
- data/examples/service/recipes/reload.rb +0 -13
- data/examples/service/recipes/restart.rb +0 -13
- data/examples/service/recipes/start.rb +0 -13
- data/examples/service/recipes/stop.rb +0 -13
- data/examples/service/spec/disable_spec.rb +0 -19
- data/examples/service/spec/enable_spec.rb +0 -19
- data/examples/service/spec/reload_spec.rb +0 -19
- data/examples/service/spec/restart_spec.rb +0 -19
- data/examples/service/spec/start_spec.rb +0 -19
- data/examples/service/spec/stop_spec.rb +0 -19
- data/examples/smartos_package/recipes/install.rb +0 -13
- data/examples/smartos_package/recipes/remove.rb +0 -13
- data/examples/smartos_package/recipes/upgrade.rb +0 -13
- data/examples/smartos_package/spec/install_spec.rb +0 -26
- data/examples/smartos_package/spec/remove_spec.rb +0 -22
- data/examples/smartos_package/spec/upgrade_spec.rb +0 -22
- data/examples/solaris_package/recipes/install.rb +0 -13
- data/examples/solaris_package/recipes/remove.rb +0 -13
- data/examples/solaris_package/recipes/upgrade.rb +0 -13
- data/examples/solaris_package/spec/install_spec.rb +0 -26
- data/examples/solaris_package/spec/remove_spec.rb +0 -22
- data/examples/solaris_package/spec/upgrade_spec.rb +0 -22
- data/examples/spec_attributes/attributes/default.rb +0 -1
- data/examples/spec_attributes/recipes/default.rb +0 -5
- data/examples/spec_attributes/spec/default_spec.rb +0 -63
- data/examples/spec_platform/recipes/default.rb +0 -3
- data/examples/spec_platform/spec/default_spec.rb +0 -36
- data/examples/spec_step_into/recipes/default.rb +0 -3
- data/examples/spec_step_into/resources/one.rb +0 -3
- data/examples/spec_step_into/resources/two.rb +0 -3
- data/examples/spec_step_into/spec/default_spec.rb +0 -50
- data/examples/state_attrs/providers/lwrp.rb +0 -2
- data/examples/state_attrs/recipes/default.rb +0 -3
- data/examples/state_attrs/resources/lwrp.rb +0 -6
- data/examples/state_attrs/spec/default_spec.rb +0 -12
- data/examples/step_into/providers/lwrp.rb +0 -3
- data/examples/step_into/providers/provides.rb +0 -3
- data/examples/step_into/recipes/default.rb +0 -3
- data/examples/step_into/resources/lwrp.rb +0 -4
- data/examples/step_into/resources/provides.rb +0 -6
- data/examples/step_into/spec/default_spec.rb +0 -30
- data/examples/stub_command/recipes/default.rb +0 -5
- data/examples/stub_command/recipes/other_recipe.rb +0 -3
- data/examples/stub_command/spec/default_spec.rb +0 -28
- data/examples/stub_data_bag/recipes/default.rb +0 -5
- data/examples/stub_data_bag/spec/default_spec.rb +0 -27
- data/examples/stub_data_bag_item/recipes/default.rb +0 -5
- data/examples/stub_data_bag_item/spec/default_spec.rb +0 -27
- data/examples/stub_node/recipes/default.rb +0 -0
- data/examples/stub_node/spec/default_spec.rb +0 -17
- data/examples/stub_search/recipes/block.rb +0 -3
- data/examples/stub_search/recipes/default.rb +0 -2
- data/examples/stub_search/spec/block_spec.rb +0 -27
- data/examples/stub_search/spec/default_spec.rb +0 -27
- data/examples/stubs_for/resources/default.rb +0 -27
- data/examples/stubs_for/resources/old.rb +0 -26
- data/examples/stubs_for/spec/default_spec.rb +0 -263
- data/examples/subscribes/recipes/before.rb +0 -5
- data/examples/subscribes/recipes/chained.rb +0 -10
- data/examples/subscribes/recipes/default.rb +0 -5
- data/examples/subscribes/recipes/delayed.rb +0 -5
- data/examples/subscribes/recipes/immediately.rb +0 -5
- data/examples/subscribes/spec/before_spec.rb +0 -16
- data/examples/subscribes/spec/chained_spec.rb +0 -21
- data/examples/subscribes/spec/default_spec.rb +0 -16
- data/examples/subscribes/spec/delayed_spec.rb +0 -16
- data/examples/subscribes/spec/immediately_spec.rb +0 -16
- data/examples/subversion/recipes/checkout.rb +0 -13
- data/examples/subversion/recipes/export.rb +0 -13
- data/examples/subversion/recipes/force_export.rb +0 -13
- data/examples/subversion/recipes/sync.rb +0 -13
- data/examples/subversion/spec/checkout_spec.rb +0 -19
- data/examples/subversion/spec/export_spec.rb +0 -19
- data/examples/subversion/spec/force_export_spec.rb +0 -19
- data/examples/subversion/spec/sync_spec.rb +0 -23
- data/examples/systemd_unit/recipes/create.rb +0 -3
- data/examples/systemd_unit/recipes/delete.rb +0 -3
- data/examples/systemd_unit/recipes/disable.rb +0 -3
- data/examples/systemd_unit/recipes/enable.rb +0 -3
- data/examples/systemd_unit/recipes/mask.rb +0 -3
- data/examples/systemd_unit/recipes/reload_or_restart.rb +0 -3
- data/examples/systemd_unit/recipes/reload_or_try_restart.rb +0 -3
- data/examples/systemd_unit/recipes/restart.rb +0 -3
- data/examples/systemd_unit/recipes/start.rb +0 -3
- data/examples/systemd_unit/recipes/stop.rb +0 -3
- data/examples/systemd_unit/recipes/try_restart.rb +0 -3
- data/examples/systemd_unit/recipes/unmask.rb +0 -3
- data/examples/systemd_unit/spec/create_spec.rb +0 -10
- data/examples/systemd_unit/spec/delete_spec.rb +0 -10
- data/examples/systemd_unit/spec/disable_spec.rb +0 -10
- data/examples/systemd_unit/spec/enable_spec.rb +0 -10
- data/examples/systemd_unit/spec/mask_spec.rb +0 -10
- data/examples/systemd_unit/spec/reload_or_restart_spec.rb +0 -10
- data/examples/systemd_unit/spec/reload_or_try_restart_spec.rb +0 -10
- data/examples/systemd_unit/spec/restart_spec.rb +0 -10
- data/examples/systemd_unit/spec/start_spec.rb +0 -10
- data/examples/systemd_unit/spec/stop_spec.rb +0 -10
- data/examples/systemd_unit/spec/try_restart_spec.rb +0 -10
- data/examples/systemd_unit/spec/unmask_spec.rb +0 -10
- data/examples/template/recipes/create.rb +0 -15
- data/examples/template/recipes/create_if_missing.rb +0 -15
- data/examples/template/recipes/delete.rb +0 -15
- data/examples/template/recipes/touch.rb +0 -15
- data/examples/template/spec/create_if_missing_spec.rb +0 -28
- data/examples/template/spec/create_spec.rb +0 -32
- data/examples/template/spec/delete_spec.rb +0 -19
- data/examples/template/spec/touch_spec.rb +0 -19
- data/examples/use_inline_resources/providers/lwrp.rb +0 -7
- data/examples/use_inline_resources/recipes/default.rb +0 -1
- data/examples/use_inline_resources/resources/lwrp.rb +0 -4
- data/examples/use_inline_resources/spec/default_spec.rb +0 -18
- data/examples/user/recipes/create.rb +0 -13
- data/examples/user/recipes/lock.rb +0 -13
- data/examples/user/recipes/manage.rb +0 -13
- data/examples/user/recipes/modify.rb +0 -13
- data/examples/user/recipes/remove.rb +0 -13
- data/examples/user/recipes/unlock.rb +0 -13
- data/examples/user/spec/create_spec.rb +0 -26
- data/examples/user/spec/lock_spec.rb +0 -22
- data/examples/user/spec/manage_spec.rb +0 -22
- data/examples/user/spec/modify_spec.rb +0 -22
- data/examples/user/spec/remove_spec.rb +0 -22
- data/examples/user/spec/unlock_spec.rb +0 -22
- data/examples/windows_package/recipes/install.rb +0 -13
- data/examples/windows_package/recipes/remove.rb +0 -13
- data/examples/windows_package/spec/install_spec.rb +0 -22
- data/examples/windows_package/spec/remove_spec.rb +0 -22
- data/examples/windows_service/recipes/configure_startup.rb +0 -13
- data/examples/windows_service/recipes/disable.rb +0 -13
- data/examples/windows_service/recipes/enable.rb +0 -13
- data/examples/windows_service/recipes/reload.rb +0 -13
- data/examples/windows_service/recipes/restart.rb +0 -13
- data/examples/windows_service/recipes/start.rb +0 -13
- data/examples/windows_service/recipes/stop.rb +0 -13
- data/examples/windows_service/spec/configure_startup_spec.rb +0 -22
- data/examples/windows_service/spec/disable_spec.rb +0 -22
- data/examples/windows_service/spec/enable_spec.rb +0 -22
- data/examples/windows_service/spec/reload_spec.rb +0 -22
- data/examples/windows_service/spec/restart_spec.rb +0 -22
- data/examples/windows_service/spec/start_spec.rb +0 -22
- data/examples/windows_service/spec/stop_spec.rb +0 -22
- data/examples/yum_package/recipes/install.rb +0 -13
- data/examples/yum_package/recipes/lock.rb +0 -13
- data/examples/yum_package/recipes/purge.rb +0 -13
- data/examples/yum_package/recipes/remove.rb +0 -13
- data/examples/yum_package/recipes/unlock.rb +0 -13
- data/examples/yum_package/recipes/upgrade.rb +0 -13
- data/examples/yum_package/spec/install_spec.rb +0 -26
- data/examples/yum_package/spec/lock_spec.rb +0 -22
- data/examples/yum_package/spec/purge_spec.rb +0 -22
- data/examples/yum_package/spec/remove_spec.rb +0 -22
- data/examples/yum_package/spec/unlock_spec.rb +0 -22
- data/examples/yum_package/spec/upgrade_spec.rb +0 -22
- data/examples/yum_repository/recipes/add.rb +0 -8
- data/examples/yum_repository/recipes/create.rb +0 -8
- data/examples/yum_repository/recipes/delete.rb +0 -3
- data/examples/yum_repository/recipes/makecache.rb +0 -3
- data/examples/yum_repository/recipes/remove.rb +0 -7
- data/examples/yum_repository/spec/add_spec.rb +0 -12
- data/examples/yum_repository/spec/create_spec.rb +0 -17
- data/examples/yum_repository/spec/delete_spec.rb +0 -12
- data/examples/yum_repository/spec/makecache_spec.rb +0 -12
- data/examples/yum_repository/spec/remove_spec.rb +0 -12
- data/examples/zypper_package/recipes/install.rb +0 -13
- data/examples/zypper_package/recipes/lock.rb +0 -13
- data/examples/zypper_package/recipes/purge.rb +0 -13
- data/examples/zypper_package/recipes/remove.rb +0 -13
- data/examples/zypper_package/recipes/unlock.rb +0 -13
- data/examples/zypper_package/recipes/upgrade.rb +0 -13
- data/examples/zypper_package/spec/install_spec.rb +0 -23
- data/examples/zypper_package/spec/lock_spec.rb +0 -19
- data/examples/zypper_package/spec/purge_spec.rb +0 -19
- data/examples/zypper_package/spec/remove_spec.rb +0 -19
- data/examples/zypper_package/spec/unlock_spec.rb +0 -19
- data/examples/zypper_package/spec/upgrade_spec.rb +0 -19
- data/spec/spec_helper.rb +0 -13
- data/spec/support/hash.rb +0 -35
- data/spec/unit/cacher_spec.rb +0 -70
- data/spec/unit/coverage/filters_spec.rb +0 -60
- data/spec/unit/deprecations_spec.rb +0 -53
- data/spec/unit/errors_spec.rb +0 -57
- data/spec/unit/expect_exception_spec.rb +0 -32
- data/spec/unit/macros_spec.rb +0 -119
- data/spec/unit/matchers/do_nothing_matcher.rb +0 -5
- data/spec/unit/matchers/include_recipe_matcher_spec.rb +0 -38
- data/spec/unit/matchers/link_to_matcher_spec.rb +0 -55
- data/spec/unit/matchers/notifications_matcher_spec.rb +0 -40
- data/spec/unit/matchers/render_file_matcher_spec.rb +0 -68
- data/spec/unit/matchers/resource_matcher_spec.rb +0 -5
- data/spec/unit/matchers/state_attrs_matcher_spec.rb +0 -68
- data/spec/unit/matchers/subscribes_matcher_spec.rb +0 -65
- data/spec/unit/renderer_spec.rb +0 -69
- data/spec/unit/server_runner_spec.rb +0 -28
- data/spec/unit/solo_runner_spec.rb +0 -171
- data/spec/unit/stubs/command_registry_spec.rb +0 -27
- data/spec/unit/stubs/command_stub_spec.rb +0 -61
- data/spec/unit/stubs/data_bag_item_registry_spec.rb +0 -39
- data/spec/unit/stubs/data_bag_item_stub_spec.rb +0 -36
- data/spec/unit/stubs/data_bag_registry_spec.rb +0 -39
- data/spec/unit/stubs/data_bag_stub_spec.rb +0 -35
- data/spec/unit/stubs/registry_spec.rb +0 -29
- data/spec/unit/stubs/search_registry_spec.rb +0 -39
- data/spec/unit/stubs/search_stub_spec.rb +0 -36
- data/spec/unit/stubs/stub_spec.rb +0 -64
data/CONTRIBUTING.md
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
Contributing to ChefSpec
|
2
|
-
========================
|
3
|
-
Pull requests are merged via Github, you can find the documentation about how to fork a repository and start contributing to ChefSpec here [https://help.github.com/articles/fork-a-repo](https://help.github.com/articles/fork-a-repo).
|
4
|
-
|
5
|
-
All contributions are welcome to be submitted for review for inclusion, but before they will be accepted, we ask that you follow these simple steps:
|
6
|
-
|
7
|
-
* [Coding standards](#coding-standards)
|
8
|
-
* [Testing](#testing)
|
9
|
-
* [Documentation](#documentation)
|
10
|
-
|
11
|
-
Also, please be patient as not all items will be tested or reviewed immediately by the core team.
|
12
|
-
|
13
|
-
Please be receptive and responsive to feedback about your additions or changes. The core team and/or other community members may make suggestions or ask questions about your change. This is part of the review process, and helps everyone to understand what is happening, why it is happening, and potentially optimizes your code.
|
14
|
-
|
15
|
-
If you're looking to contribute but aren't sure where to start, check out the [open issues](https://github.com/chefspec/chefspec/issues?state=open).
|
16
|
-
|
17
|
-
|
18
|
-
Will Not Merge
|
19
|
-
--------------
|
20
|
-
This section details, specifically, Pull Requests or features that will _not_ be merged:
|
21
|
-
|
22
|
-
1. Matchers for non-Chef core resources. ChefSpec 3.0 introduced a way for cookbook maintainers to [package matchers _with_ their cookbooks](https://github.com/chefspec/chefspec#packaging-custom-matchers) at distribution time.
|
23
|
-
2. New features without accompanying unit tests, cucumber tests, and documentation.
|
24
|
-
|
25
|
-
|
26
|
-
Coding Standards
|
27
|
-
----------------
|
28
|
-
The submitted code should be compatible with the standard Ruby coding guidelines. Here are some additional resources:
|
29
|
-
|
30
|
-
* [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide)
|
31
|
-
* [Github Styleguide](https://github.com/styleguide/ruby)
|
32
|
-
|
33
|
-
There is a tool called [Cane](https://github.com/square/cane) that allows you to validate your code's ABC complexity and documentation.
|
34
|
-
|
35
|
-
|
36
|
-
Testing
|
37
|
-
-------
|
38
|
-
Whether your pull request is a bug fix or introduces new classes or methods to the project, we kindly ask that you include tests for your changes. Even if it's just a small improvement, a test is necessary to ensure the bug is never re-introduced.
|
39
|
-
|
40
|
-
We understand that not all users submitting pull requests will be proficient with RSpec. The maintainers and community as a whole are a helpful group and can help you with writing tests. The [Better Specs](http://betterspecs.org/) site should provide some helpful resources to get you started.
|
41
|
-
|
42
|
-
ChefSpec is tested on [Travis CI](https://travis-ci.org/chefspec/chefspec) against multiple Chef Versions and Ruby Versions. **Your patches must work for all Chef and Ruby Versions on Travis.** This is in an effort to maintain backward compatibility as long as possible. For more information on which Chef and Ruby versions to support, checkout the [`.travis.yml`](https://github.com/chefspec/chefspec/blob/master/.travis.yml) file.
|
43
|
-
|
44
|
-
|
45
|
-
Documentation
|
46
|
-
-------------
|
47
|
-
Documentation is a crucial part to ChefSpec, especially given its broad depth of features. All documentation is placed inline on the method matcher so it can be generated with Yard. Please see existing matchers for an example and check out the [Yard documentation](http://yardoc.info)
|
48
|
-
|
49
|
-
When contributing new features, please ensure adequate documentation and examples are present.
|
50
|
-
|
51
|
-
---
|
52
|
-
This contributing guide is based off of the [Joomla Contributing Guide](https://raw.github.com/joomla/joomla-framework/master/CONTRIBUTING.markdown).
|
data/Gemfile
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
group :development do
|
6
|
-
gem 'rake'
|
7
|
-
gem 'redcarpet'
|
8
|
-
gem 'yard'
|
9
|
-
gem 'pry'
|
10
|
-
gem 'pry-byebug'
|
11
|
-
end
|
12
|
-
|
13
|
-
if ENV["GEMFILE_MOD"]
|
14
|
-
puts "GEMFILE_MOD: #{ENV['GEMFILE_MOD']}"
|
15
|
-
instance_eval(ENV["GEMFILE_MOD"])
|
16
|
-
else
|
17
|
-
gem 'chef', git: "https://github.com/chef/chef"
|
18
|
-
gem 'ohai', git: "https://github.com/chef/ohai"
|
19
|
-
end
|
20
|
-
|
21
|
-
# If you want to load debugging tools into the bundle exec sandbox,
|
22
|
-
# add these additional dependencies into Gemfile.local
|
23
|
-
eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local")
|
data/ISSUES.md
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
ChefSpec Issues
|
2
|
-
---------------
|
3
|
-
This file documents the steps necessary to report and issue with ChefSpec. Following these guidelines will help ensure your issue is resolved in a timely manner.
|
4
|
-
|
5
|
-
Reporting
|
6
|
-
---------
|
7
|
-
When you report an issue, please include the following information:
|
8
|
-
|
9
|
-
- What you're trying to accomplish
|
10
|
-
- An [SSCCE](http://sscce.org/)
|
11
|
-
- The command you ran
|
12
|
-
- What you expected to happen
|
13
|
-
- What actually happened
|
14
|
-
- The exception backtrace(s), if any
|
15
|
-
- What operating system and version
|
16
|
-
- Everything output by running `env`
|
17
|
-
- What version of Ruby you are using (run `ruby -v`)
|
18
|
-
- What version of Rubygems you are using (run `gem -v`)
|
19
|
-
- What version of Chef you are using (run `knife -v`)
|
20
|
-
|
21
|
-
Here's a snippet you can copy-paste into the issue and fill out:
|
22
|
-
|
23
|
-
```text
|
24
|
-
(What is the issue? What are you trying to do? What happened?)
|
25
|
-
|
26
|
-
- Command: `...`
|
27
|
-
- OS:
|
28
|
-
- Ruby:
|
29
|
-
- Rubygems:
|
30
|
-
- Chef:
|
31
|
-
- env:
|
32
|
-
```text
|
33
|
-
# Paste your env here
|
34
|
-
```
|
35
|
-
- Backtrace:
|
36
|
-
```text
|
37
|
-
# Paste backtrace here
|
38
|
-
```
|
39
|
-
```
|
40
|
-
|
41
|
-
[Create a ticket](https://github.com/chefspec/chefspec/issues/new) describing your problem and include the information above.
|
data/README.md
DELETED
@@ -1,571 +0,0 @@
|
|
1
|
-
# ChefSpec
|
2
|
-
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/chefspec.svg)](https://badge.fury.io/rb/chefspec) [![Build Status](https://travis-ci.org/chefspec/chefspec.svg?branch=master)](https://travis-ci.org/chefspec/chefspec)
|
4
|
-
|
5
|
-
ChefSpec is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.
|
6
|
-
|
7
|
-
ChefSpec runs your cookbooks locally while skipping making actual changes. This has two primary benefits:
|
8
|
-
|
9
|
-
- It's really fast!
|
10
|
-
- Your tests can vary node attributes, operating systems, and other system data to assert behavior under varying conditions.
|
11
|
-
|
12
|
-
## Important Notes
|
13
|
-
|
14
|
-
- **ChefSpec requires Ruby 2.2 or later and Chef 12.14.89 or later!**
|
15
|
-
- **This documentation corresponds to the master branch, which may be unreleased. Please check the README of the latest git tag or the gem's source for your version's documentation!**
|
16
|
-
|
17
|
-
**ChefSpec aims to maintain compatibility with at least the two most recent minor versions of Chef.** If you are running an older version of Chef it may work, or you will need to run an older version of ChefSpec.
|
18
|
-
|
19
|
-
As a general rule, if it is tested in the Travis CI matrix, it is a supported version.
|
20
|
-
|
21
|
-
## Quick Start
|
22
|
-
|
23
|
-
## When To Use ChefSpec?
|
24
|
-
|
25
|
-
As mentioned before, ChefSpec is built for speed. In order to run your tests as
|
26
|
-
quickly as possible (and to allow running tests on your workstation), ChefSpec
|
27
|
-
runs your recipe code with all the resource actions disabled. This means that
|
28
|
-
ChefSpec excels at testing complex logic in a cookbook, but can't actually tell
|
29
|
-
you if a cookbook is doing the right thing. Integration testing is provided by
|
30
|
-
the [Test Kitchen](https://kitchen.ci/) project, and for most simple cookbooks
|
31
|
-
without much logic in them we recommend you start off with integration tests and
|
32
|
-
only return to ChefSpec and unit tests as your code gets more complicated.
|
33
|
-
|
34
|
-
There are two common "units" of code in Chef cookbooks, custom resources and
|
35
|
-
recipes. If you find yourself with a lot of recipes that are so complex they
|
36
|
-
require unit tests, consider if they can be refactored as custom resources.
|
37
|
-
|
38
|
-
### Testing a Custom Resource
|
39
|
-
|
40
|
-
If you have have a cookbook with a custom resource `resources/greet.rb` like:
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
resource_name :mycookbook_greet
|
44
|
-
|
45
|
-
property :greeting, String, default: 'Hello'
|
46
|
-
|
47
|
-
action :run do
|
48
|
-
log "#{new_resource.greeting} world"
|
49
|
-
end
|
50
|
-
```
|
51
|
-
|
52
|
-
You can test that resource by creating a spec file `spec/greet_spec.rb`:
|
53
|
-
|
54
|
-
```ruby
|
55
|
-
# Load ChefSpec and put our test into ChefSpec mode.
|
56
|
-
require 'chefspec'
|
57
|
-
|
58
|
-
# Describing our custom resource.
|
59
|
-
describe 'mycookbook_greet' do
|
60
|
-
# Normally ChefSpec skips running resources, but for this test we want to
|
61
|
-
# actually run this one custom resource.
|
62
|
-
step_into :mycookbook_greet
|
63
|
-
# Nothing in this test is platform-specific, so use the latest Ubuntu for
|
64
|
-
# simulated data.
|
65
|
-
platform 'ubuntu'
|
66
|
-
|
67
|
-
# Create an example group for testing the resource defaults.
|
68
|
-
context 'with the default greeting' do
|
69
|
-
# Set the subject of this example group to a snippet of recipe code calling
|
70
|
-
# our custom resource.
|
71
|
-
recipe do
|
72
|
-
mycookbook_greet 'test'
|
73
|
-
end
|
74
|
-
|
75
|
-
# Confirm that the resources created by our custom resource's action are
|
76
|
-
# correct. ChefSpec matchers all take the form `action_type(name)`.
|
77
|
-
it { is_expected.to write_log('Hello world') }
|
78
|
-
end
|
79
|
-
|
80
|
-
# Create a second example group to test a different block of recipe code.
|
81
|
-
context 'with a custom greeting' do
|
82
|
-
# This time our test recipe code sets a property on the custom resource.
|
83
|
-
recipe do
|
84
|
-
mycookbook_greet 'test' do
|
85
|
-
greeting 'Bonjour'
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
# Use the same kind of matcher as before to confirm the action worked.
|
90
|
-
it { is_expected.to write_log('Bonjour world') }
|
91
|
-
end
|
92
|
-
end
|
93
|
-
```
|
94
|
-
|
95
|
-
And then run your test using `chef exec rspec`.
|
96
|
-
|
97
|
-
### Testing a Recipe
|
98
|
-
|
99
|
-
As a general rule of thumb, only very complex recipes benefit from ChefSpec unit
|
100
|
-
tests. If you find yourself writing a lot of recipe unit tests, consider converting
|
101
|
-
the recipes to custom resources instead. For the sake of example we'll use a
|
102
|
-
simple recipe, `recipes/farewell.rb`:
|
103
|
-
|
104
|
-
```ruby
|
105
|
-
log "#{node["mycookbook"]["farewell"]} world"
|
106
|
-
```
|
107
|
-
|
108
|
-
You can test that recipe by creating a spec file `spec/farewell_spec.rb`:
|
109
|
-
|
110
|
-
```ruby
|
111
|
-
# Load ChefSpec and put our test into ChefSpec mode.
|
112
|
-
require 'chefspec'
|
113
|
-
|
114
|
-
# Describing our recipe. The group name should be the recipe string as you would
|
115
|
-
# use it with include_recipe.
|
116
|
-
describe 'mycookbook::farewell' do
|
117
|
-
# Nothing in this test is platform-specific, so use the latest Ubuntu for
|
118
|
-
# simulated data.
|
119
|
-
platform 'ubuntu'
|
120
|
-
|
121
|
-
# Create an example group for testing the recipe defaults.
|
122
|
-
context 'with default attributes' do
|
123
|
-
# Since there was no `recipe do .. end` block here, the default subject is
|
124
|
-
# recipe we named in the `describe`. ChefSpec matchers all take the form
|
125
|
-
# `action_type(name)`.
|
126
|
-
it { is_expected.to write_log('Goodbye world') }
|
127
|
-
end
|
128
|
-
|
129
|
-
# Create a second example group to test with attributes.
|
130
|
-
context 'with a custom farewell' do
|
131
|
-
# Set an override attribute for this group.
|
132
|
-
override_attributes['mycookbook']['farewell'] = 'Adios'
|
133
|
-
|
134
|
-
# Use the same kind of matcher as before to confirm the recipe worked.
|
135
|
-
it { is_expected.to write_log('Adios world') }
|
136
|
-
end
|
137
|
-
end
|
138
|
-
```
|
139
|
-
|
140
|
-
## Cookbook Dependencies
|
141
|
-
|
142
|
-
If your cookbook depends on other cookbooks, you must ensure ChefSpec knows how
|
143
|
-
to fetch those dependencies. If you use a monorepo-style layout with all your
|
144
|
-
cookbooks in a single `cookbooks/` folder, you don't need to do anything.
|
145
|
-
|
146
|
-
If you are using Berkshelf, `require 'chefspec/berkshelf'` in your spec file (or `spec_helper.rb`):
|
147
|
-
|
148
|
-
```ruby
|
149
|
-
require 'chefspec'
|
150
|
-
require 'chefspec/berkshelf'
|
151
|
-
```
|
152
|
-
|
153
|
-
If you are using a Policyfile, `require 'chefspec/policyfile'` in you spec file (or `spec_helper.rb`):
|
154
|
-
|
155
|
-
```ruby
|
156
|
-
require 'chefspec'
|
157
|
-
require 'chefspec/policyfile'
|
158
|
-
```
|
159
|
-
|
160
|
-
Your `Policyfile.rb` should look something like this:
|
161
|
-
|
162
|
-
```ruby
|
163
|
-
# The policy name is ignored but you need to specify one.
|
164
|
-
name 'my_cookbook'
|
165
|
-
# Pull dependent cookbooks from https://supermarket.chef.io/
|
166
|
-
default_source :supermarket
|
167
|
-
# The run list is also ignored by ChefSpec but you need to specify one.
|
168
|
-
run_list 'my_cookbook::default'
|
169
|
-
# The name here must match the name in metadata.rb.
|
170
|
-
cookbook 'my_cookbook', path: '.'
|
171
|
-
```
|
172
|
-
|
173
|
-
## Writing Tests
|
174
|
-
|
175
|
-
ChefSpec is an RSpec library, so if you're already familiar with RSpec you can
|
176
|
-
use all the normal spec-y goodness to which you are accustomed. The usual structure
|
177
|
-
of an RSpec test file is a file named like `spec/something_spec.rb` containing:
|
178
|
-
|
179
|
-
```ruby
|
180
|
-
require 'chefspec'
|
181
|
-
|
182
|
-
describe 'resource name or recipe' do
|
183
|
-
# Some configuration for everything inside this `describe`.
|
184
|
-
platform 'redhat', '7'
|
185
|
-
default_attributes['value'] = 1
|
186
|
-
|
187
|
-
context 'when some condition' do
|
188
|
-
# Some configuration that only applies to this `context`.
|
189
|
-
default_attributes['value'] = 2
|
190
|
-
|
191
|
-
# `matcher` is some matcher function which we'll cover below.
|
192
|
-
it { expect(value).to matcher }
|
193
|
-
# There is a special value you can expect things on called `subject`, which
|
194
|
-
# is the main thing being tested.
|
195
|
-
it { expect(subject).to matcher }
|
196
|
-
# And if prefer it for readability, `expect(subject)` can be written as `is_expected`.
|
197
|
-
it { is_expected.to matcher }
|
198
|
-
end
|
199
|
-
|
200
|
-
context 'when some other condition' do
|
201
|
-
# Repeat as needed.
|
202
|
-
end
|
203
|
-
end
|
204
|
-
```
|
205
|
-
|
206
|
-
### ChefSpec Matchers
|
207
|
-
|
208
|
-
The primary matcher used with ChefSpec are resource matchers:
|
209
|
-
|
210
|
-
```ruby
|
211
|
-
it { expect(chef_run).to ACTION_RESOURCE('NAME') }
|
212
|
-
# Or equivalently.
|
213
|
-
it { is_expected.to ACTION_RESOURCE('NAME') }
|
214
|
-
```
|
215
|
-
|
216
|
-
This checks that a resource like `RESOURCE 'NAME'` would have run the specified
|
217
|
-
action if the cookbook was executing normally. You can also test for specific
|
218
|
-
property values:
|
219
|
-
|
220
|
-
```ruby
|
221
|
-
it { is_expected.to create_user('asmithee').with(uid: 512, gid: 45) }
|
222
|
-
# You can also use other RSpec matchers to create a "compound matcher". Check
|
223
|
-
# RSpec documentation for a full reference on the built-in matchers.
|
224
|
-
it { is_expected.to install_package('myapp').with(version: starts_with("3.")) }
|
225
|
-
```
|
226
|
-
|
227
|
-
#### `render_file`
|
228
|
-
|
229
|
-
For the common case of testing that a file is rendered to disk via either a
|
230
|
-
`template`, `file`, or `cookbook_file` resource, you can use a `render_file`
|
231
|
-
matcher:
|
232
|
-
|
233
|
-
```ruby
|
234
|
-
it { is_expected.to render_file('/etc/myapp.conf') }
|
235
|
-
# You can check for specific content in the file.
|
236
|
-
it { is_expected.to render_file('/etc/myapp.conf').with_content("debug = false\n") }
|
237
|
-
# Or with a regexp.
|
238
|
-
it { is_expected.to render_file('/etc/myapp.conf').with_content(/user = \d+/) }
|
239
|
-
# Or with a compound matcher.
|
240
|
-
it { is_expected.to render_file('/etc/myapp.conf').with_content(start_with('# This file managed by Chef')) }
|
241
|
-
# Or with a Ruby block of arbitrary assertions.
|
242
|
-
it do
|
243
|
-
is_expected.to render_file('/etc/myapp.conf').with_content { |content|
|
244
|
-
# Arbitrary RSpec code goes here.
|
245
|
-
}
|
246
|
-
end
|
247
|
-
```
|
248
|
-
|
249
|
-
#### Notifications
|
250
|
-
|
251
|
-
As actions do not normally run in ChefSpec, testing for notifications is a special
|
252
|
-
case. Unlike the resource matchers which evaluate against the ChefSpec runner,
|
253
|
-
the notification matchers evaluate against a resource object:
|
254
|
-
|
255
|
-
```ruby
|
256
|
-
# To match `notifies :run, 'execute[unpack]', :immediately
|
257
|
-
it { expect(chef_run.remote_file('/download')).to notify('execute[unpack]') }
|
258
|
-
# To check for a specific notification action.
|
259
|
-
it { expect(chef_run.remote_file('/download')).to notify('execute[unpack]').to(:run) }
|
260
|
-
# And to check for a specific timing.
|
261
|
-
it { expect(chef_run.remote_file('/download')).to notify('execute[unpack]').to(:run).immediately }
|
262
|
-
```
|
263
|
-
|
264
|
-
And similarly for subscriptions:
|
265
|
-
|
266
|
-
```ruby
|
267
|
-
it { expect(chef_run.execute('unpack')).to subscribe_to('remote_file[/download]').on(:create) }
|
268
|
-
```
|
269
|
-
|
270
|
-
### Test Subject
|
271
|
-
|
272
|
-
RSpec expectations always need a value to run against, with the main value being
|
273
|
-
tested for a given example group (`describe` or `context` block) is called the
|
274
|
-
`subject`. In ChefSpec this is almost always `ChefSpec::Runner` that has converge
|
275
|
-
some recipe code.
|
276
|
-
|
277
|
-
There are two ways to set which recipe code should be run for the test. More commonly
|
278
|
-
for testing custom resources, you use the `recipe` helper method in the test to
|
279
|
-
provide an in-line block of recipe code:
|
280
|
-
|
281
|
-
```ruby
|
282
|
-
describe 'something' do
|
283
|
-
recipe do
|
284
|
-
my_custom_resource 'something' do
|
285
|
-
debug true
|
286
|
-
end
|
287
|
-
end
|
288
|
-
end
|
289
|
-
```
|
290
|
-
|
291
|
-
By using an in-line block of recipe code, you can try many variations to test
|
292
|
-
different configurations of your custom resource.
|
293
|
-
|
294
|
-
If no `recipe` block is present, ChefSpec will use the name of the top-level
|
295
|
-
`describe` block as a recipe name to run. So for the case of testing a recipe
|
296
|
-
in your cookbook, use the `cookbookname::recipename` string as the label:
|
297
|
-
|
298
|
-
```ruby
|
299
|
-
describe 'mycookbook'
|
300
|
-
# Or.
|
301
|
-
describe 'mycookbook::myrecipe'
|
302
|
-
```
|
303
|
-
|
304
|
-
### Test Settings
|
305
|
-
|
306
|
-
Most ChefSpec configuration is set in your example groups (`describe` or `context`
|
307
|
-
blocks) using helper methods. These all follow the RSpec convention of inheriting
|
308
|
-
from a parent group to the groups inside it. So a setting in your top-level `describe`
|
309
|
-
will automatically be set in any `context` unless overridden:
|
310
|
-
|
311
|
-
```ruby
|
312
|
-
describe 'something' do
|
313
|
-
platform 'ubuntu'
|
314
|
-
|
315
|
-
# Platform is Ubuntu for any tests here.
|
316
|
-
it { is_expected.to ... }
|
317
|
-
|
318
|
-
context 'when something' do
|
319
|
-
# Platform is still Ubuntu for any tests here.
|
320
|
-
end
|
321
|
-
|
322
|
-
context 'when something else' do
|
323
|
-
platform 'fedora'
|
324
|
-
# But platform here will be Fedora.
|
325
|
-
end
|
326
|
-
end
|
327
|
-
```
|
328
|
-
|
329
|
-
#### Platform Data
|
330
|
-
|
331
|
-
To support simulating Chef runs on the same OS as you use your cookbooks on, ChefSpec
|
332
|
-
loads pre-fabricated Ohai data from [Fauxhai](https://github.com/chefspec/fauxhai/).
|
333
|
-
To configure which OS' data is set for your test, use the `platform` helper method:
|
334
|
-
|
335
|
-
```ruby
|
336
|
-
describe 'something' do
|
337
|
-
platform 'ubuntu', '18.04'
|
338
|
-
# ...
|
339
|
-
end
|
340
|
-
```
|
341
|
-
|
342
|
-
You can specify a partial version number to get the latest version of that OS
|
343
|
-
matching the provided prefix, or leave the version off entirely to get the latest
|
344
|
-
version overall:
|
345
|
-
|
346
|
-
```ruby
|
347
|
-
# Will use the latest RedHat 7.x.
|
348
|
-
platform 'redhat', '7'
|
349
|
-
# Will use the latest version of Windows.
|
350
|
-
platform 'windows'
|
351
|
-
```
|
352
|
-
|
353
|
-
**WARNING:** If you leave off the version or use a partial version prefix, the
|
354
|
-
behavior of your tests may change between versions of ChefDK as new data is
|
355
|
-
available in Fauxhai. Only use this feature if you're certain that your tests
|
356
|
-
do not (or should not) depend on the specifics of OS version.
|
357
|
-
|
358
|
-
#### Node Attributes
|
359
|
-
|
360
|
-
Node attributes are set using the `default_attributes`, `normal_attributes`,
|
361
|
-
`override_attributes`, and `automatic_attributes` helper methods. These inherit
|
362
|
-
from a parent group to its children using a deep merge, like in other places in
|
363
|
-
Chef:
|
364
|
-
|
365
|
-
```ruby
|
366
|
-
describe 'something' do
|
367
|
-
default_attributes['myapp']['name'] = 'one'
|
368
|
-
default_attributes['myapp']['email'] = 'myapp@example.com'
|
369
|
-
|
370
|
-
context 'when something' do
|
371
|
-
default_attributes['myapp']['name'] = 'two'
|
372
|
-
end
|
373
|
-
end
|
374
|
-
```
|
375
|
-
|
376
|
-
Any values set using `automatic_attributes` take priority over Fauxhai data.
|
377
|
-
|
378
|
-
#### Step Into
|
379
|
-
|
380
|
-
Normally ChefSpec skips all resource (and provider) actions. When testing the
|
381
|
-
implementation of a custom resource, we need to tell ChefSpec to run actions
|
382
|
-
on our specific custom resource so it can be tested:
|
383
|
-
|
384
|
-
```ruby
|
385
|
-
describe 'something' do
|
386
|
-
step_into :my_custom_resource
|
387
|
-
end
|
388
|
-
```
|
389
|
-
|
390
|
-
|
391
|
-
#### Other ChefSpec Configuration
|
392
|
-
|
393
|
-
You can specify any other ChefSpec configuration options using the `chefspec_options`
|
394
|
-
helper:
|
395
|
-
|
396
|
-
```ruby
|
397
|
-
describe 'something' do
|
398
|
-
chefspec_options[:log_level] = :debug
|
399
|
-
end
|
400
|
-
```
|
401
|
-
|
402
|
-
### Stubbing
|
403
|
-
|
404
|
-
In order to keep unit tests fast and independent of the target system, we have to
|
405
|
-
make sure that any interaction with the system (either the target node or the Chef
|
406
|
-
Server, both parts of the system just in opposite directions) is replaced with a
|
407
|
-
fake, local version. For some thing, like ensuring that resource actions are
|
408
|
-
replaced with a no-op, the stubbing is automatic. For others, we need to tell ChefSpec
|
409
|
-
how to handle things.
|
410
|
-
|
411
|
-
#### Guards
|
412
|
-
|
413
|
-
The most common case of interacting with the system is a guard clause on a resource:
|
414
|
-
|
415
|
-
```ruby
|
416
|
-
not_if 'some command'
|
417
|
-
# Or.
|
418
|
-
only_if 'some command'
|
419
|
-
```
|
420
|
-
|
421
|
-
In order for ChefSpec to know how to evaluate the resource, we need to tell it
|
422
|
-
how the command would have returned for this test if it was running on the actual
|
423
|
-
machine:
|
424
|
-
|
425
|
-
```ruby
|
426
|
-
describe 'something' do
|
427
|
-
recipe do
|
428
|
-
execute '/opt/myapp/install.sh' do
|
429
|
-
# Check if myapp is installed and runnable.
|
430
|
-
not_if 'myapp --version'
|
431
|
-
end
|
432
|
-
end
|
433
|
-
|
434
|
-
before do
|
435
|
-
# Tell ChefSpec the command would have succeeded.
|
436
|
-
stub_command('myapp --version').and_return(true)
|
437
|
-
# Tell ChefSpec the command would have failed.
|
438
|
-
stub_command('myapp --version').and_return(false)
|
439
|
-
# You can also use a regexp to stub multiple commands at once.
|
440
|
-
stub_command(/^myapp/).and_return(false)
|
441
|
-
end
|
442
|
-
end
|
443
|
-
```
|
444
|
-
|
445
|
-
If using the Ruby code block form of a guard (e.g. `not_if { something }`), see
|
446
|
-
the [Ruby stubbing section](#ruby-code) below.
|
447
|
-
|
448
|
-
#### Search
|
449
|
-
|
450
|
-
When testing code that uses the `search()` API in Chef, we have to stub out the
|
451
|
-
results that would normally come from the Chef Server:
|
452
|
-
|
453
|
-
```ruby
|
454
|
-
describe 'something' do
|
455
|
-
recipe do
|
456
|
-
web_servers = search(:node, 'roles:web').map { |n| n['hostname'] }
|
457
|
-
end
|
458
|
-
|
459
|
-
before do
|
460
|
-
stub_search(:node, 'roles:web').and_return([{hostname: 'one'}, {hostname: two}])
|
461
|
-
end
|
462
|
-
end
|
463
|
-
```
|
464
|
-
|
465
|
-
#### Data Bags
|
466
|
-
|
467
|
-
Similar to the Search API, the `data_bag()` and `data_bag_item()` APIs normally
|
468
|
-
fetch data from Chef Server so we need to stub their results:
|
469
|
-
|
470
|
-
```ruby
|
471
|
-
describe 'something' do
|
472
|
-
recipe do
|
473
|
-
# Side note: don't write recipe code like this. This should be `search(:users, '*:*')`.
|
474
|
-
users = data_bag('users').map do |user|
|
475
|
-
data_bag_item('users', user['id'])
|
476
|
-
end
|
477
|
-
end
|
478
|
-
|
479
|
-
before do
|
480
|
-
stub_data_bag('users').and_return(['asmithee'])
|
481
|
-
stub_data_bag_item('users', 'asmithee').and_return({uid: 1234})
|
482
|
-
end
|
483
|
-
end
|
484
|
-
```
|
485
|
-
|
486
|
-
#### Resource and Provider Methods
|
487
|
-
|
488
|
-
When testing custom resources, it is often useful to stub methods on the resource
|
489
|
-
or provider instance. These can be set up using the `stubs_for_resource` and
|
490
|
-
`stubs_for_provider` helpers:
|
491
|
-
|
492
|
-
```ruby
|
493
|
-
describe 'something' do
|
494
|
-
recipe do
|
495
|
-
my_custom_resource 'something'
|
496
|
-
end
|
497
|
-
|
498
|
-
# Set up stubs for just the one resource.
|
499
|
-
stubs_for_resource('my_custom_resource[something]') do |res|
|
500
|
-
# Can use any RSpec Mocks code here, see below.
|
501
|
-
allow(res).to receive(:something)
|
502
|
-
end
|
503
|
-
# Stubs for any instance of my_custom_resource.
|
504
|
-
stubs_for_resource('my_custom_resource') do |res|
|
505
|
-
# ...
|
506
|
-
end
|
507
|
-
# Stubs for any resource.
|
508
|
-
stubs_for_resource do |res|
|
509
|
-
# ...
|
510
|
-
end
|
511
|
-
|
512
|
-
# Stubs for the provider for just the one resource.
|
513
|
-
stubs_for_provider('my_custom_resource[something]') do |res|
|
514
|
-
# Can use any RSpec Mocks code here, see below.
|
515
|
-
allow(res).to receive(:something)
|
516
|
-
end
|
517
|
-
# And similar to the above for any provider of a type or any overall.
|
518
|
-
end
|
519
|
-
```
|
520
|
-
|
521
|
-
By default, stubs for the resource will also be set up on the `current_resource`
|
522
|
-
object. This can be disabled by using `stubs_for_resource('my_custom_resource[something]', current_resource: false)`.
|
523
|
-
You can also manually set stubs for only the `current_resource` using `stubs_for_current_resource`.
|
524
|
-
|
525
|
-
#### Ruby Code
|
526
|
-
|
527
|
-
For more complex Ruby code, in recipes, libraries, or custom resources, you have
|
528
|
-
the full power of RSpec and RSpec Mocks available to you:
|
529
|
-
|
530
|
-
```ruby
|
531
|
-
before do
|
532
|
-
allow(File).to receive(:exist?).and_call_original
|
533
|
-
allow(File).to receive(:exist?).with('/test/path').and_return(true)
|
534
|
-
end
|
535
|
-
```
|
536
|
-
|
537
|
-
Check out the [RSpec Mocks documentation](https://relishapp.com/rspec/rspec-mocks/docs)
|
538
|
-
for more information about setting up Ruby method stubs.
|
539
|
-
|
540
|
-
## Development
|
541
|
-
|
542
|
-
1. Fork the repository from GitHub.
|
543
|
-
2. Clone your fork to your local machine:
|
544
|
-
|
545
|
-
```
|
546
|
-
$ git clone git@github.com:USER/chefspec.git
|
547
|
-
```
|
548
|
-
|
549
|
-
3. Create a git branch
|
550
|
-
|
551
|
-
```
|
552
|
-
$ git checkout -b my_bug_fix
|
553
|
-
```
|
554
|
-
|
555
|
-
4. **Write tests**
|
556
|
-
|
557
|
-
5. Make your changes/patches/fixes, committing appropriately
|
558
|
-
|
559
|
-
6. Run the tests: `bundle exec rake`
|
560
|
-
|
561
|
-
7. Push your changes to GitHub
|
562
|
-
|
563
|
-
8. Open a Pull Request
|
564
|
-
|
565
|
-
ChefSpec is on [Travis CI][travis] which tests against multiple Chef and Ruby versions.
|
566
|
-
|
567
|
-
If you are contributing, please see the [Contributing Guidelines](https://github.com/chefspec/chefspec/blob/master/CONTRIBUTING.md) for more information.
|
568
|
-
|
569
|
-
## License
|
570
|
-
|
571
|
-
MIT - see the accompanying [LICENSE](https://github.com/chefspec/chefspec/blob/master/LICENSE) file for details.
|