chefspec 7.0.0 → 9.3.8
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 +5 -5
- data/Gemfile +28 -10
- data/Rakefile +74 -18
- data/chefspec.gemspec +26 -28
- data/lib/chefspec/api/core.rb +217 -0
- data/lib/chefspec/api/described.rb +53 -0
- data/lib/chefspec/api/do_nothing.rb +23 -21
- data/lib/chefspec/api/include_any_recipe.rb +24 -0
- data/lib/chefspec/api/include_recipe.rb +25 -23
- data/lib/chefspec/api/link.rb +24 -98
- data/lib/chefspec/api/notifications.rb +37 -35
- data/lib/chefspec/api/reboot.rb +9 -13
- data/lib/chefspec/api/render_file.rb +34 -32
- data/lib/chefspec/api/state_attrs.rb +27 -25
- data/lib/chefspec/api/stubs.rb +183 -0
- data/lib/chefspec/api/stubs_for.rb +139 -0
- data/lib/chefspec/api/subscriptions.rb +34 -32
- data/lib/chefspec/api/user.rb +221 -219
- data/lib/chefspec/api.rb +32 -89
- data/lib/chefspec/berkshelf.rb +5 -5
- data/lib/chefspec/cacher.rb +2 -2
- data/lib/chefspec/coverage/filters.rb +18 -15
- data/lib/chefspec/coverage.rb +36 -40
- data/lib/chefspec/deprecations.rb +5 -14
- data/lib/chefspec/errors.rb +8 -7
- data/lib/chefspec/expect_exception.rb +2 -1
- data/lib/chefspec/extensions/chef/client.rb +6 -7
- data/lib/chefspec/extensions/chef/conditional.rb +5 -3
- data/lib/chefspec/extensions/chef/cookbook/gem_installer.rb +33 -0
- data/lib/chefspec/extensions/chef/cookbook_loader.rb +14 -0
- data/lib/chefspec/extensions/chef/cookbook_uploader.rb +4 -3
- data/lib/chefspec/extensions/chef/data_query.rb +8 -11
- data/lib/chefspec/extensions/chef/lwrp_base.rb +18 -21
- data/lib/chefspec/extensions/chef/provider.rb +39 -0
- data/lib/chefspec/extensions/chef/resource/freebsd_package.rb +15 -17
- data/lib/chefspec/extensions/chef/resource.rb +148 -9
- data/lib/chefspec/extensions/chef/run_context/cookbook_compiler.rb +84 -0
- data/lib/chefspec/extensions/chef/securable.rb +1 -1
- data/lib/chefspec/extensions/ohai/system.rb +11 -0
- data/lib/chefspec/extensions.rb +21 -0
- data/lib/chefspec/file_cache_path_proxy.rb +3 -3
- data/lib/chefspec/formatter.rb +15 -3
- data/lib/chefspec/librarian.rb +7 -6
- data/lib/chefspec/matchers/do_nothing_matcher.rb +15 -15
- data/lib/chefspec/matchers/include_any_recipe_matcher.rb +51 -0
- data/lib/chefspec/matchers/include_recipe_matcher.rb +1 -1
- data/lib/chefspec/matchers/link_to_matcher.rb +2 -2
- data/lib/chefspec/matchers/notifications_matcher.rb +5 -4
- data/lib/chefspec/matchers/render_file_matcher.rb +39 -29
- data/lib/chefspec/matchers/resource_matcher.rb +19 -17
- data/lib/chefspec/matchers.rb +9 -8
- data/lib/chefspec/mixins/normalize.rb +1 -1
- data/lib/chefspec/policyfile.rb +16 -9
- data/lib/chefspec/renderer.rb +4 -4
- data/lib/chefspec/rspec.rb +4 -8
- data/lib/chefspec/runner.rb +8 -0
- data/lib/chefspec/server.rb +1 -1
- data/lib/chefspec/server_methods.rb +9 -9
- data/lib/chefspec/server_runner.rb +21 -17
- data/lib/chefspec/solo_runner.rb +148 -42
- data/lib/chefspec/stubs/command_registry.rb +1 -1
- data/lib/chefspec/stubs/command_stub.rb +1 -1
- data/lib/chefspec/stubs/data_bag_item_registry.rb +1 -1
- data/lib/chefspec/stubs/data_bag_item_stub.rb +1 -1
- data/lib/chefspec/stubs/data_bag_registry.rb +1 -1
- data/lib/chefspec/stubs/data_bag_stub.rb +1 -1
- data/lib/chefspec/stubs/registry.rb +1 -1
- data/lib/chefspec/stubs/search_registry.rb +2 -2
- data/lib/chefspec/stubs/search_stub.rb +2 -2
- data/lib/chefspec/util.rb +7 -7
- data/lib/chefspec/version.rb +1 -1
- data/lib/chefspec/zero_server.rb +23 -21
- data/lib/chefspec.rb +29 -36
- data/spec/spec_helper.rb +3 -4
- data/spec/support/hash.rb +4 -4
- data/spec/unit/cacher_spec.rb +17 -17
- data/spec/unit/coverage/filters_spec.rb +16 -16
- data/spec/unit/deprecations_spec.rb +9 -35
- data/spec/unit/errors_spec.rb +15 -15
- data/spec/unit/expect_exception_spec.rb +9 -9
- data/spec/unit/macros_spec.rb +57 -57
- data/spec/unit/matchers/do_nothing_matcher.rb +1 -1
- data/spec/unit/matchers/include_any_recipe_matcher_spec.rb +52 -0
- data/spec/unit/matchers/include_recipe_matcher_spec.rb +15 -15
- data/spec/unit/matchers/link_to_matcher_spec.rb +18 -18
- data/spec/unit/matchers/notifications_matcher_spec.rb +15 -16
- data/spec/unit/matchers/render_file_matcher_spec.rb +31 -24
- data/spec/unit/matchers/resource_matcher_spec.rb +1 -1
- data/spec/unit/matchers/state_attrs_matcher_spec.rb +24 -24
- data/spec/unit/matchers/subscribes_matcher_spec.rb +27 -29
- data/spec/unit/renderer_spec.rb +36 -36
- data/spec/unit/server_runner_spec.rb +6 -6
- data/spec/unit/solo_runner_spec.rb +70 -70
- data/spec/unit/stubs/command_registry_spec.rb +11 -11
- data/spec/unit/stubs/command_stub_spec.rb +26 -26
- data/spec/unit/stubs/data_bag_item_registry_spec.rb +17 -17
- data/spec/unit/stubs/data_bag_item_stub_spec.rb +14 -14
- data/spec/unit/stubs/data_bag_registry_spec.rb +16 -16
- data/spec/unit/stubs/data_bag_stub_spec.rb +13 -13
- data/spec/unit/stubs/registry_spec.rb +9 -9
- data/spec/unit/stubs/search_registry_spec.rb +17 -17
- data/spec/unit/stubs/search_stub_spec.rb +14 -14
- data/spec/unit/stubs/stub_spec.rb +22 -22
- data/templates/errors/may_need_to_specify_platform.erb +3 -3
- data/templates/errors/shell_out_not_stubbed.erb +10 -0
- metadata +47 -902
- data/.gitignore +0 -16
- data/.travis.yml +0 -32
- data/CHANGELOG.md +0 -777
- data/CONTRIBUTING.md +0 -52
- data/ISSUES.md +0 -41
- data/README.md +0 -1230
- data/examples/apt_package/recipes/install.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/upgrade.rb +0 -13
- data/examples/apt_package/spec/install_spec.rb +0 -26
- 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/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 -26
- data/examples/cab_package/spec/remove_spec.rb +0 -22
- data/examples/cached/recipes/default.rb +0 -1
- data/examples/cached/spec/default_spec.rb +0 -13
- 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 -27
- 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/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 -23
- 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/libraries/matchers.rb +0 -5
- 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/deploy/recipes/deploy.rb +0 -10
- data/examples/deploy/recipes/force_deploy.rb +0 -9
- data/examples/deploy/recipes/rollback.rb +0 -9
- data/examples/deploy/spec/deploy_spec.rb +0 -15
- data/examples/deploy/spec/force_deploy_spec.rb +0 -15
- data/examples/deploy/spec/rollback_spec.rb +0 -15
- 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 -26
- data/examples/dnf_package/spec/purge_spec.rb +0 -22
- data/examples/dnf_package/spec/remove_spec.rb +0 -22
- data/examples/dnf_package/spec/upgrade_spec.rb +0 -22
- 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/erl_call/recipes/run.rb +0 -13
- data/examples/erl_call/spec/run_spec.rb +0 -23
- 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 -7
- 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/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 -14
- 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 -26
- data/examples/msu_package/spec/remove_spec.rb +0 -22
- 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/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/purge.rb +0 -17
- data/examples/package/recipes/reconfig.rb +0 -17
- data/examples/package/recipes/remove.rb +0 -17
- data/examples/package/recipes/upgrade.rb +0 -17
- data/examples/package/spec/install_spec.rb +0 -27
- 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/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/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 -155
- 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/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 -17
- 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/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/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/libraries/matchers.rb +0 -5
- 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/purge.rb +0 -13
- data/examples/yum_package/recipes/remove.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/purge_spec.rb +0 -22
- data/examples/yum_package/spec/remove_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/purge.rb +0 -13
- data/examples/zypper_package/recipes/remove.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/purge_spec.rb +0 -19
- data/examples/zypper_package/spec/remove_spec.rb +0 -19
- data/examples/zypper_package/spec/upgrade_spec.rb +0 -19
- data/features/apt_package.feature +0 -14
- data/features/apt_repository.feature +0 -15
- data/features/apt_update.feature +0 -13
- data/features/attributes.feature +0 -7
- data/features/batch.feature +0 -10
- data/features/bff_package.feature +0 -12
- data/features/cab_package.feature +0 -21
- data/features/cached.feature +0 -7
- data/features/chef_gem.feature +0 -14
- data/features/chocolatey_package.feature +0 -14
- data/features/compile_time.feature +0 -7
- data/features/cookbook_file.feature +0 -13
- data/features/cron.feature +0 -11
- data/features/custom_matcher.feature +0 -11
- data/features/custom_resource.feature +0 -7
- data/features/deploy.feature +0 -12
- data/features/directory.feature +0 -11
- data/features/dnf_package.feature +0 -26
- data/features/do_nothing.feature +0 -10
- data/features/dpkg_package.feature +0 -12
- data/features/dsc_resource.feature +0 -10
- data/features/dsc_script.feature +0 -10
- data/features/env.feature +0 -12
- data/features/erl_call.feature +0 -10
- data/features/execute.feature +0 -10
- data/features/exotic_zero_port.feature +0 -7
- data/features/expect_exception.feature +0 -12
- data/features/file.feature +0 -13
- data/features/freebsd_package.feature +0 -11
- data/features/gem_package.feature +0 -14
- data/features/git.feature +0 -12
- data/features/group.feature +0 -13
- data/features/guards.feature +0 -10
- data/features/heavy_provider_light_resource.feature +0 -10
- data/features/homebrew_package.feature +0 -12
- data/features/http_request.feature +0 -15
- data/features/ifconfig.feature +0 -13
- data/features/include_recipe.feature +0 -10
- data/features/ips_package.feature +0 -12
- data/features/launchd.feature +0 -17
- data/features/link.feature +0 -12
- data/features/log.feature +0 -10
- data/features/macports_package.feature +0 -13
- data/features/mdadm.feature +0 -12
- data/features/mount.feature +0 -14
- data/features/msu_package.feature +0 -23
- data/features/multiple_actions.feature +0 -12
- data/features/multiple_run_action.feature +0 -7
- data/features/notifications.feature +0 -14
- data/features/ohai.feature +0 -10
- data/features/openbsd_package.feature +0 -12
- data/features/osx_profile.feature +0 -13
- data/features/package.feature +0 -14
- data/features/pacman_package.feature +0 -13
- data/features/paludis_package.feature +0 -12
- data/features/portage_package.feature +0 -13
- data/features/powershell_script.feature +0 -10
- data/features/reboot.feature +0 -12
- data/features/registry_key.feature +0 -13
- data/features/remote_directory.feature +0 -12
- data/features/remote_file.feature +0 -13
- data/features/render_file.feature +0 -11
- data/features/roles.feature +0 -7
- data/features/route.feature +0 -11
- data/features/rpm_package.feature +0 -12
- data/features/ruby_block.feature +0 -11
- data/features/script.feature +0 -16
- data/features/server.feature +0 -16
- data/features/server_on_disk.feature +0 -16
- data/features/service.feature +0 -15
- data/features/smartos_package.feature +0 -12
- data/features/solaris_package.feature +0 -12
- data/features/state_attrs.feature +0 -7
- data/features/step_definitions/background_steps.rb +0 -7
- data/features/step_into.feature +0 -7
- data/features/stub_command.feature +0 -7
- data/features/stub_data_bag.feature +0 -7
- data/features/stub_data_bag_item.feature +0 -7
- data/features/stub_node.feature +0 -7
- data/features/stub_search.feature +0 -7
- data/features/subscribes.feature +0 -14
- data/features/subversion.feature +0 -13
- data/features/support/env.rb +0 -38
- data/features/support/executor.rb +0 -20
- data/features/support/exotic_zero_port.rb +0 -3
- data/features/support/on_disk.rb +0 -7
- data/features/systemd_unit.feature +0 -27
- data/features/template.feature +0 -13
- data/features/use_inline_resources.feature +0 -7
- data/features/user.feature +0 -15
- data/features/windows_package.feature +0 -11
- data/features/windows_service.feature +0 -16
- data/features/yum_package.feature +0 -13
- data/features/yum_repository.feature +0 -23
- data/features/zypper_package.feature +0 -13
- data/lib/chefspec/api/apt_package.rb +0 -192
- data/lib/chefspec/api/apt_repository.rb +0 -56
- data/lib/chefspec/api/apt_update.rb +0 -53
- data/lib/chefspec/api/batch.rb +0 -43
- data/lib/chefspec/api/bff_package.rb +0 -154
- data/lib/chefspec/api/cab_package.rb +0 -80
- data/lib/chefspec/api/chef_gem.rb +0 -191
- data/lib/chefspec/api/chocolatey_package.rb +0 -107
- data/lib/chefspec/api/cookbook_file.rb +0 -166
- data/lib/chefspec/api/cron.rb +0 -80
- data/lib/chefspec/api/deploy.rb +0 -117
- data/lib/chefspec/api/directory.rb +0 -80
- data/lib/chefspec/api/dnf_package.rb +0 -154
- data/lib/chefspec/api/dpkg_package.rb +0 -117
- data/lib/chefspec/api/dsc_resource.rb +0 -49
- data/lib/chefspec/api/dsc_script.rb +0 -37
- data/lib/chefspec/api/easy_install_package.rb +0 -154
- data/lib/chefspec/api/env.rb +0 -117
- data/lib/chefspec/api/erl_call.rb +0 -43
- data/lib/chefspec/api/execute.rb +0 -43
- data/lib/chefspec/api/file.rb +0 -166
- data/lib/chefspec/api/freebsd_package.rb +0 -80
- data/lib/chefspec/api/gem_package.rb +0 -191
- data/lib/chefspec/api/git.rb +0 -117
- data/lib/chefspec/api/group.rb +0 -154
- data/lib/chefspec/api/homebrew_package.rb +0 -154
- data/lib/chefspec/api/http_request.rb +0 -228
- data/lib/chefspec/api/ifconfig.rb +0 -154
- data/lib/chefspec/api/ips_package.rb +0 -117
- data/lib/chefspec/api/launchd.rb +0 -151
- data/lib/chefspec/api/log.rb +0 -43
- data/lib/chefspec/api/macports_package.rb +0 -154
- data/lib/chefspec/api/mdadm.rb +0 -117
- data/lib/chefspec/api/mount.rb +0 -192
- data/lib/chefspec/api/msu_package.rb +0 -81
- data/lib/chefspec/api/ohai.rb +0 -43
- data/lib/chefspec/api/openbsd_package.rb +0 -155
- data/lib/chefspec/api/osx_profile.rb +0 -63
- data/lib/chefspec/api/package.rb +0 -192
- data/lib/chefspec/api/pacman_package.rb +0 -155
- data/lib/chefspec/api/paludis_package.rb +0 -155
- data/lib/chefspec/api/portage_package.rb +0 -155
- data/lib/chefspec/api/powershell_script.rb +0 -43
- data/lib/chefspec/api/registry_key.rb +0 -166
- data/lib/chefspec/api/remote_directory.rb +0 -120
- data/lib/chefspec/api/remote_file.rb +0 -166
- data/lib/chefspec/api/route.rb +0 -80
- data/lib/chefspec/api/rpm_package.rb +0 -117
- data/lib/chefspec/api/ruby_block.rb +0 -68
- data/lib/chefspec/api/script.rb +0 -278
- data/lib/chefspec/api/service.rb +0 -246
- data/lib/chefspec/api/smartos_package.rb +0 -117
- data/lib/chefspec/api/solaris_package.rb +0 -117
- data/lib/chefspec/api/subversion.rb +0 -154
- data/lib/chefspec/api/systemd_unit.rb +0 -353
- data/lib/chefspec/api/template.rb +0 -166
- data/lib/chefspec/api/windows_package.rb +0 -86
- data/lib/chefspec/api/windows_service.rb +0 -286
- data/lib/chefspec/api/yum_package.rb +0 -154
- data/lib/chefspec/api/yum_repository.rb +0 -130
- data/lib/chefspec/api/zypper_package.rb +0 -154
- data/lib/chefspec/macros.rb +0 -222
- data/spec/unit/api_spec.rb +0 -18
data/spec/unit/cacher_spec.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
require "chefspec/cacher"
|
|
3
3
|
|
|
4
4
|
describe ChefSpec::Cacher do
|
|
5
5
|
let(:klass) do
|
|
@@ -7,7 +7,7 @@ describe ChefSpec::Cacher do
|
|
|
7
7
|
extend ChefSpec::Cacher
|
|
8
8
|
|
|
9
9
|
def self.metadata
|
|
10
|
-
{ parent_example_group: { location:
|
|
10
|
+
{ parent_example_group: { location: "spec" } }
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
end
|
|
@@ -17,23 +17,23 @@ describe ChefSpec::Cacher do
|
|
|
17
17
|
|
|
18
18
|
before(:each) { described_class.class_variable_set(:@@cache, {}) unless preserve_cache }
|
|
19
19
|
|
|
20
|
-
describe
|
|
21
|
-
it
|
|
20
|
+
describe "cached" do
|
|
21
|
+
it "lazily defines the results for the cache" do
|
|
22
22
|
klass.cached(:chef_run)
|
|
23
23
|
expect(klass).to be_method_defined(:chef_run)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
it
|
|
26
|
+
it "adds the item to the cache when called" do
|
|
27
27
|
runner = double(:runner)
|
|
28
28
|
klass.cached(:chef_run) { runner }
|
|
29
29
|
klass.new.chef_run
|
|
30
30
|
|
|
31
|
-
expect(cache[Thread.current.object_id]).to have_key(
|
|
32
|
-
expect(cache[Thread.current.object_id][
|
|
31
|
+
expect(cache[Thread.current.object_id]).to have_key("spec.chef_run")
|
|
32
|
+
expect(cache[Thread.current.object_id]["spec.chef_run"]).to eq(runner)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
context
|
|
36
|
-
it
|
|
35
|
+
context "when multithreaded environment" do
|
|
36
|
+
it "is thread safe" do
|
|
37
37
|
(1..2).each do |n|
|
|
38
38
|
Thread.new do
|
|
39
39
|
klass.cached(:chef_run) { n }
|
|
@@ -43,14 +43,14 @@ describe ChefSpec::Cacher do
|
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
context
|
|
46
|
+
context "when example groups are defined by looping" do
|
|
47
47
|
let(:preserve_cache) { true }
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
%w{first second third}.each do |iteration|
|
|
50
50
|
context "on the #{iteration} iteration" do
|
|
51
|
-
context
|
|
51
|
+
context "in caching context" do
|
|
52
52
|
cached(:cached_iteration) { iteration }
|
|
53
|
-
it
|
|
53
|
+
it "caches the iteration for this context" do
|
|
54
54
|
expect(cached_iteration).to eq iteration
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -59,12 +59,12 @@ describe ChefSpec::Cacher do
|
|
|
59
59
|
end
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
-
describe
|
|
63
|
-
it
|
|
62
|
+
describe "cached!" do
|
|
63
|
+
it "loads the value at runtime" do
|
|
64
64
|
expect(klass).to receive(:cached).with(:chef_run).once
|
|
65
65
|
expect(klass).to receive(:before).once
|
|
66
66
|
|
|
67
|
-
klass.cached!(:chef_run) {
|
|
67
|
+
klass.cached!(:chef_run) {}
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
# Note: These specs don't use Berkshelf code directly as this project doesn't
|
|
4
4
|
# have a direct dependency on Berkshelf and loading it would impact the
|
|
@@ -6,51 +6,51 @@ require 'spec_helper'
|
|
|
6
6
|
# a standin for Berkshelf to exercise the `#matches?` behavior.
|
|
7
7
|
describe ChefSpec::Coverage::BerkshelfFilter do
|
|
8
8
|
let(:dependencies) do
|
|
9
|
-
[double(
|
|
9
|
+
[double("Berkshelf::Dependency", metadata?: true, name: "cookbookery")]
|
|
10
10
|
end
|
|
11
|
-
let(:berksfile) { double(
|
|
12
|
-
let(:resource) { Chef::Resource.new(
|
|
11
|
+
let(:berksfile) { double("Berkshelf::Berksfile", dependencies: dependencies) }
|
|
12
|
+
let(:resource) { Chef::Resource.new("theone") }
|
|
13
13
|
subject { described_class.new(berksfile) }
|
|
14
14
|
|
|
15
|
-
describe
|
|
16
|
-
it
|
|
15
|
+
describe "#matches?" do
|
|
16
|
+
it "returns truthy if resource source_line is nil" do
|
|
17
17
|
expect(subject.matches?(resource)).to be_truthy
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
context
|
|
21
|
-
it
|
|
20
|
+
context "when resource#source_line is under target cookbook" do
|
|
21
|
+
it "normal unix path returns truthy" do
|
|
22
22
|
resource.source_line =
|
|
23
|
-
|
|
23
|
+
"/path/to/cookbooks/nope/recipes/default.rb:22"
|
|
24
24
|
expect(subject.matches?(resource)).to be_truthy
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
it
|
|
27
|
+
it "normal windows path returns truthy" do
|
|
28
28
|
resource.source_line =
|
|
29
29
|
'C:\\path\\to\\cookbooks\\nope\\recipes\\default.rb:22'
|
|
30
30
|
expect(subject.matches?(resource)).to be_truthy
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
it
|
|
33
|
+
it "mixed windows path returns truthy" do
|
|
34
34
|
resource.source_line =
|
|
35
35
|
'C:\\path\\to\\cookbooks/nope/recipes/default.rb:22'
|
|
36
36
|
expect(subject.matches?(resource)).to be_truthy
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
context
|
|
41
|
-
it
|
|
40
|
+
context "when resource#source_line is not under target cookbook" do
|
|
41
|
+
it "normal unix path returns falsey" do
|
|
42
42
|
resource.source_line =
|
|
43
|
-
|
|
43
|
+
"/path/to/cookbooks/cookbookery/recipes/default.rb:22"
|
|
44
44
|
expect(subject.matches?(resource)).to be_falsey
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
it
|
|
47
|
+
it "normal windows path returns falsey" do
|
|
48
48
|
resource.source_line =
|
|
49
49
|
'C:\\path\\to\\cookbooks\\cookbookery\\recipes\\default.rb:22'
|
|
50
50
|
expect(subject.matches?(resource)).to be_falsey
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
it
|
|
53
|
+
it "mixed windows path returns falsey" do
|
|
54
54
|
resource.source_line =
|
|
55
55
|
'C:\\path\\to\\cookbooks/cookbookery/recipes/default.rb:22'
|
|
56
56
|
expect(subject.matches?(resource)).to be_falsey
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
describe ChefSpec::Runner do
|
|
4
4
|
before do
|
|
@@ -8,12 +8,12 @@ describe ChefSpec::Runner do
|
|
|
8
8
|
allow(ChefSpec::Runner).to receive(:deprecated)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
describe
|
|
11
|
+
describe "#define_runner_method" do
|
|
12
12
|
before do
|
|
13
13
|
allow(ChefSpec).to receive(:define_matcher)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
it
|
|
16
|
+
it "prints a deprecation" do
|
|
17
17
|
expect(ChefSpec::Runner).to receive(:deprecated)
|
|
18
18
|
.with("`ChefSpec::Runner.define_runner_method' is deprecated."\
|
|
19
19
|
" It is being used in the my_custom_resource resource matcher." \
|
|
@@ -21,37 +21,12 @@ describe ChefSpec::Runner do
|
|
|
21
21
|
ChefSpec::Runner.define_runner_method(:my_custom_resource)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
it
|
|
24
|
+
it "calls ChefSpec#define_matcher" do
|
|
25
25
|
expect(ChefSpec).to receive(:define_matcher).with(:my_custom_resource).once
|
|
26
26
|
ChefSpec::Runner.define_runner_method(:my_custom_resource)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
end
|
|
30
|
-
|
|
31
|
-
describe '#new' do
|
|
32
|
-
before do
|
|
33
|
-
allow(ChefSpec::SoloRunner).to receive(:new)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it 'prints a deprecation' do
|
|
37
|
-
expect(ChefSpec::Runner).to receive(:deprecated)
|
|
38
|
-
.with("`ChefSpec::Runner' is deprecated. Please use" \
|
|
39
|
-
" `ChefSpec::SoloRunner' or `ChefSpec::ServerRunner' instead.")
|
|
40
|
-
ChefSpec::Runner.new
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it 'calls SoloRunner#new with no args' do
|
|
44
|
-
expect(ChefSpec::SoloRunner).to receive(:new).with(no_args()).once
|
|
45
|
-
ChefSpec::Runner.new
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
it 'calls SoloRunner#new with args' do
|
|
49
|
-
args = [ 'args' ]
|
|
50
|
-
expect(ChefSpec::SoloRunner).to receive(:new).with(*args).once
|
|
51
|
-
ChefSpec::Runner.new(*args)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
end
|
|
55
30
|
end
|
|
56
31
|
|
|
57
32
|
describe ChefSpec::Server do
|
|
@@ -59,19 +34,18 @@ describe ChefSpec::Server do
|
|
|
59
34
|
allow(ChefSpec::Server).to receive(:deprecated)
|
|
60
35
|
end
|
|
61
36
|
|
|
62
|
-
it
|
|
37
|
+
it "prints a deprecation for any method called" do
|
|
63
38
|
expect(ChefSpec::Server).to receive(:deprecated)
|
|
64
39
|
.with("`ChefSpec::Server.any_method' is deprecated. There is no longer" \
|
|
65
|
-
" a global Chef Server instance. Please use a ChefSpec::
|
|
66
|
-
" instead. More documentation can be found in the ChefSpec README."
|
|
67
|
-
)
|
|
40
|
+
" a global Chef Server instance. Please use a ChefSpec::SoloRunner" \
|
|
41
|
+
" instead. More documentation can be found in the ChefSpec README.")
|
|
68
42
|
expect {
|
|
69
43
|
ChefSpec::Server.any_method
|
|
70
44
|
}.to raise_error(ChefSpec::Error::NoConversionError)
|
|
71
45
|
end
|
|
72
46
|
|
|
73
|
-
it
|
|
74
|
-
expect{ChefSpec::Server.any_method}
|
|
47
|
+
it "raises non-conversion error for any method called" do
|
|
48
|
+
expect { ChefSpec::Server.any_method }
|
|
75
49
|
.to raise_error(ChefSpec::Error::NoConversionError)
|
|
76
50
|
end
|
|
77
51
|
|
data/spec/unit/errors_spec.rb
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
module ChefSpec::Error
|
|
4
4
|
describe CommandNotStubbed do
|
|
5
|
-
let(:instance) { described_class.new(args: [
|
|
5
|
+
let(:instance) { described_class.new(args: ["cat"]) }
|
|
6
6
|
|
|
7
|
-
it
|
|
7
|
+
it "raises an exception with the correct message" do
|
|
8
8
|
instance
|
|
9
|
-
expect { raise instance }.to raise_error { |error|
|
|
9
|
+
expect { raise instance }.to( raise_error { |error|
|
|
10
10
|
expect(error).to be_a(described_class)
|
|
11
|
-
expect(error.message).to eq <<-EOH.gsub(/^ {10}/,
|
|
11
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, "")
|
|
12
12
|
Executing a real command is disabled. Unregistered command:
|
|
13
13
|
|
|
14
14
|
command("cat")
|
|
@@ -17,32 +17,32 @@ module ChefSpec::Error
|
|
|
17
17
|
|
|
18
18
|
stub_command("cat").and_return(...)
|
|
19
19
|
EOH
|
|
20
|
-
}
|
|
20
|
+
})
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
describe CookbookPathNotFound do
|
|
25
25
|
let(:instance) { described_class.new }
|
|
26
26
|
|
|
27
|
-
it
|
|
28
|
-
expect { raise instance }.to
|
|
27
|
+
it "raises an exception with the correct message" do
|
|
28
|
+
expect { raise instance }.to(raise_error { |error|
|
|
29
29
|
expect(error).to be_a(described_class)
|
|
30
|
-
expect(error.message).to eq <<-EOH.gsub(/^ {10}/,
|
|
30
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, "")
|
|
31
31
|
I could not find or infer a cookbook_path from your current working directory.
|
|
32
32
|
Please make sure you put your specs (tests) under a directory named 'spec' or
|
|
33
33
|
manually set the cookbook path in the RSpec configuration.
|
|
34
34
|
EOH
|
|
35
|
-
}
|
|
35
|
+
})
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
describe GemLoadError do
|
|
40
|
-
let(:instance) { described_class.new(gem:
|
|
40
|
+
let(:instance) { described_class.new(gem: "bacon", name: "bacon") }
|
|
41
41
|
|
|
42
|
-
it
|
|
43
|
-
expect { raise instance }.to raise_error { |error|
|
|
42
|
+
it "raises an exception with the correct message" do
|
|
43
|
+
expect { raise instance }.to( raise_error { |error|
|
|
44
44
|
expect(error).to be_a(described_class)
|
|
45
|
-
expect(error.message).to eq <<-EOH.gsub(/^ {10}/,
|
|
45
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, "")
|
|
46
46
|
I could not load the 'bacon' gem! You must have the gem installed
|
|
47
47
|
on your local system before you can use the bacon plugin.
|
|
48
48
|
You can install bacon by running:
|
|
@@ -51,7 +51,7 @@ module ChefSpec::Error
|
|
|
51
51
|
|
|
52
52
|
or add bacon to your Gemfile and run the `bundle` command to install.
|
|
53
53
|
EOH
|
|
54
|
-
}
|
|
54
|
+
})
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
end
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
describe ChefSpec::ExpectException do
|
|
4
|
-
context
|
|
4
|
+
context "when there have been no `raise_error` matchers" do
|
|
5
5
|
subject { described_class.new(Exception) }
|
|
6
6
|
|
|
7
|
-
it
|
|
7
|
+
it "does not match" do
|
|
8
8
|
allow(RSpec::Matchers::BuiltIn::RaiseError).to receive(:last_run).and_return(nil)
|
|
9
9
|
expect(subject.expected?).to be_falsy
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
context
|
|
13
|
+
context "when the last error does not match the expected type" do
|
|
14
14
|
subject { described_class.new(RuntimeError) }
|
|
15
15
|
|
|
16
|
-
it
|
|
17
|
-
last_error = double(
|
|
16
|
+
it "does not match" do
|
|
17
|
+
last_error = double("last error", last_error_for_chefspec: ArgumentError)
|
|
18
18
|
allow(RSpec::Matchers::BuiltIn::RaiseError).to receive(:last_run).and_return(last_error)
|
|
19
19
|
expect(subject.expected?).to be_falsy
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
context
|
|
23
|
+
context "when the last error matches the expected type" do
|
|
24
24
|
subject { described_class.new(RuntimeError) }
|
|
25
25
|
|
|
26
|
-
it
|
|
27
|
-
last_error = double(
|
|
26
|
+
it "does not match" do
|
|
27
|
+
last_error = double("last error", last_error_for_chefspec: RuntimeError)
|
|
28
28
|
allow(RSpec::Matchers::BuiltIn::RaiseError).to receive(:last_run).and_return(last_error)
|
|
29
29
|
expect(subject.expected?).to be_truthy
|
|
30
30
|
end
|
data/spec/unit/macros_spec.rb
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
|
-
describe ChefSpec::
|
|
4
|
-
describe
|
|
5
|
-
let(:command_stub) { double(
|
|
3
|
+
describe ChefSpec::API::Stubs do
|
|
4
|
+
describe "#stub_command" do
|
|
5
|
+
let(:command_stub) { double("command") }
|
|
6
6
|
|
|
7
|
-
it
|
|
7
|
+
it "adds the command to the command registry" do
|
|
8
8
|
allow(ChefSpec::Stubs::CommandStub).to receive(:new).and_return(command_stub)
|
|
9
|
-
|
|
9
|
+
stub_command('echo "hello"')
|
|
10
10
|
|
|
11
11
|
expect(ChefSpec::Stubs::CommandRegistry.stubs).to include(command_stub)
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
describe
|
|
16
|
-
let(:search_stub) { double(
|
|
15
|
+
describe "#stub_search" do
|
|
16
|
+
let(:search_stub) { double("search") }
|
|
17
17
|
|
|
18
|
-
it
|
|
18
|
+
it "adds the query to the search registry" do
|
|
19
19
|
allow(ChefSpec::Stubs::SearchStub).to receive(:new).and_return(search_stub)
|
|
20
|
-
|
|
20
|
+
stub_search(:node, "*:*")
|
|
21
21
|
|
|
22
22
|
expect(ChefSpec::Stubs::SearchRegistry.stubs).to include(search_stub)
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
describe
|
|
27
|
-
let(:data_bag_stub) { double(
|
|
26
|
+
describe "#stub_data_bag" do
|
|
27
|
+
let(:data_bag_stub) { double("data_bag") }
|
|
28
28
|
|
|
29
|
-
it
|
|
29
|
+
it "adds the query to the data_bag registry" do
|
|
30
30
|
allow(ChefSpec::Stubs::DataBagStub).to receive(:new).and_return(data_bag_stub)
|
|
31
|
-
|
|
31
|
+
stub_data_bag(:users)
|
|
32
32
|
|
|
33
33
|
expect(ChefSpec::Stubs::DataBagRegistry.stubs).to include(data_bag_stub)
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
describe
|
|
38
|
-
let(:data_bag_item_stub) { double(
|
|
37
|
+
describe "#stub_data_bag_item" do
|
|
38
|
+
let(:data_bag_item_stub) { double("data_bag_item") }
|
|
39
39
|
|
|
40
|
-
it
|
|
40
|
+
it "adds the query to the data_bag_item registry" do
|
|
41
41
|
allow(ChefSpec::Stubs::DataBagItemStub).to receive(:new).and_return(data_bag_item_stub)
|
|
42
|
-
|
|
42
|
+
stub_data_bag_item(:users, "id")
|
|
43
43
|
|
|
44
44
|
expect(ChefSpec::Stubs::DataBagItemRegistry.stubs).to include(data_bag_item_stub)
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
describe
|
|
49
|
-
it
|
|
50
|
-
expect(
|
|
48
|
+
describe "#stub_node" do
|
|
49
|
+
it "returns a Chef::Node" do
|
|
50
|
+
expect(stub_node).to be_a(Chef::Node)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
it
|
|
54
|
-
node =
|
|
55
|
-
expect(node.name).to eq(
|
|
53
|
+
it "defaults the node name to `node.example`" do
|
|
54
|
+
node = stub_node
|
|
55
|
+
expect(node.name).to eq("node.example")
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
it
|
|
59
|
-
node =
|
|
60
|
-
expect(node.name).to eq(
|
|
58
|
+
it "sets the node name when given" do
|
|
59
|
+
node = stub_node("example.com")
|
|
60
|
+
expect(node.name).to eq("example.com")
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
it
|
|
64
|
-
node =
|
|
63
|
+
it "sets the automatic attributes" do
|
|
64
|
+
node = stub_node
|
|
65
65
|
expect(node.automatic).to eq(Fauxhai.mock.data)
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
it
|
|
69
|
-
node =
|
|
70
|
-
expect(node[
|
|
68
|
+
it "sets the automatic attributes with ohai overrides" do
|
|
69
|
+
node = stub_node("node.example", ohai: { ipaddress: "1.2.3.4" })
|
|
70
|
+
expect(node["ipaddress"]).to eq("1.2.3.4")
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
it
|
|
74
|
-
node =
|
|
75
|
-
expect(node.automatic).to eq(Fauxhai.mock(platform:
|
|
73
|
+
it "sets the automatic attributes for a specific platform and version" do
|
|
74
|
+
node = stub_node("node.example", platform: "ubuntu", version: "18.04")
|
|
75
|
+
expect(node.automatic).to eq(Fauxhai.mock(platform: "ubuntu", version: "18.04").data)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
it
|
|
79
|
-
allow(File).to receive(:exist?).with(
|
|
80
|
-
allow(File).to receive(:read).with(
|
|
81
|
-
node =
|
|
82
|
-
expect(node[
|
|
78
|
+
it "sets the automatic attributes from a JSON data path" do
|
|
79
|
+
allow(File).to receive(:exist?).with("/path/to/json").and_return(true)
|
|
80
|
+
allow(File).to receive(:read).with("/path/to/json").and_return('{ "ipaddress": "1.2.3.4" }')
|
|
81
|
+
node = stub_node("node.example", path: "/path/to/json")
|
|
82
|
+
expect(node["ipaddress"]).to eq("1.2.3.4")
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
it
|
|
86
|
-
expect { |block|
|
|
85
|
+
it "yields a block" do
|
|
86
|
+
expect { |block| stub_node(&block) }.to yield_with_args(Chef::Node)
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
-
describe
|
|
92
|
-
describe
|
|
93
|
-
describe
|
|
94
|
-
it
|
|
95
|
-
expect(described_cookbook).to eq(
|
|
91
|
+
describe "nginx::source" do
|
|
92
|
+
describe "#described_cookbook" do
|
|
93
|
+
describe "nginx::source" do
|
|
94
|
+
it "returns the name of the cookbook" do
|
|
95
|
+
expect(described_cookbook).to eq("nginx")
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
context
|
|
99
|
-
it
|
|
100
|
-
expect(described_cookbook).to eq(
|
|
98
|
+
context "in a nested context" do
|
|
99
|
+
it "still returns the name of the cookbook" do
|
|
100
|
+
expect(described_cookbook).to eq("nginx")
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
-
describe
|
|
107
|
-
describe
|
|
108
|
-
it
|
|
109
|
-
expect(described_recipe).to eq(
|
|
106
|
+
describe "#described_recipe" do
|
|
107
|
+
describe "nginx::source" do
|
|
108
|
+
it "returns the cookbook::recipe" do
|
|
109
|
+
expect(described_recipe).to eq("nginx::source")
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
-
context
|
|
113
|
-
it
|
|
114
|
-
expect(described_recipe).to eq(
|
|
112
|
+
context "in a nested context" do
|
|
113
|
+
it "still retrns the cookbook::recipe" do
|
|
114
|
+
expect(described_recipe).to eq("nginx::source")
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe ChefSpec::Matchers::IncludeAnyRecipeMatcher do
|
|
4
|
+
let(:node) { double("Chef::Node", run_list: run_list) }
|
|
5
|
+
let(:run_list) { double("Chef::RunList", run_list_items: run_list_items) }
|
|
6
|
+
let(:run_list_items) { [run_list_item_one] }
|
|
7
|
+
let(:run_list_item_one) { double("Chef::RunList::RunListItem", name: "one") }
|
|
8
|
+
let(:run_list_item_two) { double("Chef::RunList::RunListItem", name: "two") }
|
|
9
|
+
let(:loaded_recipes) { %w{one} }
|
|
10
|
+
let(:chef_run) { double("chef run", run_context: { loaded_recipes: loaded_recipes, node: node }) }
|
|
11
|
+
|
|
12
|
+
subject { described_class.new }
|
|
13
|
+
|
|
14
|
+
describe "#failure_message" do
|
|
15
|
+
it "has the right value" do
|
|
16
|
+
subject.matches?(chef_run)
|
|
17
|
+
expect(subject.failure_message).to eq("expected to include any recipe")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
describe "#failure_message_when_negated" do
|
|
22
|
+
it "has the right value" do
|
|
23
|
+
subject.matches?(chef_run)
|
|
24
|
+
expect(subject.failure_message_when_negated).to eq("expected not to include any recipes")
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe "#description" do
|
|
29
|
+
it "has the right value" do
|
|
30
|
+
subject.matches?(chef_run)
|
|
31
|
+
expect(subject.description).to eq("include any recipe")
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe "#matches?" do
|
|
36
|
+
context "when 0 recipes are included" do
|
|
37
|
+
let(:loaded_recipes) { %w{one} }
|
|
38
|
+
|
|
39
|
+
it "returns false" do
|
|
40
|
+
expect(subject.matches?(chef_run)).to be false
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context "when at least one recipe is included" do
|
|
45
|
+
let(:loaded_recipes) { %w{one two} }
|
|
46
|
+
|
|
47
|
+
it "returns true" do
|
|
48
|
+
expect(subject.matches?(chef_run)).to be true
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
describe ChefSpec::Matchers::IncludeRecipeMatcher do
|
|
4
|
-
let(:chef_run) { double(
|
|
5
|
-
subject { described_class.new(
|
|
4
|
+
let(:chef_run) { double("chef run", run_context: { loaded_recipes: %w{one two three} }) }
|
|
5
|
+
subject { described_class.new("one::default") }
|
|
6
6
|
|
|
7
|
-
describe
|
|
8
|
-
it
|
|
7
|
+
describe "#failure_message" do
|
|
8
|
+
it "has the right value" do
|
|
9
9
|
subject.matches?(chef_run)
|
|
10
10
|
expect(subject.failure_message)
|
|
11
|
-
.to eq(%q
|
|
11
|
+
.to eq(%q{expected ["one::default", "two::default", "three::default"] to include "one::default"})
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
describe
|
|
16
|
-
it
|
|
15
|
+
describe "#failure_message_when_negated" do
|
|
16
|
+
it "has the right value" do
|
|
17
17
|
subject.matches?(chef_run)
|
|
18
18
|
expect(subject.failure_message_when_negated)
|
|
19
|
-
.to eq(%q
|
|
19
|
+
.to eq(%q{expected "one::default" to not be included})
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
describe
|
|
24
|
-
it
|
|
23
|
+
describe "#description" do
|
|
24
|
+
it "has the right value" do
|
|
25
25
|
subject.matches?(chef_run)
|
|
26
|
-
expect(subject.description).to eq(%q
|
|
26
|
+
expect(subject.description).to eq(%q{include recipe "one::default"})
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
it
|
|
30
|
+
it "matches when the recipe is included" do
|
|
31
31
|
expect(subject.matches?(chef_run)).to be_truthy
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
it
|
|
35
|
-
failure = described_class.new(
|
|
34
|
+
it "does not match when the recipe is not included" do
|
|
35
|
+
failure = described_class.new("nope")
|
|
36
36
|
expect(failure.matches?(chef_run)).to be_falsy
|
|
37
37
|
end
|
|
38
38
|
end
|