summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.rspec2
-rw-r--r--.travis.yml33
-rw-r--r--CHANGELOG.md88
-rw-r--r--CLA_ARCHIVE.md2510
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--DOC_CHANGES.md22
-rw-r--r--RELEASE_NOTES.md168
-rw-r--r--Rakefile12
-rwxr-xr-xbin/chef-service-manager2
-rwxr-xr-xbin/chef-windows-service35
-rw-r--r--chef-x86-mingw32.gemspec5
-rw-r--r--chef.gemspec9
-rw-r--r--distro/README2
-rw-r--r--distro/arch/etc/conf.d/chef-client.conf5
-rw-r--r--distro/arch/etc/conf.d/chef-expander.conf8
-rw-r--r--distro/arch/etc/conf.d/chef-server-webui.conf10
-rw-r--r--distro/arch/etc/conf.d/chef-server.conf10
-rw-r--r--distro/arch/etc/conf.d/chef-solr.conf8
-rw-r--r--distro/arch/etc/rc.d/chef-client90
-rw-r--r--distro/arch/etc/rc.d/chef-expander78
-rw-r--r--distro/arch/etc/rc.d/chef-server78
-rw-r--r--distro/arch/etc/rc.d/chef-server-webui78
-rw-r--r--distro/arch/etc/rc.d/chef-solr78
-rw-r--r--distro/common/html/_sources/ctl_chef_client.txt2
-rw-r--r--distro/common/html/_sources/ctl_chef_server.txt88
-rw-r--r--distro/common/html/_sources/ctl_chef_solo.txt2
-rw-r--r--distro/common/html/_sources/knife_bootstrap.txt2
-rw-r--r--distro/common/html/_sources/knife_cookbook_site.txt2
-rw-r--r--distro/common/html/_sources/knife_data_bag.txt8
-rw-r--r--distro/common/html/_sources/knife_status.txt2
-rw-r--r--distro/common/html/ctl_chef_client.html62
-rw-r--r--distro/common/html/ctl_chef_server.html125
-rw-r--r--distro/common/html/ctl_chef_shell.html46
-rw-r--r--distro/common/html/ctl_chef_solo.html56
-rw-r--r--distro/common/html/index.html4
-rw-r--r--distro/common/html/knife.html2
-rw-r--r--distro/common/html/knife_bootstrap.html40
-rw-r--r--distro/common/html/knife_cookbook_site.html2
-rw-r--r--distro/common/html/knife_data_bag.html8
-rw-r--r--distro/common/html/knife_node.html4
-rw-r--r--distro/common/html/knife_raw.html2
-rw-r--r--distro/common/html/knife_role.html2
-rw-r--r--distro/common/html/knife_search.html6
-rw-r--r--distro/common/html/knife_status.html4
-rw-r--r--distro/common/html/searchindex.js2
-rw-r--r--distro/common/man/man1/chef-shell.173
-rw-r--r--distro/common/man/man1/knife-bootstrap.1134
-rw-r--r--distro/common/man/man1/knife-client.12
-rw-r--r--distro/common/man/man1/knife-configure.12
-rw-r--r--distro/common/man/man1/knife-cookbook-site.15
-rw-r--r--distro/common/man/man1/knife-cookbook.12
-rw-r--r--distro/common/man/man1/knife-data-bag.110
-rw-r--r--distro/common/man/man1/knife-delete.12
-rw-r--r--distro/common/man/man1/knife-deps.12
-rw-r--r--distro/common/man/man1/knife-diff.12
-rw-r--r--distro/common/man/man1/knife-download.12
-rw-r--r--distro/common/man/man1/knife-edit.12
-rw-r--r--distro/common/man/man1/knife-environment.12
-rw-r--r--distro/common/man/man1/knife-exec.12
-rw-r--r--distro/common/man/man1/knife-index-rebuild.12
-rw-r--r--distro/common/man/man1/knife-list.12
-rw-r--r--distro/common/man/man1/knife-node.16
-rw-r--r--distro/common/man/man1/knife-raw.14
-rw-r--r--distro/common/man/man1/knife-recipe-list.12
-rw-r--r--distro/common/man/man1/knife-role.14
-rw-r--r--distro/common/man/man1/knife-search.18
-rw-r--r--distro/common/man/man1/knife-serve.12
-rw-r--r--distro/common/man/man1/knife-show.12
-rw-r--r--distro/common/man/man1/knife-ssh.12
-rw-r--r--distro/common/man/man1/knife-ssl-check.12
-rw-r--r--distro/common/man/man1/knife-ssl-fetch.12
-rw-r--r--distro/common/man/man1/knife-status.12
-rw-r--r--distro/common/man/man1/knife-tag.12
-rw-r--r--distro/common/man/man1/knife-upload.12
-rw-r--r--distro/common/man/man1/knife-user.12
-rw-r--r--distro/common/man/man1/knife-xargs.12
-rw-r--r--distro/common/man/man1/knife.12
-rw-r--r--distro/common/man/man8/chef-client.881
-rw-r--r--distro/common/man/man8/chef-solo.885
-rw-r--r--distro/debian/etc/default/chef-client4
-rw-r--r--distro/debian/etc/default/chef-expander8
-rw-r--r--distro/debian/etc/default/chef-server9
-rw-r--r--distro/debian/etc/default/chef-server-webui9
-rw-r--r--distro/debian/etc/default/chef-solr8
-rwxr-xr-xdistro/debian/etc/init.d/chef-client212
-rwxr-xr-xdistro/debian/etc/init.d/chef-expander176
-rwxr-xr-xdistro/debian/etc/init.d/chef-server122
-rwxr-xr-xdistro/debian/etc/init.d/chef-server-webui123
-rwxr-xr-xdistro/debian/etc/init.d/chef-solr176
-rw-r--r--distro/debian/etc/init/chef-client.conf17
-rw-r--r--distro/debian/etc/init/chef-expander.conf17
-rw-r--r--distro/debian/etc/init/chef-server-webui.conf17
-rw-r--r--distro/debian/etc/init/chef-server.conf17
-rw-r--r--distro/debian/etc/init/chef-solr.conf17
-rw-r--r--distro/redhat/etc/init.d/chef-client121
-rw-r--r--distro/redhat/etc/init.d/chef-expander104
-rw-r--r--distro/redhat/etc/init.d/chef-server112
-rw-r--r--distro/redhat/etc/init.d/chef-server-webui112
-rw-r--r--distro/redhat/etc/init.d/chef-solr104
-rw-r--r--distro/redhat/etc/logrotate.d/chef-client8
-rw-r--r--distro/redhat/etc/logrotate.d/chef-expander8
-rw-r--r--distro/redhat/etc/logrotate.d/chef-server8
-rw-r--r--distro/redhat/etc/logrotate.d/chef-server-webui8
-rw-r--r--distro/redhat/etc/logrotate.d/chef-solr8
-rw-r--r--distro/redhat/etc/sysconfig/chef-client15
-rw-r--r--distro/redhat/etc/sysconfig/chef-expander7
-rw-r--r--distro/redhat/etc/sysconfig/chef-server14
-rw-r--r--distro/redhat/etc/sysconfig/chef-server-webui14
-rw-r--r--distro/redhat/etc/sysconfig/chef-solr8
-rw-r--r--distro/windows/service_manager.rb20
-rw-r--r--ext/win32-eventlog/Rakefile50
-rw-r--r--ext/win32-eventlog/chef-log.man26
-rw-r--r--kitchen-tests/.kitchen.travis.yml14
-rw-r--r--kitchen-tests/.kitchen.yml24
-rw-r--r--kitchen-tests/cookbooks/webapp/attributes/default.rb13
-rw-r--r--kitchen-tests/cookbooks/webapp/recipes/default.rb7
-rw-r--r--kitchen-tests/test/fixtures/platforms/centos/5.json14
-rw-r--r--kitchen-tests/test/fixtures/platforms/centos/6.json14
-rw-r--r--kitchen-tests/test/fixtures/platforms/ubuntu/10.04.json14
-rw-r--r--kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json52
-rw-r--r--kitchen-tests/test/fixtures/platforms/ubuntu/14.04.json14
-rw-r--r--kitchen-tests/test/fixtures/platforms/ubuntu/14.10.json14
-rw-r--r--kitchen-tests/test/fixtures/serverspec_helper.rb2
-rw-r--r--kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb12
-rw-r--r--lib/chef/api_client/registration.rb4
-rw-r--r--lib/chef/application.rb606
-rw-r--r--lib/chef/application/client.rb5
-rw-r--r--lib/chef/application/solo.rb2
-rw-r--r--lib/chef/chef_fs/data_handler/group_data_handler.rb4
-rw-r--r--lib/chef/chef_fs/file_system/base_fs_dir.rb5
-rw-r--r--lib/chef/client.rb20
-rw-r--r--lib/chef/config.rb83
-rw-r--r--lib/chef/dsl/recipe.rb25
-rw-r--r--lib/chef/encrypted_data_bag_item/assertions.rb2
-rw-r--r--lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb2
-rw-r--r--lib/chef/event_loggers/base.rb62
-rw-r--r--lib/chef/event_loggers/windows_eventlog.rb103
-rw-r--r--lib/chef/exceptions.rb27
-rw-r--r--lib/chef/file_content_management/tempfile.rb38
-rw-r--r--lib/chef/guard_interpreter/resource_guard_interpreter.rb21
-rw-r--r--lib/chef/json_compat.rb8
-rw-r--r--lib/chef/knife/bootstrap.rb29
-rw-r--r--lib/chef/knife/core/object_loader.rb2
-rw-r--r--lib/chef/knife/core/subcommand_loader.rb24
-rw-r--r--lib/chef/knife/core/ui.rb6
-rw-r--r--lib/chef/knife/node_from_file.rb17
-rw-r--r--lib/chef/knife/ssh.rb7
-rw-r--r--lib/chef/mixin/convert_to_class_name.rb54
-rw-r--r--lib/chef/mixin/deep_merge.rb69
-rw-r--r--lib/chef/mixin/descendants_tracker.rb82
-rw-r--r--lib/chef/mixin/shell_out.rb4
-rw-r--r--lib/chef/mixin/which.rb37
-rw-r--r--lib/chef/monkey_patches/securerandom.rb44
-rw-r--r--lib/chef/node.rb43
-rw-r--r--lib/chef/node/attribute.rb268
-rw-r--r--lib/chef/node/attribute_collections.rb120
-rw-r--r--lib/chef/node/immutable_collections.rb12
-rw-r--r--lib/chef/node_map.rb146
-rw-r--r--lib/chef/platform/provider_mapping.rb41
-rw-r--r--lib/chef/platform/provider_priority_map.rb81
-rw-r--r--lib/chef/platform/service_helpers.rb142
-rw-r--r--lib/chef/provider.rb24
-rw-r--r--lib/chef/provider/breakpoint.rb2
-rw-r--r--lib/chef/provider/cookbook_file.rb2
-rw-r--r--lib/chef/provider/cron.rb2
-rw-r--r--lib/chef/provider/deploy.rb2
-rw-r--r--lib/chef/provider/deploy/revision.rb2
-rw-r--r--lib/chef/provider/deploy/timestamped.rb2
-rw-r--r--lib/chef/provider/directory.rb2
-rw-r--r--lib/chef/provider/dsc_script.rb3
-rw-r--r--lib/chef/provider/env.rb35
-rw-r--r--lib/chef/provider/env/windows.rb6
-rw-r--r--lib/chef/provider/erl_call.rb2
-rw-r--r--lib/chef/provider/execute.rb2
-rw-r--r--lib/chef/provider/file.rb2
-rw-r--r--lib/chef/provider/git.rb2
-rw-r--r--lib/chef/provider/group/dscl.rb4
-rw-r--r--lib/chef/provider/group/pw.rb22
-rw-r--r--lib/chef/provider/http_request.rb2
-rw-r--r--lib/chef/provider/link.rb2
-rw-r--r--lib/chef/provider/log.rb2
-rw-r--r--lib/chef/provider/mount/mount.rb2
-rw-r--r--lib/chef/provider/package/aix.rb2
-rw-r--r--lib/chef/provider/package/apt.rb2
-rw-r--r--lib/chef/provider/package/dpkg.rb2
-rw-r--r--lib/chef/provider/package/easy_install.rb2
-rw-r--r--lib/chef/provider/package/homebrew.rb4
-rw-r--r--lib/chef/provider/package/ips.rb2
-rw-r--r--lib/chef/provider/package/macports.rb3
-rw-r--r--lib/chef/provider/package/openbsd.rb107
-rw-r--r--lib/chef/provider/package/pacman.rb3
-rw-r--r--lib/chef/provider/package/paludis.rb4
-rw-r--r--lib/chef/provider/package/rpm.rb2
-rw-r--r--lib/chef/provider/package/rubygems.rb5
-rw-r--r--lib/chef/provider/package/smartos.rb2
-rw-r--r--lib/chef/provider/package/solaris.rb2
-rw-r--r--lib/chef/provider/package/windows.rb7
-rw-r--r--lib/chef/provider/package/yum.rb2
-rw-r--r--lib/chef/provider/powershell_script.rb4
-rw-r--r--lib/chef/provider/remote_directory.rb4
-rw-r--r--lib/chef/provider/route.rb2
-rw-r--r--lib/chef/provider/ruby_block.rb2
-rw-r--r--lib/chef/provider/script.rb6
-rw-r--r--lib/chef/provider/service/aix.rb128
-rw-r--r--lib/chef/provider/service/aixinit.rb117
-rw-r--r--lib/chef/provider/service/arch.rb6
-rw-r--r--lib/chef/provider/service/debian.rb68
-rw-r--r--lib/chef/provider/service/freebsd.rb8
-rw-r--r--lib/chef/provider/service/gentoo.rb3
-rw-r--r--lib/chef/provider/service/init.rb6
-rw-r--r--lib/chef/provider/service/insserv.rb26
-rw-r--r--lib/chef/provider/service/invokercd.rb10
-rw-r--r--lib/chef/provider/service/macosx.rb2
-rw-r--r--lib/chef/provider/service/redhat.rb16
-rw-r--r--lib/chef/provider/service/simple.rb2
-rw-r--r--lib/chef/provider/service/solaris.rb2
-rw-r--r--lib/chef/provider/service/systemd.rb87
-rw-r--r--lib/chef/provider/service/upstart.rb10
-rw-r--r--lib/chef/provider/service/windows.rb5
-rw-r--r--lib/chef/provider/subversion.rb2
-rw-r--r--lib/chef/provider/template.rb1
-rw-r--r--lib/chef/provider/whyrun_safe_ruby_block.rb2
-rw-r--r--lib/chef/provider_resolver.rb117
-rw-r--r--lib/chef/providers.rb7
-rw-r--r--lib/chef/recipe.rb2
-rw-r--r--lib/chef/request_id.rb2
-rw-r--r--lib/chef/resource.rb148
-rw-r--r--lib/chef/resource/apt_package.rb4
-rw-r--r--lib/chef/resource/bash.rb1
-rw-r--r--lib/chef/resource/bff_package.rb1
-rw-r--r--lib/chef/resource/breakpoint.rb2
-rw-r--r--lib/chef/resource/chef_gem.rb3
-rw-r--r--lib/chef/resource/conditional.rb6
-rw-r--r--lib/chef/resource/cookbook_file.rb3
-rw-r--r--lib/chef/resource/csh.rb1
-rw-r--r--lib/chef/resource/deploy.rb1
-rw-r--r--lib/chef/resource/deploy_revision.rb7
-rw-r--r--lib/chef/resource/directory.rb3
-rw-r--r--lib/chef/resource/dpkg_package.rb3
-rw-r--r--lib/chef/resource/dsc_script.rb3
-rw-r--r--lib/chef/resource/easy_install_package.rb3
-rw-r--r--lib/chef/resource/erl_call.rb1
-rw-r--r--lib/chef/resource/execute.rb35
-rw-r--r--lib/chef/resource/file.rb4
-rw-r--r--lib/chef/resource/freebsd_package.rb14
-rw-r--r--lib/chef/resource/gem_package.rb3
-rw-r--r--lib/chef/resource/git.rb3
-rw-r--r--lib/chef/resource/homebrew_package.rb3
-rw-r--r--lib/chef/resource/http_request.rb1
-rw-r--r--lib/chef/resource/ips_package.rb4
-rw-r--r--lib/chef/resource/link.rb3
-rw-r--r--lib/chef/resource/log.rb4
-rw-r--r--lib/chef/resource/macports_package.rb4
-rw-r--r--lib/chef/resource/openbsd_package.rb51
-rw-r--r--lib/chef/resource/pacman_package.rb3
-rw-r--r--lib/chef/resource/paludis_package.rb4
-rw-r--r--lib/chef/resource/perl.rb1
-rw-r--r--lib/chef/resource/powershell_script.rb2
-rw-r--r--lib/chef/resource/python.rb2
-rw-r--r--lib/chef/resource/remote_directory.rb3
-rw-r--r--lib/chef/resource/remote_file.rb2
-rw-r--r--lib/chef/resource/rpm_package.rb3
-rw-r--r--lib/chef/resource/ruby.rb1
-rw-r--r--lib/chef/resource/ruby_block.rb3
-rw-r--r--lib/chef/resource/script.rb27
-rw-r--r--lib/chef/resource/service.rb4
-rw-r--r--lib/chef/resource/smartos_package.rb7
-rw-r--r--lib/chef/resource/solaris_package.rb8
-rw-r--r--lib/chef/resource/subversion.rb1
-rw-r--r--lib/chef/resource/template.rb3
-rw-r--r--lib/chef/resource/timestamped_deploy.rb3
-rw-r--r--lib/chef/resource/whyrun_safe_ruby_block.rb1
-rw-r--r--lib/chef/resource/windows_package.rb7
-rw-r--r--lib/chef/resource/windows_script.rb3
-rw-r--r--lib/chef/resource/windows_service.rb4
-rw-r--r--lib/chef/resource/yum_package.rb4
-rw-r--r--lib/chef/resource_collection.rb277
-rw-r--r--lib/chef/resource_collection/resource_collection_serialization.rb59
-rw-r--r--lib/chef/resource_collection/resource_list.rb89
-rw-r--r--lib/chef/resource_collection/resource_set.rb170
-rw-r--r--lib/chef/resource_platform_map.rb151
-rw-r--r--lib/chef/resource_reporter.rb2
-rw-r--r--lib/chef/resources.rb8
-rw-r--r--lib/chef/run_context.rb1
-rw-r--r--lib/chef/run_list/run_list_expansion.rb4
-rw-r--r--lib/chef/shell.rb4
-rw-r--r--lib/chef/shell/ext.rb2
-rw-r--r--lib/chef/util/dsc/local_configuration_manager.rb22
-rw-r--r--lib/chef/util/selinux.rb12
-rw-r--r--lib/chef/version.rb2
-rw-r--r--pedant.gemfile1
-rw-r--r--spec/functional/application_spec.rb2
-rwxr-xr-xspec/functional/assets/chefinittest34
-rwxr-xr-xspec/functional/assets/testchefsubsys11
-rw-r--r--spec/functional/dsl/reboot_pending_spec.rb40
-rw-r--r--spec/functional/dsl/registry_helper_spec.rb12
-rw-r--r--spec/functional/event_loggers/windows_eventlog_spec.rb82
-rw-r--r--spec/functional/file_content_management/deploy_strategies_spec.rb24
-rw-r--r--spec/functional/http/simple_spec.rb2
-rw-r--r--spec/functional/knife/cookbook_delete_spec.rb48
-rw-r--r--spec/functional/knife/exec_spec.rb4
-rw-r--r--spec/functional/knife/smoke_test.rb2
-rw-r--r--spec/functional/knife/ssh_spec.rb44
-rwxr-xr-xspec/functional/provider/remote_file/cache_control_data_spec.rb16
-rw-r--r--spec/functional/provider/whyrun_safe_ruby_block_spec.rb4
-rw-r--r--spec/functional/rebooter_spec.rb2
-rwxr-xr-xspec/functional/resource/aix_service_spec.rb136
-rwxr-xr-xspec/functional/resource/aixinit_service_spec.rb211
-rw-r--r--spec/functional/resource/base.rb1
-rw-r--r--spec/functional/resource/batch_spec.rb15
-rw-r--r--spec/functional/resource/cron_spec.rb8
-rw-r--r--spec/functional/resource/deploy_revision_spec.rb196
-rwxr-xr-xspec/functional/resource/env_spec.rb15
-rw-r--r--spec/functional/resource/execute_spec.rb113
-rw-r--r--spec/functional/resource/file_spec.rb16
-rw-r--r--spec/functional/resource/git_spec.rb24
-rw-r--r--spec/functional/resource/group_spec.rb50
-rw-r--r--spec/functional/resource/ifconfig_spec.rb4
-rw-r--r--spec/functional/resource/link_spec.rb184
-rw-r--r--spec/functional/resource/mount_spec.rb10
-rw-r--r--spec/functional/resource/ohai_spec.rb2
-rw-r--r--spec/functional/resource/package_spec.rb44
-rw-r--r--spec/functional/resource/powershell_spec.rb126
-rw-r--r--spec/functional/resource/reboot_spec.rb4
-rw-r--r--spec/functional/resource/registry_spec.rb182
-rw-r--r--spec/functional/resource/remote_directory_spec.rb38
-rw-r--r--spec/functional/resource/remote_file_spec.rb36
-rw-r--r--spec/functional/resource/rpm_spec.rb9
-rw-r--r--spec/functional/resource/template_spec.rb8
-rw-r--r--spec/functional/resource/user/dscl_spec.rb8
-rw-r--r--spec/functional/resource/user/useradd_spec.rb92
-rw-r--r--spec/functional/run_lock_spec.rb18
-rw-r--r--spec/functional/shell_spec.rb6
-rw-r--r--spec/functional/tiny_server_spec.rb24
-rw-r--r--spec/functional/util/path_helper_spec.rb2
-rw-r--r--spec/functional/version_spec.rb2
-rw-r--r--spec/functional/win32/registry_helper_spec.rb250
-rw-r--r--spec/functional/win32/security_spec.rb4
-rw-r--r--spec/functional/win32/service_manager_spec.rb56
-rw-r--r--spec/functional/win32/versions_spec.rb12
-rw-r--r--spec/integration/client/client_spec.rb18
-rw-r--r--spec/integration/knife/chef_fs_data_store_spec.rb8
-rw-r--r--spec/integration/knife/common_options_spec.rb6
-rw-r--r--spec/integration/knife/cookbook_api_ipv6_spec.rb4
-rw-r--r--spec/integration/knife/deps_spec.rb8
-rw-r--r--spec/integration/knife/diff_spec.rb12
-rw-r--r--spec/integration/knife/download_spec.rb10
-rw-r--r--spec/integration/knife/list_spec.rb4
-rw-r--r--spec/integration/knife/raw_spec.rb10
-rw-r--r--spec/integration/knife/serve_spec.rb6
-rw-r--r--spec/integration/knife/show_spec.rb6
-rw-r--r--spec/integration/knife/upload_spec.rb36
-rw-r--r--spec/integration/recipes/lwrp_inline_resources_spec.rb2
-rw-r--r--spec/integration/solo/solo_spec.rb20
-rw-r--r--spec/spec_helper.rb19
-rw-r--r--spec/stress/win32/file_spec.rb4
-rw-r--r--spec/stress/win32/security_spec.rb8
-rw-r--r--spec/support/chef_helpers.rb1
-rw-r--r--spec/support/lib/chef/provider/snakeoil.rb1
-rw-r--r--spec/support/lib/chef/resource/zen_follower.rb8
-rw-r--r--spec/support/matchers/leak.rb4
-rw-r--r--spec/support/mock/platform.rb2
-rw-r--r--spec/support/pedant/Gemfile3
-rw-r--r--spec/support/pedant/pedant_config.rb7
-rw-r--r--spec/support/pedant/run_pedant.rb31
-rw-r--r--spec/support/platform_helpers.rb4
-rw-r--r--spec/support/shared/functional/directory_resource.rb26
-rw-r--r--spec/support/shared/functional/file_resource.rb162
-rw-r--r--spec/support/shared/functional/securable_resource.rb128
-rw-r--r--spec/support/shared/functional/securable_resource_with_reporting.rb84
-rw-r--r--spec/support/shared/functional/windows_script.rb118
-rw-r--r--spec/support/shared/integration/knife_support.rb13
-rw-r--r--spec/support/shared/matchers/exit_with_code.rb8
-rw-r--r--spec/support/shared/unit/api_error_inspector.rb14
-rw-r--r--spec/support/shared/unit/execute_resource.rb45
-rw-r--r--spec/support/shared/unit/file_system_support.rb4
-rw-r--r--spec/support/shared/unit/platform_introspector.rb42
-rw-r--r--spec/support/shared/unit/provider/file.rb419
-rw-r--r--spec/support/shared/unit/provider/useradd_based_user_provider.rb138
-rw-r--r--spec/support/shared/unit/resource/static_provider_resolution.rb66
-rw-r--r--spec/support/shared/unit/script_resource.rb28
-rw-r--r--spec/support/shared/unit/windows_script_resource.rb41
-rw-r--r--spec/unit/api_client/registration_spec.rb116
-rw-r--r--spec/unit/api_client_spec.rb112
-rw-r--r--spec/unit/application/apply_spec.rb30
-rw-r--r--spec/unit/application/client_spec.rb68
-rw-r--r--spec/unit/application/knife_spec.rb62
-rw-r--r--spec/unit/application/solo_spec.rb58
-rw-r--r--spec/unit/application_spec.rb148
-rw-r--r--spec/unit/chef_fs/data_handler/group_handler_spec.rb63
-rw-r--r--spec/unit/chef_fs/diff_spec.rb24
-rw-r--r--spec/unit/chef_fs/file_pattern_spec.rb553
-rw-r--r--spec/unit/chef_fs/file_system/operation_failed_error_spec.rb12
-rw-r--r--spec/unit/chef_fs/file_system_spec.rb39
-rw-r--r--spec/unit/chef_fs/parallelizer.rb174
-rw-r--r--spec/unit/chef_spec.rb2
-rw-r--r--spec/unit/client_spec.rb174
-rw-r--r--spec/unit/config_fetcher_spec.rb26
-rw-r--r--spec/unit/config_spec.rb221
-rw-r--r--spec/unit/cookbook/chefignore_spec.rb12
-rw-r--r--spec/unit/cookbook/cookbook_version_loader_spec.rb6
-rw-r--r--spec/unit/cookbook/metadata_spec.rb296
-rw-r--r--spec/unit/cookbook/syntax_check_spec.rb62
-rw-r--r--spec/unit/cookbook_loader_spec.rb112
-rw-r--r--spec/unit/cookbook_manifest_spec.rb144
-rw-r--r--spec/unit/cookbook_site_streaming_uploader_spec.rb54
-rw-r--r--spec/unit/cookbook_spec.rb30
-rw-r--r--spec/unit/cookbook_version_spec.rb260
-rw-r--r--spec/unit/daemon_spec.rb62
-rw-r--r--spec/unit/data_bag_item_spec.rb96
-rw-r--r--spec/unit/data_bag_spec.rb70
-rw-r--r--spec/unit/deprecation_spec.rb10
-rw-r--r--spec/unit/digester_spec.rb6
-rw-r--r--spec/unit/dsl/data_query_spec.rb2
-rw-r--r--spec/unit/dsl/platform_introspection_spec.rb28
-rw-r--r--spec/unit/dsl/reboot_pending_spec.rb36
-rw-r--r--spec/unit/dsl/regsitry_helper_spec.rb12
-rw-r--r--spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb2
-rw-r--r--spec/unit/encrypted_data_bag_item_spec.rb130
-rw-r--r--spec/unit/environment_spec.rb210
-rw-r--r--spec/unit/exceptions_spec.rb2
-rw-r--r--spec/unit/file_access_control_spec.rb112
-rw-r--r--spec/unit/file_cache_spec.rb22
-rw-r--r--spec/unit/file_content_management/deploy/cp_spec.rb4
-rw-r--r--spec/unit/file_content_management/deploy/mv_unix_spec.rb20
-rw-r--r--spec/unit/file_content_management/deploy/mv_windows_spec.rb46
-rw-r--r--spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb28
-rw-r--r--spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb24
-rw-r--r--spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb2
-rw-r--r--spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb24
-rw-r--r--spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb8
-rw-r--r--spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb4
-rw-r--r--spec/unit/handler/json_file_spec.rb20
-rw-r--r--spec/unit/handler_spec.rb78
-rw-r--r--spec/unit/http/basic_client_spec.rb6
-rw-r--r--spec/unit/http/http_request_spec.rb20
-rw-r--r--spec/unit/http/simple_spec.rb6
-rw-r--r--spec/unit/http/ssl_policies_spec.rb30
-rw-r--r--spec/unit/http/validate_content_length_spec.rb22
-rw-r--r--spec/unit/http_spec.rb18
-rw-r--r--spec/unit/knife/bootstrap_spec.rb200
-rw-r--r--spec/unit/knife/client_bulk_delete_spec.rb48
-rw-r--r--spec/unit/knife/client_create_spec.rb34
-rw-r--r--spec/unit/knife/client_delete_spec.rb30
-rw-r--r--spec/unit/knife/client_edit_spec.rb8
-rw-r--r--spec/unit/knife/client_list_spec.rb4
-rw-r--r--spec/unit/knife/client_reregister_spec.rb18
-rw-r--r--spec/unit/knife/configure_client_spec.rb40
-rw-r--r--spec/unit/knife/configure_spec.rb170
-rw-r--r--spec/unit/knife/cookbook_bulk_delete_spec.rb30
-rw-r--r--spec/unit/knife/cookbook_create_spec.rb118
-rw-r--r--spec/unit/knife/cookbook_delete_spec.rb98
-rw-r--r--spec/unit/knife/cookbook_download_spec.rb112
-rw-r--r--spec/unit/knife/cookbook_list_spec.rb18
-rw-r--r--spec/unit/knife/cookbook_metadata_from_file_spec.rb16
-rw-r--r--spec/unit/knife/cookbook_metadata_spec.rb88
-rw-r--r--spec/unit/knife/cookbook_show_spec.rb58
-rw-r--r--spec/unit/knife/cookbook_site_download_spec.rb50
-rw-r--r--spec/unit/knife/cookbook_site_install_spec.rb76
-rw-r--r--spec/unit/knife/cookbook_site_share_spec.rb110
-rw-r--r--spec/unit/knife/cookbook_site_unshare_spec.rb30
-rw-r--r--spec/unit/knife/cookbook_test_spec.rb32
-rw-r--r--spec/unit/knife/cookbook_upload_spec.rb122
-rw-r--r--spec/unit/knife/core/bootstrap_context_spec.rb44
-rw-r--r--spec/unit/knife/core/cookbook_scm_repo_spec.rb72
-rw-r--r--spec/unit/knife/core/object_loader_spec.rb6
-rw-r--r--spec/unit/knife/core/subcommand_loader_spec.rb140
-rw-r--r--spec/unit/knife/core/ui_spec.rb144
-rw-r--r--spec/unit/knife/data_bag_from_file_spec.rb2
-rw-r--r--spec/unit/knife/environment_compare_spec.rb24
-rw-r--r--spec/unit/knife/environment_create_spec.rb32
-rw-r--r--spec/unit/knife/environment_delete_spec.rb28
-rw-r--r--spec/unit/knife/environment_edit_spec.rb30
-rw-r--r--spec/unit/knife/environment_from_file_spec.rb34
-rw-r--r--spec/unit/knife/environment_list_spec.rb14
-rw-r--r--spec/unit/knife/environment_show_spec.rb20
-rw-r--r--spec/unit/knife/index_rebuild_spec.rb34
-rw-r--r--spec/unit/knife/knife_help.rb48
-rw-r--r--spec/unit/knife/node_bulk_delete_spec.rb28
-rw-r--r--spec/unit/knife/node_delete_spec.rb22
-rw-r--r--spec/unit/knife/node_edit_spec.rb34
-rw-r--r--spec/unit/knife/node_environment_set_spec.rb24
-rw-r--r--spec/unit/knife/node_from_file_spec.rb16
-rw-r--r--spec/unit/knife/node_list_spec.rb18
-rw-r--r--spec/unit/knife/node_run_list_add_spec.rb58
-rw-r--r--spec/unit/knife/node_run_list_remove_spec.rb20
-rw-r--r--spec/unit/knife/node_run_list_set_spec.rb54
-rw-r--r--spec/unit/knife/role_bulk_delete_spec.rb24
-rw-r--r--spec/unit/knife/role_create_spec.rb24
-rw-r--r--spec/unit/knife/role_delete_spec.rb20
-rw-r--r--spec/unit/knife/role_edit_spec.rb26
-rw-r--r--spec/unit/knife/role_from_file_spec.rb20
-rw-r--r--spec/unit/knife/role_list_spec.rb14
-rw-r--r--spec/unit/knife/ssh_spec.rb132
-rw-r--r--spec/unit/knife/ssl_check_spec.rb54
-rw-r--r--spec/unit/knife/ssl_fetch_spec.rb12
-rw-r--r--spec/unit/knife/status_spec.rb10
-rw-r--r--spec/unit/knife/tag_create_spec.rb10
-rw-r--r--spec/unit/knife/tag_delete_spec.rb12
-rw-r--r--spec/unit/knife/tag_list_spec.rb8
-rw-r--r--spec/unit/knife/user_create_spec.rb36
-rw-r--r--spec/unit/knife/user_delete_spec.rb8
-rw-r--r--spec/unit/knife/user_edit_spec.rb14
-rw-r--r--spec/unit/knife/user_list_spec.rb4
-rw-r--r--spec/unit/knife/user_reregister_spec.rb20
-rw-r--r--spec/unit/knife/user_show_spec.rb10
-rw-r--r--spec/unit/knife_spec.rb182
-rw-r--r--spec/unit/lwrp_spec.rb76
-rw-r--r--spec/unit/mash_spec.rb12
-rw-r--r--spec/unit/mixin/checksum_spec.rb4
-rw-r--r--spec/unit/mixin/command_spec.rb26
-rw-r--r--spec/unit/mixin/convert_to_class_name_spec.rb12
-rw-r--r--spec/unit/mixin/deep_merge_spec.rb138
-rw-r--r--spec/unit/mixin/deprecation_spec.rb10
-rw-r--r--spec/unit/mixin/enforce_ownership_and_permissions_spec.rb28
-rw-r--r--spec/unit/mixin/homebrew_user_spec.rb6
-rw-r--r--spec/unit/mixin/params_validate_spec.rb142
-rw-r--r--spec/unit/mixin/path_sanity_spec.rb28
-rw-r--r--spec/unit/mixin/securable_spec.rb354
-rw-r--r--spec/unit/mixin/shell_out_spec.rb12
-rw-r--r--spec/unit/mixin/template_spec.rb62
-rw-r--r--spec/unit/mixin/windows_architecture_helper_spec.rb10
-rw-r--r--spec/unit/mixin/xml_escape_spec.rb14
-rw-r--r--spec/unit/monkey_patches/string_spec.rb4
-rw-r--r--spec/unit/monkey_patches/uri_spec.rb2
-rw-r--r--spec/unit/monologger_spec.rb6
-rw-r--r--spec/unit/node/attribute_spec.rb386
-rw-r--r--spec/unit/node/immutable_collections_spec.rb42
-rw-r--r--spec/unit/node_map_spec.rb155
-rw-r--r--spec/unit/node_spec.rb694
-rw-r--r--spec/unit/platform/query_helpers_spec.rb10
-rw-r--r--spec/unit/platform_spec.rb92
-rw-r--r--spec/unit/policy_builder/expand_node_object_spec.rb35
-rw-r--r--spec/unit/policy_builder/policyfile_spec.rb40
-rw-r--r--spec/unit/provider/breakpoint_spec.rb18
-rw-r--r--spec/unit/provider/cookbook_file/content_spec.rb6
-rw-r--r--spec/unit/provider/cookbook_file_spec.rb2
-rw-r--r--spec/unit/provider/cron_spec.rb350
-rw-r--r--spec/unit/provider/deploy/revision_spec.rb44
-rw-r--r--spec/unit/provider/deploy/timestamped_spec.rb6
-rw-r--r--spec/unit/provider/deploy_spec.rb462
-rw-r--r--spec/unit/provider/directory_spec.rb112
-rw-r--r--spec/unit/provider/dsc_script_spec.rb26
-rw-r--r--spec/unit/provider/env/windows_spec.rb10
-rw-r--r--spec/unit/provider/env_spec.rb144
-rw-r--r--spec/unit/provider/erl_call_spec.rb18
-rw-r--r--spec/unit/provider/execute_spec.rb54
-rw-r--r--spec/unit/provider/file/content_spec.rb43
-rw-r--r--spec/unit/provider/file_spec.rb2
-rw-r--r--spec/unit/provider/git_spec.rb344
-rw-r--r--spec/unit/provider/group/dscl_spec.rb127
-rw-r--r--spec/unit/provider/group/gpasswd_spec.rb28
-rw-r--r--spec/unit/provider/group/groupadd_spec.rb66
-rw-r--r--spec/unit/provider/group/groupmod_spec.rb46
-rw-r--r--spec/unit/provider/group/pw_spec.rb42
-rw-r--r--spec/unit/provider/group/usermod_spec.rb40
-rw-r--r--spec/unit/provider/group/windows_spec.rb30
-rw-r--r--spec/unit/provider/group_spec.rb152
-rw-r--r--spec/unit/provider/http_request_spec.rb60
-rw-r--r--spec/unit/provider/ifconfig/aix_spec.rb40
-rw-r--r--spec/unit/provider/ifconfig/debian_spec.rb42
-rw-r--r--spec/unit/provider/ifconfig/redhat_spec.rb26
-rw-r--r--spec/unit/provider/ifconfig_spec.rb86
-rw-r--r--spec/unit/provider/link_spec.rb120
-rw-r--r--spec/unit/provider/log_spec.rb4
-rw-r--r--spec/unit/provider/mdadm_spec.rb46
-rw-r--r--spec/unit/provider/mount/aix_spec.rb44
-rw-r--r--spec/unit/provider/mount/mount_spec.rb234
-rw-r--r--spec/unit/provider/mount/solaris_spec.rb164
-rw-r--r--spec/unit/provider/mount/windows_spec.rb48
-rw-r--r--spec/unit/provider/ohai_spec.rb22
-rw-r--r--spec/unit/provider/package/aix_spec.rb68
-rw-r--r--spec/unit/provider/package/apt_spec.rb72
-rw-r--r--spec/unit/provider/package/dpkg_spec.rb54
-rw-r--r--spec/unit/provider/package/easy_install_spec.rb32
-rw-r--r--spec/unit/provider/package/freebsd/pkg_spec.rb106
-rw-r--r--spec/unit/provider/package/freebsd/pkgng_spec.rb46
-rw-r--r--spec/unit/provider/package/freebsd/port_spec.rb68
-rw-r--r--spec/unit/provider/package/ips_spec.rb68
-rw-r--r--spec/unit/provider/package/macports_spec.rb98
-rw-r--r--spec/unit/provider/package/openbsd_spec.rb66
-rw-r--r--spec/unit/provider/package/pacman_spec.rb70
-rw-r--r--spec/unit/provider/package/paludis_spec.rb40
-rw-r--r--spec/unit/provider/package/portage_spec.rb76
-rw-r--r--spec/unit/provider/package/rpm_spec.rb58
-rw-r--r--spec/unit/provider/package/rubygems_spec.rb281
-rw-r--r--spec/unit/provider/package/smartos_spec.rb30
-rw-r--r--spec/unit/provider/package/solaris_spec.rb70
-rw-r--r--spec/unit/provider/package/windows/msi_spec.rb6
-rw-r--r--spec/unit/provider/package/windows_spec.rb12
-rw-r--r--spec/unit/provider/package/yum_spec.rb832
-rw-r--r--spec/unit/provider/package/zypper_spec.rb94
-rw-r--r--spec/unit/provider/package_spec.rb214
-rw-r--r--spec/unit/provider/powershell_spec.rb2
-rw-r--r--spec/unit/provider/registry_key_spec.rb122
-rw-r--r--spec/unit/provider/remote_directory_spec.rb72
-rw-r--r--spec/unit/provider/remote_file/cache_control_data_spec.rb46
-rw-r--r--spec/unit/provider/remote_file/content_spec.rb90
-rw-r--r--spec/unit/provider/remote_file/fetcher_spec.rb18
-rw-r--r--spec/unit/provider/remote_file/ftp_spec.rb64
-rw-r--r--spec/unit/provider/remote_file/http_spec.rb88
-rw-r--r--spec/unit/provider/remote_file/local_file_spec.rb18
-rw-r--r--spec/unit/provider/remote_file_spec.rb6
-rw-r--r--spec/unit/provider/route_spec.rb126
-rw-r--r--spec/unit/provider/ruby_block_spec.rb8
-rw-r--r--spec/unit/provider/script_spec.rb24
-rw-r--r--spec/unit/provider/service/aix_service_spec.rb181
-rw-r--r--spec/unit/provider/service/aixinit_service_spec.rb269
-rw-r--r--spec/unit/provider/service/arch_service_spec.rb96
-rw-r--r--spec/unit/provider/service/debian_service_spec.rb80
-rw-r--r--spec/unit/provider/service/freebsd_service_spec.rb4
-rw-r--r--spec/unit/provider/service/gentoo_service_spec.rb56
-rw-r--r--spec/unit/provider/service/init_service_spec.rb78
-rw-r--r--spec/unit/provider/service/insserv_service_spec.rb16
-rw-r--r--spec/unit/provider/service/invokercd_service_spec.rb70
-rw-r--r--spec/unit/provider/service/macosx_spec.rb98
-rw-r--r--spec/unit/provider/service/redhat_spec.rb54
-rw-r--r--spec/unit/provider/service/simple_service_spec.rb56
-rw-r--r--spec/unit/provider/service/solaris_smf_service_spec.rb89
-rw-r--r--spec/unit/provider/service/systemd_service_spec.rb337
-rw-r--r--spec/unit/provider/service/upstart_service_spec.rb156
-rw-r--r--spec/unit/provider/service/windows_spec.rb184
-rw-r--r--spec/unit/provider/service_spec.rb80
-rw-r--r--spec/unit/provider/subversion_spec.rb160
-rw-r--r--spec/unit/provider/template/content_spec.rb18
-rw-r--r--spec/unit/provider/template_spec.rb12
-rw-r--r--spec/unit/provider/user/dscl_spec.rb336
-rw-r--r--spec/unit/provider/user/pw_spec.rb96
-rw-r--r--spec/unit/provider/user/solaris_spec.rb16
-rw-r--r--spec/unit/provider/user/useradd_spec.rb2
-rw-r--r--spec/unit/provider/user/windows_spec.rb52
-rw-r--r--spec/unit/provider/user_spec.rb144
-rw-r--r--spec/unit/provider/whyrun_safe_ruby_block_spec.rb8
-rw-r--r--spec/unit/provider_resolver_spec.rb552
-rw-r--r--spec/unit/provider_spec.rb46
-rw-r--r--spec/unit/recipe_spec.rb195
-rw-r--r--spec/unit/registry_helper_spec.rb286
-rw-r--r--spec/unit/resource/apt_package_spec.rb23
-rw-r--r--spec/unit/resource/bash_spec.rb8
-rw-r--r--spec/unit/resource/batch_spec.rb2
-rw-r--r--spec/unit/resource/breakpoint_spec.rb18
-rw-r--r--spec/unit/resource/chef_gem_spec.rb23
-rw-r--r--spec/unit/resource/conditional_action_not_nothing_spec.rb4
-rw-r--r--spec/unit/resource/conditional_spec.rb32
-rw-r--r--spec/unit/resource/cookbook_file_spec.rb26
-rw-r--r--spec/unit/resource/cron_spec.rb74
-rw-r--r--spec/unit/resource/csh_spec.rb8
-rw-r--r--spec/unit/resource/deploy_revision_spec.rb31
-rw-r--r--spec/unit/resource/deploy_spec.rb115
-rw-r--r--spec/unit/resource/directory_spec.rb36
-rw-r--r--spec/unit/resource/dpkg_package_spec.rb22
-rw-r--r--spec/unit/resource/easy_install_package_spec.rb27
-rw-r--r--spec/unit/resource/env_spec.rb24
-rw-r--r--spec/unit/resource/erl_call_spec.rb22
-rw-r--r--spec/unit/resource/execute_spec.rb5
-rw-r--r--spec/unit/resource/file_spec.rb58
-rw-r--r--spec/unit/resource/freebsd_package_spec.rb18
-rw-r--r--spec/unit/resource/gem_package_spec.rb23
-rw-r--r--spec/unit/resource/git_spec.rb20
-rw-r--r--spec/unit/resource/group_spec.rb54
-rw-r--r--spec/unit/resource/homebrew_package_spec.rb25
-rw-r--r--spec/unit/resource/http_request_spec.rb12
-rw-r--r--spec/unit/resource/ifconfig_spec.rb16
-rw-r--r--spec/unit/resource/ips_package_spec.rb23
-rw-r--r--spec/unit/resource/link_spec.rb50
-rw-r--r--spec/unit/resource/log_spec.rb18
-rw-r--r--spec/unit/resource/macports_package_spec.rb21
-rw-r--r--spec/unit/resource/mdadm_spec.rb36
-rw-r--r--spec/unit/resource/mount_spec.rb90
-rw-r--r--spec/unit/resource/ohai_spec.rb14
-rw-r--r--spec/unit/resource/openbsd_package_spec.rb49
-rw-r--r--spec/unit/resource/package_spec.rb24
-rw-r--r--spec/unit/resource/pacman_package_spec.rb22
-rw-r--r--spec/unit/resource/perl_spec.rb8
-rw-r--r--spec/unit/resource/portage_package_spec.rb6
-rw-r--r--spec/unit/resource/powershell_spec.rb14
-rw-r--r--spec/unit/resource/python_spec.rb8
-rw-r--r--spec/unit/resource/registry_key_spec.rb64
-rw-r--r--spec/unit/resource/remote_directory_spec.rb34
-rw-r--r--spec/unit/resource/remote_file_spec.rb82
-rw-r--r--spec/unit/resource/route_spec.rb38
-rw-r--r--spec/unit/resource/rpm_package_spec.rb22
-rw-r--r--spec/unit/resource/ruby_block_spec.rb16
-rw-r--r--spec/unit/resource/ruby_spec.rb8
-rw-r--r--spec/unit/resource/scm_spec.rb80
-rw-r--r--spec/unit/resource/script_spec.rb4
-rw-r--r--spec/unit/resource/service_spec.rb84
-rw-r--r--spec/unit/resource/smartos_package_spec.rb25
-rw-r--r--spec/unit/resource/solaris_package_spec.rb41
-rw-r--r--spec/unit/resource/subversion_spec.rb28
-rw-r--r--spec/unit/resource/template_spec.rb70
-rw-r--r--spec/unit/resource/timestamped_deploy_spec.rb15
-rw-r--r--spec/unit/resource/user_spec.rb46
-rw-r--r--spec/unit/resource/windows_package_spec.rb27
-rw-r--r--spec/unit/resource/windows_service_spec.rb15
-rw-r--r--spec/unit/resource/yum_package_spec.rb37
-rw-r--r--spec/unit/resource_collection/resource_list_spec.rb137
-rw-r--r--spec/unit/resource_collection/resource_set_spec.rb199
-rw-r--r--spec/unit/resource_collection/stepable_iterator_spec.rb48
-rw-r--r--spec/unit/resource_collection_spec.rb203
-rw-r--r--spec/unit/resource_definition_spec.rb78
-rw-r--r--spec/unit/resource_platform_map_spec.rb164
-rw-r--r--spec/unit/resource_reporter_spec.rb236
-rw-r--r--spec/unit/resource_spec.rb347
-rw-r--r--spec/unit/rest/auth_credentials_spec.rb146
-rw-r--r--spec/unit/rest_spec.rb176
-rw-r--r--spec/unit/role_spec.rb169
-rw-r--r--spec/unit/run_context/cookbook_compiler_spec.rb36
-rw-r--r--spec/unit/run_context_spec.rb50
-rw-r--r--spec/unit/run_list/run_list_expansion_spec.rb38
-rw-r--r--spec/unit/run_list/run_list_item_spec.rb56
-rw-r--r--spec/unit/run_list/versioned_recipe_list_spec.rb28
-rw-r--r--spec/unit/run_list_spec.rb110
-rw-r--r--spec/unit/run_lock_spec.rb28
-rw-r--r--spec/unit/run_status_spec.rb48
-rw-r--r--spec/unit/runner_spec.rb485
-rw-r--r--spec/unit/scan_access_control_spec.rb46
-rw-r--r--spec/unit/search/query_spec.rb60
-rw-r--r--spec/unit/shell/model_wrapper_spec.rb26
-rw-r--r--spec/unit/shell/shell_ext_spec.rb66
-rw-r--r--spec/unit/shell/shell_session_spec.rb48
-rw-r--r--spec/unit/shell_out_spec.rb8
-rw-r--r--spec/unit/shell_spec.rb52
-rw-r--r--spec/unit/user_spec.rb100
-rw-r--r--spec/unit/util/backup_spec.rb64
-rw-r--r--spec/unit/util/diff_spec.rb50
-rw-r--r--spec/unit/util/dsc/configuration_generator_spec.rb26
-rw-r--r--spec/unit/util/dsc/lcm_output_parser_spec.rb34
-rw-r--r--spec/unit/util/dsc/local_configuration_manager_spec.rb17
-rw-r--r--spec/unit/util/editor_spec.rb20
-rw-r--r--spec/unit/util/file_edit_spec.rb20
-rw-r--r--spec/unit/util/path_helper_spec.rb72
-rw-r--r--spec/unit/util/powershell/cmdlet_spec.rb18
-rw-r--r--spec/unit/util/selinux_spec.rb60
-rw-r--r--spec/unit/util/threaded_job_queue_spec.rb12
-rw-r--r--spec/unit/version/platform_spec.rb10
-rw-r--r--spec/unit/version_class_spec.rb30
-rw-r--r--spec/unit/version_constraint/platform_spec.rb14
-rw-r--r--spec/unit/version_constraint_spec.rb86
-rw-r--r--spec/unit/windows_service_spec.rb30
-rw-r--r--spec/unit/workstation_config_loader_spec.rb2
-rw-r--r--tasks/rspec.rb34
742 files changed, 22790 insertions, 16768 deletions
diff --git a/.rspec b/.rspec
index 7bfa3f20e6..eb3ef03653 100644
--- a/.rspec
+++ b/.rspec
@@ -1,2 +1,2 @@
--color
--fs
+-fd
diff --git a/.travis.yml b/.travis.yml
index ec05a9f002..2ce7238619 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,23 +1,27 @@
-# Temporary workaround for issue with rubygems 2.2.0 with bundler 1.5 on ruby
-# 1.8.7.
-#
-# A fix has been merged to rubygems but not yet released. See:
-# https://github.com/rubygems/rubygems/commit/f8e0f1d5f67cfc4e1966cc1e2db367aebf8a09e4
-#
-# See also CHEF-4916
-#
-# This workaround should be removed when that fix is released.
+# Early warning system to catch if Rubygems breaks something
before_install:
-- gem update --system 2.1.11
-- gem --version
+ gem update --system
branches:
only:
- master
- 10-stable
- 11-stable
+ - 12-stable
-script: bundle exec rspec --color --format progress
+# do not run expensive spec tests on PRs, only on branches
+script: "
+echo '--color\n-fp' > .rspec;
+if [ ${TRAVIS_PULL_REQUEST} = 'false' ];
+then
+ bundle exec rake spec:all;
+else
+ bundle exec rake spec;
+fi"
+
+env:
+ global:
+ - FORCE_FFI_YAJL=ext
matrix:
include:
@@ -36,9 +40,10 @@ matrix:
before_script:
- cd kitchen-tests
script:
- - if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then bundle exec kitchen test; fi
+# FIXME: we should fix centos-6 against AWS and then enable it here
+ - if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then bundle exec kitchen test ubuntu; fi
after_script:
- - if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then bundle exec kitchen destroy; fi
+ - if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then bundle exec kitchen destroy ubuntu; fi
env:
- KITCHEN_YAML=.kitchen.travis.yml
- EC2_SSH_KEY_PATH=~/.ssh/id_aws.pem
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f321120901..e85a727c37 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,18 @@
-## Unreleased: 12.0.0
+## Unreleased
+
+* [**Vasiliy Tolstov**](https://github.com/vtolstov):
+ cleanup cookbook path from stale files (when using chef-solo with a tarball url)
+* [**Nathan Cerny**](https://github.com/ncerny):
+ Fix rubygems provider to use https instead of http.
+* [**Anshul Sharma**](https://github.com/justanshulsharma)
+ removed securerandom patch
+* [**Scott Bonds**](https://github.com/bonds)
+ add package support for OpenBSD
+
+### Chef Contributions
+* Update Chef to use RSpec 3.
+
+## 12.0.0
* [**Jesse Hu**](https://github.com/jessehu):
retry on HTTP 50X Error when calling Chef REST API
@@ -124,9 +138,39 @@
uploads existing category of the cookbook will be used.
* [**Nicolas DUPEUX**](https://github.com/vaxvms):
Added JSON output to `knife status` command. `--medium` and `--long` output formatting parameters are now supported in knife status.
+* [**Trevor North**](https://github.com/trvrnrth):
+ Removed dead code from `knife ssh`.
+* [**Nicolas Szalay**](https://github.com/rottenbytes):
+ Fixed a bug preventing mounting of cgroup type devices in the mount provider.
+* [**Anshul Sharma**](https://github.com/justanshulsharma):
+ Fixed inconsistent globbing in `knife from file` command.
+* [**Nicolas Szalay**](https://github.com/rottenbytes):
+ Made user prompts in knife more beautiful by adding a space after Y/N prompts.
+* [**Ivan Larionov**](https://github.com/xeron):
+ Made empty run_list to produce an empty array when using node.to_hash.
+* [**Siddheshwar More**](https://github.com/siddheshwar-more):
+ Fixed a bug in knife bootstrap that caused config options to override command line options.
+* [**Thiago Oliveira**](https://github.com/chilicheech):
+ Fixed a bug in Mac OSX group provider and made it idempotent.
+* [**liseki**](https://github.com/liseki):
+ Fixed a bug in why-run mode for freebsd service resources without configured init scripts.
+* [**liseki**](https://github.com/liseki):
+ Fixed a bug in freebsd service providers to load the status correctly.
+
### Chef Contributions
+* Added RFC-023 Chef 12 Attribute Changes (https://github.com/opscode/chef-rfc/blob/master/rfc023-chef-12-attributes-changes.md)
+* Added os/platform_family options to provides syntax on the Chef::Resource DSL
+* Added provides methods to the Chef::Provider DSL
+* Added supported?(resource, action) class method to all Providers for late-evaluation if a provider can handle a
+ resource
+* Added ProviderResolver feature to handle late resolution of providers based on what kinds of support is in the
+ base operating system.
+* Partial Deprecation of Chef::Platform provider mapping. The static mapping will be removed as Chef-12 progresses
+ and the hooks will be completely dropped in Chef-13.
+* Default `guard_interpreter` for `powershell_script` resource set to `:powershell_script`, for `batch` to `:batch`
+* Recipe definition now returns the retval of the definition
* Add support for Windows 10 to version helper.
* `dsc_script` resource should honor configuration parameters when `configuration_data_script` is not set (Issue #2209)
* Ruby has been updated to 2.1.3 along with rubygems update to 2.4.2
@@ -199,8 +243,47 @@
* Removed dependencies on the 'json' gem, replaced with ffi-yajl. Use Chef::JSONCompat library for parsing and printing.
* Restore the deprecation logic of #valid_actions in LWRPs until Chef 13.
* Now that we don't allow unforked chef-client interval runs, remove the reloading of previously defined LWRPs.
+* Use shell_out to determine Chef::Config[:internal_locale], fix CentOS locale detection bug.
+* `only_if` and `not_if` attributes of `execute` resource now inherits the parent resource's
+ attributes when set to a `String`.
+* Retain the original value of `retries` for resources and display the original value when the run fails.
+* Added service provider for AIX.
+* The Windows env provider will delete elements even if they are only in ENV (and not in the registry)
+* Allow events to be logged to Windows Event Log
+* Fixed bug in env resource where a value containing the delimiter could never correctly match the existing values
+* More intelligent service check for systemd on Ubuntu 14.10.
+
+## 11.16.4
+
+* Windows omnibus installer security updates for redistributed bash.exe / sh.exe
+ vulnerabilities ("Shellshock") CVE-2014-6271, CVE-2014-6271, CVE-2014-6278,
+ CVE-2014-7186, CVE-2014-7187.
+* Fix bug on Windows where using the env resource on path could render the path unusable.
+* Chef Client now retries when it gets 50X from Chef Server.
+* Chef Client 11.16.4 can use the policyfiles generated with Chef DK 0.3.0.
+
+## 11.16.2
+
+* [**Phil Dibowitz**](https://github.com/jaymzh):
+ Fix a regression in whyrun_safe_ruby_block.
+
+## 11.16.0
+
+* Fix a bug in user dscl provider to enable managing password and other properties at the same time.
+* Add `dsc_script` resource to Chef for PowerShell DSC support on Windows
+
+## 11.14.6:
+
+* Modify action for env raises Chef::Exceptions::Env exception on Windows (Chef Issues 1754)
+* Fix RPM package version detection (Issue 1554)
+* Fix a bug in reporting not to post negative duration values.
+* Add password setting support for Mac 10.7, 10.8 and 10.9 to the dscl user provider.
+* ChefSpec can find freebsd_package resource correctly when a package resource is declared on Freebsd.
+* http_proxy and related config vars no longer clobber already set ENV vars
+* all http_proxy configs now set lowercase + uppercase versions of ENV vars
+* https_proxy/ftp_proxy support setting `http://` URLs (and whatever mix and match makes sense)
-## Last Release: 11.14.2
+## 11.14.2
* [**Jess Mink**](https://github.com/jmink):
Symlinks to directories should be swingable on windows (CHEF-3960)
@@ -331,3 +414,4 @@
would not share the same actions/default_action as their parent
* Raise error if a guard_interpreter is specified and a block is passed to a guard (conditional)
* Allow specifying a guard_interpreter after a conditional on a resource (Fixes #1943)
+* Windows package type should be a symbol (Fixes #1997)
diff --git a/CLA_ARCHIVE.md b/CLA_ARCHIVE.md
new file mode 100644
index 0000000000..2593a71470
--- /dev/null
+++ b/CLA_ARCHIVE.md
@@ -0,0 +1,2510 @@
+
+Corporate CLAs
+
+The list of Corporate CLAs allowed to contribute to Opscode projects. Only contributions from approved employees of these companies are acceptable.
+
+Employees get approved by being listed on the schedule A of the Corporate CLA.
+
+| **Number:** | **Company:** | **Date:** |
+|:------------|:---------------------------------------|:----------|
+| 1 | Opscode | |
+| 2 | Engine Yard | 1/7/09 |
+| 3 | Wikia | |
+| 4 | Aptana | 2/12/09 |
+| 5 | CleanOffer | 3/2/09 |
+| 6 | 37signals | 3/4/09 |
+| 7 | Nomitor | 3/9/09 |
+| 8 | We Go To 12 | 4/30/09 |
+| 9 | Plus2 Pty | 5/8/09 |
+| 10 | Phusion | 6/22/09 |
+| 11 | Rightscale | 6/30/09 |
+| 12 | Rubaidh | 7/27/09 |
+| 13 | Peritor GmbH | 8/12/09 |
+| 14 | Heroku | 8/13/09 |
+| 15 | Internet Exchange | 9/22/09 |
+| 16 | Betfair | 9/30/09 |
+| 17 | Sojern | 11/2/09 |
+| 18 | Runa | 12/20/09 |
+| 19 | MaxMedia | 1/11/10 |
+| 20 | Quantifind | 2/11/10 |
+| 21 | VMware | 2/11/10 |
+| 22 | Rackspace | 2/26/10 |
+| 23 | Leaway Enterprise | 3/16/10 |
+| 24 | Bueda | 3/30/10 |
+| 25 | Divergent Logic | 5/3/10 |
+| 26 | Basho Technologies | 5/4/10 |
+| 27 | Seven Scale | 5/13/10 |
+| 28 | IglooNET | 5/21/10 |
+| 29 | Freistil Consulting | 5/25/10 |
+| 30 | Promet Solutions | 5/25/10 |
+| 31 | Mint Digital | 6/16/10 |
+| 32 | Picklive | 6/16/10 |
+| 33 | 42 Lines | 6/27/10 |
+| 34 | Wildfire Interactiv | 7/9/10 |
+| 35 | Dynamic Network Services | 7/21/10 |
+| 36 | PeerPong | 8/4/10 |
+| 37 | domainfactory GmbH | 8/16/10 |
+| 38 | Tecnh | 8/17/10 |
+| 39 | 9Summer | 9/9/10 |
+| 40 | Wixpress | 9/13/10 |
+| 41 | Blue Box Group | 9/29/10 |
+| 42 | FindsYou Limited | 10/6/10 |
+| 43 | Highgroove Studios | 10/25/10 |
+| 44 | ZeStuff | 10/28/10 |
+| 45 | Worlize | 10/28/10 |
+| 46 | Automated Labs | 11/3/10 |
+| 47 | Estately | 11/4/10 |
+| 48 | Kapoq | 11/10/10 |
+| 49 | Openminds | 11/10/10 |
+| 50 | MobileCause | 11/10/10 |
+| 51 | Atalanta Systems | 11/14/10 |
+| 52 | Menue Americas | 11/17/10 |
+| 53 | Sociable Limited | 12/1/10 |
+| 54 | Nine Summer | 12/6/10 |
+| 55 | Neo Technology | 1/27/11 |
+| 56 | Moriz GmbH | 2/2/11 |
+| 57 | AegisCo | 2/14/11 |
+| 58 | SetJam | 2/15/11 |
+| 59 | Tippr | 2/18/11 |
+| 60 | Ning | 2/24/11 |
+| 61 | Workday | 3/12/11 |
+| 62 | 7digital | 3/3/11 |
+| 63 | PagerDuty | 3/17/11 |
+| 64 | Gnowsis | 3/25/11 |
+| 65 | Unboxed Consulting | 4/1/11 |
+| 66 | CustomInk | 4/8/11 |
+| 67 | TalentBox | 4/25/11 |
+| 68 | Wavii | 4/29/11 |
+| 69 | Datadog | 5/4/11 |
+| 70 | Viximo | 5/10/11 |
+| 71 | ZephirWorks | 5/11/11 |
+| 72 | Dell | 5/12/11 |
+| 73 | Newsweek/Daily Beast Company | 5/19/11 |
+| 74 | WordStream | 5/19/11 |
+| 75 | Flagbit | 6/14/11 |
+| 76 | Applications Online | 6/17/11 |
+| 77 | Versapay | 7/5/11 |
+| 78 | DigiTar | 7/19/11 |
+| 79 | DreamHost | 7/21/11 |
+| 80 | Edmunds.com | 7/22/11 |
+| 81 | Every Ware | 7/25/11 |
+| 82 | Ask.com | 8/1/11 |
+| 83 | bring.out doo Sarajevo | 8/11/11 |
+| 84 | Kos Media | 8/15/11 |
+| 85 | reallyenglish.com | 8/15/11 |
+| 86 | Fewbytes | 8/18/11 |
+| 87 | Business Intelligence Associates | 8/19/11 |
+| 88 | Tacit Knowledge | 8/22/11 |
+| 89 | Zenexity | 8/30/11 |
+| 90 | ClassDo | 8/30/11 |
+| 91 | Myplanet | 9/2/11 |
+| 92 | ihiji | 9/16/11 |
+| 93 | "Port 80 Productions, LLC" | 10/28/11 |
+| 94 | Green Alto | 11/2/11 |
+| 95 | "Heavy Water Software, Inc." | 11/4/11 |
+| 96 | Wealthfront Inc. | 11/15/11 |
+| 97 | "Kickstarter, Inc." | 11/18/11 |
+| 98 | Webtrends Inc | 11/22/11 |
+| 99 | "Infochimps, Inc." | 11/28/11 |
+| 100 | "Cycle Computing, LLC" | 11/29/11 |
+| 101 | "Ubalo, Inc" | 12/8/11 |
+| 102 | "SweetSpot Diabetes Care, Inc." | 12/12/11 |
+| 103 | "RideCharge, Inc." | 12/15/11 |
+| 104 | "Riot Games, Inc." | 12/15/11 |
+| 105 | Fiksu | 12/21/11 |
+| 106 | WhitePages Inc. | 1/3/12 |
+| 107 | "CX, Inc." | 1/12/12 |
+| 108 | Spoke Software | 1/15/12 |
+| 109 | Xforty Technologies | 1/25/12 |
+| 110 | "Democracy Works, Inc" | 1/30/12 |
+| 111 | "Pure Lake Software, Inc." | 2/10/12 |
+| 112 | Sveriges Television AB | 2/14/12 |
+| 113 | Reaktor Innovations | 2/14/12 |
+| 114 | "Oxygen Cloud, Inc." | 2/14/12 |
+| 115 | Robojar Pty Ltd | 2/17/12 |
+| 116 | Green and Secure IT Limited | 2/19/12 |
+| 117 | ModCloth | 2/23/12 |
+| 118 | Joyent | 2/29/12 |
+| 119 | "Wallrazor, Inc." | 3/4/12 |
+| 120 | "Cerner Innovation, Inc." | 3/8/12 |
+| 121 | "Numenta, Inc." | 3/27/12 |
+| 122 | Kotiri Software Ltd. | 4/3/12 |
+| 123 | "The Frontside Software, Inc." | 4/5/12 |
+| 124 | "Needle, Inc." | 4/5/12 |
+| 125 | "Gap, Inc." | 4/10/12 |
+| 126 | Youscribe | 4/11/12 |
+| 127 | Deutsche Telekom Laboratories | 4/17/12 |
+| 128 | "Relevance, Inc." | 4/20/12 |
+| 129 | Truer Sound LLC | 4/20/12 |
+| 130 | Websym Technologies Private Ltd. | 4/30/12 |
+| 131 | DreamBox Learning Inc | 5/3/12 |
+| 132 | Simple | 5/7/12 |
+| 133 | "Consumer Club, Inc" | 5/10/12 |
+| 134 | Onddo Labs | 5/18/12 |
+| 135 | CyberAgent Corp. | 5/22/12 |
+| 136 | SourceIndex IT-Services | 6/7/12 |
+| 137 | "Scribd, Inc." | 6/15/12 |
+| 138 | Civolution BV | 6/18/12 |
+| 139 | Drillinginfo | 6/18/12 |
+| 140 | NaviNet | 6/20/12 |
+| 141 | "Voxel Dot Net, Inc" | 6/26/12 |
+| 142 | Asbury Theological Seminary | 6/27/12 |
+| 143 | The Cloudscaling Group | 6/27/12 |
+| 144 | "Creationline, Inc." | 6/27/12 |
+| 145 | "Action Verb, LLC" | 7/10/12 |
+| 146 | Iugu Servicos na Internet LTDA | 7/11/12 |
+| 147 | OpeniT | 7/18/12 |
+| 148 | Cloudreach Limited | 7/24/12 |
+| 149 | Bonnier Corporation | 7/25/12 |
+| 150 | "OneHealth Solutions, Inc." | 7/25/12 |
+| 151 | Hewlett-Packard | 7/26/12 |
+| 152 | Paydici Corp. | 7/26/12 |
+| 153 | "Novell, Inc." | 8/1/12 |
+| 154 | Schuberg Phillis B.V. | 8/3/12 |
+| 155 | RelatelIQ Inc. | 8/3/12 |
+| 156 | HomeMade Digital Ltd | 8/7/12 |
+| 157 | "PrimeRevenue, Inc" | 8/10/12 |
+| 158 | Calxeda | 8/14/12 |
+| 159 | Big Cartel LLC | 8/17/12 |
+| 160 | Atlassian | 8/27/12 |
+| 161 | One Connect Limited | 9/7/12 |
+| 162 | Sonian Inc | 9/8/12 |
+| 163 | The App Business | 9/19/12 |
+| 164 | "Pat Deegan, PhD & Associates, LLC" | 9/26/12 |
+| 165 | OmniTI | 9/26/12 |
+| 166 | "Cloudant, Inc." | 10/5/12 |
+| 167 | ZestFinance | 10/8/12 |
+| 168 | Firebelly Design | 10/8/12 |
+| 169 | Nu Echo | 10/16/12 |
+| 170 | OpenConcept Consulting Inc. | 10/18/12 |
+| 171 | Apptentive | 10/20/12 |
+| 172 | "Document Swarm, LLC" | 10/20/12 |
+| 173 | "Tilting @, LLC" | 10/29/12 |
+| 174 | "Sift Science, Inc" | 10/31/12 |
+| 175 | FluxSauce | 11/1/12 |
+| 176 | Rocket Internet GmbH | 11/2/12 |
+| 177 | Coding-Knight LTD | 11/6/12 |
+| 178 | Tapp | 11/13/12 |
+| 179 | Taqtiqa LLC | 11/14/12 |
+| 180 | "Nordstrom, Inc" | 11/15/12 |
+| 181 | Daptiv Solutions LLC | 11/26/12 |
+| 182 | Lime Pepper Ltd | 11/28/12 |
+| 183 | "Straydog Software, Inc." | 11/29/12 |
+| 184 | "Fidelity Technology Group, LLC" | 12/6/12 |
+| 185 | "Angelweb, Unipessoal Lda." | 12/14/12 |
+| 186 | bcs kommunikationslosungen | 12/17/12 |
+| 187 | "North County Tech Center, LLC" | 12/22/12 |
+| 188 | Emergent One | 1/9/13 |
+| 189 | Ninefold Pty Limited | 1/9/13 |
+| 190 | DecisionDesk | 1/13/13 |
+| 191 | Belly Inc | 1/15/13 |
+| 192 | cloudbau Gmbh | 1/18/13 |
+| 193 | ActBlue Technical Services | 1/18/13 |
+| 194 | HiganWorks LLC | 1/22/13 |
+| 195 | Ontario Systems | 1/23/13 |
+| 196 | "Lytro, Inc." | 1/23/13 |
+| 197 | Grupa Allegro Sp. z o.o. | 1/31/13 |
+| 198 | Workday Inc. | 2/5/13 |
+| 199 | "Atlas Digital, LLC" | 2/6/13 |
+| 200 | Intoximeters | 2/15/13 |
+| 201 | Airbnb | 2/17/13 |
+| 202 | Valtech AB | 2/20/13 |
+| 203 | AWeber Communications | 2/25/13 |
+| 204 | adesso mobile solutions GmbH | 3/4/13 |
+| 205 | "Banno, LLC" | 3/5/13 |
+| 206 | AboutUs | 3/8/13 |
+| 207 | "Google, Inc" | 3/14/13 |
+| 208 | cloudControl GmbH | 3/21/13 |
+| 209 | Springest | 3/25/13 |
+| 210 | Criteo | 3/26/13 |
+| 211 | "Thinking Phone Networks, Inc." | 4/8/13 |
+| 212 | Evolving Web Inc | 4/11/13 |
+| 213 | BinaryBabel OSS | 4/17/13 |
+| 214 | Tout Industries | 4/18/13 |
+| 215 | "Lookout, Inc." | 4/22/13 |
+| 216 | Recorded Future Inc | 4/23/13 |
+| 217 | Irrational Industries | 5/1/13 |
+| 218 | "Socrata, Inc" | 5/1/13 |
+| 219 | "Aspera, Inc" | 5/1/13 |
+| 220 | "Hadapt, Inc" | 5/3/13 |
+| 221 | Moncai | 5/7/13 |
+| 222 | IBM | 5/14/13 |
+| 223 | Yahoo Inc. | 5/14/13 |
+| 224 | Texas A&M University College of Arch. | 5/20/13 |
+| 225 | MoPub | 5/21/13 |
+| 226 | "Onelogin, Inc" | 5/24/13 |
+| 227 | Yola | 5/28/13 |
+| 228 | CopperEgg | 5/28/13 |
+| 229 | "MeetMe, Inc" | 5/30/13 |
+| 230 | Boadree Innovations Kft. | 6/17/13 |
+| 231 | "Bitium, inc" | 6/21/13 |
+| 232 | Heart of Sales LLC DBA Ace of Sales | 7/4/13 |
+| 233 | NetSrv Consulting Ltd | 7/7/13 |
+| 234 | "AURIN Project" | 7/11/13 |
+| 235 | Onlife Health Inc | 7/17/13 |
+| 236 | Roblox Inc. | 7/17/13 |
+| 237 | "Taos Mountain, Inc" | 7/24/13 |
+| 238 | CoreMedia AG | 7/31/13 |
+| 239 | "PROS, Inc. a Delaware Corporation" | 8/14/13 |
+| 240 | Identive Group | 8/21/13 |
+| 241 | University of Derby | 8/22/13 |
+| 242 | TeamSnap | 8/29/13 |
+| 243 | Social Ally Pty Ltd | 8/29/13 |
+| 244 | Ecodev Sarl | 9/9/13 |
+| 245 | kreuzwerker GmbH | 9/18/13 |
+| 246 | Central Desktop | 9/18/13 |
+| 247 | Siili Solutions | 9/19/13 |
+| 248 | Twiket LTD | 9/23/13 |
+| 249 | Cloudsoft | 9/25/13 |
+| 250 | MYOB NZ Limited | 9/26/13 |
+| 251 | Mollie B.V. | 9/30/13 |
+| 252 | Unbounce | 10/1/13 |
+| 253 | Shutl Ltd. | 10/2/13 |
+| 254 | Rapid7 | 10/7/13 |
+| 255 | "Our Film Festival, Inc (dba Fandor)" | 10/7/13 |
+| 256 | "Ooyala, Inc." | 10/9/13 |
+| 257 | Squaremouth Inc | 10/10/13 |
+| 258 | Optiflows | 10/11/13 |
+| 259 | General Sensing LTD | 10/10/13 |
+| 260 | Deployable LTD | 10/22/13 |
+| 261 | Klarna | 10/23/13 |
+| 262 | "Nike, Inc." | 10/25/13 |
+| 263 | SoundCloud Ltd. | 11/5/13 |
+| 264 | Project Florida | 11/5/13 |
+| 265 | Intuit | 11/6/13 |
+| 266 | ComputeNext | 11/6/13 |
+| 267 | The Weather Companies | 11/8/13 |
+| 268 | PTC Inc | 11/13/13 |
+| 269 | RamTank Inc | 11/19/13 |
+| 270 | GoCardless | 11/24/13 |
+| 271 | ZANOX AG | 11/30/13 |
+| 272 | ARINC | 12/3/13 |
+| 273 | Lockheed Martin Corporation | 12/3/13 |
+| 274 | Brightcove | 12/16/13 |
+| 275 | "Sprint.ly, Inc" | 12/27/13 |
+| 276 | Cramer Development | 1/10/14 |
+| 277 | "BlackBerry, Inc." | 1/20/14 |
+| 278 | Cerner Innovation Inc | 2/6/14 |
+| 279 | Cerner Innovation Inc | 2/11/14 |
+| 280 | Engine Yard | 2/12/14 |
+| 281 | Crux Hosted Services | 2/18/14 |
+| 282 | Blue Spurs | 2/24/14 |
+| 283 | GitLab.com | 3/1/14 |
+| 284 | Yelp | 3/7/14 |
+| 285 | Workday | 3/10/14 |
+| 286 | BMC Software Inc | 3/13/14 |
+| 287 | Itison | 3/14/14 |
+| 288 | "OnBeep, Inc." | 3/19/14 |
+| 289 | Level 11 Consulting | 3/19/14 |
+| 290 | Linaro Limited | 4/4/14 |
+| 291 | Spanlink Communications | 4/17/14 |
+| 292 | "WESEEK, Inc" | 4/29/14 |
+| 293 | "Iniqa UK, Ltd" | 6/4/14 |
+| 294 | Jemstep | 6/13/1 |
+
+
+
+
+Allowed Contributors
+
+The list of allowed contributors to Opscode projects. Persons listed as associated with a company may also be individual contributors as well.
+
+To get on the list, check out our instructions on how to contribute.
+
+1. Adam Jacob Opscode
+1. Andy Delcambre Engineyard 1/7/09
+1. Arjuna Christensen 1/7/09
+1. Artur Bergman Wikia
+1. Benjamin Black Opscode 1/10/09
+1. Bryan McLellan 1/7/09
+1. Dan Walters 3/7/09
+1. Edward Muller Engineyard 1/28/09
+1. Ezra Zygmuntowicz Engineyard 1/7/09
+1. Jason Cook Wikia
+1. Joe Williams 1/17/09
+1. Kris Rasmussen Aptana 2/12/09
+1. Lee Jensen Engineyard 1/24/09
+1. Nick Sullivan Wikia
+1. Paul Nasrat 1/19/09
+1. Pawel Rein Wikia
+1. Przemek Malkowski Wikia
+1. Sean Cribbs 2/5/09
+1. Steve Berryman 1/20/09
+1. Steven Parkes Aptana 2/12/09
+1. Thom May 1/21/09
+1. Tim Dysinger 1/28/09
+1. Michael Hale 2/16/09
+1. Mathieu Sauve-Frankel 2/22/09
+1. Matthew Landauer 2/25/09
+1. John Hampton CleanOffer 3/2/09
+1. Nadeem Bitar CleanOffer 3/2/09
+1. James Gartrell 2/6/09
+1. Joshua Sierles 37signals 3/4/09
+1. Mark Imbriaco 37signals 3/4/09
+1. Stephen Haynes Nomitor 3/9/09
+1. Yun Huang Yong Nomitor 3/9/09
+1. David Lee 3/9/09
+1. Matthew Kent 3/24/09
+1. Dave Myron 4/3/09
+1. Miguel Cabeça 8/4/09
+1. Jason Jackson 4/9/09
+1. Caleb Tennis 4/10/09
+1. Michael Lim 4/14/09
+1. David Balatero 4/28/09
+1. David Grandinetti We Go To 12 4/30/09
+1. Lachlan Cox Plus2 Pty 5/8/09
+1. Scott Likens 4/30/09
+1. Andrew Willis 5/25/09
+1. Hongli Lai Phusion 6/22/09
+1. Ninh Bui Phusion 6/22/09
+1. Edmund Haselwanter cloudbau Gmbh 6/25/09
+1. Raphael Simon RightScale 6/30/09
+1. Tony Spataro RightScale 6/30/09
+1. Stéphane Crivisier 6/30/09
+1. Matthew Todd Highgroove Studios 7/1/09
+1. Grant Zanetti 2/1/09
+1. Peter Woodman 6/22/09
+1. Daniel DeLeo 7/10/09
+1. Jeppe Madsen 9/13/09
+1. Cary Penniman RightScale 7/20/09
+1. J. Chris Anderson 8/7/09
+1. Graeme Mathieson Rubaidh 8/10/09
+1. Mark Connell Rubaidh 8/10/09
+1. Jonathan Weiss Peritor GmbH 8/12/09
+1. Mathias Meyer Peritor GmbH 8/12/09
+1. Pedro Belo Heroku 8/13/09
+1. Ricardo Chimal Jr. Heroku 8/13/09
+1. Adam Wiggins Heroku 8/13/09
+1. Ryan Tomayko Heroku 8/13/09
+1. Blake Mizerany Heroku 8/13/09
+1. Diego Algorta
+1. Kevin Hunt 8/14/09
+1. Sidney Burks 8/20/09
+1. Joe Van Dyk 9/1/09
+1. Sig Lange 9/1/09
+1. Alexander van Zoest 9/1/09
+1. Nathan Mueller 9/7/09
+1. Roman Heinrich 9/11/09
+1. Gábor Vészi 9/20/09
+1. Kenneth Kalmer Internet Exchange 9/22/09
+1. Luca Greco 9/22/09
+1. Charles Cook Betfair 9/30/09
+1. Mario Giammarco 10/6/09
+1. Matthew King 10/14/09
+1. James Golick 10/27/09
+1. Jörn Berrisch 10/28/09
+1. Peter Crossley 10/30/09
+1. Eric Hankins Sojern 11/2/09
+1. David McRae Sojern 11/2/09
+1. Dan Fitch Sojern 11/2/09
+1. Ian Meyer 11/8/09
+1. John Alberts 11/9/09
+1. Lee Marlow 11/11/09
+1. Tollef Fog Heen 11/12/09
+1. Cuong Chi Nghiem 11/13/09
+1. Gordon Thiesfeld 11/18/09
+1. Dreamcat4 11/21/09
+1. Guy Bolton King 12/3/09
+1. Robert Berger Runa 12/20/09
+1. Siva Jagadeesan Runa 12/20/09
+1. Ivan Pirlik 12/22/09
+1. David Abdemoulaie 12/23/09
+1. Alex Soto 12/29/09
+1. Bryan Helmkamp 12/30/09
+1. Jesse Nelson 1/6/10
+1. Seth Chisamore Opscode 1/11/10
+1. Alfredo Deza MaxMedia 1/11/10
+1. N. Alan Johnson Jr. 1/15/10
+1. Pavel Valodzka 2/8/10
+1. Kyle Maxwell Quantifind 2/11/10
+1. Doug MacEachern VMware 2/11/10
+1. Jan Zimmek 2/14/10
+1. Dan Prince Rackspace 2/26/10
+1. Gabe Westmaas Rackspace 2/26/10
+1. Tim Harper 3/8/10
+1. Renaud Chaput 3/10/10
+1. Daniel Peterson 3/11/10
+1. Amit Cohen Leaway Enterprise 3/16/10
+1. Avishai Ish-Shalom Leaway Enterprise 3/16/10
+1. Or Cohen Leaway Enterprise 3/16/10
+1. Jon Swope 3/19/10
+1. Jonathan Tron 3/19/10
+1. Christopher Peplin Bueda 3/30/10
+1. Trotter Cashion 4/3/10
+1. Benjamin Standefer 4/6/10
+1. P. Barrett Little 4/7/10
+1. John Nixon 4/13/10
+1. Bruce Krysiak 4/13/10
+1. Akzhan Abdulin 4/14/10
+1. Grant Rodgers 4/17/10
+1. Wesley Beary 4/22/10
+1. Farzad Farid 4/23/10
+1. Olivier Raginel 4/26/10
+1. Jacques Crocker 5/3/10
+1. Pierre Baillet 5/3/10
+1. Joel Merrick 5/3/10
+1. James Sanders 5/3/10
+1. John Goulah 5/3/10
+1. Toomas Pelberg 5/3/10
+1. Ceaser Larry Divergent Logic 5/3/10
+1. Justin Sheehy Basho Technologies 5/4/10
+1. Andrew Gross Basho Technologies 5/4/10
+1. Bryan Fink Basho Technologies 5/4/10
+1. Ben Mabey 5/5/10
+1. Christopher Durtschi Divergent Logic 5/7/10
+1. Kevin Carter Divergent Logic 5/7/10
+1. Saimon Moore 5/13/10
+1. Troy Davis Seven Scale 5/13/10
+1. Eric Lindvall Seven Scale 5/13/10
+1. Alexey Ivanov 5/14/10
+1. Pritesh Mehta 5/19/10
+1. Ondrej Kudlik IglooNET 5/21/10
+1. Marek Hulan IglooNET 5/21/10
+1. Chad Woolley 5/22/10
+1. Jochen Lillich Freistil Consulting 5/25/10
+1. Marius Ducea Promet Solutions 5/25/10
+1. Eric Butler 5/26/10
+1. Sahil Cooner 6/6/10
+1. Richard Nicholas Betfair 6/9/10
+1. Dan Slimmon 6/10/10
+1. Craig Webster Picklive 6/16/10
+1. Dean Strelau Mint Digital 6/17/10
+1. Kurt Yoder 6/25/10
+1. Jim Browne 42 Lines 6/27/10
+1. Andrey Sibiryov 7/7/10
+1. Anthony Newman Betfair 7/8/10
+1. Thomas Hoover 7/8/10
+1. Dylan Egan Wildfire Interactive 7/9/10
+1. Michael Carruthers Wildfire Interactive 7/11/10
+1. Jon Seaberg RightScale 7/20/10
+1. Sean O'Meara 7/20/10
+1. Cory von Wallenstein Dynamic Network Services 7/21/10
+1. Michael Leinartas 7/22/10
+1. Thomas Bishop 7/23/10
+1. Jon Wood 7/29/10
+1. Dmitry Vyal 8/4/10
+1. Gilles Devaux PeerPong 8/4/10
+1. Chris Pepper 8/5/10
+1. Dennis Klein 8/6/10
+1. Warwick Poole 8/12/10
+1. Ken Ming Ong 8/15/10
+1. Ash Berlin 8/16/10
+1. Jochen Tuchbreiter domainfactory GmbH 8/16/10
+1. Mat Ellis Tecnh 8/17/10
+1. Michael MacDonald 8/17/10
+1. Jorge Luiz deBrito Falcão 8/18/10
+1. Jamie Winsor 8/19/10
+1. Darrin Eden 8/19/10
+1. Jonathan Smith 8/19/10
+1. Andrew Fulcher 8/23/10
+1. Matthias Marschall 8/25/10
+1. Peter Struijk 8/25/10
+1. Robert Anthony Postill 8/28/10
+1. Joshua Timberman Opscode 9/6/10
+1. Benjamin Rockwood 9/6/10
+1. Douglas Knight 9/9/10
+1. Andrew Cole 9Summer 9/9/10
+1. Dimitri Krassovski Wixpress 9/13/10
+1. Gregory Man Wixpress 9/13/10
+1. Allan Feid 9/17/10
+1. Ringo De Smet 9/26/10
+1. Tomasz Napierala 9/27/10
+1. Jesse Proudman Blue Box Group 9/29/10
+1. Ian Parades Blue Box Group 9/29/10
+1. Lee Huffman Blue Box Group 9/29/10
+1. Christopher Horton 10/1/10
+1. Jude Sutton FindsYou Limited 10/6/10
+1. James Le Cuirot FindsYou Limited 10/6/10
+1. Richard Pelavin 10/7/10
+1. Blake Irvin ModCloth 10/8/10
+1. Jim Van Fleet 10/14/10
+1. Laurent Désarmes 10/14/10
+1. Jay T. McCanta 10/15/10
+1. Eric G. Wolfe 10/20/10
+1. Sami Haahtinen 10/21/10
+1. Chris Kelly Highgroove Studios 10/25/10
+1. Gerald L. Hevener Jr. 10/25/10
+1. Charles Quinn Highgroove Studios 10/25/10
+1. Jonathan Wallace Highgroove Studios 10/25/10
+1. Jason Ardell 10/26/10
+1. Sean Carey 10/27/10
+1. Pierre-Luc Brunet ZeStuff 10/28/10
+1. Sean Walbran 10/28/10
+1. Brian McKelvey Worlize 10/28/10
+1. Jeffrey Hulten Automated Labs 11/3/10
+1. Doug Cole Estately 11/4/10
+1. Ben Bleything Estately 11/4/10
+1. Sebastian Boehm 11/6/10
+1. Ches Martin 11/8/10
+1. Eric C. Herot 11/8/10
+1. Oliver Hankeln 11/10/10
+1. David Nolan Kapoq 11/10/10
+1. Frank Louwers Openminds 11/10/10
+1. Bernard Grymonpon Openminds 11/10/10
+1. Bram Gillemon Openminds 11/10/10
+1. Paul Cortens MobileCause 11/10/10
+1. Austin Schneider MobileCause 11/10/10
+1. Kevin Ahrens 11/13/10
+1. Stephen Nelson-Smith Atalanta Systems 11/14/10
+1. Caleb Groom 11/16/10
+1. Michael Ivey 11/17/10
+1. Wojciech Wnetrzak 11/20/10
+1. Dmitriy Tkachenko 11/22/10
+1. Filip Tepper 11/24/10
+1. Denis Barushev 11/27/10
+1. Pedro F. <<pancho>> Horrillo Guerra 11/28/10
+1. James Harton Sociable Limited 12/1/10
+1. Noah Kantrowitz 12/4/10
+1. Anthony Burton 12/4/10
+1. David Esposito Nine Summer 12/6/10
+1. Mike Lecza Nine Summer 12/6/10
+1. Andrew Cole Nine Summer 12/6/10
+1. Michael Winser Nine Summer 12/6/10
+1. Cory Burke Nine Summer 12/6/10
+1. Charles Duffy Tippr 12/7/10
+1. John Vincent 12/10/10
+1. Dustin Currie 12/14/10
+1. Mark Sonnabaum 12/14/10
+1. Elliot Murphy 12/22/10
+1. Laradji Nacer 12/30/10
+1. Todd Nine 1/3/11
+1. Elijah Wright 1/5/11
+1. Anshul Khandelwal 1/13/11
+1. Michael Carruthers 1/16/11
+1. Vishvananda Ishaya 1/17/11
+1. Scott Frazer 1/17/11
+1. Eric Hodel 1/21/11
+1. Eric Heydrick 1/25/11
+1. Andreas Kollegger Neo Technology 1/27/11
+1. Steve Lum 1/31/11
+1. Anthony Goddard 2/1/11
+1. Roland Moriz Moriz GmbH 2/2/11
+1. Emil Sit Hadapt 2/2/11
+1. Ranjib Dey 2/3/11
+1. Ryan Davis 2/8/11
+1. Eric Coleman 2/8/11
+1. James Casey 2/9/11
+1. Maciej Pasternacki 2/9/11
+1. Grzegorz Marszalek 2/11/11
+1. James Sulinski AegisCo 2/14/11
+1. Erik Sabowski AegisCo 2/14/11
+1. Maciej Pasternacki SetJam 2/15/11
+1. Steven Dossett Ning 2/17/11
+1. Dane Knecht Tippr 2/18/11
+1. Mark Imbriaco Heroku 2/28/11
+1. Jonathan Matthews 7digital 3/3/11
+1. Patrick Collins 3/7/11
+1. Jim Hopp Workday 3/12/11
+1. Ken Dove Workday 3/12/11
+1. Philip Reynolds Workday 3/12/11
+1. Victor Zakharyev Workday 3/12/11
+1. Greg Fuller Workday 3/12/11
+1. Michael Callahan Workday 3/15/11
+1. Don Norton Workday 3/15/11
+1. Joe Nuspl Workday 3/15/11
+1. Dan Thom Workday 3/15/11
+1. Rick Cooper Workday 3/15/11
+1. Patrick Debois 3/14/11
+1. Michael Guterl 3/15/11
+1. Andrew Miklas PagerDuty 3/17/11
+1. Tristan Sloughter 3/22/11
+1. Jonathon Ramsey 3/23/11
+1. Jesai Langenbach 3/24/11
+1. Maciej Pasternacki Gnowsis 3/25/11
+1. Omri Cohen 3/28/11
+1. Joseph Sokol-Margolis 3/31/11
+1. Alex Tomlins Unboxed Consulting 4/1/11
+1. Holger Just 4/5/11
+1. Jake Vanderdray CustomInk 4/8/11
+1. Nathen Harvey CustomInk 4/8/11
+1. Padraig O'Sullivan 4/8/11
+1. Christian Trabold 4/16/11
+1. KC Braunschweig Edmunds.com 4/19/11
+1. Josh Pasqualetto 4/21/11
+1. Christopher C. Johnson 4/21/11
+1. Christian Paredes 4/22/11
+1. Viral Shah 4/24/11
+1. Bradley Fritz 4/24/11
+1. Nat Lownes 4/25/11
+1. Jonathan Tron TalentBox 4/25/11
+1. Joseph Halter TalentBox 4/25/11
+1. Wilson Felipe Nunes Fernandes Pereira 4/27/11
+1. Michael Grubb 4/27/11
+1. Brandon Konkle 4/28/11
+1. Matt Griffin 4/28/11
+1. Anh K. Huynh 4/28/11
+1. Erik Frey Wavii 4/29/11
+1. Spike Gronim Wavii 4/29/11
+1. Ian MacLeod Wavii 4/29/11
+1. Guido Bartolucci Wavii 4/29/11
+1. Fletcher Nichol 5/3/11
+1. James Kane 7digital 5/4/11
+1. Paul Richards 7digital 5/4/11
+1. Alexis Le-Quoc Datadog 5/4/11
+1. Matthew Singleton Datadog 5/4/11
+1. Carlo Cabanilla Datadog 5/4/11
+1. Olivier Pomel Datadog 5/4/11
+1. Fabrice Ollivier Datadog 5/4/11
+1. Matt Griffin Viximo 5/10/11
+1. Chris Chiodo Viximo 5/10/11
+1. Adam Bell Viximo 5/10/11
+1. Sergio Rubio 5/10/11
+1. Elmer Rivera 5/10/11
+1. Andrea Campi ZephirWorks 5/11/11
+1. Andrea Carlo Granata ZephirWorks 5/11/11
+1. Marco Pierleoni ZephirWorks 5/11/11
+1. Pietro Giorgianni ZephirWorks 5/11/11
+1. Jesse Newland 5/11/11
+1. Greg Swallow 5/12/11
+1. Scott Jensen Dell 5/12/11
+1. Greg Althaus Dell 5/12/11
+1. Andi Abes Dell 5/12/11
+1. Rob Hirschfeld Dell 5/12/11
+1. Paul Webster Dell 5/12/11
+1. Mitchell Hashimoto 5/12/11
+1. Jamie van Dyke 5/17/11
+1. Vladimir Kozhukalov 5/18/11
+1. Nathan Butler Newsweek/Daily Beast Company 5/19/11
+1. Ken Garland Newsweek/Daily Beast Company 5/19/11
+1. Michael Yankovski WordStream 5/19/11
+1. Augusto Becciu 5/19/11
+1. Greg Albrecht 5/19/11
+1. Eric James Buth 5/24/11
+1. Dan Porter 5/24/11
+1. Adrian Silva Atalanta Systems 5/25/11
+1. Spike Morelli Atalanta Systems 5/25/11
+1. Paul Nicholson 5/27/11
+1. Mandi Walls 5/27/11
+1. Carl Perry DreamHost 5/29/11
+1. Greg Thornton 5/30/11
+1. Joseph Heck 6/1/11
+1. Charles Ray Johnson, Jr. 6/2/11
+1. Joseph Anthony Pasquale Holsten 6/5/11
+1. John Donagher 6/6/11
+1. David Fuhr Flagbit 6/14/11
+1. Jörg Weller Flagbit 6/14/11
+1. Marcel Cary 6/15/11
+1. Yedidya "Jay" Feldblum Applications Online 6/17/11
+1. Michael Contento 6/20/11
+1. Yogesh Pathade 6/22/11
+1. Gavin Sandie 6/25/11
+1. Bryan Horstmann-Allen 6/28/11
+1. Glenn Pratt 7/5/11
+1. Andrew Narkewicz Versapay 7/5/11
+1. Zachary Tomas Stevens 7/11/11
+1. Richard Gould 7/11/11
+1. Philip Cohen 7/15/11
+1. Christopher Michael McClimans 7/18/11
+1. Jason J.W. Williams 7/19/11
+1. Nuo Yan 7/21/11
+1. Jaroslaw Åšmiejczak 7/25/11
+1. Dimitri Aivaliotis Every Ware 7/25/11
+1. Eric Rochester 7/27/11
+1. Alex North-Keys Tippr 7/29/11
+1. Adam Knight Tippr 7/29/11
+1. Eugene Wood Ask.com 8/1/11
+1. Aron Bartling Ask.com 8/1/11
+1. Jack Francis Ask.com 8/1/11
+1. Richard Marshall Ask.com 8/1/11
+1. Mikola Kucharski Ask.com 8/1/11
+1. Rory Mitchell Ask.com 8/3/11
+1. Oskar Stolc Ask.com 8/3/11
+1. Jack (John) Roehrig Ask.com 8/3/11
+1. Paul Stahlke Ask.com 8/3/11
+1. Jorge Mazzei Ask.com 8/3/11
+1. Pakojo Samm Ask.com 8/3/11
+1. David Smith Ask.com 8/3/11
+1. Mike Adolphs 8/5/11
+1. Ernad Husremović bring.out doo Sarajevo 8/11/11
+1. Jasmin Beganović bring.out doo Sarajevo 8/11/11
+1. Saša Vranić bring.out doo Sarajevo 8/11/11
+1. Å ator Emir bring.out doo Sarajevo 8/11/11
+1. Jeremy Bingham Kos Media 8/15/11
+1. Michael Taras Kos Media 8/15/11
+1. Tomoyuki Sakurai reallyenglish.com 8/15/11
+1. Mitsuru Yoshida reallyenglish.com 8/15/11
+1. Avishai Ish-Shalom Fewbytes 8/18/11
+1. Or Cohen Fewbytes 8/18/11
+1. Domenico Delle Side 8/19/11
+1. Paul Morton Business Intelligence Associates 8/19/11
+1. Phil Austin Business Intelligence Associates 8/19/11
+1. Andrian Jardan 8/22/11
+1. Vladimir Girnet Tacit Knowledge 8/22/11
+1. Scott Askew Tacit Knowledge 8/22/11
+1. Emmett Finneran 8/26/11
+1. Arthur Gautier Zenexity 8/30/11
+1. Edward Middleton ClassDo 8/30/11
+1. Michael Pearson 8/31/11
+1. Nikolay Sturm 9/1/11
+1. Nathan Lloyd Smith 9/1/11
+1. Patrick Connolly Myplanet 9/2/11
+1. Yashar Rassoulli Myplanet 9/2/11
+1. James Walker Myplanet 9/2/11
+1. Chris Read 9/6/11
+1. Prashant Srivastava 9/7/11
+1. Brad Knowles ihiji 9/16/11
+1. Stuart Rench ihiji 9/16/11
+1. Michael Maniscalco ihiji 9/16/11
+1. Brian Cunnie 9/19/11
+1. Joseph F. Reynolds 9/20/11
+1. Gabriel McArthur 9/21/11
+1. David Keith Hudgins 9/21/11
+1. Paul MacDougall 9/23/11
+1. Bulat Shakirzyanov 9/23/11
+1. Jorge Eduardo Espada 9/28/11
+1. Eric Dennis 9/28/11
+1. Stuart Glenn 9/29/11
+1. Bryan Wilson Berry 10/4/11
+1. Christopher Sturm 10/5/11
+1. John Sumsion 10/12/11
+1. Steven Phung 10/13/11
+1. Claudio Cesar Sanchez Tejeda 10/14/11
+1. Igor Afonov 10/26/11
+1. Dan Buettner Port 80 Production, LLC 10/28/11
+1. Robby Grossman 10/31/11
+1. Alan Harper 11/1/11
+1. Juanje Ojeda 11/1/11
+1. Stephane Jourdan Green Alto 11/2/11
+1. Gregory Karekinian Green Alto 11/2/11
+1. Samuel Maftoul Green Alto 11/2/11
+1. Darrin Eden Heavy Water Software, Inc. 11/4/11
+1. Sean Escriva Heavy Water Software, Inc. 11/4/11
+1. Jake Davis Heavy Water Software, Inc. 11/4/11
+1. AJ Christensen Heavy Water Software, Inc. 11/4/11
+1. Michael Weinberg Heavy Water Software, Inc. 11/4/11
+1. Aaron Baer Heavy Water Software, Inc. 11/4/11
+1. Matthew Kanwisher 11/8/11
+1. Joshua McKenty 11/9/11
+1. Iulian-Corneliu Costan 11/11/11
+1. Daniel Oliver 11/14/11
+1. Adam Garside 11/15/11
+1. Ian Wolfcat Atha Wealthfront Inc. 11/15/11
+1. John Hitchings Wealthfront Inc. 11/15/11
+1. David Fortunato Wealthfront Inc. 11/15/11
+1. Julien Wetterwald Wealthfront Inc. 11/15/11
+1. Kevin Peterson Wealthfront Inc. 11/15/11
+1. Maksim Horbul 11/16/11
+1. Roberto Gaiser 11/16/11
+1. Robert Di Marco 11/17/11
+1. Victor Lowther Dell 11/17/11
+1. Jerry Chen 11/18/11
+1. Murali Raju 11/18/11
+1. Benjamin Smith 11/18/11
+1. Aaron Suggs Kickstarter, Inc. 11/18/11
+1. Lance Ivy Kickstarter, Inc. 11/18/11
+1. Cedric Howe Kickstarter, Inc. 11/18/11
+1. Tieg Zaharia Kickstarter, Inc. 11/18/11
+1. Teemu Matilainen Reaktor Innovations 11/22/11
+1. Dave Solbes Webtrends Inc 11/22/11
+1. Grant Hutchins 11/25/11
+1. Eric Saxby ModCloth 11/27/11
+1. Gabriel Evans 11/27/11
+1. Tim Smith Webtrends Inc 11/28/11
+1. Nathaniel Eliot Infochimps, Inc 11/28/11
+1. Adam Seever Infochimps, Inc 11/28/11
+1. Travis Dempsey Infochimps, Inc 11/28/11
+1. Dhruv Bansal Infochimps, Inc 11/28/11
+1. Andrew Kaczorek Cycle Computing, LLC 11/29/11
+1. Chris Chalfant Cycle Computing, LLC 11/29/11
+1. Dan Harris Cycle Computing, LLC 11/29/11
+1. Ian Alderman Cycle Computing, LLC 11/29/11
+1. Stephen Balukoff 11/30/11
+1. Kendrick Martin Webtrends Inc 12/1/11
+1. Adnan Wahab 12/3/11
+1. Alex Howells 12/4/11
+1. Cameron Johnston Needle, Inc. 12/5/11
+1. Justin Huff 12/8/11
+1. Ian Downes Ubalo, Inc 12/8/11
+1. Erik Hollensbe 12/9/11
+1. Karel Minarik 12/11/11
+1. Adam Greene SweetSpot Diabetes Care, Inc. 12/12/11
+1. Justin Schumacher SweetSpot Diabetes Care, Inc. 12/12/11
+1. Dan Root SweetSpot Diabetes Care, Inc. 12/12/11
+1. Paul Dowman 12/12/11
+1. Andrew Le 12/12/11
+1. Paul Welch 12/13/11
+1. Harlan Barnes 12/13/11
+1. Philip Kates Rackspace US, Inc 12/13/11
+1. Brandon Philips Rackspace US, Inc 12/13/11
+1. Paul Querna Rackspace US, Inc 12/13/11
+1. Arthur Pirogovski 12/13/11
+1. John Scott Sanders, Jr RideCharge, Inc 12/15/11
+1. Jamie Winsor Riot Games 12/15/11
+1. Josiah Kiehl Riot Games 12/15/11
+1. Jesse Howarth Riot Games 12/15/11
+1. Michael Matsuuara Riot Games 12/15/11
+1. Cliff Dickerson Riot Games 12/15/11
+1. Philip Gollucci RideCharge, Inc 12/15/11
+1. Radim Marek 12/17/11
+1. Hugo Fichter 12/19/11
+1. Chris Christensen 12/20/11
+1. Chet Luther 12/20/11
+1. Mark Luntzel 12/20/11
+1. Kevin Karwaski Fiksu 12/21/11
+1. David Calavera 12/22/11
+1. Michael Stillwell 12/23/11
+1. Aaron Bull Schaefer 12/28/11
+1. Max Rabin 1/3/12
+1. Michael Bradshaw WhitePages Inc. 1/3/12
+1. Michael Cook WhitePages Inc. 1/3/12
+1. Jack Foy WhitePages Inc. 1/3/12
+1. Devin Ben-Hur WhitePages Inc. 1/3/12
+1. Jeff Bellegarde WhitePages Inc. 1/3/12
+1. John Dyer 1/4/12
+1. Sam Marx 1/5/12
+1. Praveen Arimbrathodiyil 1/6/12
+1. Joshua Buysse 1/6/12
+1. Dale Hui 1/6/12
+1. Jesse Campbell 1/8/12
+1. Roberto Carlos Morano 1/9/12
+1. Miah Johnson Scribd, Inc. 1/10/12
+1. Ian Delahorne 1/12/12
+1. Mike Javorski Spoke Software 1/15/12
+1. Michael A. Fiedler 1/16/12
+1. Luis Bosque 1/16/12
+1. Qiming He 1/18/12
+1. Hector Castro 1/19/12
+1. Wade Warren Wikia 1/23/12
+1. Geoff Papilion Wikia 1/23/12
+1. Justin Ryan Wikia 1/23/12
+1. David King Xforty Technologies 1/25/12
+1. Christian Pearce Xforty Technologies 1/25/12
+1. Andrew Libby Xforty Technologies 1/25/12
+1. Joshua Hou 1/27/12
+1. Alice Kaerast 1/28/12
+1. Brett Hoerner 1/28/12
+1. Jon-Erik Schneiderhan 1/30/12
+1. Wes Morgan Democracy Works, Inc 1/30/12
+1. Ernie Brodeur 1/31/12
+1. Stephen Figgins 1/31/12
+1. Tal Rotbart 2/1/12
+1. Benjamin Lindsey 2/1/12
+1. Markus Schirp 2/1/12
+1. Tryn Mirell 2/2/12
+1. Hari Krishna Dara 2/7/12
+1. Andrew Grangaard 2/8/12
+1. Adam Mielke 2/8/12
+1. Andrew Allan 2/9/12
+1. Antonio Soares de Azevedo Terceiro 2/9/12
+1. Istvan Szukacs 2/9/12
+1. Brian Parker Pure Lake Software, Inc. 2/10/12
+1. Sean Porter 2/10/12
+1. William Carroll 2/12/12
+1. Paul Diaconescu Sveriges Television AB 2/14/12
+1. Jonas Eklof Sveriges Television AB 2/14/12
+1. Per Bjorn Sveriges Television AB 2/14/12
+1. Frank Hoffsumer Sveriges Television AB 2/14/12
+1. Samppa Kytomaki Reaktor Innovations 2/14/12
+1. Zuhaib Siddique Atlassian 2/14/12
+1. Andrew Robson Oxygen Cloud, Inc. 2/14/12
+1. Aaron Follette Oxygen Cloud, Inc. 2/14/12
+1. Erik Bakker 2/16/12
+1. David Golden 2/16/12
+1. Jacques Chester Robojar Pty Ltd 2/17/12
+1. Nicholas VINOT 2/18/12
+1. Matthew MacDonald-Wallace 2/19/12
+1. Andrew Gross 2/20/12
+1. Andrew Fecheyr Lippins 2/21/12
+1. Shoaib Kamil 2/21/12
+1. Martin Vidner 2/23/12
+1. Jake Ritorto ModCloth 2/23/12
+1. Seth Kingry ModCloth 2/23/12
+1. Manuel Gutierrez ModCloth 2/23/12
+1. Graham McMillan World Wide Web Hosting, LLC 2/24/12
+1. Nicholas Stielau 2/24/12
+1. McClain Looney 2/24/12
+1. Jim Meyer 2/29/12
+1. Trevor Orsztynowicz Joyent 2/29/12
+1. Kevin Chang Joyent 2/29/12
+1. Geoffery Nix ModCloth 3/1/12
+1. Roberto Sanchez ModCloth 3/1/12
+1. Dan Buch ModCloth 3/1/12
+1. Ziad Sawalha Rackspace 3/2/12
+1. Benedikt Böhm 3/4/12
+1. Steven Ivy Wallrazer, Inc. 3/4/12
+1. Krzysztof Wilczynski 3/5/12
+1. Elson Orlando Rodriguez 3/5/12
+1. Michael Schubert 3/5/12
+1. Douglas Thrift Rightscale 3/5/12
+1. Andrew Benz 3/6/12
+1. Yann Robin Youscribe 3/6/12
+1. Javier Frias 3/6/12
+1. Josh Miller Edmunds.com 3/6/12
+1. Moritz Winter 3/6/12
+1. Aaron Blythe Cerner Innovation, Inc. 3/8/12
+1. Kevin Shekleton Cerner Innovation, Inc. 3/8/12
+1. Josh Murphy Cerner Innovation, Inc. 3/8/12
+1. Bryan Baugher Cerner Innovation, Inc. 3/8/12
+1. Sachin Sagar Ra 3/8/12
+1. Tarik Jabri 3/8/12
+1. Michael W. Myers 3/10/12
+1. Marcus Cobden 3/11/12
+1. Coimbatore Sankarraman Shyam Sundar 3/12/13
+1. Chris Roberts Heavy Water Software, Inc. 3/13/12
+1. Justin Mazzi World Wide Web Hosting, LLC 3/13/12
+1. Joshua Priddle World Wide Web Hosting, LLC 3/13/12
+1. Paul Stengel World Wide Web Hosting, LLC 3/13/12
+1. Vince Stratful World Wide Web Hosting, LLC 3/13/12
+1. Artem Veremey 3/13/12
+1. Jon Cowie 3/15/12
+1. Philip Kromer Infochimps, Inc 3/17/12
+1. Ben Dean 3/18/12
+1. Zachary Cook 3/19/12
+1. Welby McRoberts 3/20/12
+1. Ian Coffey Voxel Dot Net, Inc 3/20/12
+1. David Amian Valle 3/21/12
+1. Lewis J. Goettner, III 3/21/12
+1. Bernardo Gomez Palacio 3/23/12
+1. Chris Gaffney 3/23/12
+1. Igor Kurochkin 3/24/12
+1. Oleksiy Kovyrin 3/24/12
+1. Jordan Dea-Mattson Numenta, Inc. 3/26/12
+1. Cody Ebberson Numenta, Inc. 3/27/12
+1. Martin Hasan Bramwell 3/28/12
+1. Mohammed Siddick 3/28/12
+1. Ira Abramaov Fewbytes 3/29/12
+1. Paul McCallick 3/29/12
+1. Jon-Paul Sullivan Hewlett-Packard 3/30/12
+1. Sascha Bates 3/30/12
+1. Julian Cardona Edmunds.com 4/2/12
+1. David Hudson Edmunds.com 4/2/12
+1. Andrew Crump Kotiri Software Ltd. 4/3/12
+1. Zach Dunn 4/5/12
+1. Logan Lowell The Frontside Software, Inc. 4/5/12
+1. Charles Lowell The Frontside Software, Inc. 4/5/12
+1. Chris Buben 4/5/12
+1. Joseph Brian Passavanti 4/5/12
+1. Denis Barishev 4/6/12
+1. Jonas Courteau 4/6/12
+1. Eric Hankins 4/10/12
+1. Chris Buben Gap, Inc. 4/10/12
+1. Oliver Fross Gap, Inc. 4/10/12
+1. Jeffery Padgett Gap, Inc. 4/10/12
+1. Philip Vieira 4/10/12
+1. Guilhem Lettron Youscribe 4/11/12
+1. Sebastien Balant Youscribe 4/11/12
+1. Robert E. Lewis 4/13/12
+1. David Joos 4/16/12
+1. Umang Chouhan 4/16/12
+1. Sören Blom Deutsche Telekom Laboratories 4/17/12
+1. Alex Redington Relevance, Inc. 4/20/12
+1. Gabriel Horner Relevance, Inc. 4/20/12
+1. Lake Denman Relevance, Inc. 4/20/12
+1. Larry Karnowski Relevance, Inc./Truer Sound LLC 4/20/12
+1. Sam Umbach Relevance, Inc./Truer Sound LLC 4/20/12
+1. Jeremiah Snapp Asbury Theological Seminary 4/20/12
+1. Brian Bianco 4/20/12
+1. Brandon Martin 4/21/12
+1. Alexander Gordeev 4/24/12
+1. Joe Miller 4/25/12
+1. Nick Peirson 4/27/12
+1. Marc Morata Fite 4/27/12
+1. Seth Thomas 4/27/12
+1. Chris Griego 4/28/12
+1. Dmytro Ilchenko 4/30/12
+1. Morgan Nelson 4/30/12
+1. Chirag Jog Websym Technologies Private Ltd. 4/30/12
+1. Kalpak Shah Websym Technologies Private Ltd. 4/30/12
+1. Mohit Sethi Websym Technologies Private Ltd. 4/30/12
+1. Kyle VanderBeek 5/2/12
+1. TANABE Ken-ichi 5/2/12
+1. Brandon Adams DreamBox Learning, Inc. 5/3/12
+1. Hui Hu 5/5/12
+1. Will Maier Simple 5/7/12
+1. Chris Brentano Simple 5/7/12
+1. Cosmin Stejerean Simple 5/7/12
+1. Brian Merritt Simple 5/7/12
+1. Pascal Deschenes 5/8/12
+1. Michael Glenn 5/8/12
+1. Dan Crosta 5/9/12
+1. Daniel Condomitti 5/9/12
+1. Matthew Butcher 5/10/12
+1. Ben Poweski Consumer Club, Inc. 5/10/12
+1. Chris Griego Consumer Club, Inc. 5/10/12
+1. Jim Hughes Consumer Club, Inc. 5/10/12
+1. Morgan Nelson Consumer Club, Inc. 5/10/12
+1. Kristina Rodgers Consumer Club, Inc. 5/10/12
+1. Derek Schultz 5/11/12
+1. Anay Nayak 5/15/12
+1. Patrick Ting 5/17/12
+1. Xabier de Zuazo Oteiza Onddo Labs 5/18/12
+1. Raul Rodriguez Munoz Onddo Labs 5/18/12
+1. Ramez Mourad 5/21/12
+1. Jonathan Manton 5/22/12
+1. Philipp Wollermann CyberAgent Corp. 5/22/12
+1. Koji Hasebe CyberAgent Corp. 5/22/12
+1. Jean-Daniel Bussy CyberAgent Corp. 5/22/12
+1. Yoshihisa Sakamoto CyberAgent Corp. 5/22/12
+1. Kohei Maeda CyberAgent Corp. 5/22/12
+1. Eric Edgar 5/23/12
+1. Rodolphe Blancho 5/23/12
+1. Kevin Nuckolls 5/24/12
+1. Michael Nygard Relevance, Inc. 5/29/12
+1. Martin Fenner 5/30/12
+1. Lukasz Kaniowski 5/31/12
+1. Brian Flad 5/31/12
+1. Justin Witrick Rackspace 6/1/12
+1. Nickalaus Willever 6/1/12
+1. Harold "Waldo" Grunenwald III 6/4/12
+1. Bjorn Albers 6/4/12
+1. Timothy Martin Potter 6/5/12
+1. Greg Fitzgerald 6/6/12
+1. Sebastian Wendel SourceIndex IT-Services 6/7/12
+1. Leif Madsen 6/7/12
+1. Jonathan del Strother 6/7/12
+1. Bernd Roth 6/8/12
+1. Madhurranjan Mohaan 6/11/12
+1. Seth Vargo 6/11/12
+1. Gregory Jones 6/12/12
+1. Joshua Brand 6/15/12
+1. David Stainton Scribd, Inc. 6/15/12
+1. Sriram Devadas 6/17/12
+1. Christopher Webber 6/17/12
+1. Raf Geens Civolution BV 6/18/12
+1. Greg Symons Drillinginfo 6/18/12
+1. Clark Archer Drillinginfo 6/18/12
+1. David Eddy 6/18/12
+1. Jonathan Hartman Rackspace 6/21/12
+1. Boyd Edward Hemphill 6/21/12
+1. Martha Greenberg 6/24/12
+1. Paul Meserve 6/25/12
+1. Michael H. Oshita 6/25/12
+1. James W. Brinkerhoff Voxel Dot Net, Inc 6/26/12
+1. Evan Vetere Voxel Dot Net, Inc 6/26/12
+1. Kris Beevers Voxel Dot Net, Inc 6/26/12
+1. Patrick Dowell Voxel Dot Net, Inc 6/26/12
+1. Zachary Voase 6/26/12
+1. Paul Guth The Cloudscaling Group, Inc. 6/27/12
+1. Rodolphe Pineau The Cloudscaling Group, Inc. 6/27/12
+1. Jeremy Deininger The Cloudscaling Group, Inc. 6/27/12
+1. Blake Barnett The Cloudscaling Group, Inc. 6/27/12
+1. HIGUCHI Daisuke Creationline, Inc. 6/27/12
+1. Jey Hotta Creationline, Inc. 6/27/12
+1. Kent R. Spillner 7/6/12
+1. Brian Dols 7/6/12
+1. Frank Rosquin 7/10/12
+1. Bill Moritz 7/10/12
+1. Alfred Rossi Action Verb, LLC 7/10/12
+1. Patrick Ribeiro Negri lugu Seervicos na Internet LTDA 7/11/12
+1. Marcelo Paez lugu Seervicos na Internet LTDA 7/11/12
+1. Alexandre Paez lugu Seervicos na Internet LTDA 7/11/12
+1. Wong Liang Zan 7/11/12
+1. Matthew Andersen 7/12/12
+1. Jacob Atzen 7/13/12
+1. Chris Parsons 7/13/12
+1. Timothy Jones 7/14/12
+1. Ameya Prakash Gangamwar 7/15/12
+1. Adrien Brault 7/16/12
+1. Michael T. Halligan 7/17/12
+1. Andreas Boehrnsen OpeniT 7/18/12
+1. Jay Levitt 7/20/12
+1. Jose Luis Fernandez Perez 7/21/12
+1. Aaron J. Peterson 7/22/12
+1. Jim Croft Cloudreach Limited 7/24/12
+1. Richard Bowden Cloudreach Limited 7/24/12
+1. Joe Geldart Cloudreach Limited 7/24/12
+1. Bryce Lynn Tacit Knowledge 7/24/12
+1. Brian Smith Bonnier Corporation 7/25/12
+1. Michael Linde Bonnier Corporation 7/25/12
+1. Peter Lauda Bonnier Corporation 7/25/12
+1. Rakesh Patel OneHealth Solutions, Inc. 7/25/12
+1. Jay Perry 7/26/12
+1. Mark Roddy 7/26/12
+1. Andrew Regan 7/26/12
+1. Takeshi Kondo 7/26/12
+1. Paul Rossman 7/26/12
+1. Bryan Stearns Paydici Corp. 7/26/12
+1. Jim Harvey Paydici Corp. 7/26/12
+1. Bill Burcham Paydici Corp. 7/26/12
+1. Steve Rude 7/26/12
+1. Richard Clamp 7/29/12
+1. Christopher Kelly 7/30/12
+1. Deepak Kannan 7/30/12
+1. Roy Liu 7/31/12
+1. Artiom Lunev 7/31/12
+1. Anna Marseille D. Gabutero 7/31/12
+1. Lucas Jandrew Riot Games 8/1/12
+1. Dafydd Crosby 8/1/12
+1. Christoph Thiel Novell, Inc. 8/1/12
+1. Ralf Haferkamp Novell, Inc. 8/1/12
+1. Adam Spiers Novell, Inc. 8/1/12
+1. Tim Serong Novell, Inc. 8/1/12
+1. Sascha Peilicke Novell, Inc. 8/1/12
+1. Bernhard Wiedemann Novell, Inc. 8/1/12
+1. Ionuts Artarisi Novell, Inc. 8/1/12
+1. Vincent Untz Novell, Inc. 8/1/12
+1. Martin Vidner Novell, Inc. 8/1/12
+1. J. Daniel Schmidt Novell, Inc. 8/1/12
+1. Stefan Fent Novell, Inc. 8/1/12
+1. Danny Kukawka Novell, Inc. 8/1/12
+1. Michal Vyskocil Novell, Inc. 8/1/12
+1. Kristian Vlaardingerbroek Schuberg Philis B.V. 8/3/12
+1. Jon Gretarsson RelatelIQ Inc. 8/3/12
+1. Danial Pearce 8/5/12
+1. Stathis Touloumis 8/5/12
+1. Matthew Scott Moyer 8/7/12
+1. Benedict Steele 8/7/12
+1. James Tan Novell, Inc. 8/7/12
+1. John Kip Larsen 8/8/12
+1. Chris Buryta 8/9/12
+1. Sahil Muthoo 8/10/12
+1. Kyle Goodwin PrimeRevenue, Inc 8/10/12
+1. Ben Rosenblum PrimeRevenue, Inc 8/10/12
+1. Aaron Kalin 8/10/12
+1. John Dewey 8/11/12
+1. Abel Lopez 8/13/12
+1. Lyndon Washington 8/14/12
+1. Ripal Nathuji Calxeda 8/14/12
+1. Gardner Bickford 8/15/12
+1. Nick Heppner 8/16/12
+1. Jeffrey Dutton 8/16/12
+1. Taklon Wu 8/17/12
+1. Craig Tracey 8/17/12
+1. Lee Jensen Big Cartel LLC 8/17/12
+1. Chris Cameron Big Cartel LLC 8/17/12
+1. Kelley Reynolds Big Cartel LLC 8/17/12
+1. Michael Wallman 8/17/12
+1. Edward Sargisson 8/19/12
+1. Winfield Peterson 8/20/12
+1. Mathew Davies 8/21/12
+1. Justin Shepherd Rackspace 8/21/12
+1. Jason Cannavale Rackspace 8/21/12
+1. Ron Pedde Rackspace 8/21/12
+1. Joseph Breu Rackspace 8/21/12
+1. William Kelly Rackspace 8/21/12
+1. Darren Birkett Rackspace 8/21/12
+1. Evan Callicoat Rackspace 8/21/12
+1. Andrew Ferk 8/23/12
+1. Shaun Hope 8/23/12
+1. Matt Kynaston 8/24/12
+1. Ben Marini 8/25/12
+1. Garret Heaton Atlassian 8/27/12
+1. Julian Dunn 8/27/12
+1. Jordan Evans 8/28/12
+1. Andrew Laski 8/31/12
+1. Mat Schaffer 8/31/12
+1. Elliot Pahl 9/3/12
+1. Richard Shade Rightscale 9/5/12
+1. Dmytro Kovalov 9/5/12
+1. Shishir Das 9/6/12
+1. Kimball Johnson One Connect Limited 9/7/12
+1. Roy Crombleholme One Connect Limited 9/7/12
+1. Martin Foster One Connect Limited 9/7/12
+1. Alex Klepa 9/7/12
+1. Brendan Hay 9/7/12
+1. Paul Graydon 9/7/12
+1. Steve Layland 9/7/12
+1. Thomas Dudziak 9/7/12
+1. Felix Sheng 9/8/12
+1. Sean Porter Sonian Inc 9/8/12
+1. Josh Pasqualetto Sonian Inc 9/8/12
+1. TJ Vanderpoel Sonian Inc 9/8/12
+1. Justin Kolberg Sonian Inc 9/8/12
+1. Decklin Foster Sonian Inc 9/8/12
+1. Randall Morse 9/10/12
+1. Pete Cheslock Dyn 9/10/12
+1. Max Stepanov 9/11/12
+1. Sean Gallagher 9/11/12
+1. Autif Khan 9/11/12
+1. Jacques Marneweck 9/12/12
+1. William Herry 9/16/12
+1. Pawel Kozlowski 9/16/12
+1. Lawrence Gilbert 9/18/12
+1. Bob Walker 9/18/12
+1. Nathan Schimke 9/18/12
+1. Graham Christensen 9/19/12
+1. Alessandro Dal Grande The App Business 9/19/12
+1. Saager Suhas Mhatre 9/23/12
+1. Charles J Blaine 9/23/12
+1. Andres de Barbara 9/23/12
+1. Adam Vinsh 9/25/12
+1. Elliot Murphy Pat Deegan, PhD & Associates, LLC 9/26/12
+1. John Nishinaga Pat Deegan, PhD & Associates, LLC 9/26/12
+1. Farley Knight Pat Deegan, PhD & Associates, LLC 9/26/12
+1. Jon Sime OmniTI 9/26/12
+1. Clinton Wolfe OmniTI 9/26/12
+1. Theo Schlossnagle OmniTI 9/26/12
+1. Robert Treat OmniTI 9/26/12
+1. Adam DePue 9/26/12
+1. Martin Contento 9/27/12
+1. Milos Gajdos 9/27/12
+1. Brad Gignac Rackspace 9/28/12
+1. Robert Allen 9/30/12
+1. Chia-liang Kao 10/1/12
+1. Ketan Padegaonkar 10/2/12
+1. Antti Puranen Reaktor Innovations 10/5/12
+1. Stephen Crawley 10/7/12
+1. Brad Bennet ZestFinance 10/8/12
+1. Alexander Tamoykin ZestFinance 10/8/12
+1. Lloyd Philbrook Firebelly Design 10/8/12
+1. Nate Beaty Firebelly Design 10/8/12
+1. John Skopis 10/8/12
+1. Susan Potter 10/8/12
+1. Jatinder Giri 10/10/12
+1. Joan Touzet Cloudant, Inc. 10/11/12
+1. Kyle Allan Riot Games 10/11/12
+1. Jay Pipes 10/12/12
+1. John Austin Page 10/15/12
+1. Chuck Ha 10/15/12
+1. David Dvorak Webtrends 10/15/12
+1. Dipen Lad 10/15/12
+1. Pascal Deschenes Nu Echo 10/16/12
+1. Matthieu Vachon Nu Echo 10/16/12
+1. Raymond Menard Nu Echo 10/16/12
+1. Jean-Francois Alix Nu Echo 10/16/12
+1. Mariano Cortesi 10/16/12
+1. Alexander Phan 10/16/12
+1. Jeff Siegel 10/16/12
+1. William Milton 10/17/12
+1. Mark Pimentel 10/18/12
+1. Mike Gifford OpenConcept 10/18/12
+1. Mike Mallett OpenConcept 10/18/12
+1. Brian Loomis 10/20/12
+1. Michael Saffitz Apptentive 10/20/12
+1. Andrew Wooster Apptentive 10/20/12
+1. Sky Kelsey Apptentive 10/20/12
+1. Benjamin Michael Atkin Document Swarm, LLC 10/20/12
+1. Andreas Gerauer 10/22/12
+1. Steven Deaton 10/22/12
+1. Cassiano Bertol Leal 10/23/12
+1. Matt Towers 10/23/12
+1. Mark Ayers 10/23/12
+1. Anthony Leto 10/23/12
+1. Marc Soda 10/24/12
+1. Jerome D Harrington, II 10/24/12
+1. Russell Stewart Egan 10/24/12
+1. Paul Thomas 10/24/12
+1. Chris Lundquist 10/24/12
+1. Anton Orel 10/25/12
+1. Marius Sturm 10/25/12
+1. Dimitri David Boelaert-Roche 10/25/12
+1. Matthew Serafin Horan 10/25/12
+1. Vojtech Hyza 10/25/12
+1. Steve Houser 10/26/12
+1. Dmitry Zamaruev 10/29/12
+1. James Hu 10/29/12
+1. Laust Rud Jacobsen 10/29/12
+1. Zo Obradovic 10/29/12
+1. Dale Kiefling 10/29/12
+1. Todd Fleisher 10/29/12
+1. Karl Freeman 10/30/12
+1. Johannes Becker 10/30/12
+1. Fred Sadaghiani Sift Science, Inc. 10/31/12
+1. Jeff Thompson 10/31/12
+1. Stanislav Bogatyrev 10/31/12
+1. Jonathan Peck FluxSauce 11/1/12
+1. Jeffrey Borg 11/1/12
+1. Guido Serra Rocket Internet GmbH 11/2/12
+1. Sebastian Grewe 11/3/12
+1. Chaoran Xie 11/3/12
+1. Julien Duponchelle 11/4/12
+1. Trae Robrock 11/5/12
+1. Nikita Borzykh 11/6/12
+1. Ilya Sher 11/6/12
+1. Michael Fischer 11/6/12
+1. Nathan Baxter 11/6/12
+1. Simon Belluzzo 11/6/12
+1. Ben Hartshorne 11/9/12
+1. Matt Whiteley Engine Yard 11/9/12
+1. Raul Naveiras 11/13/12
+1. Eugene Wood 11/13/12
+1. Javier Perez-Griffo Tapp 11/13/12
+1. Dang Nguyen 11/13/12
+1. Pablo Banos Tapp 11/13/12
+1. Christian Hofer Tapp 11/13/12
+1. Matthew Rogers 11/13/12
+1. Stephen Lauck 11/13/12
+1. Mark Van de Vyver Taqtiqa LLC 11/14/12
+1. Thomas Carroll 11/14/12
+1. Jon DeCamp Nordstrom, Inc 11/15/12
+1. Doug Ireton Nordstrom, Inc 11/15/12
+1. Kevin Moser Nordstrom, Inc 11/15/12
+1. Justin Schumacher Nordstrom, Inc 11/15/12
+1. Rob Cummings Nordstrom, Inc 11/15/12
+1. Brandon Burton 11/20/12
+1. Christopher Ferry 11/20/12
+1. Michael Hood 11/22/12
+1. Gavin Montague 11/23/12
+1. Michal Lomnicki 11/24/12
+1. Doc Walker 11/24/12
+1. Nicolas Szalay 11/26/12
+1. Terry Carr 11/26/12
+1. Michael Myers Daptiv Solutions LLC 11/26/12
+1. Shawn Neal Daptiv Solutions LLC 11/26/12
+1. Chris Bobo Daptiv Solutions LLC 11/26/12
+1. Ian Gantt Daptiv Solutions LLC 11/26/12
+1. Alan Gray Daptiv Solutions LLC 11/26/12
+1. Kishore Kumar S 11/26/12
+1. Vincent Leraitre 11/27/12
+1. Samuel Gerstein 11/27/12
+1. John T Skarbek 11/27/12
+1. Paul A Jungwirth 11/28/12
+1. Thomas Hodder Lime Pepper Ltd 11/28/12
+1. Warren Vosper Straydog Software, Inc. 11/29/12
+1. Joshua Reedy 11/30/12
+1. Mehmet Ali Akmanalp 11/30/12
+1. Panagiotis Papadomitsos 11/30/12
+1. Allan Espinosa 11/30/12
+1. Brian Pitts 12/1/12
+1. Elliot Kendall 12/3/12
+1. Nathan Mische 12/3/12
+1. Matthew Turney 12/3/12
+1. Jay Flowers 12/4/12
+1. Loic Antoine-Gombeaud 12/5/12
+1. Joe Rodriguez 12/5/12
+1. Kyle Scarmardo Fidelity Technology Group, LLC 12/6/12
+1. Jon Lenzer Fidelity Technology Group, LLC 12/6/12
+1. Chaoran Xie Fidelity Technology Group, LLC 12/6/12
+1. Shalon Wood Fidelity Technology Group, LLC 12/6/12
+1. David Crane 12/6/12
+1. Takumi IINO 12/9/12
+1. Tolleiv Nietsch 12/9/12
+1. Benoit Caron 12/9/12
+1. Mathieu Martin 12/10/12
+1. Yung Giang 12/11/12
+1. Fabian Ruff 12/11/12
+1. Takeshi KOMIYA 12/11/12
+1. Rafael Fonseca 12/12/12
+1. Justin Campbell 12/12/12
+1. Andrey Subbota 12/13/12
+1. Jacob Ritorto 12/13/12
+1. Pierre Ozoux 12/14/12
+1. Shoaib Mushtaq 12/16/12
+1. Arnold Krille bcs kommunikationslosungen 12/17/12
+1. Rainer Dietz bcs kommunikationslosungen 12/17/12
+1. Paul Diaconescu 12/17/12
+1. Jake Davis Simple 12/17/12
+1. Mike Ehlert Simple 12/17/12
+1. Kevin Bringard 12/19/12
+1. David Whittington 12/20/12
+1. Raphael Valyi 12/20/12
+1. Michael Klapper 12/23/12
+1. Eli Klein 12/24/12
+1. Andrew Lawrence Burns 12/26/12
+1. Kevin Keane North County Tech Center, LLC 12/26/12
+1. David Petzel 12/28/12
+1. Thomas Robison 12/28/12
+1. Keenan Brock 12/28/12
+1. Stefan Borsje 12/29/12
+1. Jon Galentine 12/29/12
+1. Kiesia Croucher 12/31/12
+1. Deeba Siddiqi 1/2/13
+1. Steven De Coeyer 1/2/13
+1. Yoni Yalovitsky Fewbytes 1/2/13
+1. Alex Kiernan 1/3/13
+1. Gilles Cornu 1/4/13
+1. Gavin Mogan 1/4/13
+1. Steven Lehrburger 1/4/13
+1. Jordi Llonch 1/6/13
+1. Nicolas Rycar 1/7/13
+1. Andrew McCloud 1/7/13
+1. Gregoire Seux Criteo 1/8/13
+1. Brian Scott Emergent One 1/9/13
+1. Mike Taczak Emergent One 1/9/13
+1. Javier Segura Martinez 1/9/13
+1. Warren Bain Ninefold Pty Limited 1/9/13
+1. Shaun Domingo Ninefold Pty Limited 1/9/13
+1. Toby Hede Ninefold Pty Limited 1/9/13
+1. Paul Handly DecisionDesk 1/13/13
+1. Eric Neuman DecisionDesk 1/13/13
+1. Will Olbrys DecisionDesk 1/13/13
+1. Thomas Bouve 1/14/13
+1. Kevin Reedy Belly Inc 1/15/13
+1. Craig Ulliott Belly Inc 1/15/13
+1. Jay OConnor Belly Inc 1/15/13
+1. Courtenay Gasking 1/16/13
+1. James Dabbs 1/16/13
+1. Jerry Cattell 1/16/13
+1. Jon Webb 1/17/13
+1. Hendrik Volkmer cloudbau Gmbh 1/18/13
+1. Thomas Kadauke cloudbau Gmbh 1/18/13
+1. Martin Bosner cloudbau Gmbh 1/18/13
+1. Christopher Laco 1/18/13
+1. Haggai Philip Zagury 1/19/13
+1. Eric Sigler 1/20/13
+1. Yves Vogl 1/21/13
+1. Yukihiko Sawanobori HiganWorks LLC 1/21/13
+1. Seth Larson 1/21/13
+1. Ben Langeld 1/21/13
+1. Dan Midwood 1/22/13
+1. Peter Pouliot 1/22/13
+1. Alexander Bondarev 1/23/13
+1. Ben Dean Ontario Systems 1/23/13
+1. Keith Shook Ontario Systems 1/23/13
+1. Lucas Heinlen Ontario Systems 1/23/13
+1. Kyle Michel Ontario Systems 1/23/13
+1. Brice Oliver Ontario Systems 1/23/13
+1. David Rogers Lytro, Inc. 1/23/13
+1. Alvin Lai Lytro, Inc. 1/23/13
+1. Anuj Biyani Lytro, Inc. 1/23/13
+1. Tiffany Russo Lytro, Inc. 1/23/13
+1. Craig Brunner Lytro, Inc. 1/23/13
+1. Mugur Marculescu Lytro, Inc. 1/23/13
+1. Tom Hanley Lytro, Inc. 1/23/13
+1. Thomas Massmann 1/25/13
+1. Ankit Shah 1/25/13
+1. Josh Mahowald 1/25/13
+1. Christopher Bandy 1/25/13
+1. Mal Graty 1/27/13
+1. Vaidas Jablonskis 1/27/13
+1. Simon McCartney 1/28/13
+1. Jake Davis 1/29/13
+1. Sean Kilgore 1/29/13
+1. Scott Lampert 1/29/13
+1. Michael Frick 1/29/13
+1. Kevin Duane 1/30/13
+1. Ryan Geyer 1/30/13
+1. George Hafiz 1/30/13
+1. Eric Pardee Atlas Digital, LLC 1/30/13
+1. Jaroslaw Zmudzinski Grupa Allegro Sp. z o.o. 1/31/13
+1. Alexey Polovinkin 2/1/13
+1. Malte Swart 2/2/13
+1. Jon Burgess 2/3/13
+1. Daniel Hahn 2/4/13
+1. Maxime Brugidou Criteo 2/4/13
+1. Gareth David Rushgrove 2/4/13
+1. Michael Conigliaro 2/4/13
+1. James Kessler 2/4/13
+1. Lukasz Jagiello 2/4/13
+1. Mischa Taylor 2/4/13
+1. Mervyn Hammer Workday Inc. 2/5/13
+1. David Radcliffe 2/5/13
+1. Alexander Titov 2/5/13
+1. Buntaro OKADA 2/5/13
+1. Alexey Kalinin 2/5/13
+1. Adam Cownoble 2/6/13
+1. Josh Behrends Webtrends 2/6/13
+1. Mark Shlimovich 2/6/13
+1. Jahn Bertsch 2/7/13
+1. Sergio Rodriguez 2/7/13
+1. Timur Batyrshin 2/8/13
+1. Samuel Cooper 2/8/13
+1. Ignacy Kasperowicz 2/8/13
+1. Ranjib Dey 2/8/13
+1. Kirill Kouznetsov 2/8/13
+1. Jordan Hagan 2/8/13
+1. Alexander Coles 2/9/13
+1. Michael Grosser 2/10/13
+1. Michael Goetz 2/11/13
+1. Patrick Humpal 2/11/13
+1. Nate Smith 2/13/13
+1. Martin Eigenbrodt 2/13/13
+1. Russell Cloran 2/13/13
+1. John Gabriel McArthur 2/13/13
+1. Jessica Bourne 2/13/13
+1. Darren Haken 2/14/13
+1. Rick Polk 2/14/13
+1. Eric Berg 2/14/13
+1. Andrew Williams Intoximeters 2/15/13
+1. Matthew Follett Intoximeters 2/15/13
+1. Brendan O'Donnell 2/16/13
+1. Igor Serebryany Airbnb 2/17/13
+1. Lukas Reinfurt 2/17/13
+1. Adam Gross 2/17/13
+1. Giorgio Valoti 2/19/13
+1. Nathan Beyer Cerner Corporation 2/19/13
+1. Patrik Stenmark Valtech AB 2/20/13
+1. Evgeny Zislis 2/20/13
+1. Luyi Wang 2/20/13
+1. Jason Schadel AWeber Communications 2/20/13
+1. David Kinzer 2/22/13
+1. Achim Rosenhagen 2/23/13
+1. Doug Cole 2/23/13
+1. Matthew Wright 2/25/13
+1. Jasper Lievisse Adriaanse 2/25/13
+1. Julien Vehent AWeber Communications 2/25/13
+1. Ryan Steele AWeber Communications 2/25/13
+1. Brian K. Jones AWeber Communications 2/25/13
+1. Benjamin Krein AWeber Communications 2/25/13
+1. Cliff Erson 2/26/13
+1. Booker Bense 2/27/13
+1. Charity Majors 2/27/13
+1. Jared Russell 2/27/13
+1. Iiro Uusitalo 2/27/13
+1. Ryan Walker Rackspace 2/28/13
+1. Todd Bushnell 2/28/13
+1. BK Box 2/28/13
+1. Scott Stout 3/1/13
+1. Steffen Gebert 3/3/13
+1. John Cheng 3/3/13
+1. Jeremy Olliver 3/3/13
+1. Alexander Papaspyrou adesso mobile solutions GmbH 3/4/13
+1. Stoyan Stoyanov adesso mobile solutions GmbH 3/4/13
+1. Andreas Thielen adesso mobile solutions GmbH 3/4/13
+1. Yves Vogl adesso mobile solutions GmbH 3/4/13
+1. Brett Richardson 3/5/13
+1. Kevin Nuckolls Banno, LLC 3/5/13
+1. Nic Grayson Banno, LLC 3/5/13
+1. Luke Amdor Banno, LLC 3/5/13
+1. Danny Lockard Banno, LLC 3/5/13
+1. Thomas Wallace 3/5/13
+1. Ptah Dunbar 3/6/13
+1. Jonathan Asghar 3/6/13
+1. Brandon Sanders AboutUs 3/7/13
+1. Aaron Brown 3/7/13
+1. Paul Oliver 3/7/13
+1. Alan Willis Riot Games 3/7/13
+1. Dimitrios Verraros 3/8/13
+1. Arangamanikkannan Manickam 3/8/13
+1. David Bresnick 3/8/13
+1. Brett Weaver 3/8/13
+1. Drew Flower 3/8/13
+1. Charles Gregory Willis 3/8/13
+1. Owain Perry 3/9/13
+1. Alexander Sakharchuk 3/9/13
+1. Ameir Abdeldayem 3/9/13
+1. Robert Choi 3/10/13
+1. Gemini Agalo-os 3/10/13
+1. Alexander Galato 3/11/13
+1. Gabriel Klein 3/11/13
+1. Eric Richardson 3/12/13
+1. Steven Barre 3/13/13
+1. Paul Rossman Google, Inc 3/14/13
+1. Riccardo Carlesso Google, Inc 3/14/13
+1. Benson Kalahar Google, Inc 3/14/13
+1. Rick Wright Google, Inc 3/14/13
+1. Eric Johnson Google, Inc 3/14/13
+1. Aaron Rice 3/15/13
+1. Radoslaw Gruchalski 3/15/13
+1. Matt Gleeson Atlassian 3/18/13
+1. Will DeHaan Atlassian 3/18/13
+1. Gabor Nagy 3/18/13
+1. Bryan Stearns 3/18/13
+1. Jose Diaz-Gonzalez 3/19/13
+1. Jean-Francois Theroux 3/19/13
+1. Christopher Stolfi 3/19/13
+1. Darrell Nash 3/19/13
+1. Sean Kane 3/20/13
+1. Patrick Leckey 3/20/13
+1. Michael Rose 3/20/13
+1. Pitr Vernigorov 3/20/13
+1. Capen Brinkley 3/20/13
+1. Tima Maslyuchenko 3/21/13
+1. Yvo van Doorn 3/21/13
+1. Tobias Wilken cloudControl GmbH 3/21/13
+1. Mateusz Korszun cloudControl GmbH 3/21/13
+1. Eric Chaves 3/21/13
+1. Peter Donald 3/21/13
+1. Remon Oldenbeuving 3/22/13
+1. Philip Cristiano 3/22/13
+1. Chris Streeter 3/24/13
+1. Kenneth Vetergaard 3/25/13
+1. Gert Kremer 3/25/13
+1. Peter de Rujiter Springest 3/25/13
+1. Maarten Hoogendoorn Springest 3/25/13
+1. Daniel Ryan 3/25/13
+1. Matthieu Launay Criteo 3/26/13
+1. Jean-Baptiste Note Criteo 3/26/13
+1. Daniel Koepke 3/26/13
+1. Neil Schelly Dyn, Inc. 3/26/13
+1. David Miller Dyn, Inc. 3/26/13
+1. Bill Young Dyn, Inc. 3/26/13
+1. Phillip Goldenburg 3/27/13
+1. Faiz Kazi 3/31/13
+1. James Tucker Google, Inc 4/1/13
+1. Marco Delaurenti Google, Inc 4/1/13
+1. Sebastien Roccaserra 4/4/13
+1. Chendil Kumar Manoharan 4/4/13
+1. Jeremy Mauro Criteo 4/5/13
+1. Joshua Levine 4/5/13
+1. Harley Alaniz Lookout, Inc. 4/6/13
+1. Hiroaki Nakamura 4/8/13
+1. Leif Madsen Thinking Phone Networks, Inc. 4/8/13
+1. Chris Sibbitt Thinking Phone Networks, Inc. 4/8/13
+1. Christian Brideau Thinking Phone Networks, Inc. 4/8/13
+1. Travis Hein Thinking Phone Networks, Inc. 4/8/13
+1. Ming Chan 4/8/13
+1. Jamie Alessio 4/9/13
+1. Daichi Kamemoto 4/10/13
+1. David Groulx 4/10/13
+1. TAKEUCHI Go 4/11/13
+1. Alex Dergachev Evolving Web Inc 4/11/13
+1. Suzanne Kennedy Evolving Web Inc 4/11/13
+1. Sander Botman 4/15/13
+1. Julio Arias 4/15/13
+1. Alexander Wenzowski 4/16/13
+1. Pete Bristow 4/16/13
+1. Thorsten Klein 4/16/13
+1. Qingkun Liu 4/17/13
+1. Jonathan Cobb Tout Industries 4/18/13
+1. Matt Lanier Tout Industries 4/18/13
+1. Felix Roeser Tout Industries 4/18/13
+1. Tom Hallett Tout Industries 4/18/13
+1. Sam Gipe Tout Industries 4/18/13
+1. Brandon Turner 4/20/13
+1. Mathias Lafeldt 4/20/13
+1. Matt Bower 4/21/13
+1. Zachary Patten Lookout, Inc. 4/22/13
+1. Jim Hopp Lookout, Inc. 4/22/13
+1. Zsolt Dollenstein 4/23/13
+1. Andrew Hollingsworth 4/24/13
+1. Benjamin Krueger 4/24/13
+1. Matt Thompson Rackspace 4/25/13
+1. Hugh Saunders Rackspace 4/25/13
+1. Harry Harrington Rackspace 4/25/13
+1. Andy McCrae Rackspace 4/25/13
+1. Chris Laco Rackspace 4/25/13
+1. Bett Campbell Rackspace 4/25/13
+1. Zack Feldstein Rackspace 4/25/13
+1. Drew Rothstein 4/26/13
+1. Gaetano Santonastaso 4/26/13
+1. Tom Molin 4/26/13
+1. James Thompson 4/26/13
+1. Adam Stegman 4/26/13
+1. Robert Rehberg 4/26/13
+1. Amy Marco 4/27/13
+1. Chris Fordham 4/28/13
+1. Paolo Negri 4/29/13
+1. Jeremy Katz 4/29/13
+1. Troy Ready 4/30/13
+1. Jameson Lee 4/30/13
+1. Mehdi Lahmam 5/1/13
+1. Chandrashekar Seenappa 5/1/13
+1. Sander van Harmelen Schuberg Philis 5/1/13
+1. Matthew Hooker Simple 5/1/13
+1. Robert Roose 5/1/13
+1. Peter Jihoon Kim Irrational Industries 5/1/13
+1. Daniel Dao Quang Ming Irrational Industries 5/1/13
+1. Arun K Thampi Irrational Industries 5/1/13
+1. Paul Paradise Socrata, Inc 5/1/13
+1. Chris Armstrong Socrata, Inc 5/1/13
+1. David Chadwick Gibbons 5/1/13
+1. Chulki Lee Aspera, Inc 5/1/13
+1. Christopher Markle Aspera, Inc 5/1/13
+1. Jason Rutherford 5/1/13
+1. Peter Norton 5/2/13
+1. Walter Dal Mut 5/2/13
+1. Eric Sorenson 5/2/13
+1. Derrick Bryant 5/3/13
+1. Avrohom Katz 5/3/13
+1. Robert Postill 5/3/13
+1. Gabe Mulley Hadapt, Inc 5/3/13
+1. Daniel Schauenberg 5/4/13
+1. James Turnbull 5/6/13
+1. Seren Thompson 5/7/13
+1. Solvi Pall Asgeirsson 5/7/13
+1. Dale Ragan Moncai 5/7/13
+1. Eric Blevins Moncai 5/7/13
+1. Kevin Landreth 5/8/13
+1. Ka-Wing Tam 5/10/13
+1. John Bellone Jr. 5/10/13
+1. Paolo Agostinetto 5/11/13
+1. Robert Coleman 5/11/13
+1. Ahmad Jemai 5/13/13
+1. Manuel Ryan 5/13/13
+1. Ben Somers 5/13/13
+1. Nate Fox 5/13/13
+1. Simon Coffey 5/14/13
+1. Andrea Bernardo Ciddio 5/14/13
+1. Maxim Doucet 5/14/13
+1. Martin Klein 5/14/13
+1. Jeremiah Wuenschel Yahoo Inc. 5/14/13
+1. Deven Panchal Yahoo Inc. 5/14/13
+1. Jeff Parrish Yahoo Inc. 5/14/13
+1. Venkat Venkataraju Yahoo Inc. 5/14/13
+1. Chris Wing Yahoo Inc. 5/14/13
+1. Ittai Shadmon Yahoo Inc. 5/14/13
+1. Itsik Figenblat Yahoo Inc. 5/14/13
+1. Matthew Mencel 5/14/13
+1. Olaf Heydorn 5/16/13
+1. Bryan Stenson 5/16/13
+1. Holger Protzek 5/16/13
+1. Nilesh Bairagi 5/16/13
+1. Matt Clark 5/16/13
+1. Jan Nikolai Trzeszkowski 5/17/13
+1. Bernhard K. Weisshuhn 5/17/13
+1. Chris Reid 5/17/13
+1. Morgan Blackthorne 5/20/13
+1. Ken Miles 5/20/13
+1. James "Jim" Rosser, IV Texas A&M University College of Architecture 5/20/13
+1. Derek Groh Texas A&M University College of Architecture 5/20/13
+1. Benjamin Liles Texas A&M University College of Architecture 5/20/13
+1. Kyle Morgan Rackspace 5/20/13
+1. Wilfred Hughes 5/21/13
+1. Jeff Anderson 5/21/13
+1. Brian Hatfield 5/21/13
+1. Guillermo Carrasco Hernandez 5/21/13
+1. James Sulinksi MoPub 5/21/13
+1. Haydn Dufrene MoPub 5/21/13
+1. Rob McQueen MoPub 5/21/13
+1. Chris Snook MoPub 5/21/13
+1. Christophe Arguel 5/22/13
+1. Sean Nolen 5/22/13
+1. Chetan Sarva 5/24/13
+1. Justin Ryan Onelogin, Inc 5/24/13
+1. Stephen Touset Onelogin, Inc 5/24/13
+1. Marcelo Serpa Onelogin, Inc 5/24/13
+1. Nelson Enzo Onelogin, Inc 5/24/13
+1. Elan Ruusamäe 5/24/13
+1. Marco Betti 5/26/13
+1. Jonathan Hitchcock Yola 5/27/13
+1. Stefano Rivera Yola 5/27/13
+1. Adrian Moisey Yola 5/28/13
+1. Doug Beck Yola 5/28/13
+1. John Tran 5/28/13
+1. Jesse Ahrens CopperEgg 5/28/13
+1. Ross Dickey CopperEgg 5/28/13
+1. Scott Johnson CopperEgg 5/28/13
+1. Eric Anderson CopperEgg 5/28/13
+1. Benjamin Bytheway 5/28/13
+1. Tehmasp Chaudhri 5/28/13
+1. Russell Teabeault 5/28/13
+1. Tim Ray 5/29/13
+1. Gavin Roy MeetMe, Inc 5/30/13
+1. Peter Eisentraut MeetMe, Inc 5/30/13
+1. Jennifer Fountain MeetMe, Inc 5/30/13
+1. Kenny Furguson MeetMe, Inc 5/30/13
+1. Michael Glaesemann MeetMe, Inc 5/30/13
+1. Edward Robinson 6/1/13
+1. Baldur Gudbjornsson 6/1/13
+1. Jeffrey Jones 6/1/13
+1. Louis-Philippe Perron 6/5/13
+1. Victor Sollerhed 6/5/13
+1. Alvin Yik-ning Liang 6/5/13
+1. Cassiano Morgado de Aquino 6/5/13
+1. Brett Graves 6/6/13
+1. Mattew Collinge 6/6/13
+1. Nick Silkey Rackspace 6/6/13
+1. Chris Stephan 6/6/13
+1. Peter Fern 6/6/13
+1. Kevin Bridges 6/6/13
+1. Peter Halliday 6/7/13
+1. Felix Bunemann 6/9/13
+1. Nanuk Krinner 6/10/13
+1. Robert Dyer 6/10/13
+1. Anthony Scalisi 6/11/13
+1. Ryan Hass 6/11/13
+1. Brad Beam 6/12/13
+1. Ean Rollings 6/13/13
+1. Ken Robertson 6/13/13
+1. Tony Chong 6/13/13
+1. Oliver Nicolaas Ponder 6/14/13
+1. Mikhail Kolesnik 6/16/13
+1. Sergey Khaladzinksi 6/16/13
+1. Tucker DeWitt 6/16/13
+1. Thomas Meeus 6/17/13
+1. Lin Lin 6/17/13
+1. Omar Vargas 6/17/13
+1. Domonkos Tomcsanyi Boadree Innovations Kft. 6/17/13
+1. Prashant Nadarajan 6/18/13
+1. Eohyung Lee 6/18/13
+1. David Albrecht 6/18/13
+1. Nicholas Downs 6/19/13
+1. Mike Devine 6/19/13
+1. Thomas Cate Rackspace 6/18/13
+1. Ryan Richard Rackspace 6/18/13
+1. Matthew Thode Rackspace 6/18/13
+1. Chris Aumann 6/20/13
+1. Eric Wunderlin 6/21/13
+1. Georgi Markov 6/21/13
+1. Sjoerd Mulder 6/21/13
+1. Benjamin Knauss 6/21/13
+1. Erik Gustavson Bitium, Inc 6/21/13
+1. Prashant Nadarajan Bitium, Inc 6/21/13
+1. Walter Schiessberg 6/24/13
+1. Vasily Mikhaylichenko 6/24/13
+1. William Anthony Rhodes Jr 6/24/13
+1. Adam Wayne 6/24/13
+1. Max Manders Cloudreach 6/24/13
+1. Justin Stallard 6/25/13
+1. Nelson Chen 6/26/13
+1. Eric Sproul OmniTI 6/19/13
+1. Andrew Macgregor 6/27/13
+1. Jeffrey Damick 6/26/13
+1. Daniel Williams 6/27/13
+1. Bruce Li 6/27/13
+1. Satoshi Akama 6/28/13
+1. Dave Stern 6/28/13
+1. David Andrew 6/28/13
+1. Anthony Burns 6/29/13
+1. Michael Ballantyne 6/28/13
+1. Ewan McDougall 7/1/13
+1. Matt Patterson 7/1/13
+1. Ivan Puzyrevskiy 7/2/13
+1. Stefano Tortarolo 7/3/13
+1. Christopher MacNaughton 7/3/13
+1. Skye Book 7/3/13
+1. Mark Butcher 7/4/13
+1. Nick Morgan Heart of Sales LLC DBA Ace of Sales 7/4/13
+1. Ryan Schlesinger Heart of Sales LLC DBA Ace of Sales 7/4/13
+1. Kevin Patrick Pullin II 7/5/13
+1. Colin Woodcock NetSrv Consulting Ltd 7/7/13
+1. Joshua Tobin 7/8/13
+1. James Cuzella 7/8/13
+1. Michael John Huot Jr. 7/9/13
+1. William Albenzi 7/9/13
+1. Matas Veitas 7/10/13
+1. NagaLakshmi N 7/10/13
+1. Evan Michael Kinney 7/11/13
+1. Adam Lane 7/11/13
+1. Rafael Colton 7/11/13
+1. Julien Phalip 7/11/13
+1. Matthew Savage 7/11/13
+1. Koseki Kengo 7/11/13
+1. Gregory Palmier 7/12/13
+1. Alain O'Dea 7/12/13
+1. Peter Hoellig PROS, Inc. a Delaware Corporation 7/12/13
+1. Vladimir Skubriev 7/12/13
+1. Ryan Stephens AURIN Project -Faculty of Architecture, Building and Planning 7/12/13
+1. Martin Tomko AURIN Project -Faculty of Architecture, Building and Planning 7/12/13
+1. Christopher Bayliss AURIN Project -Faculty of Architecture, Building and Planning 7/12/13
+1. Peter Ellingsen AURIN Project -Faculty of Architecture, Building and Planning 7/12/13
+1. Chris Pettit AURIN Project -Faculty of Architecture, Building and Planning 7/12/13
+1. Jörg Thalheim 7/12/13
+1. Zac Hallett 7/12/13
+1. Emanuele Zattin 7/11/13
+1. Daniel Steen 7/12/13
+1. Ronnie Taylor 7/13/13
+1. Danny Guinther 7/14/13
+1. Michael Vitale 7/16/13
+1. Nicholas Ethier 7/16/13
+1. Steve Poe Onlife Health Inc 7/17/13
+1. Craig Menning 7/17/13
+1. Antoni Baranski Roblox Inc. 7/17/13
+1. John Landahl 7/18/13
+1. Rudy Grigar 7/19/13
+1. Katsuma Ito 7/19/13
+1. Andrew Wyatt Onlife Health Inc 7/19/13
+1. Naoki AINOYA 7/21/13
+1. David Giesberg 7/21/13
+1. Luke Hoschke 7/21/13
+1. Myles Steinhauser 7/22/13
+1. Kyle Rames Rackspace 7/23/13
+1. Chris Snell Rackspace 7/23/13
+1. Jason Roelofs 7/23/13
+1. Hugo Trippaers 7/24/13
+1. Mark Friedgan 7/24/13
+1. Matthew Hopkins 7/24/13
+1. Eddie Zaneski 7/24/13
+1. Maxwell Robett Dietz 7/24/13
+1. Simon Robson 7/25/13
+1. Dan Bachelder 7/26/13
+1. Matthew Farmer 7/26/13
+1. Thomas Neal Cravey 7/26/13
+1. Ross Timson 7/29/13
+1. Donald Stufft 7/28/13
+1. Gilles Cornu 7/28/13
+1. Kenichi Saita 7/28/13
+1. Ivan Tanev 7/27/13
+1. Chris Gallimore 7/26/13
+1. Sonny Garcia 7/26/13
+1. Alexis Midon 7/26/13
+1. Brandon Henry 7/29/13
+1. Jordan Wesolowski 7/29/13
+1. Christopher Brinley 7/29/13
+1. Nimesh Subramanian Cerner 7/29/13
+1. Eric Hartmann 7/29/13
+1. Kevin Rochford 7/30/13
+1. Jon San Miguel 7/30/13
+1. Tommy Fotak 7/31/13
+1. Nicholas Hatch 8/1/13
+1. Raf Geens 8/6/13
+1. Thomas Bell 8/6/13
+1. Braden Wright 8/6/13
+1. Johnny Tan 8/6/13
+1. Yvonne Beumer Cloudreach 8/12/13
+1. Ben House 8/9/13
+1. Joe Fitzgerald 8/12/13
+1. Peter Hessler 8/13/13
+1. Nicholas Russell 8/13/13
+1. Brian Golf 8/13/13
+1. Adam Kunk 8/13/13
+1. Sandy Vanderbleek 8/13/13
+1. Lance French 8/13/13
+1. Jeff Hagadom 8/14/13
+1. George Miranda 8/16/13
+1. Evan Gilman 8/19/13
+1. Nenad Petronijevic 8/19/13
+1. Daniel Spilker CoreMedia AG 7/31/13
+1. Felix Simmendinger CoreMedia AG 7/31/13
+1. Eike Thienemann-Dehde CoreMedia AG 7/31/13
+1. Christopher Hass CoreMedia AG 7/31/13
+1. Daniel Zabel CoreMedia AG 7/31/13
+1. Ryan Munson Taos Mountain, Inc. 7/31/13
+1. Tim Fischbach 8/20/13
+1. Chance Zibolski 8/20/13
+1. Kazuki Akamine 8/20/13
+1. David Wittman 8/20/13
+1. Brian Whipple PROS, Inc. a Delaware Corporation 8/14/13
+1. Michael Jensen PROS, Inc. a Delaware Corporation 8/14/13
+1. Asanka Samaraweera PROS, Inc. a Delaware Corporation 8/14/13
+1. Christian Vozar Belly Inc 8/20/13
+1. Darby Frey Belly Inc 8/20/13
+1. Matthew Herscovitch Identive Group 8/20/13
+1. Mark Butcher Identive Group 8/20/13
+1. Luke Bradbury University of Derby 8/28/13
+1. Dan Webb University of Derby 8/28/13
+1. Alastair Firth 8/23/13
+1. Jesse Adams 8/28/13
+1. Matt Alexander 8/28/13
+1. Jason Vanderhoof 8/26/13
+1. Lianping Chen 8/26/13
+1. Christoph Bunte 8/26/13
+1. Yvonne Lam 8/28/13
+1. Mark Cornick TeamSnap 8/29/13
+1. Justin Clarke Social Ally Pty Ltd 8/29/13
+1. H Wade Minter TeamSnap 8/29/13
+1. Kyle Ries TeamSnap 8/29/13
+1. Phillip Hutchins 8/30/13
+1. Artem Kornienko 8/30/13
+1. Ulf Mansson Recorded Future 9/2/13
+1. Sam Crang 8/31/13
+1. Jorge Acosta Goszczynski 9/3/13
+1. Lysenko Kostiantyn 9/4/13
+1. Phil Sturgeon 9/4/13
+1. Kamil Bednarz 9/4/13
+1. Travis Petticrew 9/4/13
+1. Peter Walz 8/29/13
+1. Jeffrey Utter 9/4/13
+1. Martin Cozzi 9/4/13
+1. Andrew Thompson 9/4/13
+1. Thomas von Schwerdtner 9/4/13
+1. William Dierkes 9/4/13
+1. Robin Ricard 9/5/13
+1. Ben Longden 9/5/13
+1. Alex Denvir Protec Innovations Ltd. 9/5/13
+1. Martin Meredith Protec Innovations Ltd. 9/5/13
+1. Phil Thompson Protec Innovations Ltd. 9/5/13
+1. Alejandro Blanco 9/5/13
+1. Adrian Moisey 9/5/13
+1. Alex Zorin 9/5/13
+1. Robert Schulze 9/5/13
+1. Wei Liang 9/5/13
+1. Jon Torresdal 9/5/13
+1. Sergii Golovatiuk 9/6/13
+1. Mark O'Keefe 9/6/13
+1. Brint O'Heam 9/6/13
+1. Jim Myhrberg 9/7/13
+1. James FitzGibbon 9/8/13
+1. Isbaran Akcayir 9/9/13
+1. Sylvain Tisso Ecodev Sarl 9/9/13
+1. Fabien Udriot Ecodev Sarl 9/9/13
+1. Adrien Crivelli Ecodev Sarl 9/9/13
+1. Yoshanda Shin 9/10/13
+1. Christo De Lange 9/10/13
+1. Arthur Freyman 9/10/13
+1. Martin Walton 9/10/13
+1. Matthew Brennan 9/10/13
+1. Luis Ricardo Malheiros 9/11/13
+1. Amir Kadivar 9/11/13
+1. Davanum Srinivas 9/12/13
+1. Jesse Pretorius 9/12/13
+1. Denis Corol 9/12/13
+1. Yevgen Kovalienia 9/12/13
+1. Ben Hines 9/13/13
+1. Muneyuki Noguchi 9/14/13
+1. Myers Carpenter 9/16/13
+1. Mathieu Allaire 9/16/13
+1. Michael Stucki 9/17/13
+1. Kevin Webster 9/17/13
+1. Conor McDermottroe 9/17/13
+1. Naoya Nakazawa 9/17/13
+1. Mark Gibbons Nordstrom 9/17/13
+1. Matthew Moore 9/17/13
+1. Ingo Kampe kreuzwerker GmbH 9/18/13
+1. Robert Conrad kreuzwerker GmbH 9/18/13
+1. Daniel Meisen kreuzwerker GmbH 9/18/13
+1. Alexander Dall kreuzwerker GmbH 9/18/13
+1. Jan Nabbefeld kreuzwerker GmbH 9/18/13
+1. Joern Barthel kreuzwerker GmbH 9/18/13
+1. Harvey Bandana Nordstrom 9/18/13
+1. Ben Holley 9/18/13
+1. Yuji Takaesu 9/18/13
+1. Colin Burn-Murdoch 9/20/13
+1. Andrius Marcinkevicius 9/20/13
+1. Alan Bryan Central Desktop 9/18/13
+1. Craig Lewis Central Desktop 9/18/13
+1. Saku Laitinen Siili Solutions 9/19/13
+1. Denis Barishev Twiket LTD 9/23/13
+1. Sam Orlov Twiket LTD 9/23/13
+1. Jarek Gawor IBM 9/23/13
+1. Anthony Elder IBM 9/23/13
+1. Michael C Thompson IBM 9/23/13
+1. Jeremy Hughes IBM 9/23/13
+1. Igor Rodionov 9/23/13
+1. Gabor Garami 9/24/13
+1. Iulia Banghea 9/24/13
+1. Paul Dunnavant 9/24/13
+1. Alex Heneveld Cloudsoft Corp. 9/25/13
+1. Jordi Massaguer Pla 9/25/13
+1. Richard Downer Cloudsoft Corp. 9/25/13
+1. Roger Hu 9/25/13
+1. Dominic St-Jacques 9/25/13
+1. Mahmoud Abdelkader 9/26/13
+1. Takahiro Himura 9/26/13
+1. Aled Sage Cloudsoft Corp. 9/25/13
+1. Andrew Kennedy Cloudsoft Corp. 9/25/13
+1. Sam Corbett Cloudsoft Corp. 9/25/13
+1. Trevor Leybourne MYOB NZ Limited 9/26/13
+1. Greg Zapp MYOB NZ Limited 9/26/13
+1. Bo Ma MYOB NZ Limited 9/26/13
+1. Dmitry Lavrinenko 9/27/13
+1. Vitaly Shishlyannikov 9/27/13
+1. Jonathan Mickle 9/27/13
+1. Scott Hain Jr 9/27/13
+1. Ethan Fremen 9/29/13
+1. Daniel O'Conner 9/29/13
+1. Bill Wiens 9/30/13
+1. Jeroen Grusebroek Mollie B.V. 9/30/13
+1. Morton Jonuschat 9/30/13
+1. Bentrand Paquet 10/1/13
+1. Christoph Hartmann 10/1/13
+1. Okezie Eze 10/1/13
+1. Christopher Dwan 10/1/13
+1. Carl Schmidt Unbounce 10/1/13
+1. Aaron Oman Unbounce 10/1/13
+1. Chris Spicer Unbounce 10/1/13
+1. Jimmy Zheng Unbounce 10/1/13
+1. Josh Blancett 10/1/13
+1. Stephen Romney Shutl Ltd. 10/2/13
+1. James Wilford Shutl Ltd. 10/2/13
+1. Sam Phillips Shutl Ltd. 10/2/13
+1. Yomi Colledge Shutl Ltd. 10/2/13
+1. Marco Nenciarini 10/2/13
+1. Jake Herbst 10/2/13
+1. Kawahara Masashi 10/2/13
+1. Ilan Rabinovitch Ooyala, Inc. 10/3/13
+1. Garry Polley 10/3/13
+1. Akshay Karle 10/3/13
+1. Pascal Gelinas Nu Echo 10/3/13
+1. Salim Semaoune 10/3/13
+1. August Schwer 10/4/13
+1. Sam Adams 10/7/13
+1. Niels Kristensen 10/7/13
+1. Aliaksei Kliuchnikau 10/7/13
+1. Theofilos Papapanagiotou 10/7/13
+1. Mike Rossetti Our Film Festival (dba Fandor) 10/7/13
+1. Victor Lin 10/8/13
+1. Tyler Kellen 10/8/13
+1. Baba Buehler 10/8/13
+1. Matt Clifton 10/8/13
+1. Daniel Babel Ooyala, Inc. 10/9/13
+1. Jurgen Philippaerts Ooyala, Inc. 10/9/13
+1. Josh Toft Ooyala, Inc. 10/9/13
+1. Tobias Maier BauCloud GmbH 10/9/13
+1. Ryota Arai 10/9/13
+1. Kyle Kelley 10/10/13
+1. Jaroslav Barton 10/10/13
+1. Sam Pointer 10/10/13
+1. Sebastian Guevara 10/10/13
+1. Paul Welch Squaremouth Inc 10/10/13
+1. Peter Georgantas 10/10/13
+1. Karla Jacobsen 10/10/13
+1. Ryan S Brown 10/10/13
+1. Richard Manyanza 10/11/13
+1. Guilhem Lettron Optiflows 10/11/13
+1. Ludovic Havel Optiflows 10/11/13
+1. Jean Rouge 10/11/13
+1. Devon Jones 10/11/13
+1. Matthew Kasa 10/11/13
+1. James Moorhouse 10/12/13
+1. Christopher Grim 10/12/13
+1. Ryan Frantz 10/14/13
+1. Shrikant Patnaik General Sensing LTD 10/10/13
+1. Aaron Valade General Sensing LTD 10/10/13
+1. Chris Jerdonek 10/13/13
+1. EJ Ciramella Rapid7 10/14/13
+1. Brandon Turner Rapid7 10/14/13
+1. Chris Smtih Rapid7 10/14/13
+1. Ben Tomasini 10/14/13
+1. Evan Todd 10/15/13
+1. Alex Shadrin 10/15/13
+1. Mart Karu 10/15/13
+1. Russell Cardullo 10/15/13
+1. John Tran 10/15/13
+1. Alex Koch 10/15/13
+1. Jonathan Regeimbal 10/15/13
+1. James Walker 10/16/13
+1. Justin Dugger 10/16/13
+1. Dustin Collins 10/16/13
+1. Matthew Boedicker 10/17/13
+1. John Deatherage 10/17/13
+1. Aaron Jensen 10/17/13
+1. Olksandr Slynko 10/17/13
+1. Emanuele Rocca 10/18/13
+1. Antonio Fernandez Vara 10/18/13
+1. Mickhail Zholobov 10/18/13
+1. Daniel Wallace Rackspace 10/18/13
+1. Christian Fischer 10/18/13
+1. Silviu Dicu 10/18/13
+1. William Pietri 10/19/13
+1. Daniel Tracy 10/21/13
+1. Ashish Shinde 10/22/13
+1. Mathew Hoyle Deployable LTD 10/22/13
+1. Leonardo Leite 10/22/13
+1. Michael Dore 10/22/13
+1. Hannes Van De Vreken 10/22/13
+1. Mevan Samaratunga 10/22/13
+1. Adam Enger 10/22/13
+1. Peter Jönsson Klarna 10/23/13
+1. Carl Loa Odin Klarna 10/23/13
+1. Olle Lundberg Klarna 10/23/13
+1. Pat Downey 10/24/13
+1. Max Lincoln 10/24/13
+1. Pavel Brylov 10/24/13
+1. Sam Clements 10/25/13
+1. Gabriel Mazetto 10/25/13
+1. Cory Gunterman Nike, Inc. 10/25/13
+1. Justin Redd Nike, Inc. 10/25/13
+1. Dave Palomino Nike, Inc. 10/25/13
+1. Tom Luce Nike, Inc. 10/25/13
+1. Shawn Turpin Nike, Inc. 10/25/13
+1. Ed Tretyakov 10/27/13
+1. Frank Breedijk Schuberg Phillis B.V. 10/28/13
+1. Henry Finucane 10/30/13
+1. Thomas de Grenier de Latour 10/30/13
+1. Andrey Chernih 10/30/13
+1. Matt Wormley 10/30/13
+1. Maciej Galkiewicz 10/31/13
+1. Makiko Nomura 11/1/13
+1. Cheah Chu Yeow Irrational Industries, Inc. 11/1/13
+1. Christian Paredes Irrational Industries, Inc. 11/1/13
+1. Rafael Kolless 11/2/13
+1. Zsolt Takacs 11/2/13
+1. Tobias Schmidt SoundCloud Ltd. 11/5/13
+1. Frederick Jaeckel SoundCloud Ltd. 11/5/13
+1. Matthias Rampke SoundCloud Ltd. 11/5/13
+1. Daman Yang SoundCloud Ltd. 11/5/13
+1. Ben Kochie SoundCloud Ltd. 11/5/13
+1. Alexander Grosse SoundCloud Ltd. 11/5/13
+1. Allan Beaufour Project Florida 11/5/13
+1. Jow Crobak Project Florida 11/5/13
+1. Derek Groh 11/5/13
+1. David Shawley 11/5/13
+1. Jason Faulkner 11/5/13
+1. Cheryl Ainoa Intuit 11/6/13
+1. Thomas Bishop Intuit 11/6/13
+1. Jeffrey Mendoza 11/6/13
+1. Munirathnam Srikanth ComputeNext 11/6/13
+1. Sergio Patino 11/6/13
+1. Andrew Caldwell 11/6/13
+1. Alex Derzhi 11/7/13
+1. Olivier Biesmans 11/7/13
+1. Gabriel Rosendorf The Weather Companies 11/8/13
+1. Nathaniel Eliot 11/9/13
+1. Thibaut Notteboom 11/10/13
+1. Walter Huf 11/11/13
+1. David Larken Nolen 11/11/13
+1. Makana Greenwell 11/12/13
+1. Mathew Hartley 11/12/13
+1. Julie Rice PTC Inc 11/13/13
+1. Matt Welch PTC Inc 11/13/13
+1. Jonathan Bass PTC Inc 11/13/13
+1. Joe Rocklin 11/14/13
+1. Zaininnari 11/14/13
+1. Jean Mertz 11/18/13
+1. Gleb Borisov 11/19/13
+1. Curtis Stewart 11/19/13
+1. Jim Park RamTank Inc 11/19/13
+1. Pierre Ynard Criteo 11/19/13
+1. Sergey Balbeko 11/20/13
+1. Igor Serko 11/20/13
+1. Jason Giedymin 11/20/13
+1. Luca Pradovera 11/20/13
+1. Jason Giedymin 11/20/13
+1. Shaun Rowe 11/21/13
+1. Chad Cloes Intuit 11/21/13
+1. Rick Mendes Intuit 11/21/13
+1. Grant Hoffman Intuit 11/21/13
+1. Capen Brinkley Intuit 11/21/13
+1. Kevin Young Intuit 11/21/13
+1. Walter Askew IV 11/22/13
+1. Spencer Smith 11/23/13
+1. Spencer Smith 11/23/13
+1. Connor Goodwolf 11/23/13
+1. Seiji Komatsu 11/24/13
+1. Steve Domin GoCardless 11/24/13
+1. Milos Gajdos GoCardless 11/24/13
+1. Harry Marr GoCardless 11/24/13
+1. Komatsu Seiji 11/25/13
+1. Gokulnath Manakkattil 11/26/13
+1. Joel Moss 11/27/13
+1. Drew J. Sonne 11/30/13
+1. Sascha Mollering ZANOX AG 11/30/13
+1. Boris Komraz 12/1/13
+1. Mark O'Connor 12/1/13
+1. Ivan Larionov 12/2/13
+1. Pierre Carrier 12/2/13
+1. Joe A. Kemp ARINC 12/3/13
+1. Douglas Mendizabal 12/3/13
+1. Tejay Cardon Lockheed Martin Corporation 12/3/13
+1. David Deal Lockheed Martin Corporation 12/3/13
+1. Jason Loveland Lockheed Martin Corporation 12/3/13
+1. Friedrich Clausen 12/4/13
+1. Paul Kehrer 12/4/13
+1. Stephan Renatus 12/5/13
+1. Abhijit Hiremagalur 12/5/13
+1. Wojciech Oledzki 12/5/13
+1. Johannes Plunien 12/7/13
+1. Benjamin Demaree 12/8/13
+1. Friedel Ziegelmayer 12/13/13
+1. Jason Vervlied 12/13/13
+1. Fabian Lee 12/15/13
+1. Tino Breddin 12/16/13
+1. Cameron Cope Brightcove 12/16/13
+1. Jason Perry Brightcove 12/16/13
+1. Eric Moakley Brightcove 12/16/13
+1. Joshua Spiewak Brightcove 12/16/13
+1. John Schectman Brightcove 12/16/13
+1. Keegan Holley 12/16/13
+1. James La Spada 12/17/13
+1. Jesué Sousa Cunha Junior 12/17/13
+1. Dan Rathbone 12/17/13
+1. Jay Geeseman 12/19/13
+1. David Bernick 12/20/13
+1. Primož Verdnik 12/20/13
+1. Yavor Nikolov 12/26/13
+1. Joseph C. Stump Sprint.ly, Inc 12/27/13
+1. Justin T. Abrahms Sprint.ly, Inc 12/27/13
+1. Theodore Chuong Nordsieck 12/29/13
+1. Thomas Noonan II 12/30/13
+1. Coman Ioan Andrei 12/30/13
+1. Steven Geerts Schuberg Phillis B.V. 1/2/14
+1. Scott Russell 1/3/14
+1. Lothar Wieske 1/3/14
+1. Paul Czarkowski 1/3/14
+1. Ramil Lim 1/3/14
+1. Jeff Byrnes 1/3/14
+1. Christopher James Saylor 1/4/14
+1. Gary Cao 1/6/14
+1. Christopher William Pernicano 1/6/14
+1. Emmanuel Idi 1/6/14
+1. Reid Beels 1/7/14
+1. Anthony LoBono 1/8/14
+1. Barthélemy Vessemont 1/10/14
+1. Michael Holtzman 1/10/14
+1. Tristan O'Neil Cramer Development 1/10/14
+1. Brian Cobb Cramer Development 1/10/14
+1. Brett Chalupa Cramer Development 1/10/14
+1. Dan Volkens Cramer Development 1/10/14
+1. Ryan Keairns Cramer Development 1/10/14
+1. Nikhil Benesch 1/12/14
+1. Christian Höltje 1/13/14
+1. Alexander C Corvin 1/17/14
+1. Samuel Chambers 1/18/14
+1. Cheah Chu Yeow 1/18/14
+1. Kazuki Saito 1/18/14
+1. Pete Richards 1/19/14
+1. Jimmy McCrory 1/19/14
+1. Olivier Dolbeau 1/20/14
+1. Andrew Brown BlackBerry, Inc. 1/20/14
+1. Phil Oliva BlackBerry, Inc. 1/20/14
+1. Dave Urschatz BlackBerry, Inc. 1/20/14
+1. Ishtiaq Ahmed 1/25/14
+1. Caleb Land 1/26/14
+1. Charles B Johnson 1/26/14
+1. Diego Rodriguez 1/27/14
+1. Nitin Mohan 1/27/14
+1. Szymon Szypulski 1/29/14
+1. Jaime Gil de Sagredo 1/29/14
+1. Jose Luis Ferrer Riera 1/29/14
+1. Yury Velikanau 1/29/14
+1. Jeroen Jacobs 1/30/14
+1. W. Hart Hoover Rackspace 2/3/14
+1. Jerry Richardson Disruptive Ventures, Inc 2/4/14
+1. Brian Dwyer 2/4/14
+1. Aaron O'Mullan FriendCode, Inc 2/5/14
+1. Jean-Baptiste Dalido 2/6/14
+1. Juri Timoshin 2/6/14
+1. Pascal Laporte 2/6/14
+1. Steven Cummings Cerner Innovation Inc 2/6/14
+1. Pascal Laporte 2/6/14
+1. Mick Brooks 2/7/14
+1. Aurélien Noce 2/7/14
+1. Charlie Huggard Cerner Innovation Inc 2/11/14
+1. Matthias Arnason Engine Yard 2/12/14
+1. Bryan Taylor 2/12/14
+1. Michael Dillion 2/17/14
+1. Seth Kingry 2/18/14
+1. Wesley David DeCesare Crux Hosted Services 2/18/14
+1. Kent Shultz 2/18/14
+1. Adam Durana 2/21/14
+1. Jacob McCann 2/21/14
+1. Andriy Tyurnikov 2/21/14
+1. Anton Koldaev 2/21/14
+1. Matthew Rathbone 2/21/14
+1. Egor Medvedev 2/23/14
+1. Eric Tucker Blue Spurs 2/24/14
+1. Tomas Gutierrez 2/24/14
+1. Jordan Burke 2/25/14
+1. Zvi Effron 2/25/14
+1. Pranay Manwatkar 2/26/14
+1. Kaspars Mickevics 2/26/14
+1. Roman Gorodeckij 2/27/14
+1. Matthew Baxa 2/27/14
+1. Maxime Caumartin 2/27/14
+1. Brandon Raabe 2/28/14
+1. Alan Grosskurth 2/28/14
+1. Nathan Milford 2/28/14
+1. Jacob Vosmaer GitLab.com 3/1/14
+1. Job van der Voort GitLab.com 3/1/14
+1. Marin Jankovski GitLab.com 3/1/14
+1. Martin Glaß 3/1/14
+1. Sergey Sergeev 3/1/14
+1. Marshall Ian Farmer 3/2/14
+1. Markus Schabel 3/3/14
+1. Torben Knerr 3/4/14
+1. Pavel Sadikov 3/5/14
+1. David King 3/7/14
+1. Charles Guenther Yelp 3/7/14
+1. Kris Wehner Yelp 3/7/14
+1. Brian Fletcher Workday 3/10/14
+1. Brad Pokorny IBM 3/10/14
+1. John Warren IBM 3/10/14
+1. Lance Bragstad IBM 3/10/14
+1. Luis Garcia IBM 3/10/14
+1. Mark Vanderwiel IBM 3/10/14
+1. Mathew Odden IBM 3/10/14
+1. Andrew Coulton 3/11/14
+1. Andrew Ordiales 3/11/14
+1. Will Hattingh 3/12/14
+1. Eohyung Lee 3/13/14
+1. Matthew Zito BMC Software Inc 3/13/14
+1. Nick Galbreath 3/13/14
+1. Thomas Duckering 3/14/14
+1. Stanley Halka 3/14/14
+1. Michael Morris 3/14/14
+1. Gavin Montague itison 3/14/14
+1. John Daniels itison 3/14/14
+1. Matthias Endler 3/17/14
+1. Greg Albrecht OnBeep, Inc. 3/19/14
+1. Andy Issacson OnBeep, Inc. 3/19/14
+1. Ben Graver OnBeep, Inc. 3/19/14
+1. Jim Qin OnBeep, Inc. 3/19/14
+1. Carlos Vinueza OnBeep, Inc. 3/19/14
+1. Benson Miller Level 11 Consulting 3/19/14
+1. Nik Ormseth Level 11 Consulting 3/19/14
+1. James Francis Level 11 Consulting 3/19/14
+1. Kevin Rivers Level 11 Consulting 3/19/14
+1. Michael Dellanoce 3/20/14
+1. Joey Line 3/21/14
+1. Nick Lopez 3/22/14
+1. Jason Byck 3/23/14
+1. Ian Neubert 3/25/14
+1. Brandon Taylor Groves 3/25/14
+1. Sean Walberg 3/25/14
+1. Matthijs Wijers 3/26/14
+1. Tensibai Zhaoying 3/26/14
+1. Michael Chletso 3/27/14
+1. Joseph Korkames 3/27/14
+1. Matthew Juszczak 3/27/14
+1. Hongbin Lu 3/27/14
+1. Ryan Lewon 3/28/14
+1. Tiru Srikantha 3/29/14
+1. Calvin Worsnup 3/31/14
+1. Andres More 4/1/14
+1. Joe Richards 4/1/14
+1. Mikael Henriksson 4/2/14
+1. Benjamin Dalton LeMasurier 4/2/14
+1. Dirk Moermans 4/3/14
+1. Pavel Yudin 4/4/14
+1. Ed Neville Linaro Limited 4/4/14
+1. Andrew McDermott Linaro Limited 4/4/14
+1. Ron Nandy Linaro Limited 4/4/14
+1. Florian Holzhauer 4/4/14
+1. Joshua Yotty 4/4/14
+1. Narendra V Dharmavarapu 4/4/14
+1. Brian Wilson Leake 4/6/14
+1. John Northrup 4/7/14
+1. Yoichi Isozaki 4/7/14
+1. Jordan Evans 4/8/14
+1. Oliver Kohl 4/9/14
+1. Craig Monson 4/10/14
+1. Rob Brown 4/10/14
+1. Alexander Myasnikov 4/11/14
+1. Matthew Hodgkins 4/12/14
+1. Aaron Quint 4/12/14
+1. Jaewoo Kim 4/17/14
+1. Vasiliy Tolstov 4/17/14
+1. Ryan Moe 4/18/14
+1. G. Panula 4/21/14
+1. Chris Antenesse 4/21/14
+1. Lloyd Chan 4/22/14
+1. Satoshi Tanaka 4/22/14
+1. Tim Heckman 4/24/14
+1. Trevor Lauder 4/25/14
+1. Nathan Haneysmith Nordstrom 4/25/14
+1. Aaron Lane 4/26/14
+1. Bao Nguyen 4/27/14
+1. Salvatore Poliandro III 4/28/14
+1. Eric Zhoe 4/29/14
+1. Alex Kahn 4/29/14
+1. Brendan Murtagh 4/29/14
+1. Tyler Cipriani 4/29/14
+1. Syunsuke Komma WESEEK 4/29/14
+1. Yuki Takei WESEEK 4/29/14
+1. Trevor Bramwell 5/1/14
+1. Robert Tarrall 5/1/14
+1. Josh Reichardt 5/1/14
+1. Trevor Lauder Intuit 5/1/14
+1. Jake Plimack 5/2/14
+1. Brian D Clark 5/3/14
+1. Roman Chukh 5/4/14
+1. Nick Montgomery 5/4/14
+1. Patrick Moore 5/5/14
+1. Edmund Dipple 5/6/14
+1. Kyle Boorky 5/6/14
+1. Olivier Larivain 5/6/14
+1. Aaron Valade 5/7/14
+1. Jonathan Serafini 5/7/14
+1. Jason Nelson Rackspace 5/8/14
+1. Alexander Meng 5/8/14
+1. Kyle McGovern Cerner Innovation Inc 5/8/14
+1. Jesse Washburn 5/8/14
+1. Ian Blenke 5/9/14
+1. Jochen Seeber 5/9/14
+1. Florin Stan 5/9/14
+1. Bearnard Hibbins 5/12/14
+1. Amruta Krishna Cerner Innovation Inc 5/13/14
+1. Daniel Zautner 5/13/14
+1. Andrew DuFour 5/13/14
+1. David Gil Oliva 5/19/14
+1. Emmanuel Sciara 5/20/14
+1. Francois Visconte 5/21/14
+1. Cyril Scetbon 5/21/14
+1. Doug Wilson CustomInk 4/4/14
+1. Meherez Alachheb 5/22/14
+1. Ash Wilson Rackspace 5/22/14
+1. Alexey Velikiy 5/21/14
+1. Anand Suresh 5/24/14
+1. Christoph Krämer 5/26/14
+1. Marcus Nilsson 5/27/14
+1. Eric Black 5/27/14
+1. Michiel Sikkes 5/29/14
+1. Miguel Landaeta 5/29/14
+1. Claude Ballew Jr 5/29/14
+1. Carlos Macasaet 5/29/14
+1. Steve Jansen 6/3/14
+1. Jake Champlin 6/4/14
+1. Alistair Stead Iniqa UK, Ltd 6/4/14
+1. Fahd Sultan 6/4/14
+1. Martin Smith III Rackspace 6/4/14
+1. Klaas Jan Wierenga 6/5/14
+1. Michael Bumann 6/6/14
+1. Grant Hudgens 6/6/14
+1. Rob Redpath World Wide Web Hosting, LLC 6/6/14
+1. Benjamin Ahrens 6/9/14
+1. Alessio Franceschelli 6/10/14
+1. Joseph Bowman 6/11/14
+1. William Cody Crawford 6/11/14
+1. Ryan Trauntvein 6/12/14
+1. Adam Lavin 6/14/14
+1. Brett Cave Jemstep 6/13/14
+1. Matt Wrock 6/16/14
+1. William Clark 6/17/14
+1. Karsten McMinn 6/17/14
+1. Alexander Simonov 6/17/14
+1. James Coleman 6/18/14
+1. Charles Ruhl 6/18/14
+1. Pushkar Subhash Raste 6/19/14
+1. John Coleman 6/20/14
+1. Joshua Rutherford 6/20/14
+1. Elijah Buck 6/21/14
+1. Nikalai Stakanov 6/22/14
+1. Blair Hamilton 6/22/14
+1. Jeffrey Goldschrafe 6/24/14
+1. Vijay Bheemineni 6/25/14
+1. Joshua Benjamin 6/25/14
+1. Stafford Brunk 6/25/14
+1. Sumit Gupta 6/26/14
+1. Jan Mara 6/27/14
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f8618ad381..8c19e1011a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -173,7 +173,7 @@ Contributions go through a review process to improve code quality and avoid regr
Our primary shipping vehicle is operating system specific packages that includes
all the requirements of Chef. We call these [Omnibus packages](https://github.com/opscode/omnibus-ruby)
-We also release our software as gems to [Rubygems](http://rubygems.org/) but we strongly
+We also release our software as gems to [Rubygems](https://rubygems.org/) but we strongly
recommend using Chef packages since they are the only combination of native libraries &
gems required by Chef that we test throughly.
diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md
index 08c343809a..7eb85eb894 100644
--- a/DOC_CHANGES.md
+++ b/DOC_CHANGES.md
@@ -521,3 +521,25 @@ end
Chef will then execute the Homebrew command as that user. The `homebrew_user` attribute can only be provided to the
`homebrew_package` resource, not the `package` resource.
+
+### Default `guard_interpreter` attribute for `powershell_script` resource
+
+For the `powershell_script` resource, the `guard_interpreter` attribute is set to `:powershell_script` by default. This means
+that if a string is supplied to an `only_if` or `not_if` attribute of a `powersell_script` resource, the PowerShell command
+interpreter (the 64-bit version) will be used to evaluate the guard. It also means that other features available to the guard
+when `guard_interpreter` is set to something other than `:default`, such as inheritance of attributes and the specification of
+process architectur of the guard process (i.e. 32-bit or 64-bit process) are available by default.
+
+In versions of Chef prior to Chef 12, the value of the attribute was `:default` by default, which uses the 32-bit version of the
+`cmd.exe` (batch script language) shell to evaluate strings supplied to guards.
+
+### Default `guard_interpreter` attribute for `batch` resource
+
+For the`batch` resource, the `guard_interpreter` attribute it is set to `:batch` by default. This means
+that if a string is supplied to an `only_if` or `not_if` attribute of a `batch` resource, the 64-bit version of the Windows
+default command interpreter, `cmd.exe`, will be used to evaluate the guard. It also means that other features available to the guard
+when `guard_interpreter` is set to something other than `:default`, such as inheritance of attributes and the specification of
+process architectur of the guard process (i.e. 32-bit or 64-bit process) are available by default.
+
+In versions of Chef prior to Chef 12, the value of the attribute was `:default` by default, which means the 32-bit version of the
+`cmd.exe` (batch script language) shell would be used to evaluate strings supplied to guards.
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 1fdc51c6e6..c20b486f43 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,5 +1,44 @@
+# Chef Client Release Notes 12.2.0:
+
+# Internal API Changes in this Release
+
+# End-User Changes
+
+## OpenBSD Package provider was added
+
+The package resource on OpenBSD is wired up to use the new OpenBSD package provider to install via pkg_add on OpenBSD systems.
+
# Chef Client Release Notes 12.0.0:
+# Internal API Changes in this Release
+
+These changes do not impact any cookbook code, but may impact tools that
+use the code base as a library. Authors of tools that rely on Chef
+internals should review these changes carefully and update their
+applications.
+
+## Changes to CookbookUpload
+
+`Chef::CookbookUpload.new` previously took a path as the second
+argument, but due to internal changes, this parameter was not used, and
+it has been removed. See: https://github.com/opscode/chef/commit/12c9bed3a5a7ab86ff78cb660d96f8b77ad6395d
+
+## Changes to FileVendor
+
+`Chef::Cookbook::FileVendor` was previously configured by passing a
+block to the `on_create` method; it is now configured by calling either
+`fetch_from_remote` or `fetch_from_disk`. See: https://github.com/opscode/chef/commit/3b2b4de8e7f0d55524f2a0ccaf3e1aa9f2d371eb
+
+# End-User Changes
+
+## Chef 12 Attribute Changes
+
+The Chef 12 Attribute RFC 23 (https://github.com/opscode/chef-rfc/blob/master/rfc023-chef-12-attributes-changes.md) has been merged into
+Chef. This adds the ability to remove precedence levels (or all levels) of attributes in recipes code, or to
+force setting an attribute precedence level. The major backwards incompatible change to call out in this RFC is that
+`node.force_default!` and `node.force_override!` have changed from accessors to setters, and any cookbook code that used these functions
+(extremely uncommon) simply needs to drop the exclamation point off of the method in order to use the accessor.
+
## Knife Prefers `config.rb` to `knife.rb`.
Knife will now look for `config.rb` in preference to `knife.rb` for its
@@ -13,7 +52,7 @@ when using `knife.rb`. Once third-party application developers have had
sufficient time to adapt to the change, `knife.rb` will become
deprecated and config.rb will be preferred.
-## Boostrap Changes
+## Bootstrap Changes
Chef Client 12 introduces a set of changes to `knife bootstrap`. Here is the list of changes:
@@ -249,25 +288,6 @@ Informational messages from knife are now sent to stderr, allowing you to pipe t
The `data_bag_item` dsl method can be used to load encrypted data bag items when an additional `secret` String parameter is included.
If no `secret` is provided but the data bag item is encrypted, `Chef::Config[:encrypted_data_bag_secret]` will be checked.
-# Internal API Changes in this Release
-
-These changes do not impact any cookbook code, but may impact tools that
-use the code base as a library. Authors of tools that rely on Chef
-internals should review these changes carefully and update their
-applications.
-
-## Changes to CookbookUpload
-
-`Chef::CookbookUpload.new` previously took a path as the second
-argument, but due to internal changes, this parameter was not used, and
-it has been removed. See: https://github.com/opscode/chef/commit/12c9bed3a5a7ab86ff78cb660d96f8b77ad6395d
-
-## Changes to FileVendor
-
-`Chef::Cookbook::FileVendor` was previously configured by passing a
-block to the `on_create` method; it is now configured by calling either
-`fetch_from_remote` or `fetch_from_disk`. See: https://github.com/opscode/chef/commit/3b2b4de8e7f0d55524f2a0ccaf3e1aa9f2d371eb
-
## 'group' provider on OSX properly uses 'dscl' to determine existing groups
On OSX, the 'group' provider would use 'etc' to determine existing groups,
@@ -336,3 +356,111 @@ You can read more about this RFC [here](https://github.com/opscode/chef-rfc/blob
1. `--medium`: Includes normal attributes in the output and presents the output as JSON.
1. `--long`: Includes all attributes in the output and presents the output as JSON.
+
+## AIX Service Provider Support
+
+Chef 12 now supports managing services on AIX, using both the SRC (Subsystem Resource Controller) as well as the BSD-style init system. SRC is the default; the BSD-style provider can be selected using `Chef::Provider::Service::AixInit`.
+
+The SRC service provider will manage services as well as service groups. However, because SRC has no standard mechanism for starting services on system boot, `action :enable` and `action :disable` are not supported for SRC services. You may use the `execute` resource to invoke `mkitab`, for example, to add lines to `/etc/inittab` with the right parameters.
+
+## `guard_interpreter` attribute for `powershell_script` defaults to `:powershell_script`
+The default `guard_interpreter` attribute for the `powershell_script` resource is `:powershell_script`. This means that the
+64-bit version of the PowerShell shell will be used to evaluate strings supplied to the `not_if` or `only_if` attributes of the
+resource. Prior to this release, the default value was `:default`, which used the 32-bit version of the `cmd.exe` shell to evaluate the guard.
+
+If you are using guard expressions with the `powershell_script` resource in your recipes, you should override the
+`guard_interpreter` attribute to restore the behavior of guards for this resource in Chef 11:
+
+```ruby
+# The not_if will be evaluated with 64-bit PowerShell by default,
+# So override it to :default if your guard assumes 32-bit cmd.exe
+powershell_script 'make_safe_backup' do
+ guard_interpreter :default # Chef 11 behavior
+ code 'cp ~/data/nodes.json $env:systemroot/system32/data/nodes.bak'
+
+ # cmd.exe (batch) guard below behaves differently in 32-bit vs. 64-bit processes
+ not_if 'if NOT EXIST %SYSTEMROOT%\\system32\\data\\nodes.bak exit /b 1'
+end
+```
+
+If the code in your guard expression does not rely on the `cmd.exe` interpreter, e.g. it simply executes a process that should
+return an exit code such as `findstr datafile sentinelvalue`, and does not rely on being executed from a 32-bit process, then it
+should function identically when executed from the PowerShell shell and it is not necessary to override the attribute
+to`:default` to restore Chef 11 behavior.
+
+Note that with this change guards for the `powershell_script` resource will also inherit some attributes like `:architecture`, `:cwd`,
+`:environment`, and `:path`.
+
+## `guard_interpreter` attribute for `batch` resource defaults to `:batch`
+
+The default `guard_interpreter` attribute for the `batch` resource is now `:batch`. This means that the
+64-bit version of the `cmd.exe` shell will be used to evaluate strings supplied to the `not_if` or `only_if` attributes of the
+resource. Prior to this release, the default value was `:default`, which used the 32-bit version of the `cmd.exe` shell to evaluate the guard.
+
+Note that with this change guards for the `batch` resource will also inherit some attributes like `:architecture`, `:cwd`,
+`:environment`, and `:path`.
+
+Unless the code you supply to guard attributes (`only_if` and `not_if`) has logic that requires that the 32-bit version of
+`cmd.exe` be used to evaluate the guard or you need to avoid the inheritance behavior of guard options, that code should function identically in this release of Chef and Chef 11 releases.
+
+If an assumption of a 32-bit process for guard evaluation exists in your code, you can obtain the equivalent of Chef 11's 32-bit
+process behavior by supplying an architecture attribute to the guard as follows:
+
+```ruby
+# The not_if will be evaluated with 64-bit cmd.exe by default,
+# so you can verride it with the :architecture guard option to
+# make it 32-bit as it is in Chef 11
+batch 'make_safe_backup' do
+ code 'copy %USERPROFILE%\\data\\nodes.json %SYSTEMROOT%\\system32\\data\\nodes.bak'
+
+ # cmd.exe (batch) guard code below behaves differently in 32-bit vs. 64-bit processes
+ not_if 'if NOT EXIST %SYSTEMROOT%\\system32\\data\\nodes.bak exit /b 1', :architecture => :i386
+end
+```
+
+If in addition to the 32-bit process assumption you also need to avoid the inheritance behavior, you can revert completely to
+the Chef 11's 32-bit process, no inheritance behavior by supplying `:default` for the `guard_interpreter` as follows:
+
+```ruby
+# The not_if will be evaluated with 64-bit cmd.exe by default,
+# so override it to :default if your guard assumes 32-bit cmd.exe
+batch 'make_safe_backup' do
+ guard_interpreter :default # Revert to Chef 11 behavior
+ code 'copy %USERPROFILE%\\data\\nodes.json %SYSTEMROOT%\\system32\\data\\nodes.bak'
+
+ # cmd.exe (batch) guard code below behaves differently in 32-bit vs. 64-bit processes
+ not_if 'if NOT EXIST %SYSTEMROOT%\\system32\\data\\nodes.bak exit /b 1'
+end
+```
+
+## Chef Client logs events to Windows Event Log on Windows
+
+Chef 12 will log a small set of events to Windows Event Log. This feature is enabled by default, and can be disabled by the new config option `disable_event_logger`.
+
+Events by default will be logged to the "Application" event log on Windows. Chef will log event when:
+* Run starts
+* Run completes
+* Run fails
+
+Information about these events can be found in `Chef::EventDispatch::Base`.
+
+## Resource and Provider Resolution changes
+
+Resource resolution and provider resolution has been made more dynamic in Chef-12. The `provides` syntax on the
+Chef::Resource DSL (which has existed for 4 years) has been expanded to use platform_family and os and has been applied
+to most resources. This does early switching at compile time between different resources based on the node data returned
+from ohai. The effect is that previously the package resource on a CentOS machine invoked via `package "foo"` would be
+an instance of Chef::Resource::Package but would use the Chef::Provider::Package::Yum provider. After the changes to
+the resources the resource will be an instance of Chef::Resource::YumPackage and will do the correct validation for
+the yum package provider.
+
+For the service resource it uses late validation via the Chef::ProviderResolver and will dynamically select which
+service provider to use at package converge time right before the service provider actions are invoked. This means
+that if Chef is used to install systemd (or alternatively to remove it) then the ProviderResolver will be invoked
+and will be able to determine the proper provider to start the service. It also allows for multiple providers to
+be invoked for a resource on a case-by-case basis. The old static one-to-one Chef::Platform provider mapping was
+inflexible since it cannot handle the case where an admin installs or removes a subsystem from a distro, and cannot
+handle the case where there may be multiple providers that handle different kinds of services (e.g. Upstart, SysV,
+etc). This fixes the Ubuntu 14.04 service resource problems, and can handle arbitrarily complicated future distro
+and administrative preferences dynamically.
+
diff --git a/Rakefile b/Rakefile
index b55ed8321b..70a45d94c0 100644
--- a/Rakefile
+++ b/Rakefile
@@ -52,6 +52,18 @@ task :pedant do
require File.expand_path('spec/support/pedant/run_pedant')
end
+task :build_eventlog do
+ Dir.chdir 'ext/win32-eventlog/' do
+ system 'rake build'
+ end
+end
+
+task :register_eventlog do
+ Dir.chdir 'ext/win32-eventlog/' do
+ system 'rake register'
+ end
+end
+
begin
require 'yard'
DOC_FILES = [ "README.rdoc", "LICENSE", "spec/tiny_server.rb", "lib/**/*.rb" ]
diff --git a/bin/chef-service-manager b/bin/chef-service-manager
index aaf91c7568..7cef10f506 100755
--- a/bin/chef-service-manager
+++ b/bin/chef-service-manager
@@ -28,7 +28,7 @@ if Chef::Platform.windows?
:service_name => "chef-client",
:service_display_name => "Chef Client Service",
:service_description => "Runs Chef Client on regular, configurable intervals.",
- :service_file_path => File.expand_path(File.join(File.dirname(__FILE__), '../lib/chef/application/windows_service.rb'))
+ :service_file_path => File.expand_path(File.join(File.dirname(__FILE__), '../../../../bin/chef-windows-service'))
}
Chef::Application::WindowsServiceManager.new(chef_client_service).run
else
diff --git a/bin/chef-windows-service b/bin/chef-windows-service
new file mode 100755
index 0000000000..292d5651fc
--- /dev/null
+++ b/bin/chef-windows-service
@@ -0,0 +1,35 @@
+#!/usr/bin/env ruby
+#
+# Author:: Jay Mundrawala (<jdm@getchef.com>)
+#
+# Copyright:: 2014, Chef Software, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Note:
+# The file is used by appbundler to generate a ruby file that
+# we can execute using the correct gems. The batch file we
+# generate will call that file, and will be registered as
+# a windows service.
+
+require 'rubygems'
+$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+require 'chef'
+require 'chef/application/windows_service'
+
+if Chef::Platform.windows?
+ Chef::Application::WindowsService.mainloop
+else
+ puts "chef-windows-service is only available on Windows platforms."
+end
diff --git a/chef-x86-mingw32.gemspec b/chef-x86-mingw32.gemspec
index 6d69c4e7e6..0364e07827 100644
--- a/chef-x86-mingw32.gemspec
+++ b/chef-x86-mingw32.gemspec
@@ -14,5 +14,10 @@ gemspec.add_dependency "win32-process", "0.7.3"
gemspec.add_dependency "win32-service", "0.8.2"
gemspec.add_dependency "win32-mmap", "0.4.0"
gemspec.add_dependency "wmi-lite", "~> 1.0"
+gemspec.add_dependency "win32-eventlog", "0.6.1"
+gemspec.extensions << "ext/win32-eventlog/Rakefile"
+gemspec.files += %w(ext/win32-eventlog/Rakefile ext/win32-eventlog/chef-log.man)
+
+gemspec.executables += %w( chef-service-manager chef-windows-service )
gemspec
diff --git a/chef.gemspec b/chef.gemspec
index 075d1fc5d6..8e906a0ef1 100644
--- a/chef.gemspec
+++ b/chef.gemspec
@@ -41,15 +41,12 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake", "~> 10.1.0"
# rspec_junit_formatter 0.2.0 drops ruby 1.8.7 support
- s.add_development_dependency "rspec_junit_formatter", "~> 0.1.0"
+ s.add_development_dependency "rspec_junit_formatter", "~> 0.2.0"
- %w(rspec-core rspec-expectations rspec-mocks).each { |gem| s.add_development_dependency gem, "~> 2.14.0" }
+ %w(rspec-core rspec-expectations rspec-mocks).each { |gem| s.add_development_dependency gem, "~> 3.0" }
s.bindir = "bin"
- # chef-service-manager is a windows only executable.
- # However gemspec doesn't give us a way to have this executable only
- # on windows. So we're including this in all platforms.
- s.executables = %w( chef-client chef-solo knife chef-shell shef chef-apply chef-service-manager )
+ s.executables = %w( chef-client chef-solo knife chef-shell shef chef-apply )
s.require_path = 'lib'
s.files = %w(Rakefile LICENSE README.md CONTRIBUTING.md) + Dir.glob("{distro,lib,tasks,spec}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
diff --git a/distro/README b/distro/README
deleted file mode 100644
index 36f8b12118..0000000000
--- a/distro/README
+++ /dev/null
@@ -1,2 +0,0 @@
-Init scripts meant to be used with a gem installation via the bootstrap
-cookbook.
diff --git a/distro/arch/etc/conf.d/chef-client.conf b/distro/arch/etc/conf.d/chef-client.conf
deleted file mode 100644
index efbead3149..0000000000
--- a/distro/arch/etc/conf.d/chef-client.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-LOGFILE=/var/log/chef/client.log
-CONFIG=/etc/chef/client.rb
-INTERVAL=1800
-SPLAY=20
-CHEF_CLIENT_ARGS="-L $LOGFILE -d -c $CONFIG -i $INTERVAL -s $SPLAY"
diff --git a/distro/arch/etc/conf.d/chef-expander.conf b/distro/arch/etc/conf.d/chef-expander.conf
deleted file mode 100644
index 4c70bdd2eb..0000000000
--- a/distro/arch/etc/conf.d/chef-expander.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-LOGFILE=/var/log/chef/expander.log
-CONFIG=/etc/chef/solr.rb
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-DIETIME=5
-STARTTIME=5
-CHEF_EXPANDER_ARGS="-d -c $CONFIG -L $LOGFILE -n 1 -i 1"
diff --git a/distro/arch/etc/conf.d/chef-server-webui.conf b/distro/arch/etc/conf.d/chef-server-webui.conf
deleted file mode 100644
index a737a84aa6..0000000000
--- a/distro/arch/etc/conf.d/chef-server-webui.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-LOGFILE=/var/log/chef/server-webui.log
-CONFIG=/etc/chef/webui.rb
-ADAPTER=thin
-PORT=4040
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-STARTTIME=10
-DIETIME=5
-CHEF_SERVER_WEBUI_ARGS="-p $PORT -e production -d -a $ADAPTER -L $LOGFILE -C $CONFIG -u $USER -G $GROUP"
diff --git a/distro/arch/etc/conf.d/chef-server.conf b/distro/arch/etc/conf.d/chef-server.conf
deleted file mode 100644
index 95518ce045..0000000000
--- a/distro/arch/etc/conf.d/chef-server.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-LOGFILE=/var/log/chef/server.log
-CONFIG=/etc/chef/server.rb
-ADAPTER=thin
-PORT=4000
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-STARTTIME=10
-DIETIME=5
-CHEF_SERVER_ARGS="-p $PORT -e production -d -a $ADAPTER -L $LOGFILE -C $CONFIG -u $USER -G $GROUP"
diff --git a/distro/arch/etc/conf.d/chef-solr.conf b/distro/arch/etc/conf.d/chef-solr.conf
deleted file mode 100644
index a4764a2a8e..0000000000
--- a/distro/arch/etc/conf.d/chef-solr.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-LOGFILE=/var/log/chef/solr.log
-CONFIG=/etc/chef/solr.rb
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-DIETIME=5
-STARTTIME=5
-CHEF_SOLR_ARGS="-d -c $CONFIG -L $LOGFILE -u $USER -g $GROUP"
diff --git a/distro/arch/etc/rc.d/chef-client b/distro/arch/etc/rc.d/chef-client
deleted file mode 100644
index 6e2feb2e52..0000000000
--- a/distro/arch/etc/rc.d/chef-client
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-daemon_bin="/usr/bin/chef-client"
-daemon_name=$(basename $daemon_bin)
-PIDF="/var/run/$daemon_name.pid"
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/$daemon_name.conf
-
-get_pid() {
- pidof -o %PPID $daemon_name
-}
-
-case "$1" in
- start)
- stat_busy "Starting $daemon_name"
- PID=$(get_pid)
- if [ -z "$PID" ]; then
- [ -f $PIDF ] && rm -f $PIDF
- $daemon_bin --pid $PIDF $CHEF_CLIENT_ARGS
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- echo $(get_pid) > $PIDF
- add_daemon $daemon_name
- stat_done
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
-
- stop)
- stat_busy "Stopping $daemon_name daemon"
- PID=$(get_pid)
- [ ! -z "$PID" ] && kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- rm -f $PIDF &>/dev/null
- rm_daemon $daemon_name
- stat_done
- fi
- ;;
-
- restart)
- $0 stop
- sleep 3
- $0 start
- ;;
-
- status)
- stat_busy "Checking $daemon_name status";
- ck_status $daemon_name
- ;;
-
- run)
- stat_busy "Triggering new run of $daemon_name daemon"
- PID=$(get_pid)
- [ ! -z "$PID" ] && kill -SIGUSR1 $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- stat_done
- fi
- ;;
-
- *)
- echo "usage: $) {start|stop|restart|status|run}"
-esac
diff --git a/distro/arch/etc/rc.d/chef-expander b/distro/arch/etc/rc.d/chef-expander
deleted file mode 100644
index 5925efe2b8..0000000000
--- a/distro/arch/etc/rc.d/chef-expander
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-daemon_bin="/usr/bin/chef-expander"
-daemon_name=$(basename $daemon_bin)
-PIDF="/var/run/$daemon_name.pid"
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/$daemon_name.conf
-
-get_pid() {
- pidof -o %PPID $daemon_name
-}
-
-case "$1" in
- start)
- stat_busy "Starting $daemon_name"
- PID=$(get_pid)
- if [ -z "$PID" ]; then
- [ -f $PIDF ] && rm -f $PIDF
- $daemon_bin -P $PIDF $CHEF_EXPANDER_ARGS
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- echo $(get_pid) > $PIDF
- add_daemon $daemon_name
- stat_done
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
-
- stop)
- stat_busy "Stopping $daemon_name daemon"
- PID=$(get_pid)
- [ ! -z "$PID" ] && kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- rm -f $PIDF &>/dev/null
- rm_daemon $daemon_name
- stat_done
- fi
- ;;
-
- restart)
- $0 stop
- [ -n "$DIETIME" ] && sleep $DIETIME
- $0 start
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- ;;
- status)
- stat_busy "Checking $daemon_name status";
- ck_status $daemon_name
- ;;
- *)
- echo "usage: $) {start|stop|restart|status}"
-esac
diff --git a/distro/arch/etc/rc.d/chef-server b/distro/arch/etc/rc.d/chef-server
deleted file mode 100644
index 1ffbf8dce5..0000000000
--- a/distro/arch/etc/rc.d/chef-server
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-daemon_bin="/usr/bin/chef-server"
-daemon_name=$(basename $daemon_bin)
-PIDF="/var/run/$daemon_name.pid"
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/$daemon_name.conf
-
-get_pid() {
- pidof -o %PPID $daemon_name
-}
-
-case "$1" in
- start)
- stat_busy "Starting $daemon_name"
- PID=$(get_pid)
- if [ -z "$PID" ]; then
- [ -f $PIDF ] && rm -f $PIDF
- $daemon_bin -P $PIDF $CHEF_SERVER_ARGS
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- echo $(get_pid) > $PIDF
- add_daemon $daemon_name
- stat_done
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
-
- stop)
- stat_busy "Stopping $daemon_name daemon"
- PID=$(get_pid)
- [ ! -z "$PID" ] && kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- rm -f $PIDF &>/dev/null
- rm_daemon $daemon_name
- stat_done
- fi
- ;;
-
- restart)
- $0 stop
- [ -n "$DIETIME" ] && sleep $DIETIME
- $0 start
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- ;;
- status)
- stat_busy "Checking $daemon_name status";
- ck_status $daemon_name
- ;;
- *)
- echo "usage: $) {start|stop|restart|status}"
-esac
diff --git a/distro/arch/etc/rc.d/chef-server-webui b/distro/arch/etc/rc.d/chef-server-webui
deleted file mode 100644
index bec185151f..0000000000
--- a/distro/arch/etc/rc.d/chef-server-webui
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-daemon_bin="/usr/bin/chef-server-webui"
-daemon_name=$(basename $daemon_bin)
-PIDF="/var/run/$daemon_name.pid"
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/$daemon_name.conf
-
-get_pid() {
- pidof -o %PPID $daemon_name
-}
-
-case "$1" in
- start)
- stat_busy "Starting $daemon_name"
- PID=$(get_pid)
- if [ -z "$PID" ]; then
- [ -f $PIDF ] && rm -f $PIDF
- $daemon_bin -P $PIDF $CHEF_SERVER_WEBUI_ARGS
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- echo $(get_pid) > $PIDF
- add_daemon $daemon_name
- stat_done
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
-
- stop)
- stat_busy "Stopping $daemon_name daemon"
- PID=$(get_pid)
- [ ! -z "$PID" ] && kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- rm -f $PIDF &>/dev/null
- rm_daemon $daemon_name
- stat_done
- fi
- ;;
-
- restart)
- $0 stop
- [ -n "$DIETIME" ] && sleep $DIETIME
- $0 start
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- ;;
- status)
- stat_busy "Checking $daemon_name status";
- ck_status $daemon_name
- ;;
- *)
- echo "usage: $) {start|stop|restart|status}"
-esac
diff --git a/distro/arch/etc/rc.d/chef-solr b/distro/arch/etc/rc.d/chef-solr
deleted file mode 100644
index 10bd15ea08..0000000000
--- a/distro/arch/etc/rc.d/chef-solr
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-daemon_bin="/usr/bin/chef-solr"
-daemon_name=$(basename $daemon_bin)
-PIDF="/var/run/$daemon_name.pid"
-
-. /etc/rc.conf
-. /etc/rc.d/functions
-. /etc/conf.d/$daemon_name.conf
-
-get_pid() {
- pidof -o %PPID $daemon_name
-}
-
-case "$1" in
- start)
- stat_busy "Starting $daemon_name"
- PID=$(get_pid)
- if [ -z "$PID" ]; then
- [ -f $PIDF ] && rm -f $PIDF
- $daemon_bin -P $PIDF $CHEF_SOLR_ARGS
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- echo $(get_pid) > $PIDF
- add_daemon $daemon_name
- stat_done
- fi
- else
- stat_fail
- exit 1
- fi
- ;;
-
- stop)
- stat_busy "Stopping $daemon_name daemon"
- PID=$(get_pid)
- [ ! -z "$PID" ] && kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- exit 1
- else
- rm -f $PIDF &>/dev/null
- rm_daemon $daemon_name
- stat_done
- fi
- ;;
-
- restart)
- $0 stop
- [ -n "$DIETIME" ] && sleep $DIETIME
- $0 start
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- ;;
- status)
- stat_busy "Checking $daemon_name status";
- ck_status $daemon_name
- ;;
- *)
- echo "usage: $) {start|stop|restart|status}"
-esac
diff --git a/distro/common/html/_sources/ctl_chef_client.txt b/distro/common/html/_sources/ctl_chef_client.txt
index 99b0037154..f0af14e090 100644
--- a/distro/common/html/_sources/ctl_chef_client.txt
+++ b/distro/common/html/_sources/ctl_chef_client.txt
@@ -10,7 +10,7 @@ chef-client
Options
=====================================================
-.. include:: ../../includes_ctl_chef_client/includes_ctl_chef_client_11-8_options.rst
+.. include:: ../../release_chef_12-0/includes_ctl_chef_client_options.rst
Run with Elevated Privileges
=====================================================
diff --git a/distro/common/html/_sources/ctl_chef_server.txt b/distro/common/html/_sources/ctl_chef_server.txt
index bc55662531..a7f6ce81e7 100644
--- a/distro/common/html/_sources/ctl_chef_server.txt
+++ b/distro/common/html/_sources/ctl_chef_server.txt
@@ -1,5 +1,5 @@
=====================================================
-chef-server-ctl
+|chef server ctl| (executable)
=====================================================
.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server.rst
@@ -28,31 +28,25 @@ install
=====================================================
.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_install.rst
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_install_table.rst
-
-master-recover
-=====================================================
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_master_recover.rst
-
-org-associate
-=====================================================
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_associate.rst
-
**Syntax**
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_associate_syntax.rst
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_install_syntax.rst
-**Examples**
-
-.. code-block:: bash
-
- $ chef-server-ctl org-associate prod john_smith
+**Options**
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_install_options.rst
-.. code-block:: bash
+Use Downloads
+-----------------------------------------------------
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_install_features_download.rst
- $ chef-server-ctl org-associate preprod testmaster
+Use Local Packages
+-----------------------------------------------------
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_install_features_manual.rst
+master-recover
+=====================================================
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_master_recover.rst
org-create
=====================================================
@@ -82,7 +76,6 @@ org-create
$ chef-server-ctl org-create dev Development -f /tmp/id-dev.key
-
org-delete
=====================================================
.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_delete.rst
@@ -102,46 +95,71 @@ org-delete
$ chef-server-ctl org-delete pedant-testing-org
+org-list
+=====================================================
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_list.rst
+
+**Syntax**
+
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_list_syntax.rst
-org-disassociate
+**Options**
+
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_list_options.rst
+
+org-show
+=====================================================
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_show.rst
+
+**Syntax**
+
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_show_syntax.rst
+
+org-user-add
=====================================================
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_disassociate.rst
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_user_add.rst
**Syntax**
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_disassociate_syntax.rst
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_user_add_syntax.rst
+
+**Options**
+
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_user_add_options.rst
**Examples**
.. code-block:: bash
- $ chef-server-ctl org-disassociate prod john_smith
+ $ chef-server-ctl org-user-add prod john_smith
+
+.. code-block:: bash
+ $ chef-server-ctl org-user-add preprod testmaster
.. code-block:: bash
- $ chef-server-ctl org-disassociate prod testmaster
+ $ chef-server-ctl org-user-add dev grantmc --admin
-org-list
+org-user-remove
=====================================================
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_list.rst
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_user_remove.rst
**Syntax**
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_list_syntax.rst
+.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_user_remove_syntax.rst
-**Options**
+**Examples**
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_list_options.rst
+.. code-block:: bash
-org-show
-=====================================================
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_show.rst
+ $ chef-server-ctl org-user-remove prod john_smith
-**Syntax**
+.. code-block:: bash
+
+ $ chef-server-ctl org-user-remove prod testmaster
-.. include:: ../../includes_ctl_chef_server/includes_ctl_chef_server_org_show_syntax.rst
password
=====================================================
diff --git a/distro/common/html/_sources/ctl_chef_solo.txt b/distro/common/html/_sources/ctl_chef_solo.txt
index a80c8bad3c..99f7b919de 100644
--- a/distro/common/html/_sources/ctl_chef_solo.txt
+++ b/distro/common/html/_sources/ctl_chef_solo.txt
@@ -8,7 +8,7 @@ chef-solo
Options
=====================================================
-.. include:: ../../includes_ctl_chef_solo/includes_ctl_chef_solo_options.rst
+.. include:: ../../release_chef_12-0/includes_ctl_chef_solo_options.rst
Examples
=====================================================
diff --git a/distro/common/html/_sources/knife_bootstrap.txt b/distro/common/html/_sources/knife_bootstrap.txt
index ee275b58f5..29af753b23 100644
--- a/distro/common/html/_sources/knife_bootstrap.txt
+++ b/distro/common/html/_sources/knife_bootstrap.txt
@@ -16,7 +16,7 @@ Options
=====================================================
.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins.
-.. include:: ../../includes_knife/includes_knife_bootstrap_options.rst
+.. include:: ../../release_chef_12-0/includes_knife_bootstrap_options.rst
Custom Templates
=====================================================
diff --git a/distro/common/html/_sources/knife_cookbook_site.txt b/distro/common/html/_sources/knife_cookbook_site.txt
index 92fadaa819..d1b03f2fa0 100644
--- a/distro/common/html/_sources/knife_cookbook_site.txt
+++ b/distro/common/html/_sources/knife_cookbook_site.txt
@@ -98,7 +98,7 @@ Syntax
Options
-----------------------------------------------------
-.. include:: ../../includes_knife/includes_knife_site_cookbook_share_options.rst
+.. include:: ../../release_chef_12-0/includes_knife_site_cookbook_share_options.rst
Examples
-----------------------------------------------------
diff --git a/distro/common/html/_sources/knife_data_bag.txt b/distro/common/html/_sources/knife_data_bag.txt
index 32888e6f8b..369baab2b7 100644
--- a/distro/common/html/_sources/knife_data_bag.txt
+++ b/distro/common/html/_sources/knife_data_bag.txt
@@ -20,7 +20,7 @@ Syntax
Options
-----------------------------------------------------
-.. include:: ../../includes_knife/includes_knife_data_bag_create_options.rst
+.. include:: ../../release_chef_12-0/includes_knife_data_bag_create_options.rst
Examples
-----------------------------------------------------
@@ -64,7 +64,7 @@ Syntax
Options
-----------------------------------------------------
-.. include:: ../../includes_knife/includes_knife_data_bag_edit_options.rst
+.. include:: ../../release_chef_12-0/includes_knife_data_bag_edit_options.rst
Examples
-----------------------------------------------------
@@ -88,7 +88,7 @@ Syntax
Options
-----------------------------------------------------
-.. include:: ../../includes_knife/includes_knife_data_bag_from_file_options.rst
+.. include:: ../../release_chef_12-0/includes_knife_data_bag_from_file_options.rst
Examples
-----------------------------------------------------
@@ -133,7 +133,7 @@ Syntax
Options
-----------------------------------------------------
-.. include:: ../../includes_knife/includes_knife_data_bag_show_options.rst
+.. include:: ../../release_chef_12-0/includes_knife_data_bag_show_options.rst
Examples
-----------------------------------------------------
diff --git a/distro/common/html/_sources/knife_status.txt b/distro/common/html/_sources/knife_status.txt
index 194b985f67..7f00826b96 100644
--- a/distro/common/html/_sources/knife_status.txt
+++ b/distro/common/html/_sources/knife_status.txt
@@ -12,7 +12,7 @@ Options
=====================================================
.. note:: Review the list of :doc:`common options </knife_common_options>` available to this (and all) |knife| subcommands and plugins.
-.. include:: ../../includes_knife/includes_knife_status_options.rst
+.. include:: ../../release_chef_12-0/includes_knife_status_options.rst
Examples
=====================================================
diff --git a/distro/common/html/ctl_chef_client.html b/distro/common/html/ctl_chef_client.html
index 7bb43d6878..dbdca11487 100644
--- a/distro/common/html/ctl_chef_client.html
+++ b/distro/common/html/ctl_chef_client.html
@@ -71,10 +71,8 @@
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">-A</span></tt>, <tt class="docutils literal"><span class="pre">--fatal-windows-admin-check</span></tt></dt>
<dd>Use to cause a chef-client run to fail when the chef-client does not have administrator privileges in Microsoft Windows.</dd>
-<dt><tt class="docutils literal"><span class="pre">-c</span> <span class="pre">CONFIG</span></tt>, <tt class="docutils literal"><span class="pre">--config</span> <span class="pre">CONFIG</span></tt></dt>
-<dd>The configuration file to use.</dd>
<dt><tt class="docutils literal"><span class="pre">--chef-zero-port</span> <span class="pre">PORT</span></tt></dt>
-<dd>The port on which chef-zero will listen.</dd>
+<dd>The port on which chef-zero will listen. If a port is not specified&#8212;individually, as range of ports, or from the <tt class="docutils literal"><span class="pre">chef_zero.port</span></tt> setting in the client.rb file&#8212;the chef-client will scan for ports between 8889-9999 and will pick the first port that is available.</dd>
<dt><tt class="docutils literal"><span class="pre">-F</span> <span class="pre">FORMAT</span></tt>, <tt class="docutils literal"><span class="pre">--format</span> <span class="pre">FORMAT</span></tt></dt>
<dd><p class="first">The output format: <tt class="docutils literal"><span class="pre">doc</span></tt> (default) or <tt class="docutils literal"><span class="pre">min</span></tt>.</p>
<p>Use <tt class="docutils literal"><span class="pre">doc</span></tt> to print the progress of the chef-client run using full strings that display a summary of updates as they occur.</p>
@@ -90,9 +88,53 @@
<dt><tt class="docutils literal"><span class="pre">-h</span></tt>, <tt class="docutils literal"><span class="pre">--help</span></tt></dt>
<dd>Shows help for the command.</dd>
<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--interval</span> <span class="pre">SECONDS</span></tt></dt>
-<dd>The frequency (in seconds) at which the chef-client runs. Default value: <tt class="docutils literal"><span class="pre">1800</span></tt>.</dd>
+<dd>The frequency (in seconds) at which the chef-client runs. When the chef-client is run at intervals, <tt class="docutils literal"><span class="pre">--splay</span></tt> and <tt class="docutils literal"><span class="pre">--interval</span></tt> values are applied before the chef-client run. Default value: <tt class="docutils literal"><span class="pre">1800</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">PATH</span></tt></dt>
-<dd>The path to a file that contains JSON data.</dd>
+<dd><p class="first">The path to a file that contains JSON data.</p>
+<p>Use this option to define a <tt class="docutils literal"><span class="pre">run_list</span></tt> object. For example, a JSON file similar to:</p>
+<div class="highlight-javascript"><div class="highlight"><pre><span class="s2">&quot;run_list&quot;</span><span class="o">:</span> <span class="p">[</span>
+ <span class="s2">&quot;recipe[base]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;recipe[foo]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;recipe[bar]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;role[webserver]&quot;</span>
+<span class="p">],</span>
+</pre></div>
+</div>
+<p>may be used by running <tt class="docutils literal"><span class="pre">chef-client</span> <span class="pre">-j</span> <span class="pre">path/to/file.json</span></tt>.</p>
+<p>In certain situations this option may be used to update <tt class="docutils literal"><span class="pre">normal</span></tt> attributes.</p>
+<div class="last admonition warning">
+<p class="first admonition-title">Warning</p>
+<p>Any other attribute type that is contained in this JSON file will be treated as a <tt class="docutils literal"><span class="pre">normal</span></tt> attribute. For example, attempting to update <tt class="docutils literal"><span class="pre">override</span></tt> attributes using the <tt class="docutils literal"><span class="pre">-j</span></tt> option:</p>
+<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;Install some stuff&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;override_attributes&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;apptastic&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;enable_apptastic&quot;</span><span class="o">:</span> <span class="s2">&quot;false&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;apptastic_tier_name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99.bomb.com&quot;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>will result in a node object similar to:</p>
+<div class="last highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;maybe-dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;normal&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;Install some stuff&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;override_attributes&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;apptastic&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;enable_apptastic&quot;</span><span class="o">:</span> <span class="s2">&quot;false&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;apptastic_tier_name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99.bomb.com&quot;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+</dd>
<dt><tt class="docutils literal"><span class="pre">-k</span> <span class="pre">KEY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--client_key</span> <span class="pre">KEY_FILE</span></tt></dt>
<dd>The location of the file which contains the client key. Default value: <tt class="docutils literal"><span class="pre">/etc/chef/client.pem</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">-K</span> <span class="pre">KEY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--validation_key</span> <span class="pre">KEY_FILE</span></tt></dt>
@@ -106,15 +148,21 @@
<dt><tt class="docutils literal"><span class="pre">-N</span> <span class="pre">NODE_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--node-name</span> <span class="pre">NODE_NAME</span></tt></dt>
<dd>The name of the node.</dd>
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">RUN_LIST_ITEM</span></tt>, <tt class="docutils literal"><span class="pre">--override-runlist</span> <span class="pre">RUN_LIST_ITEM</span></tt></dt>
-<dd>Replace the current run list with the specified items.</dd>
+<dd>Replace the current run list with the specified items. This option will not clear the list of cookbooks (and related files) that is cached on the node.</dd>
<dt><tt class="docutils literal"><span class="pre">--once</span></tt></dt>
<dd>Use to run the chef-client only once and to cancel <tt class="docutils literal"><span class="pre">interval</span></tt> and <tt class="docutils literal"><span class="pre">splay</span></tt> options.</dd>
<dt><tt class="docutils literal"><span class="pre">-P</span> <span class="pre">PID_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--pid</span> <span class="pre">PID_FILE</span></tt></dt>
<dd>The location in which a process identification number (pid) is saved. An executable, when started as a daemon, will write the pid to the specified file. Default value: <tt class="docutils literal"><span class="pre">/tmp/name-of-executable.pid</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">RUN_LIST_ITEM</span></tt>, <tt class="docutils literal"><span class="pre">--runlist</span> <span class="pre">RUN_LIST_ITEM</span></tt></dt>
+<dd>Use to permanently replace the current run-list with the specified run-list items.</dd>
<dt><tt class="docutils literal"><span class="pre">-R</span></tt>, <tt class="docutils literal"><span class="pre">--enable-reporting</span></tt></dt>
<dd>Use to enable Chef reporting, which performs data collection during a chef-client run.</dd>
+<dt><tt class="docutils literal"><span class="pre">RECIPE_FILE</span></tt></dt>
+<dd>The path to a recipe. For example, if a recipe file is in the current directory, use <tt class="docutils literal"><span class="pre">recipe_file.rb</span></tt>. This is typically used with the <tt class="docutils literal"><span class="pre">--local-mode</span></tt> option.</dd>
+<dt><tt class="docutils literal"><span class="pre">--run-lock-timeout</span> <span class="pre">SECONDS</span></tt></dt>
+<dd>The amount of time (in seconds) to wait for a chef-client run to finish. Default value: not set (indefinite). Set to <tt class="docutils literal"><span class="pre">0</span></tt> to cause a second chef-client to exit immediately.</dd>
<dt><tt class="docutils literal"><span class="pre">-s</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--splay</span> <span class="pre">SECONDS</span></tt></dt>
-<dd>A number (in seconds) to add to the <tt class="docutils literal"><span class="pre">interval</span></tt> that is used to determine the frequency of chef-client runs. This number can help prevent server load when there are many clients running at the same time.</dd>
+<dd>A number (in seconds) to add to the <tt class="docutils literal"><span class="pre">interval</span></tt> that is used to determine the frequency of chef-client runs. This number can help prevent server load when there are many clients running at the same time. When the chef-client is run at intervals, <tt class="docutils literal"><span class="pre">--splay</span></tt> and <tt class="docutils literal"><span class="pre">--interval</span></tt> values are applied before the chef-client run.</dd>
<dt><tt class="docutils literal"><span class="pre">-S</span> <span class="pre">CHEF_SERVER_URL</span></tt>, <tt class="docutils literal"><span class="pre">--server</span> <span class="pre">CHEF_SERVER_URL</span></tt></dt>
<dd>The URL for the Chef server.</dd>
<dt><tt class="docutils literal"><span class="pre">-u</span> <span class="pre">USER</span></tt>, <tt class="docutils literal"><span class="pre">--user</span> <span class="pre">USER</span></tt></dt>
diff --git a/distro/common/html/ctl_chef_server.html b/distro/common/html/ctl_chef_server.html
index 8c68c21cd0..c5bc97af08 100644
--- a/distro/common/html/ctl_chef_server.html
+++ b/distro/common/html/ctl_chef_server.html
@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>chef-server-ctl &mdash; chef-client Man Pages</title>
+ <title>chef-server-ctl (executable) &mdash; chef-client Man Pages</title>
<link rel="stylesheet" href="_static/guide.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -39,8 +39,8 @@
<div class="body">
- <div class="section" id="chef-server-ctl">
-<h1>chef-server-ctl<a class="headerlink" href="#chef-server-ctl" title="Permalink to this headline">¶</a></h1>
+ <div class="section" id="chef-server-ctl-executable">
+<h1>chef-server-ctl (executable)<a class="headerlink" href="#chef-server-ctl-executable" title="Permalink to this headline">¶</a></h1>
<p>The Chef server includes a command-line utility named chef-server-ctl. This command-line tool is used to start and stop individual services, reconfigure the Chef server, run chef-pedant, and then tail Chef server log files.</p>
<div class="section" id="backup-recover">
<h2>backup-recover<a class="headerlink" href="#backup-recover" title="Permalink to this headline">¶</a></h2>
@@ -132,11 +132,21 @@
<div class="section" id="install">
<h2>install<a class="headerlink" href="#install" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">install</span></tt> subcommand is used to install premium features of the Chef server: Chef management console, Chef analytics, chef-client run reporting, high availability configurations, Chef push jobs, and Chef server replication.</p>
+<p><strong>Syntax</strong></p>
<p>This subcommand has the following syntax:</p>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl install name_of_premium_feature
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl install name_of_premium_feature <span class="o">(</span>options<span class="o">)</span>
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">name_of_premium_feature</span></tt> represents the command line value associated with the premium feature:</p>
+<p><strong>Options</strong></p>
+<p>This subcommand has the following options:</p>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">--path</span> <span class="pre">PATH</span></tt></dt>
+<dd>Use to specify the location of a package. This option is not required when packages are downloaded from <a class="reference external" href="https://packagecloud.io/">https://packagecloud.io/</a>.</dd>
+</dl>
+<div class="section" id="use-downloads">
+<h3>Use Downloads<a class="headerlink" href="#use-downloads" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">install</span></tt> subcommand downloads packages from <a class="reference external" href="https://packagecloud.io/">https://packagecloud.io/</a> by default. For systems that are not behind a firewall (and have connectivity to <a class="reference external" href="https://packagecloud.io/">https://packagecloud.io/</a>), these packages can be installed as described below.</p>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
@@ -150,12 +160,16 @@
<tbody valign="top">
<tr class="row-even"><td>Chef Manage</td>
<td><p class="first">Use Chef management console to manage data bags, attributes, run-lists, roles, environments, and cookbooks from a web user interface.</p>
-<p>Run:</p>
+<p>(Front end machines only.) Run:</p>
<div class="highlight-ruby"><div class="highlight"><pre>$ chef-server-ctl install opscode-manage
</pre></div>
</div>
+<p>then:</p>
+<div class="highlight-ruby"><div class="highlight"><pre>$ opscode-manage-ctl reconfigure
+</pre></div>
+</div>
<p>and then:</p>
-<div class="last highlight-ruby"><div class="highlight"><pre>$ opscode-manage-ctl reconfigure
+<div class="last highlight-ruby"><div class="highlight"><pre>$ chef-server-ctl reconfigure
</pre></div>
</div>
</td>
@@ -166,8 +180,12 @@
<div class="highlight-ruby"><div class="highlight"><pre>$ chef-server-ctl install opscode-push-jobs-server
</pre></div>
</div>
+<p>then:</p>
+<div class="highlight-ruby"><div class="highlight"><pre>$ opscode-push-jobs-server-ctl reconfigure
+</pre></div>
+</div>
<p>and then:</p>
-<div class="last highlight-ruby"><div class="highlight"><pre>$ opscode-push-jobs-server-ctl reconfigure
+<div class="last highlight-ruby"><div class="highlight"><pre>$ chef-server-ctl reconfigure
</pre></div>
</div>
</td>
@@ -190,12 +208,16 @@
</tr>
<tr class="row-odd"><td>Reporting</td>
<td><p class="first">Use Chef reporting to keep track of what happens during every chef-client runs across all of the infrastructure being managed by Chef. Run Chef reporting with Chef management console to view reports from a web user interface.</p>
-<p>Run:</p>
+<p>(Front end machines only.) Run:</p>
<div class="highlight-ruby"><div class="highlight"><pre>$ chef-server-ctl install opscode-reporting
</pre></div>
</div>
+<p>then:</p>
+<div class="highlight-ruby"><div class="highlight"><pre>$ opscode-reporting-ctl reconfigure
+</pre></div>
+</div>
<p>and then:</p>
-<div class="last highlight-ruby"><div class="highlight"><pre>$ opscode-reporting-ctl reconfigure
+<div class="last highlight-ruby"><div class="highlight"><pre>$ chef-server-ctl reconfigure
</pre></div>
</div>
</td>
@@ -203,27 +225,23 @@
</tbody>
</table>
</div>
-<div class="section" id="master-recover">
-<h2>master-recover<a class="headerlink" href="#master-recover" title="Permalink to this headline">¶</a></h2>
-<p>The <tt class="docutils literal"><span class="pre">master-recover</span></tt> subcommand is used to force the Chef server to attempt to become the master server. This command is typically run in tandem with the <tt class="docutils literal"><span class="pre">backup-recover</span></tt> subcommand on the back-end peer, unless the back-end peer is no longer available.</p>
-<p>This subcommand has the following syntax:</p>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl master-recover
+<div class="section" id="use-local-packages">
+<h3>Use Local Packages<a class="headerlink" href="#use-local-packages" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">install</span></tt> subcommand downloads packages from <a class="reference external" href="https://packagecloud.io/">https://packagecloud.io/</a> by default. For systems that are behind a firewall (and do not have connectivity to <a class="reference external" href="https://packagecloud.io/">https://packagecloud.io/</a>), these packages can be installed manually. First download the package that is appropriate for the platform and save it to a local path. Then run the <tt class="docutils literal"><span class="pre">install</span></tt> command using the <tt class="docutils literal"><span class="pre">--path</span></tt> option to specify the location for the package:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl install NAME_OF_PACKAGE --path /path/to/package
</pre></div>
</div>
-</div>
-<div class="section" id="org-associate">
-<h2>org-associate<a class="headerlink" href="#org-associate" title="Permalink to this headline">¶</a></h2>
-<p>The <tt class="docutils literal"><span class="pre">org-associate</span></tt> subcommand is used to associate a user to an organization.</p>
-<p><strong>Syntax</strong></p>
-<p>This subcommand has the following syntax:</p>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-associate ORG_NAME USER_NAME
+<p>For example:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl install opscode-manage-1.6.2-1.el6.x86_64 --path /home/vagrant
</pre></div>
</div>
-<p><strong>Examples</strong></p>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-associate prod john_smith
-</pre></div>
</div>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-associate preprod testmaster
+</div>
+<div class="section" id="master-recover">
+<h2>master-recover<a class="headerlink" href="#master-recover" title="Permalink to this headline">¶</a></h2>
+<p>The <tt class="docutils literal"><span class="pre">master-recover</span></tt> subcommand is used to force the Chef server to attempt to become the master server. This command is typically run in tandem with the <tt class="docutils literal"><span class="pre">backup-recover</span></tt> subcommand on the back-end peer, unless the back-end peer is no longer available.</p>
+<p>This subcommand has the following syntax:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl master-recover
</pre></div>
</div>
</div>
@@ -270,22 +288,6 @@
</pre></div>
</div>
</div>
-<div class="section" id="org-disassociate">
-<h2>org-disassociate<a class="headerlink" href="#org-disassociate" title="Permalink to this headline">¶</a></h2>
-<p>The <tt class="docutils literal"><span class="pre">org-disassociate</span></tt> subcommand is used to disassociate a user from an organization.</p>
-<p><strong>Syntax</strong></p>
-<p>This subcommand has the following syntax:</p>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-disassociate ORG_NAME USER_NAME
-</pre></div>
-</div>
-<p><strong>Examples</strong></p>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-disassociate prod john_smith
-</pre></div>
-</div>
-<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-disassociate prod testmaster
-</pre></div>
-</div>
-</div>
<div class="section" id="org-list">
<h2>org-list<a class="headerlink" href="#org-list" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="docutils literal"><span class="pre">org-list</span></tt> subcommand is used to list all of the organizations currently present on the Chef server.</p>
@@ -312,6 +314,47 @@
</pre></div>
</div>
</div>
+<div class="section" id="org-user-add">
+<h2>org-user-add<a class="headerlink" href="#org-user-add" title="Permalink to this headline">¶</a></h2>
+<p>The <tt class="docutils literal"><span class="pre">org-user-add</span></tt> subcommand is used to add a user to an organization.</p>
+<p><strong>Syntax</strong></p>
+<p>This subcommand has the following syntax:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-user-add ORG_NAME USER_NAME <span class="o">(</span>options<span class="o">)</span>
+</pre></div>
+</div>
+<p><strong>Options</strong></p>
+<p>This subcommand has the following options:</p>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">--admin</span></tt></dt>
+<dd>Use to add the user to the <tt class="docutils literal"><span class="pre">admins</span></tt> group.</dd>
+</dl>
+<p><strong>Examples</strong></p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-user-add prod john_smith
+</pre></div>
+</div>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-user-add preprod testmaster
+</pre></div>
+</div>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-user-add dev grantmc --admin
+</pre></div>
+</div>
+</div>
+<div class="section" id="org-user-remove">
+<h2>org-user-remove<a class="headerlink" href="#org-user-remove" title="Permalink to this headline">¶</a></h2>
+<p>The <tt class="docutils literal"><span class="pre">org-user-remove</span></tt> subcommand is used to remove a user from an organization.</p>
+<p><strong>Syntax</strong></p>
+<p>This subcommand has the following syntax:</p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-user-remove ORG_NAME USER_NAME
+</pre></div>
+</div>
+<p><strong>Examples</strong></p>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-user-remove prod john_smith
+</pre></div>
+</div>
+<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>chef-server-ctl org-user-remove prod testmaster
+</pre></div>
+</div>
+</div>
<div class="section" id="password">
<h2>password<a class="headerlink" href="#password" title="Permalink to this headline">¶</a></h2>
<div class="admonition warning">
diff --git a/distro/common/html/ctl_chef_shell.html b/distro/common/html/ctl_chef_shell.html
index b3ae1742f8..e655ec9146 100644
--- a/distro/common/html/ctl_chef_shell.html
+++ b/distro/common/html/ctl_chef_shell.html
@@ -88,7 +88,51 @@
<dt><tt class="docutils literal"><span class="pre">-h</span></tt>, <tt class="docutils literal"><span class="pre">--help</span></tt></dt>
<dd>Shows help for the command.</dd>
<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">PATH</span></tt></dt>
-<dd>The path to a file that contains JSON data.</dd>
+<dd><p class="first">The path to a file that contains JSON data.</p>
+<p>Use this option to define a <tt class="docutils literal"><span class="pre">run_list</span></tt> object. For example, a JSON file similar to:</p>
+<div class="highlight-javascript"><div class="highlight"><pre><span class="s2">&quot;run_list&quot;</span><span class="o">:</span> <span class="p">[</span>
+ <span class="s2">&quot;recipe[base]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;recipe[foo]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;recipe[bar]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;role[webserver]&quot;</span>
+<span class="p">],</span>
+</pre></div>
+</div>
+<p>may be used by running <tt class="docutils literal"><span class="pre">chef-client</span> <span class="pre">-j</span> <span class="pre">path/to/file.json</span></tt>.</p>
+<p>In certain situations this option may be used to update <tt class="docutils literal"><span class="pre">normal</span></tt> attributes.</p>
+<div class="last admonition warning">
+<p class="first admonition-title">Warning</p>
+<p>Any other attribute type that is contained in this JSON file will be treated as a <tt class="docutils literal"><span class="pre">normal</span></tt> attribute. For example, attempting to update <tt class="docutils literal"><span class="pre">override</span></tt> attributes using the <tt class="docutils literal"><span class="pre">-j</span></tt> option:</p>
+<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;Install some stuff&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;override_attributes&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;apptastic&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;enable_apptastic&quot;</span><span class="o">:</span> <span class="s2">&quot;false&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;apptastic_tier_name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99.bomb.com&quot;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>will result in a node object similar to:</p>
+<div class="last highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;maybe-dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;normal&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;Install some stuff&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;override_attributes&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;apptastic&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;enable_apptastic&quot;</span><span class="o">:</span> <span class="s2">&quot;false&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;apptastic_tier_name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99.bomb.com&quot;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+</dd>
<dt><tt class="docutils literal"><span class="pre">-l</span> <span class="pre">LEVEL</span></tt>, <tt class="docutils literal"><span class="pre">--log-level</span> <span class="pre">LEVEL</span></tt></dt>
<dd>The level of logging that will be stored in a log file.</dd>
<dt><tt class="docutils literal"><span class="pre">-s</span></tt>, <tt class="docutils literal"><span class="pre">--solo</span></tt></dt>
diff --git a/distro/common/html/ctl_chef_solo.html b/distro/common/html/ctl_chef_solo.html
index f32136e7c4..2382fed80a 100644
--- a/distro/common/html/ctl_chef_solo.html
+++ b/distro/common/html/ctl_chef_solo.html
@@ -66,11 +66,13 @@
<dt><tt class="docutils literal"><span class="pre">-c</span> <span class="pre">CONFIG</span></tt>, <tt class="docutils literal"><span class="pre">--config</span> <span class="pre">CONFIG</span></tt></dt>
<dd>The configuration file to use.</dd>
<dt><tt class="docutils literal"><span class="pre">-d</span></tt>, <tt class="docutils literal"><span class="pre">--daemonize</span></tt></dt>
-<dd>Use to run the executable as a daemon. This option is only available on machines that run in UNIX or Linux environments. For machines that are running Microsoft Windows that require similar functionality, use the <tt class="docutils literal"><span class="pre">chef-client::service</span></tt> recipe in the <tt class="docutils literal"><span class="pre">chef-client</span></tt> cookbook: <a class="reference external" href="http://community.opscode.com/cookbooks/chef-client">http://community.opscode.com/cookbooks/chef-client</a>. This will install a chef-client service under Microsoft Windows using the Windows Service Wrapper.</dd>
+<dd><p class="first">Use to run the executable as a daemon. This option may not be used in the same command with the <tt class="docutils literal"><span class="pre">--[no-]fork</span></tt> option.</p>
+<p class="last">This option is only available on machines that run in UNIX or Linux environments. For machines that are running Microsoft Windows that require similar functionality, use the <tt class="docutils literal"><span class="pre">chef-client::service</span></tt> recipe in the <tt class="docutils literal"><span class="pre">chef-client</span></tt> cookbook: <a class="reference external" href="http://community.opscode.com/cookbooks/chef-client">http://community.opscode.com/cookbooks/chef-client</a>. This will install a chef-client service under Microsoft Windows using the Windows Service Wrapper.</p>
+</dd>
<dt><tt class="docutils literal"><span class="pre">-E</span> <span class="pre">ENVIRONMENT_NAME</span></tt>, <tt class="docutils literal"><span class="pre">--environment</span> <span class="pre">ENVIRONMENT_NAME</span></tt></dt>
<dd>The name of the environment.</dd>
<dt><tt class="docutils literal"><span class="pre">-f</span></tt>, <tt class="docutils literal"><span class="pre">--[no-]fork</span></tt></dt>
-<dd>Use to contain the chef-client run in a secondary process with dedicated RAM. When the chef-client run is complete the RAM will be returned to the master process. This option helps ensure that a chef-client will use a steady amount of RAM over time because the master process will not run recipes. This option will also help prevent memory leaks (such as those that can be introduced by the code contained within a poorly designed cookbook). Use <tt class="docutils literal"><span class="pre">--no-fork</span></tt> to disable running the chef-client in fork node. Default value: <tt class="docutils literal"><span class="pre">--fork</span></tt>.</dd>
+<dd>Use to contain the chef-client run in a secondary process with dedicated RAM. When the chef-client run is complete the RAM will be returned to the master process. This option helps ensure that a chef-client will use a steady amount of RAM over time because the master process will not run recipes. This option will also help prevent memory leaks (such as those that can be introduced by the code contained within a poorly designed cookbook). Use <tt class="docutils literal"><span class="pre">--no-fork</span></tt> to disable running the chef-client in fork node. Default value: <tt class="docutils literal"><span class="pre">--fork</span></tt>. This option may not be used in the same command with the <tt class="docutils literal"><span class="pre">--daemonize</span></tt> and <tt class="docutils literal"><span class="pre">--interval</span></tt> options.</dd>
<dt><tt class="docutils literal"><span class="pre">-F</span> <span class="pre">FORMAT</span></tt>, <tt class="docutils literal"><span class="pre">--format</span> <span class="pre">FORMAT</span></tt></dt>
<dd><p class="first">The output format: <tt class="docutils literal"><span class="pre">doc</span></tt> (default) or <tt class="docutils literal"><span class="pre">min</span></tt>.</p>
<p>Use <tt class="docutils literal"><span class="pre">doc</span></tt> to print the progress of the chef-client run using full strings that display a summary of updates as they occur.</p>
@@ -86,9 +88,53 @@
<dt><tt class="docutils literal"><span class="pre">-h</span></tt>, <tt class="docutils literal"><span class="pre">--help</span></tt></dt>
<dd>Shows help for the command.</dd>
<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--interval</span> <span class="pre">SECONDS</span></tt></dt>
-<dd>The frequency (in seconds) at which the chef-client runs.</dd>
+<dd>The frequency (in seconds) at which the chef-client runs. When the chef-client is run at intervals, <tt class="docutils literal"><span class="pre">--splay</span></tt> and <tt class="docutils literal"><span class="pre">--interval</span></tt> values are applied before the chef-client run. This option may not be used in the same command with the <tt class="docutils literal"><span class="pre">--[no-]fork</span></tt> option.</dd>
<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">PATH</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">PATH</span></tt></dt>
-<dd>The path to a file that contains JSON data. Use this option to override <tt class="docutils literal"><span class="pre">normal</span></tt> attributes set elsewhere.</dd>
+<dd><p class="first">The path to a file that contains JSON data.</p>
+<p>Use this option to define a <tt class="docutils literal"><span class="pre">run_list</span></tt> object. For example, a JSON file similar to:</p>
+<div class="highlight-javascript"><div class="highlight"><pre><span class="s2">&quot;run_list&quot;</span><span class="o">:</span> <span class="p">[</span>
+ <span class="s2">&quot;recipe[base]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;recipe[foo]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;recipe[bar]&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;role[webserver]&quot;</span>
+<span class="p">],</span>
+</pre></div>
+</div>
+<p>may be used by running <tt class="docutils literal"><span class="pre">chef-client</span> <span class="pre">-j</span> <span class="pre">path/to/file.json</span></tt>.</p>
+<p>In certain situations this option may be used to update <tt class="docutils literal"><span class="pre">normal</span></tt> attributes.</p>
+<div class="last admonition warning">
+<p class="first admonition-title">Warning</p>
+<p>Any other attribute type that is contained in this JSON file will be treated as a <tt class="docutils literal"><span class="pre">normal</span></tt> attribute. For example, attempting to update <tt class="docutils literal"><span class="pre">override</span></tt> attributes using the <tt class="docutils literal"><span class="pre">-j</span></tt> option:</p>
+<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;Install some stuff&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;override_attributes&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;apptastic&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;enable_apptastic&quot;</span><span class="o">:</span> <span class="s2">&quot;false&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;apptastic_tier_name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99.bomb.com&quot;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>will result in a node object similar to:</p>
+<div class="last highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;maybe-dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;normal&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;Install some stuff&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;override_attributes&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;apptastic&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="s2">&quot;enable_apptastic&quot;</span><span class="o">:</span> <span class="s2">&quot;false&quot;</span><span class="p">,</span>
+ <span class="s2">&quot;apptastic_tier_name&quot;</span><span class="o">:</span> <span class="s2">&quot;dev-99.bomb.com&quot;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+</dd>
<dt><tt class="docutils literal"><span class="pre">-l</span> <span class="pre">LEVEL</span></tt>, <tt class="docutils literal"><span class="pre">--log_level</span> <span class="pre">LEVEL</span></tt></dt>
<dd>The level of logging that will be stored in a log file.</dd>
<dt><tt class="docutils literal"><span class="pre">-L</span> <span class="pre">LOGLOCATION</span></tt>, <tt class="docutils literal"><span class="pre">--logfile</span> <span class="pre">c</span></tt></dt>
@@ -104,7 +150,7 @@
<dt><tt class="docutils literal"><span class="pre">--run-lock-timeout</span> <span class="pre">SECONDS</span></tt></dt>
<dd>The amount of time (in seconds) to wait for a chef-client run to finish. Default value: not set (indefinite). Set to <tt class="docutils literal"><span class="pre">0</span></tt> to cause a second chef-client to exit immediately.</dd>
<dt><tt class="docutils literal"><span class="pre">-s</span> <span class="pre">SECONDS</span></tt>, <tt class="docutils literal"><span class="pre">--splay</span> <span class="pre">SECONDS</span></tt></dt>
-<dd>A number (in seconds) to add to the <tt class="docutils literal"><span class="pre">interval</span></tt> that is used to determine the frequency of chef-client runs. This number can help prevent server load when there are many clients running at the same time.</dd>
+<dd>A number (in seconds) to add to the <tt class="docutils literal"><span class="pre">interval</span></tt> that is used to determine the frequency of chef-client runs. This number can help prevent server load when there are many clients running at the same time. When the chef-client is run at intervals, <tt class="docutils literal"><span class="pre">--splay</span></tt> and <tt class="docutils literal"><span class="pre">--interval</span></tt> values are applied before the chef-client run.</dd>
<dt><tt class="docutils literal"><span class="pre">-u</span> <span class="pre">USER</span></tt>, <tt class="docutils literal"><span class="pre">--user</span> <span class="pre">USER</span></tt></dt>
<dd>The user that owns a process. This is required when starting any executable as a daemon.</dd>
<dt><tt class="docutils literal"><span class="pre">-v</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt></dt>
diff --git a/distro/common/html/index.html b/distro/common/html/index.html
index 370c34f5f5..2742b07e03 100644
--- a/distro/common/html/index.html
+++ b/distro/common/html/index.html
@@ -44,7 +44,7 @@
<p>The following command line interfaces are available in the chef-client:</p>
<ul class="simple">
<li><a class="reference internal" href="ctl_chef_client.html"><em>chef-client</em></a></li>
-<li><a class="reference internal" href="ctl_chef_server.html"><em>chef-server-ctl</em></a></li>
+<li><a class="reference internal" href="ctl_chef_server.html"><em>chef-server-ctl (executable)</em></a></li>
<li><a class="reference internal" href="ctl_chef_shell.html"><em>chef-shell</em></a></li>
<li><a class="reference internal" href="ctl_chef_solo.html"><em>chef-solo</em></a></li>
<li><a class="reference internal" href="knife.html"><em>knife</em></a></li>
@@ -128,7 +128,7 @@
<td>The <strong>knife node</strong> subcommand is used to manage the nodes that exist on a Chef server.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="knife_raw.html"><em>knife raw</em></a></td>
-<td>The <strong>knife raw</strong> subcommand is used to send a REST request to a specified path using the Chef server API.</td>
+<td>The <strong>knife raw</strong> subcommand is used to send a REST request to an endpoint in the Chef server API.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="knife_recipe_list.html"><em>knife recipe list</em></a></td>
<td>The <strong>knife recipe list</strong> subcommand is used to view all of the recipes that are on a Chef server. A regular expression can be used to limit the results to recipes that match a specific pattern. The regular expression must be within quotes and not be surrounded by forward slashes (/).</td>
diff --git a/distro/common/html/knife.html b/distro/common/html/knife.html
index 140edc125b..5a081702fc 100644
--- a/distro/common/html/knife.html
+++ b/distro/common/html/knife.html
@@ -118,7 +118,7 @@
<td>The <strong>knife node</strong> subcommand is used to manage the nodes that exist on a Chef server.</td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="knife_raw.html"><em>knife raw</em></a></td>
-<td>The <strong>knife raw</strong> subcommand is used to send a REST request to a specified path using the Chef server API.</td>
+<td>The <strong>knife raw</strong> subcommand is used to send a REST request to an endpoint in the Chef server API.</td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="knife_recipe_list.html"><em>knife recipe list</em></a></td>
<td>The <strong>knife recipe list</strong> subcommand is used to view all of the recipes that are on a Chef server. A regular expression can be used to limit the results to recipes that match a specific pattern. The regular expression must be within quotes and not be surrounded by forward slashes (/).</td>
diff --git a/distro/common/html/knife_bootstrap.html b/distro/common/html/knife_bootstrap.html
index ea1a1cf153..5e3d70404f 100644
--- a/distro/common/html/knife_bootstrap.html
+++ b/distro/common/html/knife_bootstrap.html
@@ -83,19 +83,31 @@
<dd>The version of the chef-client to install.</dd>
<dt><tt class="docutils literal"><span class="pre">--bootstrap-wget-options</span> <span class="pre">OPTIONS</span></tt></dt>
<dd>Use to specify arbitrary options to be added to the bootstrap command when using GNU Wget. This option may not be used in the same command with <tt class="docutils literal"><span class="pre">--bootstrap-install-command</span></tt>.</dd>
-<dt><tt class="docutils literal"><span class="pre">-d</span> <span class="pre">DISTRO</span></tt>, <tt class="docutils literal"><span class="pre">--distro</span> <span class="pre">DISTRO</span></tt></dt>
-<dd><p class="first">The template file to be used during a bootstrap operation. The following distributions are supported: <tt class="docutils literal"><span class="pre">chef-full</span></tt> (the default bootstrap), <tt class="docutils literal"><span class="pre">centos5-gems</span></tt>, <tt class="docutils literal"><span class="pre">fedora13-gems</span></tt>, <tt class="docutils literal"><span class="pre">ubuntu10.04-gems</span></tt>, <tt class="docutils literal"><span class="pre">ubuntu10.04-apt</span></tt>, <tt class="docutils literal"><span class="pre">ubuntu12.04-gems</span></tt>, and the name of a custom bootstrap template file. When this option is used, knife will search for the template file in the following order: the <tt class="docutils literal"><span class="pre">bootstrap/</span></tt> folder in the current working directory, the <tt class="docutils literal"><span class="pre">bootstrap/</span></tt> folder in the chef-repo, the <tt class="docutils literal"><span class="pre">bootstrap/</span></tt> folder in the <tt class="docutils literal"><span class="pre">~/.chef/</span></tt> directory, or a default bootstrap file. Do not use the <tt class="docutils literal"><span class="pre">--template-file</span></tt> option when <tt class="docutils literal"><span class="pre">--distro</span></tt> is specified.</p>
-<div class="last admonition warning">
-<p class="first admonition-title">Warning</p>
-<p class="last">The default bootstrap operation uses the omnibus installer, which means the default template file (<tt class="docutils literal"><span class="pre">chef-full</span></tt>) should work on all supported platforms. It is recommended to use custom bootstrap templates only when the omnibus installer cannot be used. The <tt class="docutils literal"><span class="pre">.erb</span></tt> file extension is added automatically and should not be passed as part of the bootstrap command.</p>
-</div>
-</dd>
<dt><tt class="docutils literal"><span class="pre">-E</span> <span class="pre">ENVIRONMENT</span></tt>, <tt class="docutils literal"><span class="pre">--environment</span> <span class="pre">ENVIRONMENT</span></tt></dt>
<dd>The name of the environment. When this option is added to a command, the command will run only against the named environment.</dd>
<dt><tt class="docutils literal"><span class="pre">-G</span> <span class="pre">GATEWAY</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-gateway</span> <span class="pre">GATEWAY</span></tt></dt>
<dd>The SSH tunnel or gateway that is used to run a bootstrap action on a machine that is not accessible from the workstation.</dd>
<dt><tt class="docutils literal"><span class="pre">--hint</span> <span class="pre">HINT_NAME[=HINT_FILE]</span></tt></dt>
-<dd>An Ohai hint to be set on the target of the bootstrap. The hint is contained in a file and is formatted as JSON: <tt class="docutils literal"><span class="pre">{&quot;attribute&quot;:&quot;value&quot;,&quot;attribute&quot;:&quot;value&quot;...}</span></tt>. <tt class="docutils literal"><span class="pre">HINT_NAME</span></tt> is the name of the hint and <tt class="docutils literal"><span class="pre">HINT_FILE</span></tt> is the name of the hint file located at <tt class="docutils literal"><span class="pre">/etc/chef/ohai/hints/HINT_FILE.json</span></tt>. Use multiple <tt class="docutils literal"><span class="pre">--hint</span></tt> options in the command to specify multiple hints.</dd>
+<dd><p class="first">Use to specify an Ohai hint to be set on the target node.</p>
+<p>Ohai hints are used to tell Ohai something about the system that it is running on that it would not be able to discover itself. An Ohai hint exists if a JSON file exists in the hint directory with the same name as the hint. For example, calling <tt class="docutils literal"><span class="pre">hint?('antartica')</span></tt> in an Ohai plugin would return an empty hash if the file <tt class="docutils literal"><span class="pre">antartica.json</span></tt> existed in the hints directory, and return nil if the file does not exist.</p>
+<p>If the hint file contains JSON content, it will be returned as a hash from the call to <tt class="docutils literal"><span class="pre">hint?</span></tt>.</p>
+<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
+ <span class="s2">&quot;snow&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
+ <span class="s2">&quot;penguins&quot;</span><span class="o">:</span> <span class="s2">&quot;many&quot;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<div class="highlight-ruby"><div class="highlight"><pre><span class="n">arctic_hint</span> <span class="o">=</span> <span class="n">hint?</span><span class="p">(</span><span class="s1">&#39;antartica&#39;</span><span class="p">)</span>
+<span class="k">if</span> <span class="n">arctic_hint</span><span class="o">[</span><span class="s1">&#39;snow&#39;</span><span class="o">]</span>
+ <span class="s2">&quot;There are </span><span class="si">#{</span><span class="n">arctic_hint</span><span class="o">[</span><span class="s1">&#39;penguins&#39;</span><span class="o">]</span><span class="si">}</span><span class="s2"> penguins here.&quot;</span>
+<span class="k">else</span>
+ <span class="s2">&quot;There is no snow here, and penguins like snow.&quot;</span>
+<span class="k">end</span>
+</pre></div>
+</div>
+<p>The default directory in which hint files are located is <tt class="docutils literal"><span class="pre">/etc/chef/ohai/hints/</span></tt>. Use the <tt class="docutils literal"><span class="pre">Ohai::Config[:hints_path]</span></tt> setting in the client.rb file to customize this location.</p>
+<p class="last"><tt class="docutils literal"><span class="pre">HINT_FILE</span></tt> is the name of the JSON file. <tt class="docutils literal"><span class="pre">HINT_NAME</span></tt> is the name of a hint in a JSON file. Use multiple <tt class="docutils literal"><span class="pre">--hint</span></tt> options to specify multiple hints.</p>
+</dd>
<dt><tt class="docutils literal"><span class="pre">-i</span> <span class="pre">IDENTITY_FILE</span></tt>, <tt class="docutils literal"><span class="pre">--identity-file</span> <span class="pre">IDENTITY_FILE</span></tt></dt>
<dd>The SSH identity file used for authentication. Key-based authentication is recommended.</dd>
<dt><tt class="docutils literal"><span class="pre">-j</span> <span class="pre">JSON_ATTRIBS</span></tt>, <tt class="docutils literal"><span class="pre">--json-attributes</span> <span class="pre">JSON_ATTRIBS</span></tt></dt>
@@ -104,6 +116,14 @@
<dd>The name of the node.</dd>
<dt><tt class="docutils literal"><span class="pre">--[no-]host-key-verify</span></tt></dt>
<dd>Use <tt class="docutils literal"><span class="pre">--no-host-key-verify</span></tt> to disable host key verification. Default setting: <tt class="docutils literal"><span class="pre">--host-key-verify</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">--[no-]node-verify-api-cert</span></tt></dt>
+<dd>Use <tt class="docutils literal"><span class="pre">verify_api_cert</span></tt> to only do SSL validation of the Chef server connection; may be needed if the chef-client needs to talk to other services that have broken SSL certificates. If this option is not specified, the setting for <tt class="docutils literal"><span class="pre">verify_api_cert</span></tt> in the configuration file is applied.</dd>
+<dt><tt class="docutils literal"><span class="pre">--node-ssl-verify-mode</span> <span class="pre">PEER_OR_NONE</span></tt></dt>
+<dd><p class="first">The verify mode for HTTPS requests.</p>
+<p>Use <tt class="docutils literal"><span class="pre">:verify_none</span></tt> to do no validation of SSL certificates.</p>
+<p>Use <tt class="docutils literal"><span class="pre">:verify_peer</span></tt> to do validation of all SSL certificates, including the Chef server connections, S3 connections, and any HTTPS <strong>remote_file</strong> resource URLs used in the chef-client run. This is the recommended setting.</p>
+<p class="last">If this option is not specified, the setting for <tt class="docutils literal"><span class="pre">ssl_verify_mode</span></tt> in the configuration file is applied.</p>
+</dd>
<dt><tt class="docutils literal"><span class="pre">-p</span> <span class="pre">PORT</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-port</span> <span class="pre">PORT</span></tt></dt>
<dd>The SSH port.</dd>
<dt><tt class="docutils literal"><span class="pre">-P</span> <span class="pre">PASSWORD</span></tt>, <tt class="docutils literal"><span class="pre">--ssh-password</span> <span class="pre">PASSWORD</span></tt></dt>
@@ -118,8 +138,8 @@
<dd>The path to the file that contains the encryption key.</dd>
<dt><tt class="docutils literal"><span class="pre">--sudo</span></tt></dt>
<dd>Use to execute a bootstrap operation with sudo.</dd>
-<dt><tt class="docutils literal"><span class="pre">--template-file</span> <span class="pre">TEMPLATE</span></tt></dt>
-<dd>The path to a template file that will be used during a bootstrap operation. Do not use the <tt class="docutils literal"><span class="pre">--distro</span></tt> option when <tt class="docutils literal"><span class="pre">--template-file</span></tt> is specified.</dd>
+<dt><tt class="docutils literal"><span class="pre">-t</span> <span class="pre">TEMPLATE</span></tt>, <tt class="docutils literal"><span class="pre">--bootstrap-template</span> <span class="pre">TEMPLATE</span></tt></dt>
+<dd>Use to specify the bootstrap template to use. This may specify the name of a bootstrap template&#8212;<tt class="docutils literal"><span class="pre">chef-full</span></tt>, for example&#8212;or it may specify the full path to an Embedded Ruby (ERB) template that defines a custom bootstrap. Default value: <tt class="docutils literal"><span class="pre">chef-full</span></tt>, which installs the chef-client using the omnibus installer on all supported platforms.</dd>
<dt><tt class="docutils literal"><span class="pre">--use-sudo-password</span></tt></dt>
<dd>Use to perform a bootstrap operation with sudo; specify the password with the <tt class="docutils literal"><span class="pre">-P</span></tt> (or <tt class="docutils literal"><span class="pre">--ssh-password</span></tt>) option.</dd>
<dt><tt class="docutils literal"><span class="pre">-V</span> <span class="pre">-V</span></tt></dt>
diff --git a/distro/common/html/knife_cookbook_site.html b/distro/common/html/knife_cookbook_site.html
index 72bb03582d..8815961629 100644
--- a/distro/common/html/knife_cookbook_site.html
+++ b/distro/common/html/knife_cookbook_site.html
@@ -263,6 +263,8 @@ kickstart:
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">CATEGORY</span></tt></dt>
<dd>The cookbook category: <tt class="docutils literal"><span class="pre">&quot;Databases&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Web</span> <span class="pre">Servers&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Process</span> <span class="pre">Management&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Monitoring</span> <span class="pre">&amp;</span> <span class="pre">Trending&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Programming</span> <span class="pre">Languages&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Package</span> <span class="pre">Management&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Applications&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Networking&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Operating</span> <span class="pre">Systems</span> <span class="pre">&amp;</span> <span class="pre">Virtualization&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Utilities&quot;</span></tt>, or <tt class="docutils literal"><span class="pre">&quot;Other&quot;</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">-n</span></tt>, <tt class="docutils literal"><span class="pre">--dry-run</span></tt></dt>
+<dd>Use to take no action and only print out results. Default: <tt class="docutils literal"><span class="pre">false</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">PATH:PATH</span></tt>, <tt class="docutils literal"><span class="pre">--cookbook-path</span> <span class="pre">PATH:PATH</span></tt></dt>
<dd>The directory in which cookbooks are created. This can be a colon-separated path.</dd>
</dl>
diff --git a/distro/common/html/knife_data_bag.html b/distro/common/html/knife_data_bag.html
index d56fc589ad..a7a297be95 100644
--- a/distro/common/html/knife_data_bag.html
+++ b/distro/common/html/knife_data_bag.html
@@ -65,7 +65,7 @@
<dt><tt class="docutils literal"><span class="pre">DATA_BAG_ITEM</span></tt></dt>
<dd>The name of a specific item within a data bag.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt>
-<dd>The encryption key that is used for values contained within a data bag item.</dd>
+<dd>The encryption key that is used for values contained within a data bag item. If <tt class="docutils literal"><span class="pre">secret</span></tt> is not specified, the chef-client will look for a secret at the path specified by the <tt class="docutils literal"><span class="pre">encrypted_data_bag_secret</span></tt> setting in the client.rb file.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt>
<dd>The path to the file that contains the encryption key.</dd>
</dl>
@@ -138,7 +138,7 @@
<dt><tt class="docutils literal"><span class="pre">DATA_BAG_ITEM</span></tt></dt>
<dd>The name of a specific item within a data bag.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt>
-<dd>The encryption key that is used for values contained within a data bag item.</dd>
+<dd>The encryption key that is used for values contained within a data bag item. If <tt class="docutils literal"><span class="pre">secret</span></tt> is not specified, the chef-client will look for a secret at the path specified by the <tt class="docutils literal"><span class="pre">encrypted_data_bag_secret</span></tt> setting in the client.rb file.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt>
<dd>The path to the file that contains the encryption key.</dd>
</dl>
@@ -219,7 +219,7 @@
<dt><tt class="docutils literal"><span class="pre">-a</span></tt>, <tt class="docutils literal"><span class="pre">--all</span></tt></dt>
<dd>Use to upload all data bags found at the specified path.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt>
-<dd>The encryption key that is used for values contained within a data bag item.</dd>
+<dd>The encryption key that is used for values contained within a data bag item. If <tt class="docutils literal"><span class="pre">secret</span></tt> is not specified, the chef-client will look for a secret at the path specified by the <tt class="docutils literal"><span class="pre">encrypted_data_bag_secret</span></tt> setting in the client.rb file.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt>
<dd>The path to the file that contains the encryption key.</dd>
</dl>
@@ -287,7 +287,7 @@
<dt><tt class="docutils literal"><span class="pre">DATA_BAG_ITEM</span></tt></dt>
<dd>The name of a specific item within a data bag.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret</span> <span class="pre">SECRET</span></tt></dt>
-<dd>The encryption key that is used for values contained within a data bag item.</dd>
+<dd>The encryption key that is used for values contained within a data bag item. If <tt class="docutils literal"><span class="pre">secret</span></tt> is not specified, the chef-client will look for a secret at the path specified by the <tt class="docutils literal"><span class="pre">encrypted_data_bag_secret</span></tt> setting in the client.rb file.</dd>
<dt><tt class="docutils literal"><span class="pre">--secret-file</span> <span class="pre">FILE</span></tt></dt>
<dd>The path to the file that contains the encryption key.</dd>
</dl>
diff --git a/distro/common/html/knife_node.html b/distro/common/html/knife_node.html
index 755f8ee418..a3d7a51d1c 100644
--- a/distro/common/html/knife_node.html
+++ b/distro/common/html/knife_node.html
@@ -367,9 +367,9 @@ rs-123456
<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt>
<dd>The attribute (or attributes) to show.</dd>
<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt>
-<dd>Display long output when searching nodes while using the default summary format.</dd>
+<dd>Use to display all attributes in the output and to show the output as JSON.</dd>
<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt>
-<dd>Display more, but not all, of a node&#8217;s data when searching using the default summary format.</dd>
+<dd>Use to display normal attributes in the output and to show the output as JSON.</dd>
<dt><tt class="docutils literal"><span class="pre">-r</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span></tt></dt>
<dd>Use to show only the run-list.</dd>
</dl>
diff --git a/distro/common/html/knife_raw.html b/distro/common/html/knife_raw.html
index b199acae95..e661e9a84a 100644
--- a/distro/common/html/knife_raw.html
+++ b/distro/common/html/knife_raw.html
@@ -41,7 +41,7 @@
<div class="section" id="knife-raw">
<h1>knife raw<a class="headerlink" href="#knife-raw" title="Permalink to this headline">¶</a></h1>
-<p>The <strong>knife raw</strong> subcommand is used to send a REST request to a specified path using the Chef server API.</p>
+<p>The <strong>knife raw</strong> subcommand is used to send a REST request to an endpoint in the Chef server API.</p>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<p>This subcommand has the following syntax:</p>
diff --git a/distro/common/html/knife_role.html b/distro/common/html/knife_role.html
index 8f7fb52ceb..844de48d37 100644
--- a/distro/common/html/knife_role.html
+++ b/distro/common/html/knife_role.html
@@ -41,7 +41,7 @@
<div class="section" id="knife-role">
<h1>knife role<a class="headerlink" href="#knife-role" title="Permalink to this headline">¶</a></h1>
-<p>A role is a way to define certain patterns and processes that exist across nodes in an organization as belonging to a single job function. Each role consists of zero (or more) attributes and a run list. Each node can have zero (or more) roles assigned to it. When a role is run against a node, the configuration details of that node are compared against the attributes of the role, and then the contents of that role&#8217;s run list are applied to the node&#8217;s configuration details. When a chef-client runs, it merges its own attributes and run lists with those contained within each assigned role.</p>
+<p>A role is a way to define certain patterns and processes that exist across nodes in an organization as belonging to a single job function. Each role consists of zero (or more) attributes and a run-list. Each node can have zero (or more) roles assigned to it. When a role is run against a node, the configuration details of that node are compared against the attributes of the role, and then the contents of that role&#8217;s run-list are applied to the node&#8217;s configuration details. When a chef-client runs, it merges its own attributes and run-lists with those contained within each assigned role.</p>
<p>The <strong>knife role</strong> subcommand is used to manage the roles that are associated with one or more nodes on a Chef server.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
diff --git a/distro/common/html/knife_search.html b/distro/common/html/knife_search.html
index 2444c4845f..c5006d155e 100644
--- a/distro/common/html/knife_search.html
+++ b/distro/common/html/knife_search.html
@@ -41,7 +41,7 @@
<div class="section" id="knife-search">
<h1>knife search<a class="headerlink" href="#knife-search" title="Permalink to this headline">¶</a></h1>
-<p>Search indexes allow queries to be made for any type of data that is indexed by the Chef server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full-text query that can be done from several locations, including from within a recipe, by using the <tt class="docutils literal"><span class="pre">search</span></tt> subcommand in knife, or by using the <tt class="docutils literal"><span class="pre">/search</span></tt> or <tt class="docutils literal"><span class="pre">/search/INDEX</span></tt> endpoints in the Chef server API. The search engine is based on Apache Solr and is run from the Chef server.</p>
+<p>Search indexes allow queries to be made for any type of data that is indexed by the Chef server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full-text query that can be done from several locations, including from within a recipe, by using the <tt class="docutils literal"><span class="pre">search</span></tt> subcommand in knife, the <tt class="docutils literal"><span class="pre">search</span></tt> method in the Recipe DSL, and by using the <tt class="docutils literal"><span class="pre">/search</span></tt> or <tt class="docutils literal"><span class="pre">/search/INDEX</span></tt> endpoints in the Chef server API. The search engine is based on Apache Solr and is run from the Chef server.</p>
<p>The <strong>knife search</strong> subcommand is used run a search query for information that is indexed on a Chef server.</p>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
@@ -97,9 +97,9 @@ win2k8-dev
<dt><tt class="docutils literal"><span class="pre">INDEX</span></tt></dt>
<dd>The name of the index to be queried: <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, or <tt class="docutils literal"><span class="pre">DATA_BAG_NAME</span></tt>. Default index: <tt class="docutils literal"><span class="pre">node</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt>
-<dd>Display long output when searching nodes while using the default summary format.</dd>
+<dd>Use to display all attributes in the output and to show the output as JSON.</dd>
<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt>
-<dd>Display more, but not all, of a node&#8217;s data when searching using the default summary format.</dd>
+<dd>Use to display normal attributes in the output and to show the output as JSON.</dd>
<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">SORT</span></tt>, <tt class="docutils literal"><span class="pre">--sort</span> <span class="pre">SORT</span></tt></dt>
<dd>The order in which search results will be sorted.</dd>
<dt><tt class="docutils literal"><span class="pre">-q</span> <span class="pre">SEARCH_QUERY</span></tt>, <tt class="docutils literal"><span class="pre">--query</span> <span class="pre">SEARCH_QUERY</span></tt></dt>
diff --git a/distro/common/html/knife_status.html b/distro/common/html/knife_status.html
index 488a2914f3..8273f11601 100644
--- a/distro/common/html/knife_status.html
+++ b/distro/common/html/knife_status.html
@@ -61,6 +61,10 @@
<dd>The search query used to identify a a list of items on a Chef server. This option uses the same syntax as the <tt class="docutils literal"><span class="pre">search</span></tt> sub-command.</dd>
<dt><tt class="docutils literal"><span class="pre">-H</span></tt>, <tt class="docutils literal"><span class="pre">--hide-healthy</span></tt></dt>
<dd>Use to hide nodes on which a chef-client run has occurred within the previous hour.</dd>
+<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt>
+<dd>Use to display all attributes in the output and to show the output as JSON.</dd>
+<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt>
+<dd>Use to display normal attributes in the output and to show the output as JSON.</dd>
<dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">RUN_LIST</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span> <span class="pre">RUN_LIST</span></tt></dt>
<dd>A comma-separated list of roles and/or recipes to be applied.</dd>
<dt><tt class="docutils literal"><span class="pre">-s</span></tt>, <tt class="docutils literal"><span class="pre">--sort-reverse</span></tt></dt>
diff --git a/distro/common/html/searchindex.js b/distro/common/html/searchindex.js
index a0f7c322e8..956e91c737 100644
--- a/distro/common/html/searchindex.js
+++ b/distro/common/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({envversion:42,terms:{kickstart:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chisamor:12,poorli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],four:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prefix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dirnam:26,rsyslog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oldest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],accur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],service_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],umask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],descript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_typ:[0,14,31,32,4,7,36,19],under:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slowest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],replica:18,digit:18,everi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_maintain:5,upstream:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],affect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],month:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],csshx:[33,30,17],raw_data:36,cmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upload:[13,19,2,34,18,9,10,27,20,29],rabbitmq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rabbitmqctl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],x86_64:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],proxy_url:29,hord:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_java:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hint_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],direct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consequ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],second:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aggreg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ips_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],start_chef:29,even:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],supervis:18,hide:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asid:27,children:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"new":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],net:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],topolog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],metadata:[13,19,2,34,18,9,10,27,20,29],default_attribut:[4,0],kilobyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],run_list_item:[32,9,34],never:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],macports_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],here:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],num_vers:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recipe_nam:[32,0],host_head:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],interpret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hosted_everyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dry:[6,35,28],erl_cal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rubocop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],url_or_uri:[30,17],chefspec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],databagitem:36,runlist:[9,34],brought:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],substr:26,unix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],printf:1,hipchat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],txt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],describ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],would:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bundler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],call:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recommend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],indiana:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],type:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],until:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fastcgi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],relat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],server_url:27,notic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],warn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oc_bifrost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exce:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],relai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],killal:34,hold:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],must:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gecod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],join:1,henri:18,orgnam:[26,19,29],setup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],work:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],bluebox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],raid1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fnmatch:31,root:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],could:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ss6p92l_sca:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],overrid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],give:[34,1],smtp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],elrepo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],indic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],want:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],keep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],end:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],eni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vagrant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],how:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],env:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],config:34,updat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],after:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],befor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unmount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],windows_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],parallel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],demonstr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],request_path:14,attempt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],client_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opaqu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bootstrap:[13,34,18,9,27,20],credenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exclud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alias:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maintain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],environ:[13,19,27,21,22,2,31,5,6,34,36,25,18,9,10,11,20,29],danno:7,enter:[12,21,34,0,14,1,32,33,15,31,4,5,6,7,37,35,26,36,19],order:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],softwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],over:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],becaus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vari:[29,18],cli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],generic_execut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],denver:37,better:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],persist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erlang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],split:1,them:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],woken:34,thei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],proce:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspaceknif:5,"40g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],choic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],changelog:31,conflict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],timeout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],each:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],search_queri:[33,15,30,17,5],eacc:34,side:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mean:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],voxel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],log_loc:29,extract:[6,9,20,13],linod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],network:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],god:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],newli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],content:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rewrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],devops_prod1:37,billing_admin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prioriti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],http_request:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],putti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gunicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],written:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ntp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],situat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],free:1,fred:36,qword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],node1:32,kit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"1_0_0":5,"1_0_1":5,"1_0_2":5,"1_0_3":5,reconfigur:34,sigkil:18,reg_dword_big_endian:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],whateverthedefaultmightb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openssh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openssl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],filter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iso:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],temporari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],user:34,pristin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rang:[12,15],render:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chefignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],independ:[26,18],capac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],restrict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hook:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkey_classes_root:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alreadi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wrapper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netfx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],primari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],role1:0,rewritten:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tinydn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],easili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],top:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sometim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mercuri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],master:34,too:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],amqp_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],john:18,listen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cloudform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iptabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"8wjyvhy9fhcegaareg":36,namespac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a58cf8":15,yield:26,"10g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bookshelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sha1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],max_arg:28,auxw:34,target:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],provid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tree:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],project:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],matter:26,gnupg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],entri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],minut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],provis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],behavior:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ram:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mine:29,unicast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],raw:[1,2,4,5,6,8,9,10,11,13,16,18,29,20,21,22,25,27,19,31,32,34,36],pessimist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],seed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_rubi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chefservicefeatur:29,blue:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],though:32,usernam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],glob:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],object:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regular:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],s001:34,specifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],letter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],breakpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],don:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],doc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],metal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dog:36,doe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_licens:26,wildcard:[21,15,25],teck:7,unchang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],runit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opposit:[6,13,35,20,18],whitelist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],random:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ruby_block:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syntax:[13,34,18,9,27,20],radio:7,identifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],make:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],celeri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],absolut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],layout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a58e134":15,holder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],configur:[13,19,34,18,9,10,27,20,29],apach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lwrp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ldap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],folder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oct:33,likewis:5,stop:34,compli:18,amazon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],servermanagercmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],report:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],youtub:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],method:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],runa:34,reload:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zabbix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],no_proxy_url_or_ip:29,groupinstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],num:[33,30,17],mandatori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],result:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],respons:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],key_fil:34,mdadm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],best:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rsa_kei:19,awar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],said:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],databas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multiinst:26,sigint:18,solr4:18,irb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],irc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],approach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],databag:14,attribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],were:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extens:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],policyfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],toler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],advertis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kitchen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],protect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],easi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],met:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],howev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],against:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fedora13:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],logic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],countri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],login:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],com:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rehash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],publishset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],loader:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],your_email:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],usr1:34,diff:[13,19,27,31,2,34,5,36,25,18,9,10,11,20,29],trust:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],assum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],duplic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chrome:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fri:33,three:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],been:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trigger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],basic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homepath:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hesit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quickli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],life:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_edit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suppress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],worker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],telnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],argument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verify_api_cert:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],child:25,"catch":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ident:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data_bag_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gnu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],servic:34,properti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],calcul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unsolv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dashboard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nexenta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],powershel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],seven:18,remount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],player:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exit:[9,1],conf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sever:15,amout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],growl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],perform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suggest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],use_last_modifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],couchdb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],preserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],descend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],djbdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syncd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],complet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],raid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],orgmapp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rais:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],portal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tune:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mirror_expir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kept:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scenario:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"30t21":5,name_of_premium_featur:18,inherit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],contact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gzip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],everyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],left:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],protocol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],just:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sigusr1:34,bandwidth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],human:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],name_of_servic:18,yet:18,languag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],previous:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reboot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mod_php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],force_default:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],had:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],macport:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],save:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ubuntu12:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ubuntu10:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],applic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_vers:[4,5,31],metabas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fusion:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],json_class:[0,14,31,32,4,7,36,19],shadow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pingabl:18,daemon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],specif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deprec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nrpe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arbitrari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],manual:[33,30,34,17],graylog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deploy_revis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],public_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sublime_text:26,specifii:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],underli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multi_str:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],right:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],interv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],percentag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tibetanspaniel:36,intern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],successfulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transmiss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],knife_config:29,total:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],setloc:29,fidel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],track:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],select:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],condit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],foo:14,localhost:18,core:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uncompress:5,insecur:18,repositori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anagram:26,actions_messag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"super":34,grizzli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subkei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],postgresql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],surround:[13,0,31,32,3,20,19],birdman:7,svn_argument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],horizon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],commit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"float":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],profession:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bound:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],diwb:18,down:18,run_list:[29,1],storag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],eth1:18,git:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suffici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],support:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nova:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"class":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],avail:34,reli:29,gid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wordpress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],editor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],jane:18,war:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lowest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],head:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noevict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],form:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],some:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forg:[13,30,17],useradd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"25t23":5,icmp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"true":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wmi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],middle_nam:18,attr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ssh_known_host:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maximum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tell:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inaccur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fundament:31,opensus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],featur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openbsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],classic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decrypt:36,sale:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],diagnost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],glanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ship:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],check:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,16,18,19,20,21,22,23,24,25,27,29,31,32,33,34,36],sticki:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],assembl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vista:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],groupmod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],encrypt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],when:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],win_wget_p:29,role:[1,2,3,4,5,6,8,9,10,11,13,14,16,18,29,20,21,22,25,27,19,31,32,34,36],test:[13,19,2,34,18,9,10,27,20,29],roll:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],node:[1,2,4,5,6,8,9,10,11,13,16,18,29,20,21,22,25,27,19,31,34,36],notif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],intend:26,phoenix:37,kvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asterisk:[26,18],devop:[0,31,32,4,5,19],stompserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],intent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],younger:7,search_attribut:1,faster:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anywher:[6,35],ignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],time:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],push:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backward:27,skip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redis2:5,netbsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],row:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zookeep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],varnish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],middl:[13,17],depend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zone:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],installonlypkg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comun:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],text:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],downtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aspx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],string:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org_nam:18,cookbooks_path:9,cloudstack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lru:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],template_filenam:29,brows:[6,35],public_hostnam:33,script_fil:1,pkgbuild:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],administr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],level:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],did:[12,18],magnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],item:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cooki:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],validation_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prevent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bffcreat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sign:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],port:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"5272a43f":12,raid5:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],icinga:5,repli:[13,17],current:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],id3lib:5,reg_binari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deriv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],executionpolici:29,gener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unauthor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef11:18,chef12:18,modif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],address:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],locat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],along:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redmin:5,wait:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],box:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_environ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],invit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checksum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],behav:26,healthi:12,noinput:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regardless:29,rightscal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extra:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],modul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],test_system:1,prefer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],peer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],leav:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],seattl:37,visibl:1,instal:34,post:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regex:[32,3,31,0,19],memori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subvers:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],handler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],criteria:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checkout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],azur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rabbitmq_chef:5,visual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tandem:18,templat:[13,34,18,9,27,20],log_directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],effort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],role_nam:[32,0,25],proxy_cache_path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tokyo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uniqu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cat:1,descriptor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],profitbrick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],graphit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],www:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscode_erchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],purpos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nearest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],container_servic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stream:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backslash:[26,28],agent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],topic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],critic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mirrorlist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],occur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alwai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sundai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multipl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gem_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ping:18,uptim:[33,18],write:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mixlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],purg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],map:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],product:[13,21,35,15,4,6,18,20,29],omnitruck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],max:28,clone:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sp4:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],identity_fil:[33,30,17,29],appnam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hklm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],log_level:[9,34,29],roundrobin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data:[13,19,31,2,34,5,18,9,10,27,20,29],man:[9,34,27,18],freshli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nullsoft:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],purge_before_symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],logwatch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],preced:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],combin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],talk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],port_list:26,config_fil:[10,30,17],ssh_wrapper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],partial_search:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ttl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gitignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],still:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dynam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],entiti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],conjunct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],group:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],monitor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],duplex:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],platform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],non:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],main_monitor:3,rake:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],initi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],safari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],half:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nov:34,superset:26,provision:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],discuss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],term:34,name:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],revert:18,separ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],full_nam:18,compil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],failov:18,domain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],replac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],individu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],continu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unlock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gnu_parallel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],year:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],happen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"3rd":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],space:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"100g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],profil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vrrp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],internet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],correct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkey_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],orgtest:15,newsiz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],migrat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],argv:1,mime:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org:34,"byte":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],care:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reusabl:31,wai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],frequenc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],synchron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],turn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],place:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fa0fc4abf3f6787aeb5c3c5c35de667c:31,router:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],principl:26,think:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],frequent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],first:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],origin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],directli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],carri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],onc:34,arrai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"long":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oppos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uncaught:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],open:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],predefin:1,size:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],given:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reprepro:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],silent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],install_chef:29,ssh_command:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iaa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],baremetalcloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],citi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cumul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],averag:33,white:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apt_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],json_attrib:29,environment_nam:[9,4,25],hub:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],especi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],provinc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],copi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],full_control:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],artifact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],broadcast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"short":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],enclos:26,mostli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],john_smith:18,pecl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],than:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],png:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],serv:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,16,18,19,20,21,22,25,27,29,31,32,34,36],wide:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sbuild:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],posix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],balanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],optimist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zsh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pre:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fork:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],config_cont:29,pro:26,delim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ani:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],client_kei:[26,34],ant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],medium:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],smartos_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cassandra:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extralarg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],engin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],destroi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],note:1,sendfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ideal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],copyright_hold:31,take:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],channel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],begin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sure:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trace:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],normal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],buffer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],statu:34,instiki:5,timestamped_deploi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pair:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],collectstat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],later:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drive:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_expand_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],runtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],superblock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],expand_str:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],steadi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],show:34,encrypted_data_bag_secret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],concurr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],permiss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sysctl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],help:34,xml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],onli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],explicitli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],moneta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],favor:[33,30,17],gceserviceaccount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],activ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],state:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hello_world:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],analyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sighup:18,nearli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],variou:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],get:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stomp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],secondari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],repo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],ssl:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,16,18,19,20,21,22,23,24,25,27,29,31,32,33,34,36],cannot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ssh:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,16,18,19,20,21,22,23,24,25,27,29,31,32,34,36],ssd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],requir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debian5:29,foodcrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aptitud:33,netscalar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],where:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],summari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wiki:[26,5],kernel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],installshield:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],spork:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],endloc:29,drbd0:18,data_bag:[26,36,14],mtu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],xenserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],concern:18,detect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],review:[0,1,2,3,4,25,6,7,8,11,12,14,15,16,35,29,21,22,23,24,5,28,19,31,32,33,36,37],label:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],behind:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],volatil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],between:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dockerfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"import":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],across:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sname:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],parent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],node_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],screen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solaris_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],supermarket:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syntax_check_cache_path:26,come:26,tue:34,gpasswd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uuid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],region:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pychef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],library_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],datamapp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mani:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],runcontext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reindex:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prereleas:29,color:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],period:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],symfoni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],colon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],generic_writ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cancel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsc_mof:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],poll:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bluepil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ultim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org_full_nam:18,west:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rebuild:[13,19,27,1,22,2,21,31,4,5,6,34,36,25,18,9,10,11,20,29],replace_str:28,mark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],spiceweasel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rebuilt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],my_cookbook:31,rubi:[13,19,27,21,22,2,31,4,5,6,34,36,25,18,9,10,11,20,29],editpad:26,thing:18,those:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"case":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],eip:21,pedant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],invok:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],base64:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],librato:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suse:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_nginx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stdout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],metric:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_client:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],airbrak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cluster:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ascii:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aa384235:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],develop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],author:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],media:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],same:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],binari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],html:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],document:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],week:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],finish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],webserv:[21,32,33,25,6,35,29],nest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],confidenti:36,driver:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],capabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openldap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],improv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],repoforg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appropri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],megabyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],without:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trusted_certs_dir:[13,30],model:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],resource_collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],a29d6f254577b830091f140c3a78b1f:31,execut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],loaderror:33,key_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kill:34,aspect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org_cleanu:3,touch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passphras:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],http_proxi:29,speed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aws_access_key_id:26,samba:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],display_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],except:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],identif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instrument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],query_to_run:15,ruby1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],earli:18,around:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ohai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],read:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],traffic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],platform_vers:31,world:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yyyymmddhhmmss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mof:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iftop:5,integ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],server:34,either:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],output:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rubyv:1,manag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cisco:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],glesi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],server01:[33,30,17],freez:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rsync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],keytab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],confirm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],definit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appscript:33,keyston:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],highcpu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],portage_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],knife:[9,34,27,18],refer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],power:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],notepad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inspect:[6,13,20],broken:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],a45298c9:12,starttim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],found:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],berksfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bazaar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comparison:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],central:9,ack:5,gplv2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gplv3:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],acl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],percona:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],act:27,backup:34,processor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],effici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],max_siz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],your:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],charli:36,hkey_current_config:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],log:34,daemontool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],simultan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],overwrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],start:34,interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ipv4:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ipv6:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],svn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],enough:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bundl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],untar:5,cabinet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opensolari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],activemq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],conclus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],longer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chefclientfeatur:29,pull:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],possibl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"default":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pacman:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bucket:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],powershell_script:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vhd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],embed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],connect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cbc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uid:36,creat:34,certain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remote_directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_handl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decreas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fail2ban:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file:34,fill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],incorrect:34,file_maxbyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],googl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prepend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],field:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],valid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],you:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],architectur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],codecademi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],registri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sequenc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],symbol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fsck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],snitch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dropbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_lag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reduc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_copyright:26,mask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],use_etag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],escap:[26,28],cpu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actions_consum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],represent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],all:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],selinux:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forbidden:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ibm305ramac:1,lacp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],java_opt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_l2_interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],follow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],disk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dism:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sympa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],init:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],program:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],app_conf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scratch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],introduc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cloudkick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],global:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],premium:18,fals:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checkin:1,subcommand:34,util:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verb:[13,22,23,8,11,20],failur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],veri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ossec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],excluded_memb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],list:34,last_nam:18,gerritt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recipe_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plain:36,user_nam:[33,30,7,17,18],pid_fil:34,enterpris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drbd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],past:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syslog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rate:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],design:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pass:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ssh_attr:[33,30,17],further:18,current_dir:26,proxi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],what:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum_repositori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sub:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],section:[13,20,26],abl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],brief:[12,13,20],rackspac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delet:34,abbrevi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],version:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noprofil:29,"public":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],millisecond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],full:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],berkelei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multilib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],excess:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gandi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],standard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],modifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],valu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thrift:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],search:[13,19,31,2,34,18,9,10,27,20,29],memcach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prior:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],amount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],action:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],warrant:[13,20,1],via:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tmux:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],filenam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],establish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redisio:4,proceed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],two:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],validation_client_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],more:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flat:8,association_us:18,desir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],site:[13,19,31,2,34,18,9,10,27,20,29],flag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],particular:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],known:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compani:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],destin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],installroot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],psql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],none:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],endpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hour:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dep:[13,19,27,31,2,34,5,36,18,9,10,11,20,29],dev:[12,32,15,4,18],histori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oktawav:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkey_local_machin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],caveat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],learn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nagio:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],external_url:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prompt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sensu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],share:[13,19,31,2,34,18,9,10,27,20,29],bootstrap_directori:29,accept:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verify_non:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],minimum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],poni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],explor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_data_bag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],csh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],first_nam:18,secur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rather:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anoth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pxe_dust:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],simpl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],distro:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],resourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],referenc:[7,19],vlan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fstype:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rbac:26,perl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data_bag_item_dogs_tibetanspaniel:36,associ:34,github:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],postfix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],created_at:5,django:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],caus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],allkei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],logrot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rotat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],templatefortextstr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],i386:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],through:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],htop:5,paramet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],create_dirs_before_symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],systemd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_databas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exact:[32,15],pend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_nam:[0,25,5,31],bypass:[6,13,20],"return":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],graylog2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],timestamp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],framework:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],admin_nam:26,troubleshoot:18,instruct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],authent:[13,19,27,21,22,2,31,4,5,6,34,36,25,18,9,10,11,20,29],"1password":5,userprofil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],token:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],average_r:5,compris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unicod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],only_if:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],truncat:[32,5],denni:7,harm:[13,30],"300mb":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],crontab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],expect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],new_client:1,create_wait_m:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],portland:37,beyond:26,event:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ftp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vancouv:37,robert:7,publish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],etag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],print:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],occurr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_nam:[19,7,31,18],gpl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],qualifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],devops_data:36,advanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],campfir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],effect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reason:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],base:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],put:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],workstat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],basi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thread:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],launch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],omit:[15,19],perman:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],heartbeat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],assign:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],excurs:18,notifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],number:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],env_vari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],done:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stdlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],blank:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],miss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_atomic_upd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pgdg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],differ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],script:[13,19,27,21,22,2,31,4,5,6,34,36,25,18,9,10,11,20,29],ipaddress:1,interact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unrestrict:29,least:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checkpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],win2k8:15,statement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zeromq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scheme:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],journli:4,jetti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],store:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],schema:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dpkg_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],storm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],part:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pars:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consult:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dpkg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reinstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],grep:[34,5,29],remot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remov:[1,2,4,5,6,8,9,10,11,13,16,18,29,20,21,22,25,27,19,31,34,36],reg_qword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],secret_access_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],randomli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comput:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gvim:26,packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],expir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dedic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],testmast:18,berkshelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],built:[26,18],equival:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],also:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],centos5:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rakefil:21,build:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stackforg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],splai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pipelin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],distribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exec:[13,19,27,21,22,2,31,4,5,6,34,36,25,18,9,10,11,20,29],previou:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quota:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],most:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],private_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],preprod:18,cover:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],destruct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],clojur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],clean:33,microsoft:[13,34,18,9,27,20],carefulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],xcode:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alphanumer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ignore_failur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],session:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fine:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],affin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],firewal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pretti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jtimberman:[5,29],darwin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],everysec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unus:[7,19],chef_gem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"__file__":26,express:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verify_p:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nativ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mainten:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fastest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],restart:34,"225f954f":12,data_bag_name_or_path:36,crt:21,boost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],your_company_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],common:[13,19,20,29],gelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syntax_check_cach:26,certif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],set:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],dump:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],creator:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],startup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ifconfig:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],see:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arg:28,reserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flavor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cssh:[33,30,17],git_ssh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],example_nod:1,prempt_delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],someth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subscript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],altern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solo:[34,27,18],chef_nod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gemfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],numer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],javascript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],succeed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],distinguish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],popul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],satisfi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_multi_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delimit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],context:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],access_key_id:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lash:1,vault:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],load:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],markdown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],point:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],schedul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uptod:18,header:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shutdown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ucspi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],desktop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],authz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspace_api_kei:26,unsuccess:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],java:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],devic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],add:[1,2,4,5,6,8,9,10,11,13,16,18,29,20,21,22,25,27,19,31,34,36],empti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],secret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],strategi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],atomic_upd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],togeth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],imag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rspec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],understand:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0_8_0":5,look:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],registry_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],frozen:31,hkcc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],batch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],durat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],formatt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"while":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],corpsit:21,abov:29,error:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkcr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maradn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],loop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkcu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],real:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],motd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],readm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],client_desc:1,dynect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],itself:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cento:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],skype:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vcloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"null":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fedora:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],grant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],belong:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hadoop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shorter:1,octal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],languages_ruby_vers:15,higher:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],x86:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0_7_0":5,cloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wherea:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inflat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alert:5,jpackag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lxc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nosess:26,typic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lower:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],task:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lib:29,older:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],british_sea_pow:29,ssl_verify_mod:[13,17],person:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reflect:4,docker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rbenv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],propos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],override_attribut:[4,0],mysql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openstack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"07z":5,password:34,workflow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],web03:15,win:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],input:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subsequ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],app:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vendor:5,obsolet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fqdn_or_ip_address:29,format:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],ipmi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],main_attribut:15,local_download_path:29,nginx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exceptionclass:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],characterist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],success:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],signal:18,svlogd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],resolv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],elaps:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],princip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],api:[13,19,27,21,22,2,31,4,5,6,34,36,25,18,9,10,11,20,29],encount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vsphere:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],often:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],simplifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],add_formatt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],acknowledg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],creation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],macterm:[33,30,17],back:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unspecifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sampl:[32,36,0,18],staticfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],force_overrid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mirror:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_rol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],virtualenv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scale:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lamin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],per:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],attribute_nam:32,retri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],larg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],undon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prod:18,proc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],snort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_user:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],agreement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],infra:18,step:[13,30,34],wget:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],crond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ufw:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],generic_read:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],constraint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drbdadm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],idl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],block:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instance_typ:15,nsi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hudson:5,ohai_tim:1,smart_o_s_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscodesupport:5,within:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ensur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rundeck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],errno:34,question:26,fast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],custom:[13,34,18,9,27,20],includ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forward:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],properli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ifcfg:15,textpad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remote_source_msi_url:29,pwd:29,link:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],translat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],newer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],atom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noninteract:29,line:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],info:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],utc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consist:[26,0],munin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],groovi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nscd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"export":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],similar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nsca:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],supervisor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],doesn:32,repres:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"char":28,incomplet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],home:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],curl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],titl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sequenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],invalid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"_imag":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transport:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],peopl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nice:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deseri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mongodb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],meaning:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_server_url:[26,34,27,29],eval:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],splunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ladvd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],desert:25,lang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"1024mb":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],infrequ:[13,20,1],algorithm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yourcompani:26,depth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_overview_attribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hello:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],endtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],code:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],partial:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],queri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],groupadd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trywgfa6r70no28pnhmpghevkbzuxouemnbnauqsuyo:36,steve:7,privat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ulimit:4,elsewher:9,send:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],junip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fatal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],getchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passiv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vlc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],volum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recip:[1,2,4,5,6,8,9,10,11,13,14,16,18,29,20,21,22,25,27,19,31,32,34,36],magic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_vlan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],id_rsa:29,geograph:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hive:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"try":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pleas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],malici:[13,30],impli:15,jdk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slackwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],download:[13,19,2,34,18,9,10,27,20,29],click:34,append:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ps1:29,index:[13,19,27,1,22,2,21,31,4,5,6,34,36,25,18,9,10,11,20,29],compar:[13,19,27,21,22,2,31,5,6,34,36,25,18,9,10,11,20,29],a47823c9:12,winrm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],find:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],access:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],f65c969b:12,logloc:[9,34],isapi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hku:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bodi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],let:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ubuntu:[13,34,18,9,27,20],becom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sinc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],convert:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],copyright:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],overwritten:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aardvark:26,larger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fetch:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,31,32,33,34,36],converg:34,rpm_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ctl:34,chang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],honor:27,fstab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],firefox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ago:12,danger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],spec_help:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],approxim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gatewai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apt:[13,34,18,9,27,20],"boolean":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],smartmon:31,redi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pxe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],from:[13,19,2,34,18,9,10,27,20,29],zip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],commun:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],doubl:26,upgrad:34,nexu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],next:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],websit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],few:[34,18],use_conditional_get:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],usr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mismatch:4,about:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"transient":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],starter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],account:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],retriev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tunnel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alia:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],crazi:36,hint_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],control:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sqlite:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],weaker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],process:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sudo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],high:34,tag:[0,1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,36],proprietari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tarbal:[5,18],someurlher:31,symlink_before_migr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sit:[26,36],tamper:[13,30],zenpack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_dword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subdirectori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instead:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscode_us:26,zendmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],somelongurlher:31,overridden:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],watch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apicli:19,tier:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_repo_path:[21,13,22,35,25,23,6,24,8,11,28],physic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tenant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alloc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delete_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],essenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bind:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zenoss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],correspond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],issu:[13,34,26,17,18],client_foo:19,allow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum_globalconfig:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aws_secret_access_kei:26,jira:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],restorecon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comma:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_ro_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],infrastructur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openvpn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bittorr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],therefor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],keepaliv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],greater:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],auto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],auth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rubygem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recipe_url:9,front:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_cache_path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],edit:34,radiant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pacman_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a7cffd5":15,mode:[34,18],all_cap:26,subset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jane_do:18,chunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],meta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"static":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ec2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],citrix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],patch:5,special:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],out:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],variabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gentoo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bag:[13,19,31,2,34,5,18,9,10,27,20,29],armor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erlang_solut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rails_enterpris:5,categori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suitabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rem:29,hardwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"_default":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"56g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],local_destination_msi_path:29,red:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_server:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shut:18,insid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sendmail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],manipul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],standalon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],releas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shortest:18,qpid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stackscript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],s3_bucket:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fqdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],david:18,length:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],outsid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],retain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],respond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],polici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],echo:29,date:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],puppet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pgp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kerbero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],owner:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],facil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],underscor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erubi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],licens:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mkdir:29,system:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],messag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],attach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],attack:[13,17],privaci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],termin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"final":29,uri_for_https_serv:30,udp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shell:[34,18],big:18,fuzzi:15,shallow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rdoc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rsa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exactli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],haven:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passenger_apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homedr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],structur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],charact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sens:5,sensit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],start_tim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plaintext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remote_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inno:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],download_directori:31,have:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bootstrap_proxi:29,cfengin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],freebsd_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],min:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],atim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],accuraci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],which:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"256f884f":12,datacent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],singl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reposerv:29,unless:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],freebsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deploy:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],who:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oracl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cipher:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deploi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],xarg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,36,37],kuwata:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],segment:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],why:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],push_job:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],p180:29,url:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],request:[13,19,27,21,22,2,31,4,5,6,34,36,25,18,9,10,11,20,29],uri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],determin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jenkin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],editpa:26,wikipedia:26,verbos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bring:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nagl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redirect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],emac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],launchpad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspace_usernam:26,terremark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"26am":34,jar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],should:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],local:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],contribut:5,"226ca64f":12,notat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],familiar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passeng:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],autom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],beam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],increas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsc_script:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],enabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],organ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],twice:32,sudoer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],num_to_keep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sha:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],integr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],partit:18,contain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],view:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debconf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],conform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],legaci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],libshadow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],signatur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],displai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],elast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],temporarili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],brightbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],imagemagick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],xxxxx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],closer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],datadog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],impos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],correctli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pattern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machine_execut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vim74:26,sublim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],progress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],email:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],retry_delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],job:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],entir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homebrew:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],swift:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],addit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plugin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],admin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],equal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],etc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ami:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cinder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sigterm:18,testclient:19,strftime:1,etm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comment:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extrasmal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hyphen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chmod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],b4c32f2:5,respect:31,rpm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mailto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_email:26,yaml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bluelock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dword_big_endian:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],insuffici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],json:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],scriptabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ia2itmjrsw8:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],immedi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],capistrano:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],both:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vmware:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rvm:29,last:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thesecret123:36,present:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],replic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],need:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mvc3:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],defin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passord:18,hkey_current_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flowdock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],code_gener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],helper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],squid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slicehost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],archiv:[9,5],dual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lightweight:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],incom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],revis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],parti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],member:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],handl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],amazonec2tag:5,infer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backtrac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],http:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hostnam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],again:36,keepal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nested_attribut:15,iop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machine_batch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],identify_fil:[33,30,17],logfil:[9,34],php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tftp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],expand:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cosmet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],center:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],not_if:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],well:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],command:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,29,30,31,32,33,34,35,36,37],digitalocean:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],setx:29,latest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],newest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data_bag_item:36,less:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tcp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],end_tim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machine_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],webui:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sdanna:5,dsc_resourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sku:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gmc:28,smith:18,omnibu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],myhelpermodul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apparmor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],foobar:32,logger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"4d44b5b":5,match:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_path:26,cpan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],know:26,mynod:[25,29],cookbook_descript:5,recurs:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],insert:5,tail:34,resid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],like:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fsync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],latest_vers:5,amazonaw:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],necessari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mustach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],soft:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],page:[9,34,27,18],apachev2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],eucalyptu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],revers:12,twitter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kdc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msiexec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_data_bag_item:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flush:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],proper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],small:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],librari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tmp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbookvers:31,leaf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],leak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redis_lb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],qr_knife_web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a7ca19f":15,easy_install_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],investig:18,throttl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],usag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maven:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vhost:5,host:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stage:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homesick:5,sbin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ntlm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],justin:26,column:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],haproxi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],loftninja:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],disabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],own:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],automat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],guard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],webpi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],smarto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],merb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],virtualbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],merg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],omnio:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transfer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],downgrad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],progra:26,"var":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exampleorg:19,"function":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],waldendud:18,subscrib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],baseurl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],addloc:29,bff_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oauth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],highest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],count:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],made:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wise:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arp_tabl:26,node_ip_address:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dmg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],whether:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rc1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],troubl:18,asynchron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],record:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],below:18,limit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],indefinit:9,lvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],otherwis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],problem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actions_web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],epel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],grantmc:28,evalu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ceilomet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dure:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],updated_at:5,ephemer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],implement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mtime:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mutual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],boot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],detail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],virtual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],other:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],branch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],riak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upstart:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],juno:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspace_api_usernam:26,"100m":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thoreau:18,sbdm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debian:[13,34,18,9,27,20],webpicmdlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"25z":5,sphinx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tomcat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scientif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rule:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],blog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],emerg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0_8_1":5,cookbook:[13,19,2,34,18,9,10,27,20,29]},objtypes:{},objnames:{},filenames:["knife_role","knife_exec","knife_configure","knife_recipe_list","knife_environment","knife_cookbook_site","knife_download","knife_user","knife_list","ctl_chef_solo","knife_common_options","knife_delete","knife_status","index","knife_raw","knife_search","knife_index_rebuild","knife_ssl_check","ctl_chef_server","knife_client","knife","knife_diff","knife_edit","knife_show","knife_serve","knife_deps","knife_using","ctl_chef_shell","knife_xargs","knife_bootstrap","knife_ssl_fetch","knife_cookbook","knife_node","knife_ssh","ctl_chef_client","knife_upload","knife_data_bag","knife_tag"],titles:["knife role","knife exec","knife configure","knife recipe list","knife environment","knife cookbook site","knife download","knife user","knife list","chef-solo","Common Options","knife delete","knife status","chef-client Man Pages","knife raw","knife search","knife index rebuild","knife ssl check","chef-server-ctl","knife client","knife","knife diff","knife edit","knife show","knife serve","knife deps","Working with Knife","chef-shell","knife xargs","knife bootstrap","knife ssl fetch","knife cookbook","knife node","knife ssh","chef-client","knife upload","knife data bag","knife tag"],objects:{},titleterms:{help:18,show:[0,31,32,4,5,23,7,18,36,19],text:26,syntax:[0,1,2,3,4,25,6,7,8,11,12,14,15,16,35,19,21,22,23,24,5,26,28,29,31,32,33,36,37],privileg:34,configur:2,reregist:[7,19],window:[34,29],format:26,subcommand:18,stop:18,repo:26,ssl:[30,17],verb:26,ssh:33,password:18,restart:18,recip:3,term:18,tail:18,edit:[0,22,4,32,7,18,36,19],list:[0,31,32,3,37,4,5,7,18,8,36,19],upload:[35,31],authent:1,server:18,bag:36,common:10,kill:18,remov:32,set:26,chef:[34,9,27,18,13],instal:[5,18],download:[6,5,31],unshar:5,index:16,statu:[12,18],sub:26,compar:4,delet:[36,0,31,32,37,4,7,18,11,19],knife:[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,35,19,20,21,22,23,24,25,26,28,29,30,31,32,33,36,37],metadata:31,solo:9,run:34,add:32,ubuntu:29,org:18,plug:26,search:[26,15,5],cleans:18,page:13,recov:18,ctl:18,mani:26,backup:18,onc:18,apt:29,api:1,run_list:32,linux:34,diff:21,from:[32,4,36,0,31],log:18,script:1,data:[26,36],rebuild:16,upgrad:18,custom:29,avail:18,start:18,json:26,master:18,editor:26,shell:27,option:[0,1,2,3,4,25,6,7,8,9,10,11,12,14,15,16,35,19,21,22,23,24,5,27,28,29,31,32,33,34,36,37],rubi:1,reconfigur:18,bulk:[32,31,0,19],hup:18,uninstal:18,serv:24,dep:25,servic:18,work:26,fetch:30,bootstrap:29,creat:[0,31,32,37,4,7,18,36,19],"int":18,share:5,site:5,templat:29,mode:27,high:18,raw:14,tag:37,file:[0,31,32,4,18,36],check:17,quot:26,same:26,client:[13,34,19],role:0,test:31,environ:4,config:18,node:32,elev:34,exec:1,user:[26,7,18],xarg:28,associ:18,debian:29,man:13,gather:18,request:1,exampl:[0,1,2,3,4,25,6,7,8,9,11,12,14,15,16,35,19,21,22,23,24,5,28,29,31,32,33,34,36,37],command:26,wildcard:26,disassoci:18,cookbook:[5,31],microsoft:29}}) \ No newline at end of file
+Search.setIndex({envversion:42,terms:{kickstart:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chisamor:12,poorli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],four:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prefix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dirnam:26,rsyslog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oldest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],accur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],service_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],umask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],descript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_typ:[0,14,31,32,4,7,36,19],under:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slowest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],replica:18,digit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],everi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_maintain:5,upstream:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],affect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],month:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],csshx:[33,30,17],raw_data:36,cmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upload:[],rabbitmq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rabbitmqctl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],x86_64:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],proxy_url:29,hord:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_java:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hint_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],direct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consequ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],second:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aggreg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ips_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],start_chef:29,even:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],supervis:18,hide:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asid:27,peer_or_non:29,"new":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],net:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],topolog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],metadata:[],default_attribut:[4,0],kilobyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],run_list_item:[32,9,34],displai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],never:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],macports_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],here:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],num_vers:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recipe_nam:[32,0],host_head:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],interpret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hosted_everyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dry:[6,35,28,5],erl_cal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rubocop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],url_or_uri:[30,17],chefspec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],databagitem:36,runlist:[9,34],brought:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],substr:26,unix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],printf:1,hipchat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],txt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],describ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],would:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bundler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],call:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recommend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],indiana:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],type:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],until:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fastcgi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],relat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],server_url:27,notic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],warn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oc_bifrost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exce:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],relai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],killal:34,hold:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],must:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gecod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],join:1,henri:18,orgnam:[26,19,29],setup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],work:[],bluebox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],raid1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fnmatch:31,root:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],could:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ss6p92l_sca:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],overrid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],give:[34,1],smtp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],elrepo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],indic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],want:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],keep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],end:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quot:[],eni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vagrant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],how:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],env:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],config:[],updat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],after:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],emac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],befor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],windows_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],parallel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],demonstr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],request_path:14,attempt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],client_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opaqu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bootstrap:[],credenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exclud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alias:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maintain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],environ:[],danno:7,enter:[12,21,34,0,14,1,32,33,15,31,4,5,6,7,37,35,26,36,19],order:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],softwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],over:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],becaus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vari:[29,18],cli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],generic_execut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],denver:37,better:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],persist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erlang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],serverspec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],split:1,them:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],woken:34,thei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],proce:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspaceknif:5,"40g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],choic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],changelog:31,conflict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],timeout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],each:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],search_queri:[33,15,30,17,5],eacc:34,side:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mean:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],voxel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],log_loc:29,extract:[6,9,20,13],linod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],network:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],god:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],newli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],content:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rewrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],devops_prod1:37,billing_admin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prioriti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],http_request:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],putti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gunicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],written:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ntp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],situat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],free:1,fred:36,qword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],node1:32,kit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"1_0_0":5,"1_0_1":5,"1_0_2":5,"1_0_3":5,reconfigur:[],sigkil:18,reg_dword_big_endian:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],whateverthedefaultmightb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openssh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openssl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],filter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iso:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],temporari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],user:[],pristin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rang:[12,15,34],render:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chefignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],independ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],capac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],restrict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hook:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instruct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alreadi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],messag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netfx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],primari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],role1:0,rewritten:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tinydn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],top:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sometim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mercuri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],master:[],too:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],amqp_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],john:18,listen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cloudform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iptabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"8wjyvhy9fhcegaareg":36,namespac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a58cf8":15,yield:26,"10g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bookshelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sha1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],max_arg:28,auxw:34,target:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],provid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tree:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],project:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],matter:26,gnupg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],entri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],minut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],provis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],behavior:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ram:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mine:29,unicast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],raw:[],pessimist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],seed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_rubi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],snow:29,chefservicefeatur:29,blue:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],though:32,usernam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],glob:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],object:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regular:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],s001:34,specifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],letter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],breakpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],don:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],doc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],metal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dog:36,doe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_licens:26,wildcard:[],teck:7,unchang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],antartica:29,dot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bomb:[9,27,34],runit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opposit:[6,13,35,20,18],whitelist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],random:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ruby_block:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syntax:[],radio:7,identifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],make:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],celeri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],absolut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],layout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a58e134":15,holder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],configur:[],apach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lwrp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ldap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],folder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oct:33,likewis:5,stop:[],compli:18,amazon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],servermanagercmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],report:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],youtub:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bar:[9,27,34],method:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],runa:34,reload:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zabbix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],no_proxy_url_or_ip:29,groupinstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],num:[33,30,17],mandatori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],result:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],respons:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noinput:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],key_fil:34,mdadm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],best:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rsa_kei:19,awar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],said:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],databas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multiinst:26,sigint:18,solr4:18,irb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],irc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],approach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],databag:14,attribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],were:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extens:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],policyfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],toler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],advertis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kitchen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],protect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],easi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],met:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],howev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],against:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fedora13:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],logic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],countri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],login:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],com:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rehash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],publishset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],loader:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],your_email:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],usr1:34,diff:[],trust:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],assum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],duplic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hints_path:29,chrome:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fri:33,three:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],been:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trigger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],basic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homepath:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hesit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quickli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],life:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_edit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suppress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],worker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],telnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],argument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verify_api_cert:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],child:25,"catch":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ident:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data_bag_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gnu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],servic:[],properti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],calcul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unsolv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dashboard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nexenta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],powershel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],seven:18,remount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],player:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exit:[9,34,1],conf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sever:15,amout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],growl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],perform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suggest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],use_last_modifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],couchdb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],preserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],descend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],djbdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syncd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],complet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],raid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],orgmapp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rais:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],portal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unicorn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tune:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mirror_expir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kept:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scenario:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"30t21":5,flush_cach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],name_of_premium_featur:18,inherit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],contact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gzip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],everyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],left:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],protocol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],just:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sigusr1:34,bandwidth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],human:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],name_of_servic:18,yet:18,languag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],previous:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reboot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mod_php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],had:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],macport:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],els:29,save:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ubuntu12:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ubuntu10:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],applic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_vers:[4,5,31],mayb:[9,27,34],metabas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fusion:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],json_class:[0,14,31,32,4,7,36,19],shadow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pingabl:18,daemon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],specif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deprec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nrpe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arbitrari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],manual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],graylog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deploy_revis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],public_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sublime_text:26,specifii:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],el6:18,underli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multi_str:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],right:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],interv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],percentag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tibetanspaniel:36,intern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],successfulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transmiss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],knife_config:29,total:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],setloc:29,deploy:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],track:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],select:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],condit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],foo:[9,27,14,34],localhost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],core:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uncompress:5,insecur:18,repositori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anagram:26,actions_messag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"super":34,grizzli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subkei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plug:[],postgresql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],surround:[13,0,31,32,3,20,19],birdman:7,svn_argument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],horizon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],commit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"float":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],profession:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bound:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],diwb:18,down:18,run_list:[],storag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],eth1:18,git:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suffici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],support:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nova:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"class":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],avail:[],reli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wordpress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],editor:[],jane:18,sha512:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],war:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lowest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],head:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noevict:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],form:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],some:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forg:[13,30,17],useradd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"25t23":5,icmp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"true":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wmi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],middle_nam:18,attr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ssh_known_host:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maximum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mtu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inaccur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fundament:31,opensus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],featur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openbsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],classic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decrypt:36,sale:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],diagnost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],glanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ship:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],check:[],sticki:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],assembl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vista:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],groupmod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],encrypt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],when:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],win_wget_p:29,role:[],test:[],roll:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],node:[],notif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],intend:26,phoenix:37,kvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asterisk:[26,18],devop:[0,31,32,4,5,19],stompserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],intent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],younger:7,search_attribut:1,faster:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anywher:[6,35],pbkdf2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],time:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],push:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backward:27,impli:15,skip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redis2:5,netbsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],row:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zookeep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],varnish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],middl:[13,17],depend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zone:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],installonlypkg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comun:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],text:[],downtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aspx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],string:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org_nam:18,cookbooks_path:9,cloudstack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lru:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],template_filenam:29,brows:[6,35],public_hostnam:33,script_fil:1,pkgbuild:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],administr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],level:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],did:[12,18],iter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],magnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],item:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cooki:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],validation_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prevent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bffcreat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sign:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],port:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"5272a43f":12,raid5:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],icinga:5,repli:[13,17],current:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],id3lib:5,reg_binari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deriv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],executionpolici:29,gener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unauthor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef11:18,chef12:18,modif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],address:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],along:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redmin:5,wait:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],box:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_environ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],invit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checksum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],behav:26,healthi:12,regardless:29,rightscal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extra:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],modul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],test_system:1,prefer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],peer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],leav:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],seattl:37,visibl:1,instal:[],post:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regex:[32,3,31,0,19],memori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sensu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subvers:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],handler:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],criteria:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checkout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],azur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rabbitmq_chef:5,visual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tandem:18,templat:[],log_directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],effort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],role_nam:[32,0,25],proxy_cache_path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tokyo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uniqu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cat:1,descriptor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],profitbrick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],graphit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],www:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscode_erchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],purpos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nearest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],container_servic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stream:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backslash:[26,28],agent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],topic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],critic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mirrorlist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],occur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alwai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sundai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multipl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gem_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ping:18,uptim:[33,18],write:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mixlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],purg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],map:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],product:[13,21,35,15,4,6,18,20,29],omnitruck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],max:28,clone:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sp4:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],identity_fil:[33,30,17,29],appnam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hklm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],log_level:[9,34,29],roundrobin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data:[],man:[],freshli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nullsoft:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],purge_before_symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],logwatch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],preced:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],combin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],talk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],port_list:26,config_fil:[10,30,17],ssh_wrapper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],partial_search:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ttl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gitignor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],still:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dynam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],entiti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],conjunct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],group:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],monitor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],duplex:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],platform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],non:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],main_monitor:3,rake:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],initi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],safari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],half:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nov:34,superset:26,provision:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],discuss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],term:[],name:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],revert:18,separ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],full_nam:18,compil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],failov:18,domain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],replac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],individu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],name_of_packag:18,continu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unlock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gnu_parallel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],year:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],happen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subnet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"3rd":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],space:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"100g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],profil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vrrp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],internet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],correct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkey_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],orgtest:15,newsiz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],migrat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],argv:1,mime:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org:[],"byte":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],care:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reusabl:31,wai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],frequenc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],synchron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thing:18,place:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fa0fc4abf3f6787aeb5c3c5c35de667c:31,router:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],principl:26,think:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],frequent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],first:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],origin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],directli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],carri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],onc:[],arrai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"long":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oppos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uncaught:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],open:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],predefin:1,size:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],given:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reprepro:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],silent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],install_chef:29,ssh_command:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iaa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],baremetalcloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],citi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cumul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],averag:33,white:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apt_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],json_attrib:29,environment_nam:[9,4,25],hub:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],especi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],provinc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],copi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],full_control:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],artifact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],broadcast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],minitest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"short":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],enclos:26,mostli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],john_smith:18,pecl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],than:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],png:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],serv:[],wide:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sbuild:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],windows_servic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],posix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],balanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],optimist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zsh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pre:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fork:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],config_cont:29,pro:26,delim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ani:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],client_kei:[26,34],ant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],medium:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],smartos_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cassandra:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extralarg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],engin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],destroi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],note:1,sendfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ideal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],copyright_hold:31,take:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],channel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],begin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sure:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trace:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],normal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],buffer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],statu:[],instiki:5,timestamped_deploi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pair:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],collectstat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],later:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drive:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_expand_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],runtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],superblock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],expand_str:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],salt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],show:[],encrypted_data_bag_secret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],concurr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],permiss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sysctl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],help:[],xml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],onli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],explicitli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],moneta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],favor:[33,30,17],gceserviceaccount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],activ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],state:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hello_world:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],analyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sighup:18,nearli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],variou:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],get:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stomp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],secondari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],repo:[],ssl:[],cannot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ssh:[],requir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debian5:29,foodcrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aptitud:33,netscalar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],where:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],summari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wiki:[26,5],kernel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],installshield:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],spork:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],endloc:29,drbd0:18,data_bag:[26,36,14],xenserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],concern:18,detect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],review:[0,1,2,3,4,25,6,7,8,11,12,14,15,16,35,29,21,22,23,24,5,28,19,31,32,33,36,37],label:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],behind:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],volatil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],between:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dockerfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"import":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],across:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sname:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],parent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],node_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],screen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solaris_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],supermarket:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syntax_check_cache_path:26,come:26,tue:34,gpasswd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uuid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],librato:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pychef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],library_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],datamapp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mani:[],runcontext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reindex:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],color:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],period:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],symfoni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],colon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],generic_writ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cancel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsc_mof:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],poll:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bluepil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ultim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org_full_nam:18,west:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rebuild:[],replace_str:28,mark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],spiceweasel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rebuilt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],my_cookbook:31,rubi:[],editpad:26,those:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"case":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],eip:21,pedant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],invok:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],base64:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],region:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suse:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_nginx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stdout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],metric:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_client:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],airbrak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cluster:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ascii:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aa384235:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],develop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],author:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],media:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],same:[],binari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],html:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],document:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],week:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],finish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],webserv:[21,32,33,34,25,6,35,9,27,29],nest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],confidenti:36,driver:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],capabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openldap:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],improv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],repoforg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appropri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],megabyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],without:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trusted_certs_dir:[13,30],model:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],resource_collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],a29d6f254577b830091f140c3a78b1f:31,execut:[],loaderror:33,key_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kill:[],aspect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],org_cleanu:3,touch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passphras:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],http_proxi:29,speed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aws_access_key_id:26,samba:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],display_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],except:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],identif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instrument:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],query_to_run:15,ruby1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],earli:18,around:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ohai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],read:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],traffic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],platform_vers:31,world:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yyyymmddhhmmss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mof:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],iftop:5,integ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],server:[],either:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],output:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rubyv:1,manag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cisco:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],glesi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],server01:[33,30,17],freez:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rsync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],keytab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],easili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],definit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appscript:33,keyston:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],highcpu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],portage_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],knife:[],refer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],power:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],notepad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inspect:[6,13,20],broken:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],a45298c9:12,starttim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],found:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],berksfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bazaar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comparison:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],central:9,ack:5,gplv2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gplv3:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],acl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],percona:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],act:27,backup:[],processor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],effici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],max_siz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],insuffici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],your:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],charli:36,hkey_current_config:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],log:[],daemontool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],simultan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],overwrit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],start:[],interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ipv4:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ipv6:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],svn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],enough:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bundl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],untar:5,cabinet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opensolari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],activemq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],conclus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],longer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chefclientfeatur:29,pull:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],possibl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"default":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pacman:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bucket:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],powershell_script:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vhd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],embed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],connect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cbc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uid:36,creat:[],certain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remote_directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_handl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],decreas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fail2ban:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file:[],fill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],incorrect:34,file_maxbyt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],googl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prepend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],field:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],valid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],you:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],architectur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],codecademi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],registri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sequenc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],symbol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pear:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fsck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],snitch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dropbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pool:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_lag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reduc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],directori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_copyright:26,mask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],use_etag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],escap:[26,28],cpu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actions_consum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],represent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],all:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],selinux:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forbidden:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ibm305ramac:1,lacp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],java_opt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_l2_interfac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],follow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],disk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],children:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sympa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],init:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],program:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],app_conf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scratch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],introduc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cloudkick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],global:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],premium:18,fals:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checkin:1,subcommand:[],util:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verb:[],mechan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],failur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],veri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ossec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],excluded_memb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],list:[],last_nam:18,gerritt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recipe_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plain:36,user_nam:[33,30,7,17,18],pid_fil:34,enterpris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drbd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],past:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syslog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rate:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],design:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pass:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ssh_attr:[33,30,17],further:18,current_dir:26,proxi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],what:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum_repositori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sub:[],section:[13,20,26],abl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],brief:[12,13,20],rackspac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delet:[],abbrevi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],version:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noprofil:29,"public":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prereleas:29,full:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],berkelei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],multilib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],excess:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gandi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],standard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],modifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],valu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thrift:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],search:[],memcach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prior:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],amount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pick:34,action:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],warrant:[13,20,1],via:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tmux:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],filenam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],establish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redisio:4,proceed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],two:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],validation_client_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],more:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flat:8,association_us:18,wrapper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],desir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],site:[],flag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],particular:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],known:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compani:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],destin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],installroot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],psql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],none:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],endpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hour:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dep:[],dev:[12,32,15,34,4,18,9,27],histori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oktawav:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkey_local_machin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],caveat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],learn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nagio:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],external_url:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prompt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scan:34,share:[],bootstrap_directori:29,accept:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verify_non:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],minimum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],poni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],explor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_data_bag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],csh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],first_nam:18,secur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rather:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anoth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pxe_dust:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],simpl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],distro:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],regener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],resourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],referenc:[7,19],vlan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fstype:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rbac:26,perl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data_bag_item_dogs_tibetanspaniel:36,associ:[],github:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],postfix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],created_at:5,django:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],caus:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],allkei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],logrot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rotat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],templatefortextstr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],i386:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],through:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],htop:5,paramet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],create_dirs_before_symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],systemd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_databas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exact:[32,15],pend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_nam:[0,25,5,31],bypass:[6,13,20],"return":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],graylog2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],timestamp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],framework:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],admin_nam:26,troubleshoot:18,hkey_classes_root:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],authent:[],"1password":5,userprofil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],token:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],average_r:5,compris:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unicod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],only_if:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],truncat:[32,5],denni:7,harm:[13,30],"300mb":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],crontab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],expect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],new_client:1,create_wait_m:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],portland:37,beyond:26,event:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ftp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vancouv:37,robert:7,publish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],etag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],print:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],occurr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_nam:[19,7,31,18],gpl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],qualifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],devops_data:36,advanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],campfir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],effect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reason:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],base:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],put:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],workstat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],basi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thread:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],launch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],omit:[15,19],perman:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],heartbeat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],assign:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],excurs:18,notifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],number:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],env_vari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],done:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stdlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],blank:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],miss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_atomic_upd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pgdg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],differ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],script:[],ipaddress:1,interact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unrestrict:29,least:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],checkpoint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],win2k8:15,statement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zeromq:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scheme:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],journli:4,jetti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],store:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],schema:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dpkg_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],storm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],part:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pars:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consult:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dpkg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reinstal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],grep:[34,5,29],remot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remov:[],reg_qword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],secret_access_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],randomli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comput:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gvim:26,packag:[],expir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dedic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],testmast:18,berkshelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],built:[26,18],equival:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],also:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],centos5:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rakefil:21,build:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stackforg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],splai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pipelin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],distribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exec:[],previou:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],quota:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],most:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],private_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],preprod:18,clear:34,cover:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],destruct:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],clojur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],clean:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],packagecloud:18,configuration_data_script:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],microsoft:[],carefulli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],xcode:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alphanumer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ignore_failur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],session:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fine:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],affin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],firewal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bff:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pretti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jtimberman:[5,29],darwin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],everysec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unus:[7,19],chef_gem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"__file__":26,express:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],verify_p:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nativ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mainten:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fastest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],restart:[],"225f954f":12,data_bag_name_or_path:36,crt:21,boost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],your_company_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],common:[],gelf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cmdlet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],syntax_check_cach:26,certif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],set:[],dump:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],creator:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],startup:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ifconfig:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],see:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arg:28,reserv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flavor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cssh:[33,30,17],git_ssh:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],example_nod:1,prempt_delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],someth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subscript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],altern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solo:[],chef_nod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gemfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],numer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],javascript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],succeed:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],distinguish:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],popul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],satisfi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_multi_sz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delimit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],configuration_data:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],context:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],access_key_id:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lash:1,vault:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],load:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],markdown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],point:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],schedul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],uptod:18,header:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shutdown:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ucspi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],desktop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backend:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],authz:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspace_api_kei:26,unsuccess:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],java:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],devic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],add:[],empti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],secret:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],strategi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],atomic_upd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homebrew_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],togeth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],imag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rspec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],understand:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0_8_0":5,look:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],registry_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],frozen:31,hkcc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bill:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],batch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],durat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],formatt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"while":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],corpsit:21,abov:29,error:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkcr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maradn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],loop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hkcu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],real:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],motd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],readm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],client_desc:1,dynect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],itself:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cento:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],skype:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vcloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unmount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fedora:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],grant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],belong:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hadoop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shorter:1,octal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],languages_ruby_vers:15,higher:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],x86:26,"0_7_0":5,optim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cloud:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wherea:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inflat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alert:5,jpackag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lxc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nosess:26,typic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lower:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],task:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lib:29,older:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],british_sea_pow:29,ssl_verify_mod:[13,17,29],person:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apptastic_tier_nam:[9,27,34],reflect:4,docker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rbenv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],propos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],override_attribut:[4,34,27,0,9],mysql:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openstack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"07z":5,password:[],busser:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],web03:15,win:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],input:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tell:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subsequ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],app:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vendor:5,obsolet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fqdn_or_ip_address:29,format:[],ipmi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],main_attribut:15,local_download_path:29,nginx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exceptionclass:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],characterist:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],success:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],signal:18,svlogd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],resolv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],elaps:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],princip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],api:[],encount:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vsphere:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],often:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],simplifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],add_formatt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],acknowledg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],creation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],macterm:[33,30,17],back:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],unspecifi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sampl:[32,36,0,18],staticfil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],force_overrid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mirror:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_rol:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],virtualenv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scale:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lamin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],per:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],attribute_nam:32,retri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],larg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],undon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slash:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],prod:18,proc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],snort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_user:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],agreement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],infra:18,step:[13,30,34],apptast:[9,27,34],wget:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],crond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ufw:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],generic_read:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],constraint:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],drbdadm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],idl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],block:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instance_typ:15,nsi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hudson:5,ohai_tim:1,smart_o_s_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscodesupport:5,within:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ensur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rundeck:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],errno:34,question:26,arctic_hint:29,fast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],custom:[],includ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],forward:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],properli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ifcfg:15,textpad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remote_source_msi_url:29,pwd:29,link:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],translat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],newer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],atom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],noninteract:29,line:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],penguin:29,info:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],utc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],consist:[26,0],munin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],groovi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nscd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"export":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],similar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nsca:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],supervisor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],doesn:32,repres:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"char":28,incomplet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],home:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],curl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],titl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sequenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],invalid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"_imag":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transport:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],peopl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nice:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deseri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mongodb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],meaning:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_server_url:[26,34,27,29],eval:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],splunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ladvd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],desert:25,lang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"1024mb":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],infrequ:[13,20,1],algorithm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],confirm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yourcompani:26,depth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_overview_attribut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hello:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],endtim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],code:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],partial:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],queri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],groupadd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trywgfa6r70no28pnhmpghevkbzuxouemnbnauqsuyo:36,steve:7,privat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ulimit:4,elsewher:[],send:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],junip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fatal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],getchef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passiv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vlc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],volum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recip:[],magic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],netdev_vlan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],id_rsa:29,geograph:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hive:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"try":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pleas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],malici:[13,30],startup_typ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jdk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slackwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],download:[],click:34,append:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ps1:29,index:[],turn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],compar:[],a47823c9:12,winrm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],find:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],access:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],f65c969b:12,logloc:[9,34],isapi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hku:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bodi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],let:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ubuntu:[],becom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sinc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],convert:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],copyright:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],overwritten:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aardvark:26,larger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],steadi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fetch:[],converg:34,cert:29,rpm_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ctl:[],chang:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],honor:27,fstab:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],firefox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ago:12,danger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],spec_help:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],approxim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gatewai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apt:[],"boolean":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],smartmon:31,redi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pxe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],from:[],zip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],commun:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],doubl:26,upgrad:[],nexu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],next:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],websit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],few:[34,18],use_conditional_get:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],usr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sort:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],src:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mismatch:4,about:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"transient":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],starter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],account:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],retriev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tunnel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alia:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],crazi:36,hint_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],control:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sqlite:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],weaker:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],process:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sudo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_collect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],high:[],tag:[],proprietari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tarbal:[5,18],someurlher:31,symlink_before_migr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sit:[26,36],tamper:[13,30],zenpack:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reg_dword:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],subdirectori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instead:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],opscode_us:26,zendmd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],somelongurlher:31,overridden:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],watch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apicli:19,tier:[],chef_repo_path:[21,13,22,35,25,23,6,24,8,11,28],physic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tenant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],alloc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],delete_kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],essenti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bind:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zenoss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],correspond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],issu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],client_foo:19,allow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum_globalconfig:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],aws_secret_access_kei:26,jira:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],restorecon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comma:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_ro_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],infrastructur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],openvpn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],asa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bittorr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],therefor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],keepaliv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],greater:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],python:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],auto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],auth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rubygem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],recipe_url:9,front:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],file_cache_path:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],trac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],anyth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],edit:[],radiant:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pacman_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a7cffd5":15,resource_nam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],all_cap:26,subset:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jane_do:18,chunk:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],meta:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"static":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ec2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],citrix:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],patch:5,special:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],out:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],variabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gentoo:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bag:[],armor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erlang_solut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rails_enterpris:5,categori:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],suitabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rem:29,hardwar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"_default":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"56g":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],local_destination_msi_path:29,red:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sql_server:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shut:18,insid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],workflow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],manipul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],standalon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],releas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shortest:18,qpid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stackscript:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],s3_bucket:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ask:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fqdn:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],david:18,length:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],outsid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],retain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],respond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],polici:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],echo:29,date:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],puppet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pgp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kerbero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],owner:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],facil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],underscor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],erubi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],licens:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mkdir:29,system:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arista:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],attach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],attack:[13,17],privaci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],termin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"final":29,uri_for_https_serv:30,udp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shell:[],big:18,fuzzi:15,shallow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rdoc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rsa:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exactli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],haven:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passenger_apache2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homedr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],structur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],charact:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sens:5,sensit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],start_tim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plaintext:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],remote_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inno:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],download_directori:31,have:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bootstrap_proxi:29,cfengin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],freebsd_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],min:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rout:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],atim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],accuraci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],which:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"256f884f":12,datacent:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],zlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],force_default:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],reposerv:29,unless:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],freebsd:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fidel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],who:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oracl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],discov:29,cipher:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deploi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],xarg:[],kuwata:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],segment:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],why:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],push_job:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],placement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],p180:29,url:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],request:[],uri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],deni:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],yum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],determin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],jenkin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],editpa:26,millisecond:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wikipedia:26,verbos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bring:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nagl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redirect:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],locat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],launchpad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspace_usernam:26,terremark:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"26am":34,jar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sendmail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],should:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],local:[],contribut:5,"226ca64f":12,notat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],familiar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passeng:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],autom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],beam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],increas:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dsc_script:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],enabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],organ:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],twice:32,sudoer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],num_to_keep:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sha:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stuff:[9,27,34],integr:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],partit:18,contain:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_zero:34,view:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debconf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],conform:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],legaci:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],libshadow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],signatur:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],easy_install_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],elast:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],temporarili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],brightbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],imagemagick:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],xxxxx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],closer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],datadog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],impos:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],correctli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pattern:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machine_execut:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vim74:26,sublim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],progress:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],application_php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],email:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kei:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],retry_delai:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],job:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],entir:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homebrew:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],swift:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],addit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],plugin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],admin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],equal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],etc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],instanc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ami:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cinder:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sigterm:18,testclient:19,strftime:1,etm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],comment:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],extrasmal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hyphen:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chmod:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],solv:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],b4c32f2:5,respect:31,rpm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mailto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_email:26,yaml:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bluelock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dword_big_endian:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],enable_apptast:[9,27,34],compon:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],json:[],treat:[9,27,34],scriptabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ia2itmjrsw8:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],immedi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],capistrano:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],both:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vmware:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rvm:29,last:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thesecret123:36,present:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],replic:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],need:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mvc3:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],defin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],passord:18,hkey_current_us:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flowdock:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],code_gener:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],helper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],squid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],slicehost:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],archiv:[9,5],dual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],lightweight:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],incom:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],revis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],parti:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],member:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],handl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],amazonec2tag:5,infer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],backtrac:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],http:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],hostnam:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],again:36,keepal:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"null":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],nested_attribut:15,iop:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machine_batch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],identify_fil:[33,30,17],logfil:[9,34],php:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tftp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],expand:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cosmet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],center:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],not_if:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],well:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],command:[],digitalocean:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],setx:29,latest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],newest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],data_bag_item:36,less:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tcp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],end_tim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machine_fil:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],webui:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sdanna:5,dsc_resourc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],sku:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],gmc:28,smith:18,omnibu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],myhelpermodul:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],apparmor:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],foobar:32,logger:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"4d44b5b":5,match:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbook_path:26,cpan:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],know:26,mynod:[25,29],cookbook_descript:5,recurs:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],insert:5,tail:[],resid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],like:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],fsync:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],latest_vers:5,amazonaw:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],necessari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mustach:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],soft:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],page:[],apachev2:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],shef:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],eucalyptu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],revers:12,twitter:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],kdc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],msiexec:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],chef_data_bag_item:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],flush:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],proper:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],small:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],librari:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tmp:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],cookbookvers:31,leaf:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],leak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],redis_lb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],qr_knife_web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0a7ca19f":15,mode:[],investig:18,throttl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],usag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],symlink:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],maven:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],vhost:5,host:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],stage:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],homesick:5,sbin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ntlm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],justin:26,column:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dism:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],haproxi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],loftninja:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],disabl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],own:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],automat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],guard:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],webpi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],smarto:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],merb:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],virtualbox:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],merg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],omnio:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],transfer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],machine_imag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],singl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],appl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],downgrad:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],progra:26,"var":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],exampleorg:19,"function":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],waldendud:18,subscrib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],baseurl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],addloc:29,bff_packag:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],oauth:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],highest:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],bug:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],count:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],succe:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],made:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],wise:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],arp_tabl:26,node_ip_address:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dmg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],whether:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rc1:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],troubl:18,asynchron:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],record:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],below:18,limit:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],indefinit:[9,34],lvm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],otherwis:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],problem:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],actions_web:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],epel:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],grantmc:[28,18],evalu:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],ceilomet:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],dure:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pid:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],updated_at:5,ephemer:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],implement:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mtime:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],pip:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inc:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],mutual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],boot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],detail:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],virtual:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],other:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],branch:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],riak:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],upstart:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],juno:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rackspace_api_usernam:26,"100m":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],thoreau:18,sbdm:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],debian:[],webpicmdlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"25z":5,sphinx:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],tomcat:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],scientif:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],rule:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],blog:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],emerg:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"0_8_1":5,cookbook:[]},objtypes:{},objnames:{},filenames:["knife_role","knife_exec","knife_configure","knife_recipe_list","knife_environment","knife_cookbook_site","knife_download","knife_user","knife_list","ctl_chef_solo","knife_common_options","knife_delete","knife_status","index","knife_raw","knife_search","knife_index_rebuild","knife_ssl_check","ctl_chef_server","knife_client","knife","knife_diff","knife_edit","knife_show","knife_serve","knife_deps","knife_using","ctl_chef_shell","knife_xargs","knife_bootstrap","knife_ssl_fetch","knife_cookbook","knife_node","knife_ssh","ctl_chef_client","knife_upload","knife_data_bag","knife_tag"],titles:["knife role","knife exec","knife configure","knife recipe list","knife environment","knife cookbook site","knife download","knife user","knife list","chef-solo","Common Options","knife delete","knife status","chef-client Man Pages","knife raw","knife search","knife index rebuild","knife ssl check","chef-server-ctl (executable)","knife client","knife","knife diff","knife edit","knife show","knife serve","knife deps","Working with Knife","chef-shell","knife xargs","knife bootstrap","knife ssl fetch","knife cookbook","knife node","knife ssh","chef-client","knife upload","knife data bag","knife tag"],objects:{},titleterms:{help:18,execut:18,show:[0,31,32,4,5,23,7,18,36,19],text:26,syntax:[0,1,2,3,4,25,6,7,8,11,12,14,15,16,35,19,21,22,23,24,5,26,28,29,31,32,33,36,37],privileg:34,configur:2,reregist:[7,19],window:[34,29],local:18,format:26,subcommand:18,stop:18,repo:26,ssl:[30,17],verb:26,ssh:33,password:18,restart:18,recip:3,term:18,tail:18,edit:[0,22,4,32,7,18,36,19],list:[0,31,32,3,37,4,5,7,18,8,36,19],upload:[35,31],authent:1,server:18,bag:36,common:10,kill:18,remov:[32,18],set:26,chef:[34,9,27,18,13],instal:[5,18],download:[6,31,5,18],unshar:5,index:16,statu:[12,18],sub:26,compar:4,delet:[36,0,31,32,37,4,7,18,11,19],knife:[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,35,19,20,21,22,23,24,25,26,28,29,30,31,32,33,36,37],metadata:31,solo:9,run:34,add:[32,18],ubuntu:29,org:18,plug:26,search:[26,15,5],cleans:18,page:13,recov:18,ctl:18,mani:26,backup:18,onc:18,apt:29,api:1,run_list:32,linux:34,diff:21,from:[32,4,36,0,31],log:18,script:1,data:[26,36],rebuild:16,upgrad:18,custom:29,avail:18,start:18,json:26,master:18,editor:26,shell:27,option:[0,1,2,3,4,25,6,7,8,9,10,11,12,14,15,16,35,19,21,22,23,24,5,27,28,29,31,32,33,34,36,37],rubi:1,reconfigur:18,bulk:[32,31,0,19],hup:18,uninstal:18,serv:24,packag:18,dep:25,servic:18,work:26,fetch:30,bootstrap:29,creat:[0,31,32,37,4,7,18,36,19],"int":18,share:5,site:5,templat:29,mode:27,high:18,raw:14,tag:37,file:[0,31,32,4,18,36],check:17,quot:26,same:26,client:[13,34,19],role:0,test:31,environ:4,config:18,node:32,elev:34,exec:1,user:[26,7,18],xarg:28,associ:[],debian:29,man:13,gather:18,request:1,exampl:[0,1,2,3,4,25,6,7,8,9,11,12,14,15,16,35,19,21,22,23,24,5,28,29,31,32,33,34,36,37],command:26,wildcard:26,disassoci:[],cookbook:[5,31],microsoft:29}}) \ No newline at end of file
diff --git a/distro/common/man/man1/chef-shell.1 b/distro/common/man/man1/chef-shell.1
index 97aa50bbd0..df004c5b0f 100644
--- a/distro/common/man/man1/chef-shell.1
+++ b/distro/common/man/man1/chef-shell.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "CHEF-SHELL" "1" "Chef 11.16" "" "chef-shell"
+.TH "CHEF-SHELL" "1" "Chef 12.0" "" "chef-shell"
.SH NAME
chef-shell \- The man page for the chef-shell command line tool.
.
@@ -101,6 +101,77 @@ Shows help for the command.
.TP
.B \fB\-j PATH\fP, \fB\-\-json\-attributes PATH\fP
The path to a file that contains JSON data.
+.sp
+Use this option to define a \fBrun_list\fP object. For example, a JSON file similar to:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+"run_list": [
+ "recipe[base]",
+ "recipe[foo]",
+ "recipe[bar]",
+ "role[webserver]"
+],
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+may be used by running \fBchef\-client \-j path/to/file.json\fP\&.
+.sp
+In certain situations this option may be used to update \fBnormal\fP attributes.
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Any other attribute type that is contained in this JSON file will be treated as a \fBnormal\fP attribute. For example, attempting to update \fBoverride\fP attributes using the \fB\-j\fP option:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+{
+ "name": "dev\-99",
+ "description": "Install some stuff",
+ "override_attributes": {
+ "apptastic": {
+ "enable_apptastic": "false",
+ "apptastic_tier_name": "dev\-99.bomb.com"
+ }
+ }
+}
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+will result in a node object similar to:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+{
+ "name": "maybe\-dev\-99",
+ "normal": {
+ "name": "dev\-99",
+ "description": "Install some stuff",
+ "override_attributes": {
+ "apptastic": {
+ "enable_apptastic": "false",
+ "apptastic_tier_name": "dev\-99.bomb.com"
+ }
+ }
+ }
+}
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
.TP
.B \fB\-l LEVEL\fP, \fB\-\-log\-level LEVEL\fP
The level of logging that will be stored in a log file.
diff --git a/distro/common/man/man1/knife-bootstrap.1 b/distro/common/man/man1/knife-bootstrap.1
index 1068daa224..a4a699872f 100644
--- a/distro/common/man/man1/knife-bootstrap.1
+++ b/distro/common/man/man1/knife-bootstrap.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-BOOTSTRAP" "1" "Chef 11.16" "" "knife bootstrap"
+.TH "KNIFE-BOOTSTRAP" "1" "Chef 12.0" "" "knife bootstrap"
.SH NAME
knife-bootstrap \- The man page for the knife bootstrap subcommand.
.
@@ -57,61 +57,78 @@ This subcommand has the following options:
.B \fB\-A\fP, \fB\-\-forward\-agent\fP
Use to enable SSH agent forwarding.
.TP
-.B \fB\-\-bootstrap\-no\-proxy NO_PROXY_URL_or_IP\fP
-A URL or IP address that specifies a location that should not be proxied. Note: This option is used internally by Chef to help verify bootstrap operations during testing and should never be used during an actual bootstrap operation.
-.TP
-.B \fB\-\-bootstrap\-proxy PROXY_URL\fP
-The proxy server for the node that is the target of a bootstrap operation.
-.TP
-.B \fB\-\-bootstrap\-version VERSION\fP
-The version of the chef\-client to install.
-.TP
-.B \fB\-c CONFIG_FILE\fP, \fB\-\-config CONFIG_FILE\fP
-The configuration file to use.
+.B \fB\-\-bootstrap\-curl\-options OPTIONS\fP
+Use to specify arbitrary options to be added to the bootstrap command when using cURL\&. This option may not be used in the same command with \fB\-\-bootstrap\-install\-command\fP\&.
.TP
-.B \fB\-\-chef\-zero\-port PORT\fP
-The port on which chef\-zero will listen.
+.B \fB\-\-bootstrap\-install\-command COMMAND\fP
+Use to execute a custom installation command sequence for the chef\-client\&. This option may not be used in the same command with \fB\-\-bootstrap\-curl\-options\fP, \fB\-\-bootstrap\-install\-sh\fP, or \fB\-\-bootstrap\-wget\-options\fP\&.
.TP
-.B \fB\-\-[no\-]color\fP
-Use to view colored output.
+.B \fB\-\-bootstrap\-install\-sh URL\fP
+Use to fetch and execute an installation script at the specified URL. This option may not be used in the same command with \fB\-\-bootstrap\-install\-command\fP\&.
.TP
-.B \fB\-d DISTRO\fP, \fB\-\-distro DISTRO\fP
+.B \fB\-\-bootstrap\-no\-proxy NO_PROXY_URL_or_IP\fP
+A URL or IP address that specifies a location that should not be proxied.
.sp
-\fBWARNING:\fP
+\fBNOTE:\fP
.INDENT 7.0
.INDENT 3.5
-The default bootstrap operation uses the omnibus installer, which means the default template file (\fBchef\-full\fP) should work on all supported platforms. It is recommended to use custom bootstrap templates only when the omnibus installer cannot be used. The \fB\&.erb\fP file extension is added automatically and should not be passed as part of the bootstrap command.
+This option is used internally by Chef to help verify bootstrap operations during testing and should never be used during an actual bootstrap operation.
.UNINDENT
.UNINDENT
-.sp
-The template file to be used during a bootstrap operation. The following distributions are supported: \fBchef\-full\fP (the default bootstrap), \fBcentos5\-gems\fP, \fBfedora13\-gems\fP, \fBubuntu10.04\-gems\fP, \fBubuntu10.04\-apt\fP, \fBubuntu12.04\-gems\fP, and the name of a custom bootstrap template file. When this option is used, knife will search for the template file in the following order: the \fBbootstrap/\fP folder in the current working directory, the \fBbootstrap/\fP folder in the chef\-repo, the \fBbootstrap/\fP folder in the \fB~/.chef/\fP directory, or a default bootstrap file. Do not use the \fB\-\-template\-file\fP option when \fB\-\-distro\fP is specified.
.TP
-.B \fB\-\-defaults\fP
-Use to have knife use the default value instead of asking a user to provide one.
+.B \fB\-\-bootstrap\-proxy PROXY_URL\fP
+The proxy server for the node that is the target of a bootstrap operation.
.TP
-.B \fB\-\-disable\-editing\fP
-Use to prevent the $EDITOR from being opened and to accept data as\-is.
+.B \fB\-\-bootstrap\-version VERSION\fP
+The version of the chef\-client to install.
.TP
-.B \fB\-e EDITOR\fP, \fB\-\-editor EDITOR\fP
-The $EDITOR that is used for all interactive commands.
+.B \fB\-\-bootstrap\-wget\-options OPTIONS\fP
+Use to specify arbitrary options to be added to the bootstrap command when using GNU Wget\&. This option may not be used in the same command with \fB\-\-bootstrap\-install\-command\fP\&.
.TP
.B \fB\-E ENVIRONMENT\fP, \fB\-\-environment ENVIRONMENT\fP
The name of the environment. When this option is added to a command, the command will run only against the named environment.
.TP
-.B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP
-The output format: \fBsummary\fP (default), \fBtext\fP, \fBjson\fP, \fByaml\fP, and \fBpp\fP\&.
-.TP
.B \fB\-G GATEWAY\fP, \fB\-\-ssh\-gateway GATEWAY\fP
The SSH tunnel or gateway that is used to run a bootstrap action on a machine that is not accessible from the workstation.
.TP
-.B \fB\-h\fP, \fB\-\-help\fP
-Shows help for the command.
-.TP
.B \fB\-\-hint HINT_NAME[=HINT_FILE]\fP
-An Ohai hint to be set on the target of the bootstrap. The hint is contained in a file and is formatted as JSON: \fB{"attribute":"value","attribute":"value"...}\fP\&. \fBHINT_NAME\fP is the name of the hint and \fBHINT_FILE\fP is the name of the hint file located at \fB/etc/chef/ohai/hints/HINT_FILE.json\fP\&. Use multiple \fB\-\-hint\fP options in the command to specify multiple hints.
-.TP
-.B \fB\-\-[no\-]host\-key\-verify\fP
-Use \fB\-\-no\-host\-key\-verify\fP to disable host key verification. Default setting: \fB\-\-host\-key\-verify\fP\&.
+Use to specify an Ohai hint to be set on the target node.
+.sp
+Ohai hints are used to tell Ohai something about the system that it is running on that it would not be able to discover itself. An Ohai hint exists if a JSON file exists in the hint directory with the same name as the hint. For example, calling \fBhint?(\(aqantartica\(aq)\fP in an Ohai plugin would return an empty hash if the file \fBantartica.json\fP existed in the hints directory, and return nil if the file does not exist.
+.sp
+If the hint file contains JSON content, it will be returned as a hash from the call to \fBhint?\fP\&.
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+{
+ "snow": true,
+ "penguins": "many"
+}
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+arctic_hint = hint?(\(aqantartica\(aq)
+if arctic_hint[\(aqsnow\(aq]
+ "There are #{arctic_hint[\(aqpenguins\(aq]} penguins here."
+else
+ "There is no snow here, and penguins like snow."
+end
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The default directory in which hint files are located is \fB/etc/chef/ohai/hints/\fP\&. Use the \fBOhai::Config[:hints_path]\fP setting in the client.rb file to customize this location.
+.sp
+\fBHINT_FILE\fP is the name of the JSON file. \fBHINT_NAME\fP is the name of a hint in a JSON file. Use multiple \fB\-\-hint\fP options to specify multiple hints.
.TP
.B \fB\-i IDENTITY_FILE\fP, \fB\-\-identity\-file IDENTITY_FILE\fP
The SSH identity file used for authentication. Key\-based authentication is recommended.
@@ -119,12 +136,24 @@ The SSH identity file used for authentication. Key\-based authentication is reco
.B \fB\-j JSON_ATTRIBS\fP, \fB\-\-json\-attributes JSON_ATTRIBS\fP
A JSON string that is added to the first run of a chef\-client\&.
.TP
-.B \fB\-k KEY\fP, \fB\-\-key KEY\fP
-The private key that knife will use to sign requests made by the API client to the Chef server\&.
-.TP
.B \fB\-N NAME\fP, \fB\-\-node\-name NAME\fP
The name of the node.
.TP
+.B \fB\-\-[no\-]host\-key\-verify\fP
+Use \fB\-\-no\-host\-key\-verify\fP to disable host key verification. Default setting: \fB\-\-host\-key\-verify\fP\&.
+.TP
+.B \fB\-\-[no\-]node\-verify\-api\-cert\fP
+Use \fBverify_api_cert\fP to only do SSL validation of the Chef server connection; may be needed if the chef\-client needs to talk to other services that have broken SSL certificates. If this option is not specified, the setting for \fBverify_api_cert\fP in the configuration file is applied.
+.TP
+.B \fB\-\-node\-ssl\-verify\-mode PEER_OR_NONE\fP
+The verify mode for HTTPS requests.
+.sp
+Use \fB:verify_none\fP to do no validation of SSL certificates.
+.sp
+Use \fB:verify_peer\fP to do validation of all SSL certificates, including the Chef server connections, S3 connections, and any HTTPS \fBremote_file\fP resource URLs used in the chef\-client run. This is the recommended setting.
+.sp
+If this option is not specified, the setting for \fBssl_verify_mode\fP in the configuration file is applied.
+.TP
.B \fB\-p PORT\fP, \fB\-\-ssh\-port PORT\fP
The SSH port.
.TP
@@ -134,15 +163,9 @@ The SSH password. This can be used to pass the password directly on the command
.B \fB\-\-prerelease\fP
Use to install pre\-release gems.
.TP
-.B \fB\-\-print\-after\fP
-Use to show data after a destructive operation.
-.TP
.B \fB\-r RUN_LIST\fP, \fB\-\-run\-list RUN_LIST\fP
A comma\-separated list of roles and/or recipes to be applied.
.TP
-.B \fB\-s URL\fP, \fB\-\-server\-url URL\fP
-The URL for the Chef server\&.
-.TP
.B \fB\-\-secret SECRET\fP
The encryption key that is used for values contained within a data bag item.
.TP
@@ -152,32 +175,17 @@ The path to the file that contains the encryption key.
.B \fB\-\-sudo\fP
Use to execute a bootstrap operation with sudo\&.
.TP
-.B \fB\-\-template\-file TEMPLATE\fP
-The path to a template file that will be used during a bootstrap operation. Do not use the \fB\-\-distro\fP option when \fB\-\-template\-file\fP is specified.
-.TP
-.B \fB\-u USER\fP, \fB\-\-user USER\fP
-The user name used by knife to sign requests made by the API client to the Chef server\&. Authentication will fail if the user name does not match the private key.
+.B \fB\-t TEMPLATE\fP, \fB\-\-bootstrap\-template TEMPLATE\fP
+Use to specify the bootstrap template to use. This may specify the name of a bootstrap template\-\-\-\fBchef\-full\fP, for example\-\-\-or it may specify the full path to an Embedded Ruby (ERB) template that defines a custom bootstrap. Default value: \fBchef\-full\fP, which installs the chef\-client using the omnibus installer on all supported platforms.
.TP
.B \fB\-\-use\-sudo\-password\fP
Use to perform a bootstrap operation with sudo; specify the password with the \fB\-P\fP (or \fB\-\-ssh\-password\fP) option.
.TP
-.B \fB\-v\fP, \fB\-\-version\fP
-The version of the chef\-client\&.
-.TP
-.B \fB\-V\fP, \fB\-\-verbose\fP
-Set for more verbose outputs. Use \fB\-VV\fP for maximum verbosity.
-.TP
.B \fB\-V \-V\fP
Use to run the initial chef\-client run at the \fBdebug\fP log\-level (e.g. \fBchef\-client \-l debug\fP).
.TP
.B \fB\-x USERNAME\fP, \fB\-\-ssh\-user USERNAME\fP
The SSH user name.
-.TP
-.B \fB\-y\fP, \fB\-\-yes\fP
-Use to respond to all confirmation prompts with "Yes". knife will not ask for confirmation.
-.TP
-.B \fB\-z\fP, \fB\-\-local\-mode\fP
-Use to run the chef\-client in local mode. This allows all commands that work against the Chef server to also work against the local chef\-repo\&.
.UNINDENT
.sp
\fBExamples\fP
diff --git a/distro/common/man/man1/knife-client.1 b/distro/common/man/man1/knife-client.1
index 9606b93687..9dbd174c71 100644
--- a/distro/common/man/man1/knife-client.1
+++ b/distro/common/man/man1/knife-client.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-CLIENT" "1" "Chef 11.16" "" "knife client"
+.TH "KNIFE-CLIENT" "1" "Chef 12.0" "" "knife client"
.SH NAME
knife-client \- The man page for the knife client subcommand.
.
diff --git a/distro/common/man/man1/knife-configure.1 b/distro/common/man/man1/knife-configure.1
index 55ddb910ac..91eb69f1c6 100644
--- a/distro/common/man/man1/knife-configure.1
+++ b/distro/common/man/man1/knife-configure.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-CONFIGURE" "1" "Chef 11.16" "" "knife configure"
+.TH "KNIFE-CONFIGURE" "1" "Chef 12.0" "" "knife configure"
.SH NAME
knife-configure \- The man page for the knife configure subcommand.
.
diff --git a/distro/common/man/man1/knife-cookbook-site.1 b/distro/common/man/man1/knife-cookbook-site.1
index add01304d9..a90a5305f0 100644
--- a/distro/common/man/man1/knife-cookbook-site.1
+++ b/distro/common/man/man1/knife-cookbook-site.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-COOKBOOK-SITE" "1" "Chef 11.16" "" "knife cookbook site"
+.TH "KNIFE-COOKBOOK-SITE" "1" "Chef 12.0" "" "knife cookbook site"
.SH NAME
knife-cookbook-site \- The man page for the knife cookbook site subcommand.
.
@@ -409,6 +409,9 @@ This argument has the following options:
.B \fBCATEGORY\fP
The cookbook category: \fB"Databases"\fP, \fB"Web Servers"\fP, \fB"Process Management"\fP, \fB"Monitoring & Trending"\fP, \fB"Programming Languages"\fP, \fB"Package Management"\fP, \fB"Applications"\fP, \fB"Networking"\fP, \fB"Operating Systems & Virtualization"\fP, \fB"Utilities"\fP, or \fB"Other"\fP\&.
.TP
+.B \fB\-n\fP, \fB\-\-dry\-run\fP
+Use to take no action and only print out results. Default: \fBfalse\fP\&.
+.TP
.B \fB\-o PATH:PATH\fP, \fB\-\-cookbook\-path PATH:PATH\fP
The directory in which cookbooks are created. This can be a colon\-separated path.
.UNINDENT
diff --git a/distro/common/man/man1/knife-cookbook.1 b/distro/common/man/man1/knife-cookbook.1
index b42338c905..ce74c9dd8c 100644
--- a/distro/common/man/man1/knife-cookbook.1
+++ b/distro/common/man/man1/knife-cookbook.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-COOKBOOK" "1" "Chef 11.16" "" "knife cookbook"
+.TH "KNIFE-COOKBOOK" "1" "Chef 12.0" "" "knife cookbook"
.SH NAME
knife-cookbook \- The man page for the knife cookbook subcommand.
.
diff --git a/distro/common/man/man1/knife-data-bag.1 b/distro/common/man/man1/knife-data-bag.1
index 556f56a054..a4d45ce60e 100644
--- a/distro/common/man/man1/knife-data-bag.1
+++ b/distro/common/man/man1/knife-data-bag.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-DATA-BAG" "1" "Chef 11.16" "" "knife data bag"
+.TH "KNIFE-DATA-BAG" "1" "Chef 12.0" "" "knife data bag"
.SH NAME
knife-data-bag \- The man page for the knife data bag subcommand.
.
@@ -119,7 +119,7 @@ This argument has the following options:
The name of a specific item within a data bag.
.TP
.B \fB\-\-secret SECRET\fP
-The encryption key that is used for values contained within a data bag item.
+The encryption key that is used for values contained within a data bag item. If \fBsecret\fP is not specified, the chef\-client will look for a secret at the path specified by the \fBencrypted_data_bag_secret\fP setting in the client.rb file.
.TP
.B \fB\-\-secret\-file FILE\fP
The path to the file that contains the encryption key.
@@ -236,7 +236,7 @@ This argument has the following options:
The name of a specific item within a data bag.
.TP
.B \fB\-\-secret SECRET\fP
-The encryption key that is used for values contained within a data bag item.
+The encryption key that is used for values contained within a data bag item. If \fBsecret\fP is not specified, the chef\-client will look for a secret at the path specified by the \fBencrypted_data_bag_secret\fP setting in the client.rb file.
.TP
.B \fB\-\-secret\-file FILE\fP
The path to the file that contains the encryption key.
@@ -372,7 +372,7 @@ This argument has the following options:
Use to upload all data bags found at the specified path.
.TP
.B \fB\-\-secret SECRET\fP
-The encryption key that is used for values contained within a data bag item.
+The encryption key that is used for values contained within a data bag item. If \fBsecret\fP is not specified, the chef\-client will look for a secret at the path specified by the \fBencrypted_data_bag_secret\fP setting in the client.rb file.
.TP
.B \fB\-\-secret\-file FILE\fP
The path to the file that contains the encryption key.
@@ -475,7 +475,7 @@ This argument has the following options:
The name of a specific item within a data bag.
.TP
.B \fB\-\-secret SECRET\fP
-The encryption key that is used for values contained within a data bag item.
+The encryption key that is used for values contained within a data bag item. If \fBsecret\fP is not specified, the chef\-client will look for a secret at the path specified by the \fBencrypted_data_bag_secret\fP setting in the client.rb file.
.TP
.B \fB\-\-secret\-file FILE\fP
The path to the file that contains the encryption key.
diff --git a/distro/common/man/man1/knife-delete.1 b/distro/common/man/man1/knife-delete.1
index 1b31849596..fcbf52a65a 100644
--- a/distro/common/man/man1/knife-delete.1
+++ b/distro/common/man/man1/knife-delete.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-DELETE" "1" "Chef 11.16" "" "knife delete"
+.TH "KNIFE-DELETE" "1" "Chef 12.0" "" "knife delete"
.SH NAME
knife-delete \- The man page for the knife delete subcommand.
.
diff --git a/distro/common/man/man1/knife-deps.1 b/distro/common/man/man1/knife-deps.1
index 581ea6f0e9..afa384c1a9 100644
--- a/distro/common/man/man1/knife-deps.1
+++ b/distro/common/man/man1/knife-deps.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-DEPS" "1" "Chef 11.16" "" "knife deps"
+.TH "KNIFE-DEPS" "1" "Chef 12.0" "" "knife deps"
.SH NAME
knife-deps \- The man page for the knife deps subcommand.
.
diff --git a/distro/common/man/man1/knife-diff.1 b/distro/common/man/man1/knife-diff.1
index 97938ef13c..8bf19ef609 100644
--- a/distro/common/man/man1/knife-diff.1
+++ b/distro/common/man/man1/knife-diff.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-DIFF" "1" "Chef 11.16" "" "knife diff"
+.TH "KNIFE-DIFF" "1" "Chef 12.0" "" "knife diff"
.SH NAME
knife-diff \- The man page for the knife diff subcommand.
.
diff --git a/distro/common/man/man1/knife-download.1 b/distro/common/man/man1/knife-download.1
index 3b60df12e2..ab232fe613 100644
--- a/distro/common/man/man1/knife-download.1
+++ b/distro/common/man/man1/knife-download.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-DOWNLOAD" "1" "Chef 11.16" "" "knife download"
+.TH "KNIFE-DOWNLOAD" "1" "Chef 12.0" "" "knife download"
.SH NAME
knife-download \- The man page for the knife download subcommand.
.
diff --git a/distro/common/man/man1/knife-edit.1 b/distro/common/man/man1/knife-edit.1
index 344431b082..bc159e6444 100644
--- a/distro/common/man/man1/knife-edit.1
+++ b/distro/common/man/man1/knife-edit.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-EDIT" "1" "Chef 11.16" "" "knife edit"
+.TH "KNIFE-EDIT" "1" "Chef 12.0" "" "knife edit"
.SH NAME
knife-edit \- The man page for the knife edit subcommand.
.
diff --git a/distro/common/man/man1/knife-environment.1 b/distro/common/man/man1/knife-environment.1
index d7aedf35c5..d583abe7fa 100644
--- a/distro/common/man/man1/knife-environment.1
+++ b/distro/common/man/man1/knife-environment.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-ENVIRONMENT" "1" "Chef 11.16" "" "knife environment"
+.TH "KNIFE-ENVIRONMENT" "1" "Chef 12.0" "" "knife environment"
.SH NAME
knife-environment \- The man page for the knife environment subcommand.
.
diff --git a/distro/common/man/man1/knife-exec.1 b/distro/common/man/man1/knife-exec.1
index 7f46263108..b63491185f 100644
--- a/distro/common/man/man1/knife-exec.1
+++ b/distro/common/man/man1/knife-exec.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-EXEC" "1" "Chef 11.16" "" "knife exec"
+.TH "KNIFE-EXEC" "1" "Chef 12.0" "" "knife exec"
.SH NAME
knife-exec \- The man page for the knife exec subcommand.
.
diff --git a/distro/common/man/man1/knife-index-rebuild.1 b/distro/common/man/man1/knife-index-rebuild.1
index d327c4b2e6..3fe2c52f8c 100644
--- a/distro/common/man/man1/knife-index-rebuild.1
+++ b/distro/common/man/man1/knife-index-rebuild.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-INDEX-REBUILD" "1" "Chef 11.16" "" "knife index rebuild"
+.TH "KNIFE-INDEX-REBUILD" "1" "Chef 12.0" "" "knife index rebuild"
.SH NAME
knife-index-rebuild \- The man page for the knife index rebuild subcommand.
.
diff --git a/distro/common/man/man1/knife-list.1 b/distro/common/man/man1/knife-list.1
index 546eacf009..c9349fa822 100644
--- a/distro/common/man/man1/knife-list.1
+++ b/distro/common/man/man1/knife-list.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-LIST" "1" "Chef 11.16" "" "knife list"
+.TH "KNIFE-LIST" "1" "Chef 12.0" "" "knife list"
.SH NAME
knife-list \- The man page for the knife list subcommand.
.
diff --git a/distro/common/man/man1/knife-node.1 b/distro/common/man/man1/knife-node.1
index fb1adffe9d..af7eab9317 100644
--- a/distro/common/man/man1/knife-node.1
+++ b/distro/common/man/man1/knife-node.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-NODE" "1" "Chef 11.16" "" "knife node"
+.TH "KNIFE-NODE" "1" "Chef 12.0" "" "knife node"
.SH NAME
knife-node \- The man page for the knife node subcommand.
.
@@ -557,10 +557,10 @@ This argument has the following options:
The attribute (or attributes) to show.
.TP
.B \fB\-l\fP, \fB\-\-long\fP
-Display long output when searching nodes while using the default summary format.
+Use to display all attributes in the output and to show the output as JSON\&.
.TP
.B \fB\-m\fP, \fB\-\-medium\fP
-Display more, but not all, of a node\(aqs data when searching using the default summary format.
+Use to display normal attributes in the output and to show the output as JSON\&.
.TP
.B \fB\-r\fP, \fB\-\-run\-list\fP
Use to show only the run\-list.
diff --git a/distro/common/man/man1/knife-raw.1 b/distro/common/man/man1/knife-raw.1
index 53cb7abf34..a484db25bb 100644
--- a/distro/common/man/man1/knife-raw.1
+++ b/distro/common/man/man1/knife-raw.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-RAW" "1" "Chef 11.16" "" "knife raw"
+.TH "KNIFE-RAW" "1" "Chef 12.0" "" "knife raw"
.SH NAME
knife-raw \- The man page for the knife raw subcommand.
.
@@ -31,7 +31,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
-The \fBknife raw\fP subcommand is used to send a REST request to a specified path using the Chef server API\&.
+The \fBknife raw\fP subcommand is used to send a REST request to an endpoint in the Chef server API\&.
.sp
\fBSyntax\fP
.sp
diff --git a/distro/common/man/man1/knife-recipe-list.1 b/distro/common/man/man1/knife-recipe-list.1
index cba87be064..3bd5a4c3aa 100644
--- a/distro/common/man/man1/knife-recipe-list.1
+++ b/distro/common/man/man1/knife-recipe-list.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-RECIPE-LIST" "1" "Chef 11.16" "" "knife recipe list"
+.TH "KNIFE-RECIPE-LIST" "1" "Chef 12.0" "" "knife recipe list"
.SH NAME
knife-recipe-list \- The man page for the knife recipe list subcommand.
.
diff --git a/distro/common/man/man1/knife-role.1 b/distro/common/man/man1/knife-role.1
index 5275489dd8..d5b5616d31 100644
--- a/distro/common/man/man1/knife-role.1
+++ b/distro/common/man/man1/knife-role.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-ROLE" "1" "Chef 11.16" "" "knife role"
+.TH "KNIFE-ROLE" "1" "Chef 12.0" "" "knife role"
.SH NAME
knife-role \- The man page for the knife role subcommand.
.
@@ -31,7 +31,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
-A role is a way to define certain patterns and processes that exist across nodes in an organization as belonging to a single job function. Each role consists of zero (or more) attributes and a run list. Each node can have zero (or more) roles assigned to it. When a role is run against a node, the configuration details of that node are compared against the attributes of the role, and then the contents of that role\(aqs run list are applied to the node\(aqs configuration details. When a chef\-client runs, it merges its own attributes and run lists with those contained within each assigned role.
+A role is a way to define certain patterns and processes that exist across nodes in an organization as belonging to a single job function. Each role consists of zero (or more) attributes and a run\-list. Each node can have zero (or more) roles assigned to it. When a role is run against a node, the configuration details of that node are compared against the attributes of the role, and then the contents of that role\(aqs run\-list are applied to the node\(aqs configuration details. When a chef\-client runs, it merges its own attributes and run\-lists with those contained within each assigned role.
.sp
The \fBknife role\fP subcommand is used to manage the roles that are associated with one or more nodes on a Chef server\&.
.SH COMMON OPTIONS
diff --git a/distro/common/man/man1/knife-search.1 b/distro/common/man/man1/knife-search.1
index 5955a12529..3b81898530 100644
--- a/distro/common/man/man1/knife-search.1
+++ b/distro/common/man/man1/knife-search.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-SEARCH" "1" "Chef 11.16" "" "knife search"
+.TH "KNIFE-SEARCH" "1" "Chef 12.0" "" "knife search"
.SH NAME
knife-search \- The man page for the knife search subcommand.
.
@@ -31,7 +31,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
-Search indexes allow queries to be made for any type of data that is indexed by the Chef server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full\-text query that can be done from several locations, including from within a recipe, by using the \fBsearch\fP subcommand in knife, or by using the \fB/search\fP or \fB/search/INDEX\fP endpoints in the Chef server API\&. The search engine is based on Apache Solr and is run from the Chef server\&.
+Search indexes allow queries to be made for any type of data that is indexed by the Chef server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full\-text query that can be done from several locations, including from within a recipe, by using the \fBsearch\fP subcommand in knife, the \fBsearch\fP method in the Recipe DSL, and by using the \fB/search\fP or \fB/search/INDEX\fP endpoints in the Chef server API\&. The search engine is based on Apache Solr and is run from the Chef server\&.
.sp
The \fBknife search\fP subcommand is used run a search query for information that is indexed on a Chef server\&.
.sp
@@ -168,10 +168,10 @@ The name of the index to be queried: \fBclient\fP, \fBenvironment\fP, \fBnode\fP
The private key that knife will use to sign requests made by the API client to the Chef server\&.
.TP
.B \fB\-l\fP, \fB\-\-long\fP
-Display long output when searching nodes while using the default summary format.
+Use to display all attributes in the output and to show the output as JSON\&.
.TP
.B \fB\-m\fP, \fB\-\-medium\fP
-Display more, but not all, of a node\(aqs data when searching using the default summary format.
+Use to display normal attributes in the output and to show the output as JSON\&.
.TP
.B \fB\-o SORT\fP, \fB\-\-sort SORT\fP
The order in which search results will be sorted.
diff --git a/distro/common/man/man1/knife-serve.1 b/distro/common/man/man1/knife-serve.1
index e56c8dbe9f..8760559f32 100644
--- a/distro/common/man/man1/knife-serve.1
+++ b/distro/common/man/man1/knife-serve.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-SERVE" "1" "Chef 11.16" "" "knife serve"
+.TH "KNIFE-SERVE" "1" "Chef 12.0" "" "knife serve"
.SH NAME
knife-serve \- The man page for the knife serve subcommand.
.
diff --git a/distro/common/man/man1/knife-show.1 b/distro/common/man/man1/knife-show.1
index 2ee107d37b..94f295afb7 100644
--- a/distro/common/man/man1/knife-show.1
+++ b/distro/common/man/man1/knife-show.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-SHOW" "1" "Chef 11.16" "" "knife show"
+.TH "KNIFE-SHOW" "1" "Chef 12.0" "" "knife show"
.SH NAME
knife-show \- The man page for the knife show subcommand.
.
diff --git a/distro/common/man/man1/knife-ssh.1 b/distro/common/man/man1/knife-ssh.1
index 50a4babae3..78555b7293 100644
--- a/distro/common/man/man1/knife-ssh.1
+++ b/distro/common/man/man1/knife-ssh.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-SSH" "1" "Chef 11.16" "" "knife ssh"
+.TH "KNIFE-SSH" "1" "Chef 12.0" "" "knife ssh"
.SH NAME
knife-ssh \- The man page for the knife ssh subcommand.
.
diff --git a/distro/common/man/man1/knife-ssl-check.1 b/distro/common/man/man1/knife-ssl-check.1
index c90f7be05c..23b945468d 100644
--- a/distro/common/man/man1/knife-ssl-check.1
+++ b/distro/common/man/man1/knife-ssl-check.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-SSL-CHECK" "1" "Chef 11.16" "" "knife ssl check"
+.TH "KNIFE-SSL-CHECK" "1" "Chef 12.0" "" "knife ssl check"
.SH NAME
knife-ssl-check \- The man page for the knife ssl check subcommand.
.
diff --git a/distro/common/man/man1/knife-ssl-fetch.1 b/distro/common/man/man1/knife-ssl-fetch.1
index c6f0af2472..88b0ad1ebf 100644
--- a/distro/common/man/man1/knife-ssl-fetch.1
+++ b/distro/common/man/man1/knife-ssl-fetch.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-SSL-FETCH" "1" "Chef 11.16" "" "knife ssl fetch"
+.TH "KNIFE-SSL-FETCH" "1" "Chef 12.0" "" "knife ssl fetch"
.SH NAME
knife-ssl-fetch \- The man page for the knife ssl fetch subcommand.
.
diff --git a/distro/common/man/man1/knife-status.1 b/distro/common/man/man1/knife-status.1
index 52929d5d8c..038cf3a0f0 100644
--- a/distro/common/man/man1/knife-status.1
+++ b/distro/common/man/man1/knife-status.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-STATUS" "1" "Chef 11.16" "" "knife status"
+.TH "KNIFE-STATUS" "1" "Chef 12.0" "" "knife status"
.SH NAME
knife-status \- The man page for the knife status subcommand.
.
diff --git a/distro/common/man/man1/knife-tag.1 b/distro/common/man/man1/knife-tag.1
index d794f1953a..3149f520f1 100644
--- a/distro/common/man/man1/knife-tag.1
+++ b/distro/common/man/man1/knife-tag.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-TAG" "1" "Chef 11.16" "" "knife tag"
+.TH "KNIFE-TAG" "1" "Chef 12.0" "" "knife tag"
.SH NAME
knife-tag \- The man page for the knife tag subcommand.
.
diff --git a/distro/common/man/man1/knife-upload.1 b/distro/common/man/man1/knife-upload.1
index 82bb3e464e..dfc20e0270 100644
--- a/distro/common/man/man1/knife-upload.1
+++ b/distro/common/man/man1/knife-upload.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-UPLOAD" "1" "Chef 11.16" "" "knife upload"
+.TH "KNIFE-UPLOAD" "1" "Chef 12.0" "" "knife upload"
.SH NAME
knife-upload \- The man page for the knife upload subcommand.
.
diff --git a/distro/common/man/man1/knife-user.1 b/distro/common/man/man1/knife-user.1
index 88dd5dae7d..cdd15b9d14 100644
--- a/distro/common/man/man1/knife-user.1
+++ b/distro/common/man/man1/knife-user.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-USER" "1" "Chef 11.16" "" "knife user"
+.TH "KNIFE-USER" "1" "Chef 12.0" "" "knife user"
.SH NAME
knife-user \- The man page for the knife user subcommand.
.
diff --git a/distro/common/man/man1/knife-xargs.1 b/distro/common/man/man1/knife-xargs.1
index ff78b2d068..1fcc3d9f4a 100644
--- a/distro/common/man/man1/knife-xargs.1
+++ b/distro/common/man/man1/knife-xargs.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE-XARGS" "1" "Chef 11.16" "" "knife xargs"
+.TH "KNIFE-XARGS" "1" "Chef 12.0" "" "knife xargs"
.SH NAME
knife-xargs \- The man page for the knife xargs subcommand.
.
diff --git a/distro/common/man/man1/knife.1 b/distro/common/man/man1/knife.1
index f0bc35ba37..9259da8477 100644
--- a/distro/common/man/man1/knife.1
+++ b/distro/common/man/man1/knife.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "KNIFE" "1" "Chef 11.16" "" "knife"
+.TH "KNIFE" "1" "Chef 12.0" "" "knife"
.SH NAME
knife \- The man page for the knife command line tool.
.
diff --git a/distro/common/man/man8/chef-client.8 b/distro/common/man/man8/chef-client.8
index 6a8de44e27..4c8a1f7b8f 100644
--- a/distro/common/man/man8/chef-client.8
+++ b/distro/common/man/man8/chef-client.8
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "CHEF-CLIENT" "8" "Chef 11.16" "" "chef-client"
+.TH "CHEF-CLIENT" "8" "Chef 12.0" "" "chef-client"
.SH NAME
chef-client \- The man page for the chef-client command line tool.
.
@@ -86,7 +86,7 @@ This command has the following options:
Use to cause a chef\-client run to fail when the chef\-client does not have administrator privileges in Microsoft Windows\&.
.TP
.B \fB\-\-chef\-zero\-port PORT\fP
-The port on which chef\-zero will listen.
+The port on which chef\-zero will listen. If a port is not specified\-\-\-individually, as range of ports, or from the \fBchef_zero.port\fP setting in the client.rb file\-\-\-the chef\-client will scan for ports between 8889\-9999 and will pick the first port that is available.
.TP
.B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP
The output format: \fBdoc\fP (default) or \fBmin\fP\&.
@@ -110,10 +110,81 @@ The name of the group that owns a process. This is required when starting any ex
Shows help for the command.
.TP
.B \fB\-i SECONDS\fP, \fB\-\-interval SECONDS\fP
-The frequency (in seconds) at which the chef\-client runs. Default value: \fB1800\fP\&.
+The frequency (in seconds) at which the chef\-client runs. When the chef\-client is run at intervals, \fB\-\-splay\fP and \fB\-\-interval\fP values are applied before the chef\-client run. Default value: \fB1800\fP\&.
.TP
.B \fB\-j PATH\fP, \fB\-\-json\-attributes PATH\fP
The path to a file that contains JSON data.
+.sp
+Use this option to define a \fBrun_list\fP object. For example, a JSON file similar to:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+"run_list": [
+ "recipe[base]",
+ "recipe[foo]",
+ "recipe[bar]",
+ "role[webserver]"
+],
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+may be used by running \fBchef\-client \-j path/to/file.json\fP\&.
+.sp
+In certain situations this option may be used to update \fBnormal\fP attributes.
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Any other attribute type that is contained in this JSON file will be treated as a \fBnormal\fP attribute. For example, attempting to update \fBoverride\fP attributes using the \fB\-j\fP option:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+{
+ "name": "dev\-99",
+ "description": "Install some stuff",
+ "override_attributes": {
+ "apptastic": {
+ "enable_apptastic": "false",
+ "apptastic_tier_name": "dev\-99.bomb.com"
+ }
+ }
+}
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+will result in a node object similar to:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+{
+ "name": "maybe\-dev\-99",
+ "normal": {
+ "name": "dev\-99",
+ "description": "Install some stuff",
+ "override_attributes": {
+ "apptastic": {
+ "enable_apptastic": "false",
+ "apptastic_tier_name": "dev\-99.bomb.com"
+ }
+ }
+ }
+}
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
.TP
.B \fB\-k KEY_FILE\fP, \fB\-\-client_key KEY_FILE\fP
The location of the file which contains the client key. Default value: \fB/etc/chef/client.pem\fP\&.
@@ -134,7 +205,7 @@ Use to view colored output. Default setting: \fB\-\-color\fP\&.
The name of the node.
.TP
.B \fB\-o RUN_LIST_ITEM\fP, \fB\-\-override\-runlist RUN_LIST_ITEM\fP
-Replace the current run list with the specified items.
+Replace the current run list with the specified items. This option will not clear the list of cookbooks (and related files) that is cached on the node.
.TP
.B \fB\-\-once\fP
Use to run the chef\-client only once and to cancel \fBinterval\fP and \fBsplay\fP options.
@@ -155,7 +226,7 @@ The path to a recipe. For example, if a recipe file is in the current directory,
The amount of time (in seconds) to wait for a chef\-client run to finish. Default value: not set (indefinite). Set to \fB0\fP to cause a second chef\-client to exit immediately.
.TP
.B \fB\-s SECONDS\fP, \fB\-\-splay SECONDS\fP
-A number (in seconds) to add to the \fBinterval\fP that is used to determine the frequency of chef\-client runs. This number can help prevent server load when there are many clients running at the same time.
+A number (in seconds) to add to the \fBinterval\fP that is used to determine the frequency of chef\-client runs. This number can help prevent server load when there are many clients running at the same time. When the chef\-client is run at intervals, \fB\-\-splay\fP and \fB\-\-interval\fP values are applied before the chef\-client run.
.TP
.B \fB\-S CHEF_SERVER_URL\fP, \fB\-\-server CHEF_SERVER_URL\fP
The URL for the Chef server\&.
diff --git a/distro/common/man/man8/chef-solo.8 b/distro/common/man/man8/chef-solo.8
index 73a49a79cf..d4bbc7507f 100644
--- a/distro/common/man/man8/chef-solo.8
+++ b/distro/common/man/man8/chef-solo.8
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "CHEF-SOLO" "8" "Chef 11.16" "" "chef-solo"
+.TH "CHEF-SOLO" "8" "Chef 12.0" "" "chef-solo"
.SH NAME
chef-solo \- The man page for the chef-solo command line tool.
.
@@ -77,13 +77,15 @@ This command has the following options:
The configuration file to use.
.TP
.B \fB\-d\fP, \fB\-\-daemonize\fP
-Use to run the executable as a daemon. This option is only available on machines that run in UNIX or Linux environments. For machines that are running Microsoft Windows that require similar functionality, use the \fBchef\-client::service\fP recipe in the \fBchef\-client\fP cookbook: \fI\%http://community.opscode.com/cookbooks/chef\-client\fP\&. This will install a chef\-client service under Microsoft Windows using the Windows Service Wrapper\&.
+Use to run the executable as a daemon. This option may not be used in the same command with the \fB\-\-[no\-]fork\fP option.
+.sp
+This option is only available on machines that run in UNIX or Linux environments. For machines that are running Microsoft Windows that require similar functionality, use the \fBchef\-client::service\fP recipe in the \fBchef\-client\fP cookbook: \fI\%http://community.opscode.com/cookbooks/chef\-client\fP\&. This will install a chef\-client service under Microsoft Windows using the Windows Service Wrapper\&.
.TP
.B \fB\-E ENVIRONMENT_NAME\fP, \fB\-\-environment ENVIRONMENT_NAME\fP
The name of the environment.
.TP
.B \fB\-f\fP, \fB\-\-[no\-]fork\fP
-Use to contain the chef\-client run in a secondary process with dedicated RAM. When the chef\-client run is complete the RAM will be returned to the master process. This option helps ensure that a chef\-client will use a steady amount of RAM over time because the master process will not run recipes. This option will also help prevent memory leaks (such as those that can be introduced by the code contained within a poorly designed cookbook). Use \fB\-\-no\-fork\fP to disable running the chef\-client in fork node. Default value: \fB\-\-fork\fP\&.
+Use to contain the chef\-client run in a secondary process with dedicated RAM. When the chef\-client run is complete the RAM will be returned to the master process. This option helps ensure that a chef\-client will use a steady amount of RAM over time because the master process will not run recipes. This option will also help prevent memory leaks (such as those that can be introduced by the code contained within a poorly designed cookbook). Use \fB\-\-no\-fork\fP to disable running the chef\-client in fork node. Default value: \fB\-\-fork\fP\&. This option may not be used in the same command with the \fB\-\-daemonize\fP and \fB\-\-interval\fP options.
.TP
.B \fB\-F FORMAT\fP, \fB\-\-format FORMAT\fP
The output format: \fBdoc\fP (default) or \fBmin\fP\&.
@@ -107,10 +109,81 @@ The name of the group that owns a process. This is required when starting any ex
Shows help for the command.
.TP
.B \fB\-i SECONDS\fP, \fB\-\-interval SECONDS\fP
-The frequency (in seconds) at which the chef\-client runs.
+The frequency (in seconds) at which the chef\-client runs. When the chef\-client is run at intervals, \fB\-\-splay\fP and \fB\-\-interval\fP values are applied before the chef\-client run. This option may not be used in the same command with the \fB\-\-[no\-]fork\fP option.
.TP
.B \fB\-j PATH\fP, \fB\-\-json\-attributes PATH\fP
-The path to a file that contains JSON data. Use this option to override \fBnormal\fP attributes set elsewhere.
+The path to a file that contains JSON data.
+.sp
+Use this option to define a \fBrun_list\fP object. For example, a JSON file similar to:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+"run_list": [
+ "recipe[base]",
+ "recipe[foo]",
+ "recipe[bar]",
+ "role[webserver]"
+],
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+may be used by running \fBchef\-client \-j path/to/file.json\fP\&.
+.sp
+In certain situations this option may be used to update \fBnormal\fP attributes.
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Any other attribute type that is contained in this JSON file will be treated as a \fBnormal\fP attribute. For example, attempting to update \fBoverride\fP attributes using the \fB\-j\fP option:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+{
+ "name": "dev\-99",
+ "description": "Install some stuff",
+ "override_attributes": {
+ "apptastic": {
+ "enable_apptastic": "false",
+ "apptastic_tier_name": "dev\-99.bomb.com"
+ }
+ }
+}
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+will result in a node object similar to:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+{
+ "name": "maybe\-dev\-99",
+ "normal": {
+ "name": "dev\-99",
+ "description": "Install some stuff",
+ "override_attributes": {
+ "apptastic": {
+ "enable_apptastic": "false",
+ "apptastic_tier_name": "dev\-99.bomb.com"
+ }
+ }
+ }
+}
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
.TP
.B \fB\-l LEVEL\fP, \fB\-\-log_level LEVEL\fP
The level of logging that will be stored in a log file.
@@ -134,7 +207,7 @@ The URL location from which a remote cookbook tar.gz will be downloaded.
The amount of time (in seconds) to wait for a chef\-client run to finish. Default value: not set (indefinite). Set to \fB0\fP to cause a second chef\-client to exit immediately.
.TP
.B \fB\-s SECONDS\fP, \fB\-\-splay SECONDS\fP
-A number (in seconds) to add to the \fBinterval\fP that is used to determine the frequency of chef\-client runs. This number can help prevent server load when there are many clients running at the same time.
+A number (in seconds) to add to the \fBinterval\fP that is used to determine the frequency of chef\-client runs. This number can help prevent server load when there are many clients running at the same time. When the chef\-client is run at intervals, \fB\-\-splay\fP and \fB\-\-interval\fP values are applied before the chef\-client run.
.TP
.B \fB\-u USER\fP, \fB\-\-user USER\fP
The user that owns a process. This is required when starting any executable as a daemon.
diff --git a/distro/debian/etc/default/chef-client b/distro/debian/etc/default/chef-client
deleted file mode 100644
index a6413a30d4..0000000000
--- a/distro/debian/etc/default/chef-client
+++ /dev/null
@@ -1,4 +0,0 @@
-LOGFILE=/var/log/chef/client.log
-CONFIG=/etc/chef/client.rb
-INTERVAL=1800
-SPLAY=20
diff --git a/distro/debian/etc/default/chef-expander b/distro/debian/etc/default/chef-expander
deleted file mode 100644
index 3d855705ba..0000000000
--- a/distro/debian/etc/default/chef-expander
+++ /dev/null
@@ -1,8 +0,0 @@
-LOGFILE=/var/log/chef/expander.log
-CONFIG=/etc/chef/solr.rb
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-DIETIME=5
-STARTTIME=5
-CHEF_EXPANDER_ARGS="-n 1 -i 1"
diff --git a/distro/debian/etc/default/chef-server b/distro/debian/etc/default/chef-server
deleted file mode 100644
index b91a3ce81c..0000000000
--- a/distro/debian/etc/default/chef-server
+++ /dev/null
@@ -1,9 +0,0 @@
-LOGFILE=/var/log/chef/server.log
-CONFIG=/etc/chef/server.rb
-ADAPTER=thin
-PORT=4000
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-STARTTIME=10
-DIETIME=5
diff --git a/distro/debian/etc/default/chef-server-webui b/distro/debian/etc/default/chef-server-webui
deleted file mode 100644
index 50dd22a288..0000000000
--- a/distro/debian/etc/default/chef-server-webui
+++ /dev/null
@@ -1,9 +0,0 @@
-LOGFILE=/var/log/chef/server-webui.log
-CONFIG=/etc/chef/webui.rb
-ADAPTER=thin
-PORT=4040
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-STARTTIME=10
-DIETIME=5
diff --git a/distro/debian/etc/default/chef-solr b/distro/debian/etc/default/chef-solr
deleted file mode 100644
index 7f5220c058..0000000000
--- a/distro/debian/etc/default/chef-solr
+++ /dev/null
@@ -1,8 +0,0 @@
-LOGFILE=/var/log/chef/solr.log
-CONFIG=/etc/chef/solr.rb
-USER=chef
-GROUP=chef
-# Sleep to give daemon enough time to fully start or stop.
-DIETIME=5
-STARTTIME=5
-MAXTRIES=20
diff --git a/distro/debian/etc/init.d/chef-client b/distro/debian/etc/init.d/chef-client
deleted file mode 100755
index b74f6d914b..0000000000
--- a/distro/debian/etc/init.d/chef-client
+++ /dev/null
@@ -1,212 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: chef-client
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start a chef-client.
-### END INIT INFO
-#
-# Copyright (c) 2009-2010 Opscode, Inc, <legal@opscode.com>
-#
-# chef-client Startup script for chef-client.
-# chkconfig: - 99 02
-# description: starts up chef-client in daemon mode.
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=$(which chef-client)
-NAME=chef-client
-DESC=chef-client
-PIDFILE=/var/run/chef/client.pid
-
-test -x $DAEMON || exit 1
-
-. /lib/lsb/init-functions
-
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-if [ ! -d /var/run/chef ]; then
- mkdir /var/run/chef
-fi
-
-DAEMON_OPTS="-d -P $PIDFILE -c $CONFIG -i $INTERVAL -s $SPLAY"
-
-if [ ! -z $LOGFILE ]; then
- DAEMON_OPTS="${DAEMON_OPTS} -L $LOGFILE"
-fi
-
-running_pid() {
- pid=$1
- name=$2
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- cmd=`awk '/Name:/ {print $2}' /proc/$pid/status`
- [ "$cmd" != "$name" ] && return 1
- return 0
-}
-
-running() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=`cat $PIDFILE`
- running_pid $pid $NAME || return 1
- return 0
-}
-
-start_server() {
- if [ -z "$DAEMONUSER" ] ; then
- start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS
- errcode=$?
- else
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --chuid $DAEMONUSER \
- --exec $DAEMON -- $DAEMON_OPTS
- errcode=$?
- fi
- return $errcode
-}
-
-stop_server() {
- if [ -z "$DAEMONUSER" ] ; then
- killproc -p $PIDFILE $DAEMON
- errcode=$?
- else
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER \
- --exec $DAEMON
- errcode=$?
- fi
- return $errcode
-}
-
-reload_server() {
- if [ -z "$DAEMONUSER" ] ; then
- killproc -p $PIDFILE $DAEMON -HUP
- errcode=$?
- else
- start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER \
- --exec $DAEMON
- errcode=$?
- fi
- return $errcode
-}
-
-run_server() {
- if [ -z "$DAEMONUSER" ] ; then
- killproc -p $PIDFILE $DAEMON -USR1
- errcode=$?
- else
- start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER \
- --exec $DAEMON
- errcode=$?
- fi
- return $errcode
-}
-
-force_stop() {
- [ ! -e "$PIDFILE" ] && return
- if running ; then
- /bin/kill -15 $pid
- sleep "$DIETIME"s
- if running ; then
- /bin/kill -9 $pid
- sleep "$DIETIME"s
- if running ; then
- echo "Cannot kill $NAME (pid=$pid)!"
- exit 1
- fi
- fi
- fi
- rm -f $PIDFILE
-}
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC " "$NAME"
- if running ; then
- log_progress_msg "apparently already running"
- log_end_msg 0
- exit 0
- fi
- if start_server ; then
- [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
- if running ; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
- else
- log_end_msg 1
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- if running ; then
- errcode=0
- stop_server || errcode=$?
- log_end_msg $errcode
- else
- log_progress_msg "apparently not running"
- log_end_msg 0
- exit 0
- fi
- ;;
- force-stop)
- $0 stop
- if running; then
- log_daemon_msg "Stopping (force) $DESC" "$NAME"
- errcode=0
- force_stop || errcode=$?
- log_end_msg $errcode
- fi
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- errcode=0
- if running ; then
- stop_server || errcode=$?
- [ -n "$DIETIME" ] && sleep $DIETIME
- fi
- start_server || errcode=$?
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- running || errcode=$?
- log_end_msg $errcode
- ;;
- status)
- log_daemon_msg "Checking status of $DESC" "$NAME"
- if running ; then
- log_progress_msg "running"
- log_end_msg 0
- else
- log_progress_msg "apparently not running"
- log_end_msg 1
- exit 3
- fi
- ;;
- reload)
- if running; then
- log_daemon_msg "Reloading $DESC" "$NAME"
- errcode=0
- reload_server || errcode=$?
- log_end_msg $errcode
- fi
- ;;
- run)
- if running; then
- log_daemon_msg "Triggering run of $DESC" "$NAME"
- errcode=0
- run_server || errcode=$?
- log_end_msg $errcode
- fi
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|force-stop|restart|force-reload|status|run}" >&2
- exit 1
- ;;
-esac
-
-exit 0
-
diff --git a/distro/debian/etc/init.d/chef-expander b/distro/debian/etc/init.d/chef-expander
deleted file mode 100755
index fdf6e40678..0000000000
--- a/distro/debian/etc/init.d/chef-expander
+++ /dev/null
@@ -1,176 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: chef-expander
-# Required-Start: $remote_fs $network rabbitmq-server chef-solr
-# Required-Stop: $remote_fs $network rabbitmq-server chef-solr
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start a chef-expander.
-### END INIT INFO
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# chef-expander Startup script for chef-expander.
-# chkconfig: - 85 02
-# description: starts up chef-expander in daemon mode.
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=$(which chef-expander)
-NAME=chef-expander
-DESC=chef-expander
-PIDFILE=/var/run/chef/expander.pid
-
-test -x $DAEMON || exit 1
-
-. /lib/lsb/init-functions
-
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-if [ ! -d /var/run/chef ]; then
- mkdir /var/run/chef
- chown $USER:$GROUP /var/run/chef
-fi
-
-DAEMON_OPTS="-d -c $CONFIG -P $PIDFILE -L $LOGFILE $CHEF_EXPANDER_ARGS"
-
-running_pid() {
- pid=$1
- name=$2
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- cmd=`cat /proc/$pid/cmdline | tr '\000' '\n' | awk 'NR==2'`
- [ "$cmd" != "$name" ] && return 1
- return 0
-}
-
-running() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=`cat $PIDFILE`
- running_pid $pid $DAEMON || return 1
- return 0
-}
-
-start_server() {
- if [ -z "$DAEMONUSER" ] ; then
- start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS
- errcode=$?
- else
- start-stop-daemon --start --quiet --pidfile $PIDFILE \
- --chuid $DAEMONUSER \
- --exec $DAEMON -- $DAEMON_OPTS
- errcode=$?
- fi
- return $errcode
-}
-
-stop_server() {
- if [ -z "$DAEMONUSER" ] ; then
- killproc -p $PIDFILE $DAEMON
- errcode=$?
- else
- start-stop-daemon --stop --quiet --pidfile $PIDFILE \
- --user $DAEMONUSER \
- --exec $DAEMON
- errcode=$?
- fi
- return $errcode
-}
-
-reload_server() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=pidofproc $PIDFILE # This is the daemon's pid
- /bin/kill -1 $pid
- return $?
-}
-
-force_stop() {
- [ ! -e "$PIDFILE" ] && return
- if running ; then
- /bin/kill -15 $pid
- sleep "$DIETIME"s
- if running ; then
- /bin/kill -9 $pid
- sleep "$DIETIME"s
- if running ; then
- echo "Cannot kill $NAME (pid=$pid)!"
- exit 1
- fi
- fi
- fi
- rm -f $PIDFILE
-}
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC " "$NAME"
- if running ; then
- log_progress_msg "apparently already running"
- log_end_msg 0
- exit 3
- fi
- if start_server ; then
- [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
- if running ; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
- else
- log_end_msg 1
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- if running ; then
- errcode=0
- stop_server || errcode=$?
- log_end_msg $errcode
- else
- log_progress_msg "apparently not running"
- log_end_msg 0
- exit 0
- fi
- ;;
- force-stop)
- $0 stop
- if running; then
- log_daemon_msg "Stopping (force) $DESC" "$NAME"
- errcode=0
- force_stop || errcode=$?
- log_end_msg $errcode
- fi
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- errcode=0
- stop_server || errcode=$?
- [ -n "$DIETIME" ] && sleep $DIETIME
- start_server || errcode=$?
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- running || errcode=$?
- log_end_msg $errcode
- ;;
- status)
- log_daemon_msg "Checking status of $DESC" "$NAME"
- if running ; then
- log_progress_msg "running"
- log_end_msg 0
- else
- log_progress_msg "apparently not running"
- log_end_msg 1
- exit 1
- fi
- ;;
- reload)
- log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
- log_warning_msg "cannot re-read the config file (use restart)."
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
- exit 1
- ;;
-esac
-
-exit 0
-
diff --git a/distro/debian/etc/init.d/chef-server b/distro/debian/etc/init.d/chef-server
deleted file mode 100755
index 0b94fc7fc7..0000000000
--- a/distro/debian/etc/init.d/chef-server
+++ /dev/null
@@ -1,122 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: chef-server
-# Required-Start: $remote_fs $network rabbitmq-server couchdb
-# Required-Stop: $remote_fs $network rabbitmq-server couchdb
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start a chef-server.
-### END INIT INFO
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# chef-server Startup script for chef-server.
-# chkconfig: - 90 02
-# description: starts up chef-server webui.
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=$(which chef-server)
-PIDFILE=/var/run/chef/server.%s.pid
-MAINPID=/var/run/chef/server.main.pid
-NAME=chef-server
-DESC=chef-server
-
-test -x $DAEMON || exit 1
-
-. /lib/lsb/init-functions
-
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-if [ ! -d /var/run/chef ]; then
- mkdir /var/run/chef
- chown $USER:$GROUP /var/run/chef
-fi
-
-DAEMON_OPTS="-p $PORT -e production -d -a $ADAPTER -P $PIDFILE -L $LOGFILE -C $CONFIG -u $USER -G $GROUP"
-
-running() {
- [ ! -f "$MAINPID" ] && return 1
- pid=`cat $MAINPID`
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- (ps -fp $pid | egrep -q "merb.*(merb : master|worker.*$PORT)") || return 1
- return 0
-}
-
-start_server() {
- $DAEMON $DAEMON_OPTS
- errcode=$?
- return $errcode
-}
-
-stop_server() {
- $DAEMON -K all -P $PIDFILE
- errcode=$?
- return $errcode
-}
-
-reload_server() {
- stop_server
- [ -n "$DIETIME" ] && sleep $DIETIME
- start_server
- [ -n "$STARTTIME" ] && sleep $STARTTIME
-}
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC "
- if running ; then
- log_progress_msg "apparently already running"
- log_end_msg 0
- exit 0
- fi
- if start_server ; then
- [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
- if running ; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
- else
- log_end_msg 1
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC"
- if running ; then
- errcode=0
- stop_server || errcode=$?
- log_end_msg $errcode
- else
- log_progress_msg "apparently not running"
- log_end_msg 0
- exit 0
- fi
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC"
- errcode=0
- reload_server
- running && errcode=$?
- log_end_msg $errcode
- ;;
- status)
- log_daemon_msg "Checking status of $DESC"
- if running ; then
- log_progress_msg "running"
- log_end_msg 0
- else
- log_progress_msg "apparently not running"
- log_end_msg 1
- exit 3
- fi
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|status}" >&2
- exit 1
- ;;
-esac
-
-exit 0
-
diff --git a/distro/debian/etc/init.d/chef-server-webui b/distro/debian/etc/init.d/chef-server-webui
deleted file mode 100755
index e2db8a49b7..0000000000
--- a/distro/debian/etc/init.d/chef-server-webui
+++ /dev/null
@@ -1,123 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: chef-server-webui
-# Required-Start: $remote_fs $network chef-server
-# Required-Stop: $remote_fs $network chef-server
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start a chef-server-webui
-### END INIT INFO
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# chef-server-webui Startup script for chef-server-webui.
-# chkconfig: - 95 02
-# description: starts up chef-server webui.
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=$(which chef-server-webui)
-PIDFILE=/var/run/chef/server-webui.%s.pid
-MAINPID=/var/run/chef/server-webui.main.pid
-NAME=chef-server-webui
-DESC=chef-server-webui
-
-test -x $DAEMON || exit 1
-
-. /lib/lsb/init-functions
-
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-if [ ! -d /var/run/chef ]; then
- mkdir /var/run/chef
- chown $USER:$GROUP /var/run/chef
-fi
-
-DAEMON_OPTS="-p $PORT -e production -d -a $ADAPTER -P $PIDFILE -L $LOGFILE -C $CONFIG -u $USER -G $GROUP"
-
-running() {
- [ ! -f "$MAINPID" ] && return 1
- pid=`cat $MAINPID`
- name=$WORKER
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- (ps -fp $pid | egrep -q "merb.*(merb : master|worker.*$PORT)") || return 1
- return 0
-}
-
-start_server() {
- $DAEMON $DAEMON_OPTS
- errcode=$?
- return $errcode
-}
-
-stop_server() {
- $DAEMON -K all -P $PIDFILE
- errcode=$?
- return $errcode
-}
-
-reload_server() {
- stop_server
- [ -n "$DIETIME" ] && sleep $DIETIME
- start_server
- [ -n "$STARTTIME" ] && sleep $STARTTIME
-}
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC "
- if running ; then
- log_progress_msg "apparently already running"
- log_end_msg 0
- exit 0
- fi
- if start_server ; then
- [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
- if running ; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
- else
- log_end_msg 1
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC"
- if running ; then
- errcode=0
- stop_server || errcode=$?
- log_end_msg $errcode
- else
- log_progress_msg "apparently not running"
- log_end_msg 0
- exit 0
- fi
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC"
- errcode=0
- reload_server
- running && errcode=$?
- log_end_msg $errcode
- ;;
- status)
- log_daemon_msg "Checking status of $DESC"
- if running ; then
- log_progress_msg "running"
- log_end_msg 0
- else
- log_progress_msg "apparently not running"
- log_end_msg 1
- exit 3
- fi
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|status}" >&2
- exit 1
- ;;
-esac
-
-exit 0
-
diff --git a/distro/debian/etc/init.d/chef-solr b/distro/debian/etc/init.d/chef-solr
deleted file mode 100755
index 2cc93b5fd2..0000000000
--- a/distro/debian/etc/init.d/chef-solr
+++ /dev/null
@@ -1,176 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: chef-solr
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start a chef-solr.
-### END INIT INFO
-#
-# Copyright (c) 2009-2010 Opscode, Inc <legal@opscode.com>
-#
-# chef-solr Startup script for chef-solr.
-# chkconfig: - 84 02
-# description: starts up chef-solr in daemon mode.
-
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=$(which chef-solr)
-DAEMON_NAME=java
-NAME=chef-solr
-DESC=chef-solr
-PIDFILE=/var/run/chef/solr.pid
-
-test -x $DAEMON || exit 1
-
-. /lib/lsb/init-functions
-
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-if [ ! -d /var/run/chef ]; then
- mkdir /var/run/chef
- chown $USER:$GROUP /var/run/chef
-fi
-
-if [ ! -f $LOGFILE ]; then
- touch $LOGFILE
- chown $USER:$GROUP $LOGFILE
-fi
-
-DAEMON_OPTS="-d -P $PIDFILE -c $CONFIG -L $LOGFILE -u $USER -g $GROUP"
-
-running_pid() {
- pid=$1
- name=$2
- [ -z "$pid" ] && return 1
- [ ! -d /proc/$pid ] && return 1
- cmd=`cat /proc/$pid/cmdline | tr '\000' '\n' | head -1`
- [ "$cmd" != "$name" ] && return 1
- return 0
-}
-
-running() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=`cat $PIDFILE`
- running_pid $pid $DAEMON_NAME || return 1
- return 0
-}
-
-start_server() {
- start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS
- errcode=$?
- for i in `seq 0 $MAXTRIES`
- do
- if running; then
- errcode=0
- break
- else
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- fi
- done
- return $errcode
-}
-
-stop_server() {
- killproc -p $PIDFILE $DAEMON
- errcode=$?
- return $errcode
-}
-
-reload_server() {
- [ ! -f "$PIDFILE" ] && return 1
- pid=pidofproc $PIDFILE # This is the daemon's pid
- /bin/kill -1 $pid
- return $?
-}
-
-force_stop() {
- [ ! -e "$PIDFILE" ] && return
- if running ; then
- /bin/kill -15 $pid
- sleep "$DIETIME"s
- if running ; then
- /bin/kill -9 $pid
- sleep "$DIETIME"s
- if running ; then
- echo "Cannot kill $NAME (pid=$pid)!"
- exit 1
- fi
- fi
- fi
- rm -f $PIDFILE
-}
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC " "$NAME"
- if running ; then
- log_progress_msg "apparently already running"
- log_end_msg 0
- exit 3
- fi
- if start_server ; then
- [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
- if running ; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
- else
- log_end_msg 1
- fi
- ;;
- stop)
- log_daemon_msg "Stopping $DESC" "$NAME"
- if running ; then
- errcode=0
- stop_server || errcode=$?
- log_end_msg $errcode
- else
- log_progress_msg "apparently not running"
- log_end_msg 0
- exit 0
- fi
- ;;
- force-stop)
- $0 stop
- if running; then
- log_daemon_msg "Stopping (force) $DESC" "$NAME"
- errcode=0
- force_stop || errcode=$?
- log_end_msg $errcode
- fi
- ;;
- restart|force-reload)
- log_daemon_msg "Restarting $DESC" "$NAME"
- errcode=0
- stop_server || errcode=$?
- [ -n "$DIETIME" ] && sleep $DIETIME
- start_server || errcode=$?
- [ -n "$STARTTIME" ] && sleep $STARTTIME
- running || errcode=$?
- log_end_msg $errcode
- ;;
- status)
- log_daemon_msg "Checking status of $DESC" "$NAME"
- if running ; then
- log_progress_msg "running"
- log_end_msg 0
- else
- log_progress_msg "apparently not running"
- log_end_msg 1
- exit 1
- fi
- ;;
- reload)
- log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
- log_warning_msg "cannot re-read the config file (use restart)."
- ;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/distro/debian/etc/init/chef-client.conf b/distro/debian/etc/init/chef-client.conf
deleted file mode 100644
index 5f246b140c..0000000000
--- a/distro/debian/etc/init/chef-client.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# chef-client - Chef Configuration Management Client
-#
-# Chef Client provides the Chef configuration management daemon
-
-description "Chef Client"
-
-start on filesystem
-stop on runlevel [!2345]
-
-respawn
-respawn limit 5 30
-
-pre-start script
- test -x /usr/bin/chef-client || { stop; exit 1; }
-end script
-
-exec /usr/bin/chef-client -i 1800 -L /var/log/chef/client.log
diff --git a/distro/debian/etc/init/chef-expander.conf b/distro/debian/etc/init/chef-expander.conf
deleted file mode 100644
index 2c08f6cecc..0000000000
--- a/distro/debian/etc/init/chef-expander.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# chef-expander - Chef Expander
-#
-# Chef Expander provides indexing of Solr for Chef Server
-
-description "Chef Expander"
-
-start on filesystem
-stop on runlevel [!2345]
-
-respawn
-respawn limit 5 30
-
-pre-start script
- test -x /usr/bin/chef-expander || { stop; exit 1; }
-end script
-
-exec /usr/bin/chef-expander -c /etc/chef/solr.rb -L /var/log/chef/expander.log -n 1 -i 1
diff --git a/distro/debian/etc/init/chef-server-webui.conf b/distro/debian/etc/init/chef-server-webui.conf
deleted file mode 100644
index 8ba25877e4..0000000000
--- a/distro/debian/etc/init/chef-server-webui.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# chef-server-webui - Chef Server WebUI
-#
-# Chef Server WebUI provides the browser-accessible UI to the Chef Server API
-
-description "Chef Server WebUI"
-
-start on filesystem
-stop on runlevel [!2345]
-
-respawn
-respawn limit 5 30
-
-pre-start script
- test -x /usr/bin/chef-server-webui || { stop; exit 1; }
-end script
-
-exec /usr/bin/chef-server-webui -e production -p 4040 -L /var/log/chef/server-webui.log
diff --git a/distro/debian/etc/init/chef-server.conf b/distro/debian/etc/init/chef-server.conf
deleted file mode 100644
index a372e50ea3..0000000000
--- a/distro/debian/etc/init/chef-server.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# chef-server - Chef Server
-#
-# Chef Server provides the Chef API server
-
-description "Chef Server API"
-
-start on filesystem
-stop on runlevel [!2345]
-
-respawn
-respawn limit 5 30
-
-pre-start script
- test -x /usr/bin/chef-server || { stop; exit 1; }
-end script
-
-exec /usr/bin/chef-server -e production -p 4000 -L /var/log/chef/server.log
diff --git a/distro/debian/etc/init/chef-solr.conf b/distro/debian/etc/init/chef-solr.conf
deleted file mode 100644
index edca5e3f80..0000000000
--- a/distro/debian/etc/init/chef-solr.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-# chef-solr - Chef Solr
-#
-# Chef Solr provides Solr search for Chef Server
-
-description "Chef Solr"
-
-start on filesystem
-stop on runlevel [!2345]
-
-respawn
-respawn limit 5 30
-
-pre-start script
- test -x /usr/bin/chef-solr || { stop; exit 1; }
-end script
-
-exec /usr/bin/chef-solr -c /etc/chef/solr.rb -L /var/log/chef/solr.log
diff --git a/distro/redhat/etc/init.d/chef-client b/distro/redhat/etc/init.d/chef-client
deleted file mode 100644
index b41150e7a1..0000000000
--- a/distro/redhat/etc/init.d/chef-client
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/bash
-#
-# chef-client Startup script for the Chef client
-#
-# chkconfig: - 98 02
-# description: Client component of the Chef systems integration framework.
-
-### BEGIN INIT INFO
-# Provides: chef-client
-# Required-Start: $local_fs $network $remote_fs
-# Required-Stop: $local_fs $network $remote_fs
-# Should-Start: $named $time
-# Should-Stop: $named $time
-# Short-Description: Startup script for the Chef client
-# Description: Client component of the Chef systems integration framework.
-### END INIT INFO
-
-# Source function library
-. /etc/init.d/functions
-
-exec="/usr/bin/chef-client"
-prog="chef-client"
-
-[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-config=${CONFIG-/etc/chef/client.rb}
-pidfile=${PIDFILE-/var/run/chef/client.pid}
-lockfile=${LOCKFILE-/var/lock/subsys/$prog}
-logfile=${LOGFILE-/var/log/chef/client.log}
-interval=${INTERVAL-1800}
-splay=${SPLAY-20}
-options=${OPTIONS-}
-
-start() {
- [ -x $exec ] || exit 5
- [ -f $config ] || exit 6
- echo -n $"Starting $prog: "
- daemon chef-client -d -c "$config" -L "$logfile" -P "$pidfile" -i "$interval" -s "$splay" "$options"
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
-}
-
-stop() {
- echo -n $"Stopping $prog: "
- killproc -p $pidfile chef-client
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
-}
-
-restart () {
- stop
- start
-}
-
-reload() {
- echo -n $"Reloading $prog: "
- killproc -p $pidfile chef-client -HUP
- retval=$?
- echo
- return $retval
-}
-
-run() {
- echo -n $"Triggering run of $prog: "
- killproc -p $pidfile chef-client -USR1
- retval=$?
- echo
- return $retval
-}
-
-force_reload() {
- restart
-}
-
-rh_status() {
- # run checks to determine if the service is running or use generic status
- status -p $pidfile $prog
-}
-
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
-
-case "$1" in
- start)
- rh_status_q && exit 0
- $1
- ;;
- stop)
- rh_status_q || exit 0
- $1
- ;;
- restart)
- $1
- ;;
- reload)
- rh_status_q || exit 7
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
- ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
- ;;
- run)
- $1
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|run}"
- exit 2
-esac
-exit $?
diff --git a/distro/redhat/etc/init.d/chef-expander b/distro/redhat/etc/init.d/chef-expander
deleted file mode 100644
index 82ae34dd62..0000000000
--- a/distro/redhat/etc/init.d/chef-expander
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash
-#
-# chef-expander Startup script for the Chef search indexer
-#
-# chkconfig: - 95 05
-# description: Search indexer component of the Chef Server.
-
-### BEGIN INIT INFO
-# Provides: chef-expander
-# Required-Start: $local_fs $network $remote_fs chef-solr rabbitmq-server
-# Required-Stop: $local_fs $network $remote_fs chef-solr rabbitmq-server
-# Should-Start: $named $time
-# Should-Stop: $named $time
-# Short-Description: Startup script for the Chef search indexer
-# Description: Search indexer component of the Chef Server.
-### END INIT INFO
-
-# Source function library
-. /etc/init.d/functions
-
-exec="/usr/bin/chef-expander"
-prog="chef-expander"
-
-[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-config=${CONFIG-/etc/chef/expander.rb}
-pidfile=${PIDFILE-/var/run/chef/expander.pid}
-lockfile=${LOCKFILE-/var/lock/subsys/$prog}
-logfile=${LOGFILE-/var/log/chef/expander.log}
-options=${OPTIONS-}
-
-start() {
- [ -x $exec ] || exit 5
- [ -f $config ] || exit 6
- echo -n $"Starting $prog: "
- daemon $prog -d -c "$config" -L "$logfile" -P "$pidfile" "$options"
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
-}
-
-stop() {
- echo -n $"Stopping $prog: "
- killproc -p $pidfile $prog
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
-}
-
-restart () {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-force_reload() {
- restart
-}
-
-rh_status() {
- # run checks to determine if the service is running or use generic status
- status -p $pidfile $prog
-}
-
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
-
-case "$1" in
- start)
- rh_status_q && exit 0
- $1
- ;;
- stop)
- rh_status_q || exit 0
- $1
- ;;
- restart)
- $1
- ;;
- reload)
- rh_status_q || exit 7
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
- ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-esac
-exit $?
diff --git a/distro/redhat/etc/init.d/chef-server b/distro/redhat/etc/init.d/chef-server
deleted file mode 100644
index f956dd4e45..0000000000
--- a/distro/redhat/etc/init.d/chef-server
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/bash
-#
-# chef-server Startup script for chef-server
-#
-# chkconfig: - 96 04
-# description: Server component of the Chef systems integration framework.
-
-### BEGIN INIT INFO
-# Provides: chef-server
-# Required-Start: $local_fs $network $remote_fs chef-solr chef-expander
-# Required-Stop: $local_fs $network $remote_fs chef-solr chef-expander
-# Should-Start: $named $time
-# Should-Stop: $named $time
-# Short-Description: Startup script for chef-server
-# Description: Server component of the Chef systems integration framework.
-### END INIT INFO
-
-# Source function library
-. /etc/init.d/functions
-
-exec="/usr/bin/chef-server"
-prog="chef-server"
-
-[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-config=${CONFIG-/etc/chef/server.rb}
-pidfile=${PIDFILE-/var/run/chef/server.main.pid}
-lockfile=${LOCKFILE-/var/lock/subsys/$prog}
-logfile=${LOGFILE-/var/log/chef/server.log}
-port=${PORT-4000}
-env=${ENVIRONMENT-production}
-adapter=${ADAPTER-thin}
-childpidfiles=${CHILDPIDFILES-/var/run/chef/server.%s.pid}
-user=${SERVER_USER-chef}
-group=${SERVER_GROUP-chef}
-options=${OPTIONS-}
-
-start() {
- [ -x $exec ] || exit 5
- [ -f $config ] || exit 6
- echo -n $"Starting $prog: "
- daemon $prog -d -C "$config" -L "$logfile" -p "$port" -e "$env" \
- -a "$adapter" -P "$childpidfiles" -u "$user" -G "$group" \
- "$options" "&>/dev/null"
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
-}
-
-stop() {
- echo -n $"Stopping $prog: "
- killproc -p $pidfile $prog
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
-}
-
-restart () {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-force_reload() {
- restart
-}
-
-rh_status() {
- # run checks to determine if the service is running or use generic status
- status -p $pidfile $prog
-}
-
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
-
-case "$1" in
- start)
- rh_status_q && exit 0
- $1
- ;;
- stop)
- rh_status_q || exit 0
- $1
- ;;
- restart)
- $1
- ;;
- reload)
- rh_status_q || exit 7
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
- ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-esac
-exit $?
diff --git a/distro/redhat/etc/init.d/chef-server-webui b/distro/redhat/etc/init.d/chef-server-webui
deleted file mode 100644
index 65498bf723..0000000000
--- a/distro/redhat/etc/init.d/chef-server-webui
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/bash
-#
-# chef-server-webui Startup script for chef-server-webui
-#
-# chkconfig: - 97 03
-# description: Server WebUI component of the Chef systems integration framework.
-
-### BEGIN INIT INFO
-# Provides: chef-server-webui
-# Required-Start: $local_fs $network $remote_fs chef-sever
-# Required-Stop: $local_fs $network $remote_fs chef-server
-# Should-Start: $named $time
-# Should-Stop: $named $time
-# Short-Description: Startup script for chef-server-webui
-# Description: Server WebUI component of the Chef systems integration framework.
-### END INIT INFO
-
-# Source function library
-. /etc/init.d/functions
-
-exec="/usr/bin/chef-server-webui"
-prog="chef-server-webui"
-
-[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-config=${CONFIG-/etc/chef/webui.rb}
-pidfile=${PIDFILE-/var/run/chef/server-webui.main.pid}
-lockfile=${LOCKFILE-/var/lock/subsys/$prog}
-logfile=${LOGFILE-/var/log/chef/server-webui.log}
-port=${PORT-4040}
-env=${ENVIRONMENT-production}
-adapter=${ADAPTER-thin}
-childpidfiles=${CHILDPIDFILES-/var/run/chef/server-webui.%s.pid}
-user=${SERVER_USER-chef}
-group=${SERVER_GROUP-chef}
-options=${OPTIONS-}
-
-start() {
- [ -x $exec ] || exit 5
- [ -f $config ] || exit 6
- echo -n $"Starting $prog: "
- daemon $prog -d -C "$config" -L "$logfile" -p "$port" -e "$env" \
- -a "$adapter" -P "$childpidfiles" -u "$user" -G "$group" \
- "$options" "&>/dev/null"
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
-}
-
-stop() {
- echo -n $"Stopping $prog: "
- killproc -p $pidfile $prog
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
-}
-
-restart () {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-force_reload() {
- restart
-}
-
-rh_status() {
- # run checks to determine if the service is running or use generic status
- status -p $pidfile $prog
-}
-
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
-
-case "$1" in
- start)
- rh_status_q && exit 0
- $1
- ;;
- stop)
- rh_status_q || exit 0
- $1
- ;;
- restart)
- $1
- ;;
- reload)
- rh_status_q || exit 7
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
- ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-esac
-exit $?
diff --git a/distro/redhat/etc/init.d/chef-solr b/distro/redhat/etc/init.d/chef-solr
deleted file mode 100644
index 9223173276..0000000000
--- a/distro/redhat/etc/init.d/chef-solr
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash
-#
-# chef-solr Startup script for the SOLR search engine
-#
-# chkconfig: - 94 06
-# description: SOLR search engine for the Chef Server.
-
-### BEGIN INIT INFO
-# Provides: chef-solr
-# Required-Start: $local_fs $network $remote_fs
-# Required-Stop: $local_fs $network $remote_fs
-# Should-Start: $named $time
-# Should-Stop: $named $time
-# Short-Description: Startup script for the SOLR search engine
-# Description: SOLR search engine for the Chef Server.
-### END INIT INFO
-
-# Source function library
-. /etc/init.d/functions
-
-exec="/usr/bin/chef-solr"
-prog="chef-solr"
-
-[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
-config=${CONFIG-/etc/chef/solr.rb}
-pidfile=${PIDFILE-/var/run/chef/solr.pid}
-lockfile=${LOCKFILE-/var/lock/subsys/$prog}
-logfile=${LOGFILE-/var/log/chef/solr.log}
-options=${OPTIONS-}
-
-start() {
- [ -x $exec ] || exit 5
- [ -f $config ] || exit 6
- echo -n $"Starting $prog: "
- daemon $prog -d -c "$config" -L "$logfile" -P "$pidfile" "$options"
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
-}
-
-stop() {
- echo -n $"Stopping $prog: "
- killproc -p $pidfile $prog
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
-}
-
-restart () {
- stop
- start
-}
-
-reload() {
- restart
-}
-
-force_reload() {
- restart
-}
-
-rh_status() {
- # run checks to determine if the service is running or use generic status
- status -p $pidfile $prog
-}
-
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
-
-case "$1" in
- start)
- rh_status_q && exit 0
- $1
- ;;
- stop)
- rh_status_q || exit 0
- $1
- ;;
- restart)
- $1
- ;;
- reload)
- rh_status_q || exit 7
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- rh_status
- ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-esac
-exit $?
diff --git a/distro/redhat/etc/logrotate.d/chef-client b/distro/redhat/etc/logrotate.d/chef-client
deleted file mode 100644
index 5e99edbf9a..0000000000
--- a/distro/redhat/etc/logrotate.d/chef-client
+++ /dev/null
@@ -1,8 +0,0 @@
-/var/log/chef/client.log {
- rotate 12
- weekly
- compress
- postrotate
- /etc/init.d/chef-client condrestart >/dev/null || :
- endscript
-}
diff --git a/distro/redhat/etc/logrotate.d/chef-expander b/distro/redhat/etc/logrotate.d/chef-expander
deleted file mode 100644
index d68b479de2..0000000000
--- a/distro/redhat/etc/logrotate.d/chef-expander
+++ /dev/null
@@ -1,8 +0,0 @@
-/var/log/chef/expander.log {
- rotate 12
- weekly
- compress
- postrotate
- /etc/init.d/chef-expander condrestart >/dev/null || :
- endscript
-}
diff --git a/distro/redhat/etc/logrotate.d/chef-server b/distro/redhat/etc/logrotate.d/chef-server
deleted file mode 100644
index 8e2ebde311..0000000000
--- a/distro/redhat/etc/logrotate.d/chef-server
+++ /dev/null
@@ -1,8 +0,0 @@
-/var/log/chef/server.log {
- rotate 12
- weekly
- compress
- postrotate
- /etc/init.d/chef-server condrestart >/dev/null || :
- endscript
-}
diff --git a/distro/redhat/etc/logrotate.d/chef-server-webui b/distro/redhat/etc/logrotate.d/chef-server-webui
deleted file mode 100644
index d8781fe200..0000000000
--- a/distro/redhat/etc/logrotate.d/chef-server-webui
+++ /dev/null
@@ -1,8 +0,0 @@
-/var/log/chef/server-webui.log {
- rotate 12
- weekly
- compress
- postrotate
- /etc/init.d/chef-server-webui condrestart >/dev/null || :
- endscript
-}
diff --git a/distro/redhat/etc/logrotate.d/chef-solr b/distro/redhat/etc/logrotate.d/chef-solr
deleted file mode 100644
index 54f18fe196..0000000000
--- a/distro/redhat/etc/logrotate.d/chef-solr
+++ /dev/null
@@ -1,8 +0,0 @@
-/var/log/chef/solr.log {
- rotate 12
- weekly
- compress
- postrotate
- /etc/init.d/chef-solr condrestart >/dev/null || :
- endscript
-}
diff --git a/distro/redhat/etc/sysconfig/chef-client b/distro/redhat/etc/sysconfig/chef-client
deleted file mode 100644
index c65de74539..0000000000
--- a/distro/redhat/etc/sysconfig/chef-client
+++ /dev/null
@@ -1,15 +0,0 @@
-# Configuration file for the chef-client service
-
-#CONFIG=/etc/chef/client.rb
-#PIDFILE=/var/run/chef/client.pid
-#LOCKFILE=/var/lock/subsys/chef-client
-#LOGFILE=/var/log/chef/client.log
-# Sleep interval between runs.
-# This value is in seconds.
-#INTERVAL=1800
-# Maximum amount of random delay before starting a run. Prevents every client
-# from contacting the server at the exact same time.
-# This value is in seconds.
-#SPLAY=20
-# Any additional chef-client options.
-#OPTIONS=
diff --git a/distro/redhat/etc/sysconfig/chef-expander b/distro/redhat/etc/sysconfig/chef-expander
deleted file mode 100644
index 9af06d6b3c..0000000000
--- a/distro/redhat/etc/sysconfig/chef-expander
+++ /dev/null
@@ -1,7 +0,0 @@
-# Configuration file for the chef-expander service
-
-#PIDFILE=/var/run/chef/expander.pid
-#CONFIG=/etc/chef/expander.rb
-#LOGFILE=/var/log/chef/expander.log
-# Any additional chef-expander options.
-OPTIONS="-n 1 -i 1"
diff --git a/distro/redhat/etc/sysconfig/chef-server b/distro/redhat/etc/sysconfig/chef-server
deleted file mode 100644
index 6b18090ba9..0000000000
--- a/distro/redhat/etc/sysconfig/chef-server
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration file for the chef-server service
-
-#CONFIG=/etc/chef/server.rb
-#PIDFILE=/var/run/chef/server.pid
-#LOCKFILE=/var/lock/subsys/chef-server
-#LOGFILE=/var/log/chef/server.log
-#PORT=4000
-#ENVIRONMENT=production
-#ADAPTER=thin
-#CHILDPIDFILES=/var/run/chef/server.%s.pid
-#SERVER_USER=chef
-#SERVER_GROUP=chef
-# Any additional chef-server options.
-#OPTIONS=
diff --git a/distro/redhat/etc/sysconfig/chef-server-webui b/distro/redhat/etc/sysconfig/chef-server-webui
deleted file mode 100644
index c08df36147..0000000000
--- a/distro/redhat/etc/sysconfig/chef-server-webui
+++ /dev/null
@@ -1,14 +0,0 @@
-# Configuration file for the chef-server-webui service
-
-#CONFIG=/etc/chef/webui.rb
-#PIDFILE=/var/run/chef/server-webui.pid
-#LOCKFILE=/var/lock/subsys/chef-server-webui
-#LOGFILE=/var/log/chef/server-webui.log
-#PORT=4040
-#ENVIRONMENT=production
-#ADAPTER=thin
-#CHILDPIDFILES=/var/run/chef/server-webui.%s.pid
-#SERVER_USER=chef
-#SERVER_GROUP=chef
-# Any additional chef-server-webui options.
-#OPTIONS=
diff --git a/distro/redhat/etc/sysconfig/chef-solr b/distro/redhat/etc/sysconfig/chef-solr
deleted file mode 100644
index 31d99f1f1c..0000000000
--- a/distro/redhat/etc/sysconfig/chef-solr
+++ /dev/null
@@ -1,8 +0,0 @@
-# Configuration file for the chef-solr service
-
-#CONFIG=/etc/chef/solr.rb
-#PIDFILE=/var/run/chef/solr.pid
-#LOCKFILE=/var/lock/subsys/chef-solr
-#LOGFILE=/var/log/chef/solr.log
-# Options for Java. Need to start with -j followed by options.
-#OPTIONS="-j "
diff --git a/distro/windows/service_manager.rb b/distro/windows/service_manager.rb
deleted file mode 100644
index 3cd3335b93..0000000000
--- a/distro/windows/service_manager.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Author:: Seth Chisamore (<schisamo@opscode.com>)
-# Copyright:: Copyright (c) 2011 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-$stderr.puts "WARNING: service_manager.rb is changed to: chef-service-manager"
-$stderr.puts "Please use chef-service-manager instead of service_manager.rb to install and manage chef-client as a windows service."
diff --git a/ext/win32-eventlog/Rakefile b/ext/win32-eventlog/Rakefile
new file mode 100644
index 0000000000..3112c27e8e
--- /dev/null
+++ b/ext/win32-eventlog/Rakefile
@@ -0,0 +1,50 @@
+require 'rubygems'
+require 'rake'
+require 'mkmf'
+
+desc "Building event log dll"
+
+def ensure_present(commands)
+ commands.each do |c|
+ unless find_executable c
+ warn "Could not find #{c}. Windows Event Logging will not correctly function."
+ end
+ end
+end
+
+
+EVT_MC_FILE = 'chef-log.man'
+EVT_RC_FILE = 'chef-log.rc'
+EVT_RESOURCE_OBJECT = 'resource.o'
+EVT_SHARED_OBJECT = 'chef-log.dll'
+MC = 'windmc'
+RC = 'windres'
+CC = 'gcc'
+
+ensure_present [MC, RC, CC]
+
+task :build => [EVT_RESOURCE_OBJECT, EVT_SHARED_OBJECT]
+task :default => [:build, :register]
+
+file EVT_RC_FILE=> EVT_MC_FILE do
+ sh "#{MC} #{EVT_MC_FILE}"
+end
+
+file EVT_RESOURCE_OBJECT => EVT_RC_FILE do
+ sh "#{RC} -i #{EVT_RC_FILE} -o #{EVT_RESOURCE_OBJECT}"
+end
+
+file EVT_SHARED_OBJECT => EVT_RESOURCE_OBJECT do
+ sh "#{CC} -o #{EVT_SHARED_OBJECT} -shared #{EVT_RESOURCE_OBJECT}"
+end
+
+task :register => EVT_SHARED_OBJECT do
+ require 'win32/eventlog'
+ dll_file = File.expand_path(EVT_SHARED_OBJECT)
+ Win32::EventLog.add_event_source(
+ :source => "Application",
+ :key_name => "Chef",
+ :event_message_file => dll_file,
+ :category_message_file => dll_file
+ )
+end
diff --git a/ext/win32-eventlog/chef-log.man b/ext/win32-eventlog/chef-log.man
new file mode 100644
index 0000000000..4b4a022d7f
--- /dev/null
+++ b/ext/win32-eventlog/chef-log.man
@@ -0,0 +1,26 @@
+MessageId=10000
+SymbolicName=RUN_START
+Language=English
+Starting Chef Client run v%1
+.
+
+MessageId=10001
+SymbolicName=RUN_STARTED
+Language=English
+Started Chef Client run %1
+.
+
+MessageId=10002
+SymbolicName=RUN_COMPLETED
+Language=English
+Completed Chef Client run %1 in %2 seconds
+.
+
+MessageId=10003
+SymbolicName=RUN_FAILED
+Language=English
+Failed Chef Client run %1 in %2 seconds.%n
+Exception type: %3%n
+Exception message: %4%n
+Exception backtrace: %5%n
+.
diff --git a/kitchen-tests/.kitchen.travis.yml b/kitchen-tests/.kitchen.travis.yml
index 4fd6a78900..66bbe23f64 100644
--- a/kitchen-tests/.kitchen.travis.yml
+++ b/kitchen-tests/.kitchen.travis.yml
@@ -6,18 +6,28 @@ driver_config:
iam_profile_name: <%= ENV['IAM_PROFILE_NAME'] %>
provisioner:
- name: chef_solo
+ name: chef_zero
github: <%= ENV['TRAVIS_REPO_SLUG'] %>
branch: <%= ENV['TRAVIS_COMMIT'] %>
require_chef_omnibus: true
data_path: test/fixtures
+# disable file provider diffs so we don't overflow travis' line limit
+ client_rb:
+ diff_disabled: true
platforms:
- name: ubuntu-12.04
driver_plugin: ec2
driver_config:
region: "us-west-2"
- availability_zone: "us-west-2b"
+ availability_zone: "us-west-2a"
+ ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
+ security_group_ids: ["travis-ci"]
+ - name: centos-6.4
+ driver_plugin: ec2
+ driver_config:
+ region: "us-west-2"
+ availability_zone: "us-west-2a"
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
security_group_ids: ["travis-ci"]
diff --git a/kitchen-tests/.kitchen.yml b/kitchen-tests/.kitchen.yml
index 651a606502..775bb59378 100644
--- a/kitchen-tests/.kitchen.yml
+++ b/kitchen-tests/.kitchen.yml
@@ -1,14 +1,34 @@
---
+driver:
+ name: vagrant
+ customize:
+ cpus: 4
+ memory: 2048
+
provisioner:
- name: chef_solo
+ name: chef_zero
github: "opscode/chef"
branch: <%= %x(git rev-parse HEAD) %>
require_chef_omnibus: true
data_path: test/fixtures
+ client_rb:
+ diff_disabled: true
platforms:
+ # upstream community mysql cookbook broken on 10.04
+ #- name: ubuntu-10.04
+ # run_list: apt::default
- name: ubuntu-12.04
- driver_plugin: vagrant
+ run_list: apt::default
+ - name: ubuntu-14.04
+ run_list: apt::default
+ # upstream community mysql cookbook also broken on 14.10
+ #- name: ubuntu-14.10
+ # run_list: apt::default
+ - name: centos-6.4
+ run_list: yum-epel::default
+ - name: centos-5.10
+ run_list: yum-epel::default
suites:
- name: webapp
diff --git a/kitchen-tests/cookbooks/webapp/attributes/default.rb b/kitchen-tests/cookbooks/webapp/attributes/default.rb
index efe06b6549..fb33efa49e 100644
--- a/kitchen-tests/cookbooks/webapp/attributes/default.rb
+++ b/kitchen-tests/cookbooks/webapp/attributes/default.rb
@@ -1,7 +1,14 @@
default['apache']['remote_host_ip'] = '127.0.0.1'
-default['mysql']['version'] = "5.5"
-
default['webapp']['database'] = 'webapp'
default['webapp']['db_username'] = 'webapp'
-default['webapp']['path'] = '/var/www/'
+default['webapp']['path'] = '/srv/webapp'
+
+# XXX: apache2 cookbook 2.0.0 has bugs around changing the mpm and then attempting a graceful restart
+# which fails and leaves the service down.
+case node['platform']
+when "ubuntu"
+ if node['platform_version'].to_f >= 14.04
+ default[:apache][:mpm] = 'event'
+ end
+end
diff --git a/kitchen-tests/cookbooks/webapp/recipes/default.rb b/kitchen-tests/cookbooks/webapp/recipes/default.rb
index 82479e5137..839b0ad8d8 100644
--- a/kitchen-tests/cookbooks/webapp/recipes/default.rb
+++ b/kitchen-tests/cookbooks/webapp/recipes/default.rb
@@ -14,8 +14,11 @@ creds = Hash.new
creds[item_name] = data_bag_item('passwords', item_name)
end
-apache_site "default" do
- enable true
+web_app "webapp" do
+ server_name 'localhost'
+ server_aliases [node['fqdn'], node['hostname'], 'localhost.localdomain']
+ docroot node['webapp']['path']
+ cookbook 'apache2'
end
mysql_service "default" do
diff --git a/kitchen-tests/test/fixtures/platforms/centos/5.json b/kitchen-tests/test/fixtures/platforms/centos/5.json
new file mode 100644
index 0000000000..9d324a2f03
--- /dev/null
+++ b/kitchen-tests/test/fixtures/platforms/centos/5.json
@@ -0,0 +1,14 @@
+{
+ "apache": {
+ "package": "httpd",
+ "service_name": "httpd"
+ },
+ "mysql": {
+ "server_package": "mysql-server",
+ "client_package": "mysql",
+ "service_name": "mysqld"
+ },
+ "php" : {
+ "package": "php53"
+ }
+}
diff --git a/kitchen-tests/test/fixtures/platforms/centos/6.json b/kitchen-tests/test/fixtures/platforms/centos/6.json
new file mode 100644
index 0000000000..4f74a3ed4a
--- /dev/null
+++ b/kitchen-tests/test/fixtures/platforms/centos/6.json
@@ -0,0 +1,14 @@
+{
+ "apache": {
+ "package": "httpd",
+ "service_name": "httpd"
+ },
+ "mysql": {
+ "server_package": "mysql-server",
+ "client_package": "mysql",
+ "service_name": "mysqld"
+ },
+ "php" : {
+ "package": "php"
+ }
+}
diff --git a/kitchen-tests/test/fixtures/platforms/ubuntu/10.04.json b/kitchen-tests/test/fixtures/platforms/ubuntu/10.04.json
new file mode 100644
index 0000000000..a9677c7ca5
--- /dev/null
+++ b/kitchen-tests/test/fixtures/platforms/ubuntu/10.04.json
@@ -0,0 +1,14 @@
+{
+ "apache": {
+ "package": "apache2",
+ "service_name": "apache2"
+ },
+ "mysql": {
+ "server_package": "mysql-server-5.1",
+ "client_package": "mysql-client-5.1",
+ "service_name": "mysql"
+ },
+ "php" : {
+ "package": "php5"
+ }
+}
diff --git a/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json b/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json
index 5e436a3cb0..eab46db2e5 100644
--- a/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json
+++ b/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json
@@ -1,42 +1,14 @@
{
- "apache": {
- "package": "apache2",
- "binary": "/usr/sbin/apache2",
- "dir": "/etc/apache2",
- "lib_dir": "/usr/lib/apache2",
- "libexec_dir": "/usr/lib/apache2/modules",
- "cache_dir": "/var/cache/apache2",
- "cgibin_dir": "/usr/lib/cgi-bin",
- "docroot_dir": "/var/www",
- "conf": "/etc/apache2/apache2.conf",
- "perl_pkg": "perl",
- "log_dir": "/var/log/apache2",
- "root_group": "root",
- "service_name": "apache2",
- "service_restart_command": "/usr/sbin/invoke-rc.d apache2 restart && sleep 1",
- "service_reload_command": "/usr/sbin/invoke-rc.d apache2 reload && sleep 1",
- "default_site_name": "000-default",
- "default_site_enabled": false,
- "default_modules": [
- "status",
- "alias",
- "auth_basic",
- "authn_file",
- "authz_core",
- "authz_groupfile",
- "authz_host",
- "authz_user",
- "autoindex",
- "dir",
- "env",
- "mime",
- "negotiation",
- "setenvif"
- ]
- },
- "mysql": {
- "server": {
- "version": "5.5"
- }
- }
+ "apache": {
+ "package": "apache2",
+ "service_name": "apache2"
+ },
+ "mysql": {
+ "server_package": "mysql-server-5.5",
+ "client_package": "mysql-client-5.5",
+ "service_name": "mysql"
+ },
+ "php" : {
+ "package": "php5"
+ }
}
diff --git a/kitchen-tests/test/fixtures/platforms/ubuntu/14.04.json b/kitchen-tests/test/fixtures/platforms/ubuntu/14.04.json
new file mode 100644
index 0000000000..eab46db2e5
--- /dev/null
+++ b/kitchen-tests/test/fixtures/platforms/ubuntu/14.04.json
@@ -0,0 +1,14 @@
+{
+ "apache": {
+ "package": "apache2",
+ "service_name": "apache2"
+ },
+ "mysql": {
+ "server_package": "mysql-server-5.5",
+ "client_package": "mysql-client-5.5",
+ "service_name": "mysql"
+ },
+ "php" : {
+ "package": "php5"
+ }
+}
diff --git a/kitchen-tests/test/fixtures/platforms/ubuntu/14.10.json b/kitchen-tests/test/fixtures/platforms/ubuntu/14.10.json
new file mode 100644
index 0000000000..eab46db2e5
--- /dev/null
+++ b/kitchen-tests/test/fixtures/platforms/ubuntu/14.10.json
@@ -0,0 +1,14 @@
+{
+ "apache": {
+ "package": "apache2",
+ "service_name": "apache2"
+ },
+ "mysql": {
+ "server_package": "mysql-server-5.5",
+ "client_package": "mysql-client-5.5",
+ "service_name": "mysql"
+ },
+ "php" : {
+ "package": "php5"
+ }
+}
diff --git a/kitchen-tests/test/fixtures/serverspec_helper.rb b/kitchen-tests/test/fixtures/serverspec_helper.rb
index 48963dc45d..ad1f866775 100644
--- a/kitchen-tests/test/fixtures/serverspec_helper.rb
+++ b/kitchen-tests/test/fixtures/serverspec_helper.rb
@@ -1,4 +1,4 @@
-# Shamelessly copied from opscode/onehealth-cookbooks/apache2/test/fixtures/serverspec_helper.rb
+# Shamelessly copied from https://github.com/onehealth-cookbooks/apache2/blob/master/test/fixtures/serverspec_helper.rb
# The commented-out platforms in the osmapping hash can be added once we have added them into
# our .kitchen.yml and .kitchen.travis.yml and added the appropriate JSON under test/fixtures/platforms.
diff --git a/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb b/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb
index 05da3ff337..64c9121a6f 100644
--- a/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb
+++ b/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb
@@ -19,21 +19,21 @@ describe "webapp::default", :end_to_end => true do
end
end
- describe "mysql-server-#{property[:mysql][:server][:version]} package" do
+ describe "#{property[:mysql][:server_package]} package" do
include_examples "a package" do
- let(:package_name) { "mysql-server-#{property[:mysql][:server][:version]}" }
+ let(:package_name) { property[:mysql][:server_package] }
end
end
- describe "mysql-client-5.5 package" do
+ describe "#{property[:mysql][:client_package]} package" do
include_examples "a package" do
- let(:package_name) { "mysql-client-5.5" }
+ let(:package_name) { property[:mysql][:client_package] }
end
end
describe "php package" do
include_examples "a package" do
- let(:package_name) { "php5" }
+ let(:package_name) { property[:php][:package] }
end
end
end
@@ -57,7 +57,7 @@ describe "webapp::default", :end_to_end => true do
describe "mysql service" do
include_examples "a service" do
- let(:service_name) { "mysql" }
+ let(:service_name) { property[:mysql][:service_name] }
end
end
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb
index 213d0b7f49..8a5885eff3 100644
--- a/lib/chef/api_client/registration.rb
+++ b/lib/chef/api_client/registration.rb
@@ -153,7 +153,9 @@ class Chef
def file_flags
base_flags = File::CREAT|File::TRUNC|File::RDWR
# Windows doesn't have symlinks, so it doesn't have NOFOLLOW
- base_flags |= File::NOFOLLOW if defined?(File::NOFOLLOW)
+ if defined?(File::NOFOLLOW) && !Chef::Config[:follow_client_key_symlink]
+ base_flags |= File::NOFOLLOW
+ end
base_flags
end
end
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index abcc81c290..a2718e7556 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -28,370 +28,372 @@ require 'mixlib/cli'
require 'tmpdir'
require 'rbconfig'
-class Chef::Application
- include Mixlib::CLI
+class Chef
+ class Application
+ include Mixlib::CLI
- def initialize
- super
+ def initialize
+ super
- @chef_client = nil
- @chef_client_json = nil
-
- # Always switch to a readable directory. Keeps subsequent Dir.chdir() {}
- # from failing due to permissions when launched as a less privileged user.
- end
-
- # Reconfigure the application. You'll want to override and super this method.
- def reconfigure
- configure_chef
- configure_logging
- configure_proxy_environment_variables
- configure_encoding
- end
+ @chef_client = nil
+ @chef_client_json = nil
- # Get this party started
- def run
- setup_signal_handlers
- reconfigure
- setup_application
- run_application
- end
+ # Always switch to a readable directory. Keeps subsequent Dir.chdir() {}
+ # from failing due to permissions when launched as a less privileged user.
+ end
- def setup_signal_handlers
- trap("INT") do
- Chef::Application.fatal!("SIGINT received, stopping", 2)
+ # Reconfigure the application. You'll want to override and super this method.
+ def reconfigure
+ configure_chef
+ configure_logging
+ configure_proxy_environment_variables
+ configure_encoding
end
- trap("TERM") do
- Chef::Application.fatal!("SIGTERM received, stopping", 3)
+ # Get this party started
+ def run
+ setup_signal_handlers
+ reconfigure
+ setup_application
+ run_application
end
- unless Chef::Platform.windows?
- trap("QUIT") do
- Chef::Log.info("SIGQUIT received, call stack:\n " + caller.join("\n "))
+ def setup_signal_handlers
+ trap("INT") do
+ Chef::Application.fatal!("SIGINT received, stopping", 2)
end
- trap("HUP") do
- Chef::Log.info("SIGHUP received, reconfiguring")
- reconfigure
+ trap("TERM") do
+ Chef::Application.fatal!("SIGTERM received, stopping", 3)
+ end
+
+ unless Chef::Platform.windows?
+ trap("QUIT") do
+ Chef::Log.info("SIGQUIT received, call stack:\n " + caller.join("\n "))
+ end
+
+ trap("HUP") do
+ Chef::Log.info("SIGHUP received, reconfiguring")
+ reconfigure
+ end
end
end
- end
- # Parse configuration (options and config file)
- def configure_chef
- parse_options
- load_config_file
- end
+ # Parse configuration (options and config file)
+ def configure_chef
+ parse_options
+ load_config_file
+ end
- # Parse the config file
- def load_config_file
- config_fetcher = Chef::ConfigFetcher.new(config[:config_file])
- if config[:config_file].nil?
- Chef::Log.warn("No config file found or specified on command line, using command line options.")
- elsif config_fetcher.config_missing?
- pp config_missing: true
- Chef::Log.warn("*****************************************")
- Chef::Log.warn("Did not find config file: #{config[:config_file]}, using command line options.")
- Chef::Log.warn("*****************************************")
- else
- config_content = config_fetcher.read_config
- apply_config(config_content, config[:config_file])
+ # Parse the config file
+ def load_config_file
+ config_fetcher = Chef::ConfigFetcher.new(config[:config_file])
+ if config[:config_file].nil?
+ Chef::Log.warn("No config file found or specified on command line, using command line options.")
+ elsif config_fetcher.config_missing?
+ pp config_missing: true
+ Chef::Log.warn("*****************************************")
+ Chef::Log.warn("Did not find config file: #{config[:config_file]}, using command line options.")
+ Chef::Log.warn("*****************************************")
+ else
+ config_content = config_fetcher.read_config
+ apply_config(config_content, config[:config_file])
+ end
+ Chef::Config.merge!(config)
end
- Chef::Config.merge!(config)
- end
- # Initialize and configure the logger.
- # === Loggers and Formatters
- # In Chef 10.x and previous, the Logger was the primary/only way that Chef
- # communicated information to the user. In Chef 10.14, a new system, "output
- # formatters" was added, and in Chef 11.0+ it is the default when running
- # chef in a console (detected by `STDOUT.tty?`). Because output formatters
- # are more complex than the logger system and users have less experience with
- # them, the config option `force_logger` is provided to restore the Chef 10.x
- # behavior.
- #
- # Conversely, for users who want formatter output even when chef is running
- # unattended, the `force_formatter` option is provided.
- #
- # === Auto Log Level
- # When `log_level` is set to `:auto` (default), the log level will be `:warn`
- # when the primary output mode is an output formatter (see
- # +using_output_formatter?+) and `:info` otherwise.
- #
- # === Automatic STDOUT Logging
- # When `force_logger` is configured (e.g., Chef 10 mode), a second logger
- # with output on STDOUT is added when running in a console (STDOUT is a tty)
- # and the configured log_location isn't STDOUT. This accounts for the case
- # that a user has configured a log_location in client.rb, but is running
- # chef-client by hand to troubleshoot a problem.
- def configure_logging
- Chef::Log.init(MonoLogger.new(Chef::Config[:log_location]))
- if want_additional_logger?
- configure_stdout_logger
+ # Initialize and configure the logger.
+ # === Loggers and Formatters
+ # In Chef 10.x and previous, the Logger was the primary/only way that Chef
+ # communicated information to the user. In Chef 10.14, a new system, "output
+ # formatters" was added, and in Chef 11.0+ it is the default when running
+ # chef in a console (detected by `STDOUT.tty?`). Because output formatters
+ # are more complex than the logger system and users have less experience with
+ # them, the config option `force_logger` is provided to restore the Chef 10.x
+ # behavior.
+ #
+ # Conversely, for users who want formatter output even when chef is running
+ # unattended, the `force_formatter` option is provided.
+ #
+ # === Auto Log Level
+ # When `log_level` is set to `:auto` (default), the log level will be `:warn`
+ # when the primary output mode is an output formatter (see
+ # +using_output_formatter?+) and `:info` otherwise.
+ #
+ # === Automatic STDOUT Logging
+ # When `force_logger` is configured (e.g., Chef 10 mode), a second logger
+ # with output on STDOUT is added when running in a console (STDOUT is a tty)
+ # and the configured log_location isn't STDOUT. This accounts for the case
+ # that a user has configured a log_location in client.rb, but is running
+ # chef-client by hand to troubleshoot a problem.
+ def configure_logging
+ Chef::Log.init(MonoLogger.new(Chef::Config[:log_location]))
+ if want_additional_logger?
+ configure_stdout_logger
+ end
+ Chef::Log.level = resolve_log_level
+ rescue StandardError => error
+ Chef::Log.fatal("Failed to open or create log file at #{Chef::Config[:log_location]}: #{error.class} (#{error.message})")
+ Chef::Application.fatal!("Aborting due to invalid 'log_location' configuration", 2)
end
- Chef::Log.level = resolve_log_level
- rescue StandardError => error
- Chef::Log.fatal("Failed to open or create log file at #{Chef::Config[:log_location]}: #{error.class} (#{error.message})")
- Chef::Application.fatal!("Aborting due to invalid 'log_location' configuration", 2)
- end
- def configure_stdout_logger
- stdout_logger = MonoLogger.new(STDOUT)
- stdout_logger.formatter = Chef::Log.logger.formatter
- Chef::Log.loggers << stdout_logger
- end
+ def configure_stdout_logger
+ stdout_logger = MonoLogger.new(STDOUT)
+ stdout_logger.formatter = Chef::Log.logger.formatter
+ Chef::Log.loggers << stdout_logger
+ end
- # Based on config and whether or not STDOUT is a tty, should we setup a
- # secondary logger for stdout?
- def want_additional_logger?
- ( Chef::Config[:log_location] != STDOUT ) && STDOUT.tty? && (!Chef::Config[:daemonize]) && (Chef::Config[:force_logger])
- end
+ # Based on config and whether or not STDOUT is a tty, should we setup a
+ # secondary logger for stdout?
+ def want_additional_logger?
+ ( Chef::Config[:log_location] != STDOUT ) && STDOUT.tty? && (!Chef::Config[:daemonize]) && (Chef::Config[:force_logger])
+ end
- # Use of output formatters is assumed if `force_formatter` is set or if
- # `force_logger` is not set and STDOUT is to a console (tty)
- def using_output_formatter?
- Chef::Config[:force_formatter] || (!Chef::Config[:force_logger] && STDOUT.tty?)
- end
+ # Use of output formatters is assumed if `force_formatter` is set or if
+ # `force_logger` is not set and STDOUT is to a console (tty)
+ def using_output_formatter?
+ Chef::Config[:force_formatter] || (!Chef::Config[:force_logger] && STDOUT.tty?)
+ end
- def auto_log_level?
- Chef::Config[:log_level] == :auto
- end
+ def auto_log_level?
+ Chef::Config[:log_level] == :auto
+ end
- # if log_level is `:auto`, convert it to :warn (when using output formatter)
- # or :info (no output formatter). See also +using_output_formatter?+
- def resolve_log_level
- if auto_log_level?
- if using_output_formatter?
- :warn
+ # if log_level is `:auto`, convert it to :warn (when using output formatter)
+ # or :info (no output formatter). See also +using_output_formatter?+
+ def resolve_log_level
+ if auto_log_level?
+ if using_output_formatter?
+ :warn
+ else
+ :info
+ end
else
- :info
+ Chef::Config[:log_level]
end
- else
- Chef::Config[:log_level]
end
- end
- # Configure and set any proxy environment variables according to the config.
- def configure_proxy_environment_variables
- configure_http_proxy
- configure_https_proxy
- configure_ftp_proxy
- configure_no_proxy
- end
-
- # Sets the default external encoding to UTF-8 (users can change this, but they shouldn't)
- def configure_encoding
- Encoding.default_external = Chef::Config[:ruby_encoding]
- end
+ # Configure and set any proxy environment variables according to the config.
+ def configure_proxy_environment_variables
+ configure_http_proxy
+ configure_https_proxy
+ configure_ftp_proxy
+ configure_no_proxy
+ end
- # Called prior to starting the application, by the run method
- def setup_application
- raise Chef::Exceptions::Application, "#{self.to_s}: you must override setup_application"
- end
+ # Sets the default external encoding to UTF-8 (users can change this, but they shouldn't)
+ def configure_encoding
+ Encoding.default_external = Chef::Config[:ruby_encoding]
+ end
- # Actually run the application
- def run_application
- raise Chef::Exceptions::Application, "#{self.to_s}: you must override run_application"
- end
+ # Called prior to starting the application, by the run method
+ def setup_application
+ raise Chef::Exceptions::Application, "#{self.to_s}: you must override setup_application"
+ end
- # Initializes Chef::Client instance and runs it
- def run_chef_client(specific_recipes = [])
- Chef::LocalMode.with_server_connectivity do
- override_runlist = config[:override_runlist]
- if specific_recipes.size > 0
- override_runlist ||= []
- end
- @chef_client = Chef::Client.new(
- @chef_client_json,
- :override_runlist => config[:override_runlist],
- :specific_recipes => specific_recipes,
- :runlist => config[:runlist]
- )
- @chef_client_json = nil
+ # Actually run the application
+ def run_application
+ raise Chef::Exceptions::Application, "#{self.to_s}: you must override run_application"
+ end
- if can_fork?
- fork_chef_client # allowed to run client in forked process
- else
- # Unforked interval runs are disabled, so this runs chef-client
- # once and then exits. If TERM signal is received, will "ignore"
- # the signal to finish converge.
- run_with_graceful_exit_option
+ # Initializes Chef::Client instance and runs it
+ def run_chef_client(specific_recipes = [])
+ Chef::LocalMode.with_server_connectivity do
+ override_runlist = config[:override_runlist]
+ if specific_recipes.size > 0
+ override_runlist ||= []
+ end
+ @chef_client = Chef::Client.new(
+ @chef_client_json,
+ :override_runlist => config[:override_runlist],
+ :specific_recipes => specific_recipes,
+ :runlist => config[:runlist]
+ )
+ @chef_client_json = nil
+
+ if can_fork?
+ fork_chef_client # allowed to run client in forked process
+ else
+ # Unforked interval runs are disabled, so this runs chef-client
+ # once and then exits. If TERM signal is received, will "ignore"
+ # the signal to finish converge.
+ run_with_graceful_exit_option
+ end
+ @chef_client = nil
end
- @chef_client = nil
end
- end
- private
- def can_fork?
- # win32-process gem exposes some form of :fork for Process
- # class. So we are seperately ensuring that the platform we're
- # running on is not windows before forking.
- Chef::Config[:client_fork] && Process.respond_to?(:fork) && !Chef::Platform.windows?
- end
-
- # Run chef-client once and then exit. If TERM signal is received, ignores the
- # signal to finish the converge and exists.
- def run_with_graceful_exit_option
- # Override the TERM signal.
- trap('TERM') do
- Chef::Log.debug("SIGTERM received during converge," +
- " finishing converge to exit normally (send SIGINT to terminate immediately)")
+ private
+ def can_fork?
+ # win32-process gem exposes some form of :fork for Process
+ # class. So we are seperately ensuring that the platform we're
+ # running on is not windows before forking.
+ Chef::Config[:client_fork] && Process.respond_to?(:fork) && !Chef::Platform.windows?
end
- @chef_client.run
- true
- end
-
- def fork_chef_client
- Chef::Log.info "Forking chef instance to converge..."
- pid = fork do
- # Want to allow forked processes to finish converging when
- # TERM singal is received (exit gracefully)
+ # Run chef-client once and then exit. If TERM signal is received, ignores the
+ # signal to finish the converge and exists.
+ def run_with_graceful_exit_option
+ # Override the TERM signal.
trap('TERM') do
Chef::Log.debug("SIGTERM received during converge," +
- " finishing converge to exit normally (send SIGINT to terminate immediately)")
+ " finishing converge to exit normally (send SIGINT to terminate immediately)")
end
- client_solo = Chef::Config[:solo] ? "chef-solo" : "chef-client"
- $0 = "#{client_solo} worker: ppid=#{Process.ppid};start=#{Time.new.strftime("%R:%S")};"
- begin
- Chef::Log.debug "Forked instance now converging"
- @chef_client.run
- rescue Exception => e
- Chef::Log.error(e.to_s)
- exit 1
- else
- exit 0
+ @chef_client.run
+ true
+ end
+
+ def fork_chef_client
+ Chef::Log.info "Forking chef instance to converge..."
+ pid = fork do
+ # Want to allow forked processes to finish converging when
+ # TERM singal is received (exit gracefully)
+ trap('TERM') do
+ Chef::Log.debug("SIGTERM received during converge," +
+ " finishing converge to exit normally (send SIGINT to terminate immediately)")
+ end
+
+ client_solo = Chef::Config[:solo] ? "chef-solo" : "chef-client"
+ $0 = "#{client_solo} worker: ppid=#{Process.ppid};start=#{Time.new.strftime("%R:%S")};"
+ begin
+ Chef::Log.debug "Forked instance now converging"
+ @chef_client.run
+ rescue Exception => e
+ Chef::Log.error(e.to_s)
+ exit 1
+ else
+ exit 0
+ end
end
+ Chef::Log.debug "Fork successful. Waiting for new chef pid: #{pid}"
+ result = Process.waitpid2(pid)
+ handle_child_exit(result)
+ Chef::Log.debug "Forked instance successfully reaped (pid: #{pid})"
+ true
end
- Chef::Log.debug "Fork successful. Waiting for new chef pid: #{pid}"
- result = Process.waitpid2(pid)
- handle_child_exit(result)
- Chef::Log.debug "Forked instance successfully reaped (pid: #{pid})"
- true
- end
- def handle_child_exit(pid_and_status)
- status = pid_and_status[1]
- return true if status.success?
- message = if status.signaled?
- "Chef run process terminated by signal #{status.termsig} (#{Signal.list.invert[status.termsig]})"
- else
- "Chef run process exited unsuccessfully (exit code #{status.exitstatus})"
+ def handle_child_exit(pid_and_status)
+ status = pid_and_status[1]
+ return true if status.success?
+ message = if status.signaled?
+ "Chef run process terminated by signal #{status.termsig} (#{Signal.list.invert[status.termsig]})"
+ else
+ "Chef run process exited unsuccessfully (exit code #{status.exitstatus})"
+ end
+ raise Exceptions::ChildConvergeError, message
end
- raise Exceptions::ChildConvergeError, message
- end
- def apply_config(config_content, config_file_path)
- Chef::Config.from_string(config_content, config_file_path)
- rescue Exception => error
- Chef::Log.fatal("Configuration error #{error.class}: #{error.message}")
- filtered_trace = error.backtrace.grep(/#{Regexp.escape(config_file_path)}/)
- filtered_trace.each {|line| Chef::Log.fatal(" " + line )}
- Chef::Application.fatal!("Aborting due to error in '#{config_file_path}'", 2)
- end
+ def apply_config(config_content, config_file_path)
+ Chef::Config.from_string(config_content, config_file_path)
+ rescue Exception => error
+ Chef::Log.fatal("Configuration error #{error.class}: #{error.message}")
+ filtered_trace = error.backtrace.grep(/#{Regexp.escape(config_file_path)}/)
+ filtered_trace.each {|line| Chef::Log.fatal(" " + line )}
+ Chef::Application.fatal!("Aborting due to error in '#{config_file_path}'", 2)
+ end
- # Set ENV['http_proxy']
- def configure_http_proxy
- if http_proxy = Chef::Config[:http_proxy]
- http_proxy_string = configure_proxy("http", http_proxy,
- Chef::Config[:http_proxy_user], Chef::Config[:http_proxy_pass])
- env['http_proxy'] = http_proxy_string unless env['http_proxy']
- env['HTTP_PROXY'] = http_proxy_string unless env['HTTP_PROXY']
+ # Set ENV['http_proxy']
+ def configure_http_proxy
+ if http_proxy = Chef::Config[:http_proxy]
+ http_proxy_string = configure_proxy("http", http_proxy,
+ Chef::Config[:http_proxy_user], Chef::Config[:http_proxy_pass])
+ env['http_proxy'] = http_proxy_string unless env['http_proxy']
+ env['HTTP_PROXY'] = http_proxy_string unless env['HTTP_PROXY']
+ end
end
- end
- # Set ENV['https_proxy']
- def configure_https_proxy
- if https_proxy = Chef::Config[:https_proxy]
- https_proxy_string = configure_proxy("https", https_proxy,
- Chef::Config[:https_proxy_user], Chef::Config[:https_proxy_pass])
- env['https_proxy'] = https_proxy_string unless env['https_proxy']
- env['HTTPS_PROXY'] = https_proxy_string unless env['HTTPS_PROXY']
+ # Set ENV['https_proxy']
+ def configure_https_proxy
+ if https_proxy = Chef::Config[:https_proxy]
+ https_proxy_string = configure_proxy("https", https_proxy,
+ Chef::Config[:https_proxy_user], Chef::Config[:https_proxy_pass])
+ env['https_proxy'] = https_proxy_string unless env['https_proxy']
+ env['HTTPS_PROXY'] = https_proxy_string unless env['HTTPS_PROXY']
+ end
end
- end
- # Set ENV['ftp_proxy']
- def configure_ftp_proxy
- if ftp_proxy = Chef::Config[:ftp_proxy]
- ftp_proxy_string = configure_proxy("ftp", ftp_proxy,
- Chef::Config[:ftp_proxy_user], Chef::Config[:ftp_proxy_pass])
- env['ftp_proxy'] = ftp_proxy_string unless env['ftp_proxy']
- env['FTP_PROXY'] = ftp_proxy_string unless env['FTP_PROXY']
+ # Set ENV['ftp_proxy']
+ def configure_ftp_proxy
+ if ftp_proxy = Chef::Config[:ftp_proxy]
+ ftp_proxy_string = configure_proxy("ftp", ftp_proxy,
+ Chef::Config[:ftp_proxy_user], Chef::Config[:ftp_proxy_pass])
+ env['ftp_proxy'] = ftp_proxy_string unless env['ftp_proxy']
+ env['FTP_PROXY'] = ftp_proxy_string unless env['FTP_PROXY']
+ end
end
- end
- # Set ENV['no_proxy']
- def configure_no_proxy
- if Chef::Config[:no_proxy]
- env['no_proxy'] = Chef::Config[:no_proxy] unless env['no_proxy']
- env['NO_PROXY'] = Chef::Config[:no_proxy] unless env['NO_PROXY']
+ # Set ENV['no_proxy']
+ def configure_no_proxy
+ if Chef::Config[:no_proxy]
+ env['no_proxy'] = Chef::Config[:no_proxy] unless env['no_proxy']
+ env['NO_PROXY'] = Chef::Config[:no_proxy] unless env['NO_PROXY']
+ end
end
- end
- # Builds a proxy uri. Examples:
- # http://username:password@hostname:port
- # https://username@hostname:port
- # ftp://hostname:port
- # when
- # scheme = "http", "https", or "ftp"
- # hostport = hostname:port
- # user = username
- # pass = password
- def configure_proxy(scheme, path, user, pass)
- begin
- path = "#{scheme}://#{path}" unless path.include?('://')
- # URI.split returns the following parts:
- # [scheme, userinfo, host, port, registry, path, opaque, query, fragment]
- parts = URI.split(URI.encode(path))
- # URI::Generic.build requires an integer for the port, but URI::split gives
- # returns a string for the port.
- parts[3] = parts[3].to_i if parts[3]
- if user
- userinfo = URI.encode(URI.encode(user), '@:')
- if pass
- userinfo << ":#{URI.encode(URI.encode(pass), '@:')}"
+ # Builds a proxy uri. Examples:
+ # http://username:password@hostname:port
+ # https://username@hostname:port
+ # ftp://hostname:port
+ # when
+ # scheme = "http", "https", or "ftp"
+ # hostport = hostname:port
+ # user = username
+ # pass = password
+ def configure_proxy(scheme, path, user, pass)
+ begin
+ path = "#{scheme}://#{path}" unless path.include?('://')
+ # URI.split returns the following parts:
+ # [scheme, userinfo, host, port, registry, path, opaque, query, fragment]
+ parts = URI.split(URI.encode(path))
+ # URI::Generic.build requires an integer for the port, but URI::split gives
+ # returns a string for the port.
+ parts[3] = parts[3].to_i if parts[3]
+ if user
+ userinfo = URI.encode(URI.encode(user), '@:')
+ if pass
+ userinfo << ":#{URI.encode(URI.encode(pass), '@:')}"
+ end
+ parts[1] = userinfo
end
- parts[1] = userinfo
+
+ return URI::Generic.build(parts).to_s
+ rescue URI::Error => e
+ # URI::Error messages generally include the offending string. Including a message
+ # for which proxy config item has the issue should help deduce the issue when
+ # the URI::Error message is vague.
+ raise Chef::Exceptions::BadProxyURI, "Cannot configure #{scheme} proxy. Does not comply with URI scheme. #{e.message}"
end
+ end
- return URI::Generic.build(parts).to_s
- rescue URI::Error => e
- # URI::Error messages generally include the offending string. Including a message
- # for which proxy config item has the issue should help deduce the issue when
- # the URI::Error message is vague.
- raise Chef::Exceptions::BadProxyURI, "Cannot configure #{scheme} proxy. Does not comply with URI scheme. #{e.message}"
+ # This is a hook for testing
+ def env
+ ENV
end
- end
- # This is a hook for testing
- def env
- ENV
- end
+ class << self
+ def debug_stacktrace(e)
+ message = "#{e.class}: #{e}\n#{e.backtrace.join("\n")}"
+ chef_stacktrace_out = "Generated at #{Time.now.to_s}\n"
+ chef_stacktrace_out += message
- class << self
- def debug_stacktrace(e)
- message = "#{e.class}: #{e}\n#{e.backtrace.join("\n")}"
- chef_stacktrace_out = "Generated at #{Time.now.to_s}\n"
- chef_stacktrace_out += message
+ Chef::FileCache.store("chef-stacktrace.out", chef_stacktrace_out)
+ Chef::Log.fatal("Stacktrace dumped to #{Chef::FileCache.load("chef-stacktrace.out", false)}")
+ Chef::Log.debug(message)
+ true
+ end
- Chef::FileCache.store("chef-stacktrace.out", chef_stacktrace_out)
- Chef::Log.fatal("Stacktrace dumped to #{Chef::FileCache.load("chef-stacktrace.out", false)}")
- Chef::Log.debug(message)
- true
- end
+ # Log a fatal error message to both STDERR and the Logger, exit the application
+ def fatal!(msg, err = -1)
+ Chef::Log.fatal(msg)
+ Process.exit err
+ end
- # Log a fatal error message to both STDERR and the Logger, exit the application
- def fatal!(msg, err = -1)
- Chef::Log.fatal(msg)
- Process.exit err
+ def exit!(msg, err = -1)
+ Chef::Log.debug(msg)
+ Process.exit err
+ end
end
- def exit!(msg, err = -1)
- Chef::Log.debug(msg)
- Process.exit err
- end
end
-
end
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb
index 7f0a39782a..5463f504bc 100644
--- a/lib/chef/application/client.rb
+++ b/lib/chef/application/client.rb
@@ -238,6 +238,11 @@ class Chef::Application::Client < Chef::Application
:boolean => true
end
+ option :audit_mode,
+ :long => "--[no-]audit-mode",
+ :description => "If not specified, run converge and audit phase. If true, run only audit phase. If false, run only converge phase.",
+ :boolean => true
+
IMMEDIATE_RUN_SIGNAL = "1".freeze
attr_reader :chef_client_json
diff --git a/lib/chef/application/solo.rb b/lib/chef/application/solo.rb
index 474bbf3f6c..c99170f437 100644
--- a/lib/chef/application/solo.rb
+++ b/lib/chef/application/solo.rb
@@ -191,6 +191,8 @@ class Chef::Application::Solo < Chef::Application
cookbooks_path = Array(Chef::Config[:cookbook_path]).detect{|e| e =~ /\/cookbooks\/*$/ }
recipes_path = File.expand_path(File.join(cookbooks_path, '..'))
+ Chef::Log.debug "Cleanup path #{recipes_path} before extract recipes into it"
+ FileUtils.rm_rf(recipes_path, :secure => true)
Chef::Log.debug "Creating path #{recipes_path} to extract recipes into"
FileUtils.mkdir_p(recipes_path)
tarball_path = File.join(recipes_path, 'recipes.tgz')
diff --git a/lib/chef/chef_fs/data_handler/group_data_handler.rb b/lib/chef/chef_fs/data_handler/group_data_handler.rb
index 4d1b10f321..1a36c66eb8 100644
--- a/lib/chef/chef_fs/data_handler/group_data_handler.rb
+++ b/lib/chef/chef_fs/data_handler/group_data_handler.rb
@@ -36,6 +36,10 @@ class Chef
result
end
+ def normalize_for_post(group, entry)
+ normalize_for_put(group, entry)
+ end
+
def preserve_key?(key)
return key == 'name'
end
diff --git a/lib/chef/chef_fs/file_system/base_fs_dir.rb b/lib/chef/chef_fs/file_system/base_fs_dir.rb
index 74038f481b..8cc277facc 100644
--- a/lib/chef/chef_fs/file_system/base_fs_dir.rb
+++ b/lib/chef/chef_fs/file_system/base_fs_dir.rb
@@ -40,6 +40,11 @@ class Chef
true
end
+ # An empty children array is an empty dir
+ def empty?
+ children.empty?
+ end
+
# Abstract: children
end
end
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index e8ff352116..4f37bd0ee3 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -36,6 +36,8 @@ require 'chef/cookbook/file_vendor'
require 'chef/cookbook/file_system_file_vendor'
require 'chef/cookbook/remote_file_vendor'
require 'chef/event_dispatch/dispatcher'
+require 'chef/event_loggers/base'
+require 'chef/event_loggers/windows_eventlog'
require 'chef/formatters/base'
require 'chef/formatters/doc'
require 'chef/formatters/minimal'
@@ -151,7 +153,7 @@ class Chef
@runner = nil
@ohai = Ohai::System.new
- event_handlers = configure_formatters
+ event_handlers = configure_formatters + configure_event_loggers
event_handlers += Array(Chef::Config[:event_handlers])
@events = EventDispatch::Dispatcher.new(*event_handlers)
@@ -191,6 +193,22 @@ class Chef
end
end
+ def configure_event_loggers
+ if Chef::Config.disable_event_logger
+ []
+ else
+ Chef::Config.event_loggers.map do |evt_logger|
+ case evt_logger
+ when Symbol
+ Chef::EventLoggers.new(evt_logger)
+ when Class
+ evt_logger.new
+ else
+ end
+ end
+ end
+ end
+
# Instantiates a Chef::Node object, possibly loading the node's prior state
# when using chef-client. Delegates to policy_builder
#
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 107b50ee85..08ce1a8ff6 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -25,11 +25,13 @@ require 'mixlib/config'
require 'chef/util/selinux'
require 'chef/util/path_helper'
require 'pathname'
+require 'chef/mixin/shell_out'
class Chef
class Config
extend Mixlib::Config
+ extend Chef::Mixin::ShellOut
PathHelper = Chef::Util::PathHelper
@@ -76,6 +78,10 @@ class Chef
formatters << [name, file_path]
end
+ def self.add_event_logger(logger)
+ event_handlers << logger
+ end
+
# Config file to load (client.rb, knife.rb, etc. defaults set differently in knife, chef-client, etc.)
configurable(:config_file)
@@ -390,6 +396,12 @@ class Chef
# If chef-zero is enabled, this defaults to nil (no authentication).
default(:client_key) { chef_zero.enabled ? nil : platform_specific_path("/etc/chef/client.pem") }
+ # When registering the client, should we allow the client key location to
+ # be a symlink? eg: /etc/chef/client.pem -> /etc/chef/prod-client.pem
+ # If the path of the key goes through a directory like /tmp this should
+ # never be set to true or its possibly an easily exploitable security hole.
+ default :follow_client_key_symlink, false
+
# This secret is used to decrypt encrypted data bag items.
default(:encrypted_data_bag_secret) do
if File.exist?(platform_specific_path("/etc/chef/encrypted_data_bag_secret"))
@@ -449,6 +461,15 @@ class Chef
# Event Handlers
default :event_handlers, []
+ default :disable_event_loggers, false
+ default :event_loggers do
+ evt_loggers = []
+ if Chef::Platform::windows? and not Chef::Platform::windows_server_2003?
+ evt_loggers << :win_evt
+ end
+ evt_loggers
+ end
+
# Exception Handlers
default :exception_handlers, []
@@ -476,7 +497,7 @@ class Chef
default :ssh_gateway, nil
default :bootstrap_version, nil
default :bootstrap_proxy, nil
- default :bootstrap_template, "chef-full"
+ default :bootstrap_template, nil
default :secret, nil
default :secret_file, nil
default :identity_file, nil
@@ -539,10 +560,12 @@ class Chef
# used to update files.
default :file_atomic_update, true
- # If false file staging is will be done via tempfiles that are
- # created under ENV['TMP'] otherwise tempfiles will be created in
- # the directory that files are going to reside.
- default :file_staging_uses_destdir, true
+ # There are 3 possible values for this configuration setting.
+ # true => file staging is done in the destination directory
+ # false => file staging is done via tempfiles under ENV['TMP']
+ # :auto => file staging will try using destination directory if possible and
+ # will fall back to ENV['TMP'] if destination directory is not usable.
+ default :file_staging_uses_destdir, :auto
# Exit if another run is in progress and the chef-client is unable to
# get the lock before time expires. If nil, no timeout is enforced. (Exits
@@ -602,32 +625,44 @@ class Chef
#
# If there is no 'locale -a' then we return 'en_US.UTF-8' since that is the most commonly
# available English UTF-8 locale. However, all modern POSIXen should support 'locale -a'.
- default :internal_locale do
- begin
- locales = `locale -a`.split
- case
- when locales.include?('C.UTF-8')
- 'C.UTF-8'
- when locales.include?('en_US.UTF-8')
- 'en_US.UTF-8'
- when locales.include?('en.UTF-8')
- 'en.UTF-8'
- when guesses = locales.select { |l| l =~ /^en_.*UTF-8$'/ }
- guesses.first
+ def self.guess_internal_locale
+ # https://github.com/opscode/chef/issues/2181
+ # Some systems have the `locale -a` command, but the result has
+ # invalid characters for the default encoding.
+ #
+ # For example, on CentOS 6 with ENV['LANG'] = "en_US.UTF-8",
+ # `locale -a`.split fails with ArgumentError invalid UTF-8 encoding.
+ locales = shell_out_with_systems_locale("locale -a").stdout.split
+ case
+ when locales.include?('C.UTF-8')
+ 'C.UTF-8'
+ when locales.include?('en_US.UTF-8'), locales.include?('en_US.utf8')
+ 'en_US.UTF-8'
+ when locales.include?('en.UTF-8')
+ 'en.UTF-8'
+ else
+ # Will match en_ZZ.UTF-8, en_ZZ.utf-8, en_ZZ.UTF8, en_ZZ.utf8
+ guesses = locales.select { |l| l =~ /^en_.*UTF-?8$/i }
+ unless guesses.empty?
+ guessed_locale = guesses.first
+ # Transform into the form en_ZZ.UTF-8
+ guessed_locale.gsub(/UTF-?8$/i, "UTF-8")
else
Chef::Log.warn "Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support."
'C'
end
- rescue
- if Chef::Platform.windows?
- Chef::Log.debug "Defaulting to locale en_US.UTF-8 on Windows, until it matters that we do something else."
- else
- Chef::Log.warn "No usable locale -a command found, assuming you have en_US.UTF-8 installed."
- end
- 'en_US.UTF-8'
end
+ rescue
+ if Chef::Platform.windows?
+ Chef::Log.debug "Defaulting to locale en_US.UTF-8 on Windows, until it matters that we do something else."
+ else
+ Chef::Log.debug "No usable locale -a command found, assuming you have en_US.UTF-8 installed."
+ end
+ 'en_US.UTF-8'
end
+ default :internal_locale, guess_internal_locale
+
# Force UTF-8 Encoding, for when we fire up in the 'C' locale or other strange locales (e.g.
# japanese windows encodings). If we do not do this, then knife upload will fail when a cookbook's
# README.md has UTF-8 characters that do not encode in whatever surrounding encoding we have been
diff --git a/lib/chef/dsl/recipe.rb b/lib/chef/dsl/recipe.rb
index 476d9db666..120497d56e 100644
--- a/lib/chef/dsl/recipe.rb
+++ b/lib/chef/dsl/recipe.rb
@@ -17,7 +17,6 @@
# limitations under the License.
#
-require 'chef/resource_platform_map'
require 'chef/mixin/convert_to_class_name'
require 'chef/exceptions'
@@ -53,9 +52,7 @@ class Chef
end
def has_resource_definition?(name)
- yes_or_no = run_context.definitions.has_key?(name)
-
- yes_or_no
+ run_context.definitions.has_key?(name)
end
# Processes the arguments and block as a resource definition.
@@ -69,12 +66,10 @@ class Chef
# This sets up the parameter overrides
new_def.instance_eval(&block) if block
-
new_recipe = Chef::Recipe.new(cookbook_name, recipe_name, run_context)
new_recipe.params = new_def.params
new_recipe.params[:name] = args[0]
new_recipe.instance_eval(&new_def.recipe)
- new_recipe
end
# Instantiates a resource (via #build_resource), then adds it to the
@@ -86,21 +81,7 @@ class Chef
resource = build_resource(type, name, created_at, &resource_attrs_block)
- # Some resources (freebsd_package) can be invoked with multiple names
- # (package || freebsd_package).
- # https://github.com/opscode/chef/issues/1773
- # For these resources we want to make sure
- # their key in resource collection is same as the name they are declared
- # as. Since this might be a breaking change for resources that define
- # customer to_s methods, we are working around the issue by letting
- # resources know of their created_as_type until this issue is fixed in
- # Chef 12:
- # https://github.com/opscode/chef/issues/1817
- if resource.respond_to?(:created_as_type=)
- resource.created_as_type = type
- end
-
- run_context.resource_collection.insert(resource)
+ run_context.resource_collection.insert(resource, resource_type:type, instance_name:name)
resource
end
@@ -124,7 +105,7 @@ class Chef
# This behavior is very counter-intuitive and should be removed.
# See CHEF-3694, https://tickets.opscode.com/browse/CHEF-3694
# Moved to this location to resolve CHEF-5052, https://tickets.opscode.com/browse/CHEF-5052
- resource.load_prior_resource
+ resource.load_prior_resource(type, name)
resource.cookbook_name = cookbook_name
resource.recipe_name = recipe_name
# Determine whether this resource is being created in the context of an enclosing Provider
diff --git a/lib/chef/encrypted_data_bag_item/assertions.rb b/lib/chef/encrypted_data_bag_item/assertions.rb
index e9acebbd29..0f9416e7b6 100644
--- a/lib/chef/encrypted_data_bag_item/assertions.rb
+++ b/lib/chef/encrypted_data_bag_item/assertions.rb
@@ -45,7 +45,7 @@ class Chef::EncryptedDataBagItem
def assert_aead_requirements_met!(algorithm)
unless OpenSSL::Cipher.method_defined?(:auth_data=)
- raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires Ruby >= 1.9"
+ raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires Ruby >= 2.0"
end
unless OpenSSL::Cipher.ciphers.include?(algorithm)
raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires an OpenSSL version with \"#{algorithm}\" algorithm support"
diff --git a/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb b/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb
index 3567925844..9a54396174 100644
--- a/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb
+++ b/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb
@@ -25,7 +25,7 @@ class Chef::EncryptedDataBagItem
def assert_requirements_met!
unless OpenSSL::Cipher.method_defined?(:auth_data=)
- raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires Ruby >= 1.9"
+ raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires Ruby >= 2.0"
end
unless OpenSSL::Cipher.ciphers.include?(algorithm)
raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires an OpenSSL version with \"#{algorithm}\" algorithm support"
diff --git a/lib/chef/event_loggers/base.rb b/lib/chef/event_loggers/base.rb
new file mode 100644
index 0000000000..1f676dd516
--- /dev/null
+++ b/lib/chef/event_loggers/base.rb
@@ -0,0 +1,62 @@
+#
+# Author:: Jay Mundrawala (<jdm@getchef.com>)
+#
+# Copyright:: 2014, Chef Software, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/event_dispatch/base'
+
+class Chef
+ module EventLoggers
+ class UnknownEventLogger < StandardError; end
+ class UnavailableEventLogger < StandardError; end
+
+ def self.event_loggers_by_name
+ @event_loggers_by_name ||= {}
+ end
+
+ def self.register(name, logger)
+ event_loggers_by_name[name.to_s] = logger
+ end
+
+ def self.by_name(name)
+ event_loggers_by_name[name]
+ end
+
+ def self.available_event_loggers
+ event_loggers_by_name.select do |key, val|
+ val.available?
+ end.keys
+ end
+
+ def self.new(name)
+ event_logger_class = by_name(name.to_s) or
+ raise UnknownEventLogger, "No event logger found for #{name} (available: #{available_event_loggers.join(', ')})"
+ raise UnavailableEventLogger unless available_event_loggers.include? name.to_s
+ event_logger_class.new
+ end
+
+ class Base < EventDispatch::Base
+ def self.short_name(name)
+ Chef::EventLoggers.register(name, self)
+ end
+
+ # Returns true if this implementation of EventLoggers can be used
+ def self.available?
+ false
+ end
+ end
+ end
+end
diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb
new file mode 100644
index 0000000000..6d45d4fab4
--- /dev/null
+++ b/lib/chef/event_loggers/windows_eventlog.rb
@@ -0,0 +1,103 @@
+#
+# Author:: Jay Mundrawala (<jdm@getchef.com>)
+#
+# Copyright:: 2014, Chef Software, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/event_loggers/base'
+require 'chef/platform/query_helpers'
+
+if Chef::Platform::windows? and not Chef::Platform::windows_server_2003?
+ [:INFINITE, :WAIT_FAILED, :FORMAT_MESSAGE_IGNORE_INSERTS, :ERROR_INSUFFICIENT_BUFFER].each do |c|
+ # These are redefined in 'win32/eventlog'
+ Windows::Constants.send(:remove_const, c)
+ end
+
+ require 'win32/eventlog'
+end
+
+class Chef
+ module EventLoggers
+ class WindowsEventLogger < EventLoggers::Base
+ short_name(:win_evt)
+
+ # These must match those that are defined in the manifest file
+ RUN_START_EVENT_ID = 10000
+ RUN_STARTED_EVENT_ID = 10001
+ RUN_COMPLETED_EVENT_ID = 10002
+ RUN_FAILED_EVENT_ID = 10003
+
+ EVENT_CATEGORY_ID = 11000
+ LOG_CATEGORY_ID = 11001
+
+ # Since we must install the event logger, this is not really configurable
+ SOURCE = 'Chef'
+
+ def self.available?
+ return Chef::Platform::windows?
+ end
+
+ def initialize
+ @eventlog = ::Win32::EventLog::open('Application')
+ end
+
+ def run_start(version)
+ @eventlog.report_event(
+ :event_type => ::Win32::EventLog::INFO_TYPE,
+ :source => SOURCE,
+ :event_id => RUN_START_EVENT_ID,
+ :data => [version]
+ )
+ end
+
+ def run_started(run_status)
+ @run_status = run_status
+ @eventlog.report_event(
+ :event_type => ::Win32::EventLog::INFO_TYPE,
+ :source => SOURCE,
+ :event_id => RUN_STARTED_EVENT_ID,
+ :data => [run_status.run_id]
+ )
+ end
+
+ def run_completed(node)
+ @eventlog.report_event(
+ :event_type => ::Win32::EventLog::INFO_TYPE,
+ :source => SOURCE,
+ :event_id => RUN_COMPLETED_EVENT_ID,
+ :data => [@run_status.run_id, @run_status.elapsed_time.to_s]
+ )
+ end
+
+ #Failed chef-client run %1 in %2 seconds.
+ #Exception type: %3
+ #Exception message: %4
+ #Exception backtrace: %5
+ def run_failed(e)
+ @eventlog.report_event(
+ :event_type => ::Win32::EventLog::ERROR_TYPE,
+ :source => SOURCE,
+ :event_id => RUN_FAILED_EVENT_ID,
+ :data => [@run_status.run_id,
+ @run_status.elapsed_time.to_s,
+ e.class.name,
+ e.message,
+ e.backtrace.join("\n")]
+ )
+ end
+
+ end
+ end
+end
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb
index 67429ac5a2..c8d26dbed2 100644
--- a/lib/chef/exceptions.rb
+++ b/lib/chef/exceptions.rb
@@ -91,7 +91,11 @@ class Chef
class ResourceNotFound < RuntimeError; end
# Can't find a Resource of this type that is valid on this platform.
- class NoSuchResourceType < NameError; end
+ class NoSuchResourceType < NameError
+ def initialize(short_name, node)
+ super "Cannot find a resource for #{short_name} on #{node[:platform]} version #{node[:platform_version]}"
+ end
+ end
class InvalidResourceSpecification < ArgumentError; end
class SolrConnectionError < RuntimeError; end
@@ -122,6 +126,13 @@ class Chef
class CannotDetermineHomebrewOwner < Package; end
+ # Can not create staging file during file deployment
+ class FileContentStagingError < RuntimeError
+ def initialize(errors)
+ super "Staging tempfile can not be created during file deployment.\n Errors: #{errors.join('\n')}!"
+ end
+ end
+
# A different version of a cookbook was added to a
# VersionedRecipeList than the one already there.
class CookbookVersionConflict < ArgumentError ; end
@@ -151,7 +162,12 @@ class Chef
# Node::Attribute computes the merged version of of attributes
# and makes it read-only. Attempting to modify a read-only
# attribute will cause this error.
- class ImmutableAttributeModification < NoMethodError; end
+ class ImmutableAttributeModification < NoMethodError
+ def initialize
+ super "Node attributes are read-only when you do not specify which precedence level to set. " +
+ %Q(To set an attribute use code like `node.default["key"] = "value"')
+ end
+ end
# Merged node attributes are invalidated when the component
# attributes are updated. Attempting to read from a stale copy
@@ -355,5 +371,12 @@ class Chef
end
class InvalidSearchQuery < ArgumentError; end
+
+ # Raised by Chef::ProviderResolver
+ class AmbiguousProviderResolution < RuntimeError
+ def initialize(resource, classes)
+ super "Found more than one provider for #{resource.resource_name} resource: #{classes}"
+ end
+ end
end
end
diff --git a/lib/chef/file_content_management/tempfile.rb b/lib/chef/file_content_management/tempfile.rb
index 61a5ce2a7c..2dde0ce21b 100644
--- a/lib/chef/file_content_management/tempfile.rb
+++ b/lib/chef/file_content_management/tempfile.rb
@@ -35,7 +35,22 @@ class Chef
private
def tempfile_open
- tf = ::Tempfile.open(tempfile_basename, tempfile_dirname)
+ tf = nil
+ errors = [ ]
+
+ tempfile_dirnames.each do |tempfile_dirname|
+ begin
+ tf = ::Tempfile.open(tempfile_basename, tempfile_dirname)
+ break
+ rescue SystemCallError => e
+ message = "Creating temp file under '#{tempfile_dirname}' failed with: '#{e.message}'"
+ Chef::Log.debug(message)
+ errors << message
+ end
+ end
+
+ raise Chef::Exceptions::FileContentStagingError(errors) if tf.nil?
+
# We always process the tempfile in binmode so that we
# preserve the line endings of the content.
tf.binmode
@@ -53,16 +68,29 @@ class Chef
basename
end
- def tempfile_dirname
+ # Returns the possible directories for the tempfile to be created in.
+ def tempfile_dirnames
# in why-run mode we need to create a Tempfile to compare against, which we will never
# wind up deploying, but our enclosing directory for the destdir may not exist yet, so
# instead we can reliably always create a Tempfile to compare against in Dir::tmpdir
- if Chef::Config[:file_staging_uses_destdir] && !Chef::Config[:why_run]
- ::File.dirname(@new_resource.path)
+ if Chef::Config[:why_run]
+ [ Dir.tmpdir ]
else
- Dir::tmpdir
+ case Chef::Config[:file_staging_uses_destdir]
+ when :auto
+ # In auto mode we try the destination directory first and fallback to ENV['TMP'] if
+ # that doesn't work.
+ [ ::File.dirname(@new_resource.path), Dir.tmpdir ]
+ when true
+ [ ::File.dirname(@new_resource.path) ]
+ when false
+ [ Dir.tmpdir ]
+ else
+ raise Chef::Exceptions::ConfigurationError, "Unknown setting '#{Chef::Config[:file_staging_uses_destdir]}' for Chef::Config[:file_staging_uses_destdir]. Possible values are :auto, true or false."
+ end
end
end
+
end
end
end
diff --git a/lib/chef/guard_interpreter/resource_guard_interpreter.rb b/lib/chef/guard_interpreter/resource_guard_interpreter.rb
index 229a8502c7..346b585d8c 100644
--- a/lib/chef/guard_interpreter/resource_guard_interpreter.rb
+++ b/lib/chef/guard_interpreter/resource_guard_interpreter.rb
@@ -33,10 +33,19 @@ class Chef
# to the resource
merge_inherited_attributes
- # Script resources have a code attribute, which is
- # what is used to execute the command, so include
- # that with attributes specified by caller in opts
- block_attributes = @command_opts.merge({:code => @command})
+ # Only execute and script resources and use guard attributes.
+ # The command to be executed on them are passed via different attributes.
+ # Script resources use code attribute and execute resources use
+ # command attribute. Moreover script resources are also execute
+ # resources. Here we make sure @command is assigned to the right
+ # attribute by checking the type of the resources.
+ # We need to make sure we check for Script first because any resource
+ # that can get to here is an Execute resource.
+ if @parent_resource.is_a? Chef::Resource::Script
+ block_attributes = @command_opts.merge({:code => @command})
+ else
+ block_attributes = @command_opts.merge({:command => @command})
+ end
# Handles cases like powershell_script where default
# attributes are different when used in a guard vs. not. For
@@ -79,8 +88,8 @@ class Chef
raise ArgumentError, "Specified guard_interpreter resource #{parent_resource.guard_interpreter.to_s} unknown for this platform"
end
- if ! resource_class.ancestors.include?(Chef::Resource::Script)
- raise ArgumentError, "Specified guard interpreter class #{resource_class} must be a kind of Chef::Resource::Script resource"
+ if ! resource_class.ancestors.include?(Chef::Resource::Execute)
+ raise ArgumentError, "Specified guard interpreter class #{resource_class} must be a kind of Chef::Resource::Execute resource"
end
empty_events = Chef::EventDispatch::Dispatcher.new
diff --git a/lib/chef/json_compat.rb b/lib/chef/json_compat.rb
index 3350da0c13..d0b3b4c7f8 100644
--- a/lib/chef/json_compat.rb
+++ b/lib/chef/json_compat.rb
@@ -39,6 +39,8 @@ class Chef
CHEF_SANDBOX = "Chef::Sandbox".freeze
CHEF_RESOURCE = "Chef::Resource".freeze
CHEF_RESOURCECOLLECTION = "Chef::ResourceCollection".freeze
+ CHEF_RESOURCESET = "Chef::ResourceCollection::ResourceSet".freeze
+ CHEF_RESOURCELIST = "Chef::ResourceCollection::ResourceList".freeze
class <<self
@@ -145,8 +147,12 @@ class Chef
Chef::Resource
when CHEF_RESOURCECOLLECTION
Chef::ResourceCollection
+ when CHEF_RESOURCESET
+ Chef::ResourceCollection::ResourceSet
+ when CHEF_RESOURCELIST
+ Chef::ResourceCollection::ResourceList
when /^Chef::Resource/
- Chef::Resource.find_subclass_by_name(json_class)
+ Chef::Resource.find_descendants_by_name(json_class)
else
raise Chef::Exceptions::JSON::ParseError, "Unsupported `json_class` type '#{json_class}'"
end
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index a992cf5779..19a329199d 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -194,13 +194,15 @@ class Chef
:description => "Verify the SSL cert for HTTPS requests to the Chef server API.",
:boolean => true
+ def default_bootstrap_template
+ "chef-full"
+ end
+
def bootstrap_template
- # For some reason knife.merge_configs doesn't pick up the default values from
- # Chef::Config[:knife][:bootstrap_template] unless Chef::Config[:knife][:bootstrap_template]
- # is forced to pick up the values before calling merge_configs.
- # We therefore have Chef::Config[:knife][:bootstrap_template] to pick up the defaults
- # if no option is specified.
- config[:bootstrap_template] || config[:distro] || config[:template_file] || Chef::Config[:knife][:bootstrap_template]
+ # The order here is important. We want to check if we have the new Chef 12 option is set first.
+ # Knife cloud plugins unfortunately all set a default option for the :distro so it should be at
+ # the end.
+ config[:bootstrap_template] || config[:template_file] || config[:distro] || default_bootstrap_template
end
def find_template
@@ -210,7 +212,6 @@ class Chef
if File.exists?(template)
Chef::Log.debug("Using the specified bootstrap template: #{File.dirname(template)}")
return template
-
end
# Otherwise search the template directories until we find the right one
@@ -280,14 +281,16 @@ class Chef
ssh = Chef::Knife::Ssh.new
ssh.ui = ui
ssh.name_args = [ server_name, ssh_command ]
- ssh.config[:ssh_user] = Chef::Config[:knife][:ssh_user] || config[:ssh_user]
+
+ # command line arguments and config file values are now merged into config in Chef::Knife#merge_configs
+ ssh.config[:ssh_user] = config[:ssh_user]
ssh.config[:ssh_password] = config[:ssh_password]
- ssh.config[:ssh_port] = Chef::Config[:knife][:ssh_port] || config[:ssh_port]
- ssh.config[:ssh_gateway] = Chef::Config[:knife][:ssh_gateway] || config[:ssh_gateway]
- ssh.config[:forward_agent] = Chef::Config[:knife][:forward_agent] || config[:forward_agent]
- ssh.config[:identity_file] = Chef::Config[:knife][:identity_file] || config[:identity_file]
+ ssh.config[:ssh_port] = config[:ssh_port]
+ ssh.config[:ssh_gateway] = config[:ssh_gateway]
+ ssh.config[:forward_agent] = config[:forward_agent]
+ ssh.config[:identity_file] = config[:identity_file]
ssh.config[:manual] = true
- ssh.config[:host_key_verify] = Chef::Config[:knife][:host_key_verify] || config[:host_key_verify]
+ ssh.config[:host_key_verify] = config[:host_key_verify]
ssh.config[:on_error] = :raise
ssh
end
diff --git a/lib/chef/knife/core/object_loader.rb b/lib/chef/knife/core/object_loader.rb
index 209f6987d4..698b09ac84 100644
--- a/lib/chef/knife/core/object_loader.rb
+++ b/lib/chef/knife/core/object_loader.rb
@@ -105,7 +105,7 @@ class Chef
end
def file_exists_and_is_readable?(file)
- File.exists?(file) && File.readable?(file)
+ File.exist?(file) && File.readable?(file)
end
end
diff --git a/lib/chef/knife/core/subcommand_loader.rb b/lib/chef/knife/core/subcommand_loader.rb
index d2be1be2d3..f9b8f5008e 100644
--- a/lib/chef/knife/core/subcommand_loader.rb
+++ b/lib/chef/knife/core/subcommand_loader.rb
@@ -22,6 +22,9 @@ class Chef
class Knife
class SubcommandLoader
+ MATCHES_CHEF_GEM = %r{/chef-[\d]+\.[\d]+\.[\d]+}.freeze
+ MATCHES_THIS_CHEF_GEM = %r{/chef-#{Chef::VERSION}/}.freeze
+
attr_reader :chef_config_dir
attr_reader :env
@@ -122,6 +125,14 @@ class Chef
subcommand_files = {}
files.each do |file|
rel_path = file[/(#{Regexp.escape File.join('chef', 'knife', '')}.*)\.rb/, 1]
+
+ # When not installed as a gem (ChefDK/appbundler in particular), AND
+ # a different version of Chef is installed via gems, `files` will
+ # include some files from the 'other' Chef install. If this contains
+ # a knife command that doesn't exist in this version of Chef, we will
+ # get a LoadError later when we try to require it.
+ next if from_different_chef_version?(file)
+
subcommand_files[rel_path] = file
end
@@ -185,6 +196,19 @@ class Chef
Dir[glob].map { |f| f.untaint }
end
+
+ def from_different_chef_version?(path)
+ matches_any_chef_gem?(path) && !matches_this_chef_gem?(path)
+ end
+
+ def matches_any_chef_gem?(path)
+ path =~ MATCHES_CHEF_GEM
+ end
+
+ def matches_this_chef_gem?(path)
+ path =~ MATCHES_THIS_CHEF_GEM
+ end
+
end
end
end
diff --git a/lib/chef/knife/core/ui.rb b/lib/chef/knife/core/ui.rb
index f3ecfbcae8..00a4834638 100644
--- a/lib/chef/knife/core/ui.rb
+++ b/lib/chef/knife/core/ui.rb
@@ -209,11 +209,11 @@ class Chef
def confirmation_instructions(default_choice)
case default_choice
when true
- '? (Y/n)'
+ '? (Y/n) '
when false
- '? (y/N)'
+ '? (y/N) '
else
- '? (Y/N)'
+ '? (Y/N) '
end
end
diff --git a/lib/chef/knife/node_from_file.rb b/lib/chef/knife/node_from_file.rb
index d69392a8db..66f2a466fd 100644
--- a/lib/chef/knife/node_from_file.rb
+++ b/lib/chef/knife/node_from_file.rb
@@ -35,16 +35,17 @@ class Chef
end
def run
- updated = loader.load_from('nodes', @name_args[0])
-
- updated.save
-
- output(format_for_display(updated)) if config[:print_after]
-
- ui.info("Updated Node #{updated.name}!")
+ @name_args.each do |arg|
+ updated = loader.load_from('nodes', arg)
+
+ updated.save
+
+ output(format_for_display(updated)) if config[:print_after]
+
+ ui.info("Updated Node #{updated.name}!")
+ end
end
end
end
end
-
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index accca39aa2..de4c60d998 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -106,13 +106,6 @@ class Chef
def session
config[:on_error] ||= :skip
ssh_error_handler = Proc.new do |server|
- if config[:manual]
- node_name = server.host
- else
- @action_nodes.each do |n|
- node_name = n if format_for_display(n)[config[:attribute]] == server.host
- end
- end
case config[:on_error]
when :skip
ui.warn "Failed to connect to #{server.host} -- #{$!.class.name}: #{$!.message}"
diff --git a/lib/chef/mixin/convert_to_class_name.rb b/lib/chef/mixin/convert_to_class_name.rb
index f849b8de6a..19f229fdd3 100644
--- a/lib/chef/mixin/convert_to_class_name.rb
+++ b/lib/chef/mixin/convert_to_class_name.rb
@@ -61,6 +61,60 @@ class Chef
base.to_s + (file_base == 'default' ? '' : "_#{file_base}")
end
+ # Copied from rails activesupport. In ruby >= 2.0 const_get will just do this, so this can
+ # be deprecated and removed.
+ #
+ # MIT LICENSE is here: https://github.com/rails/rails/blob/master/activesupport/MIT-LICENSE
+
+ # Tries to find a constant with the name specified in the argument string.
+ #
+ # 'Module'.constantize # => Module
+ # 'Test::Unit'.constantize # => Test::Unit
+ #
+ # The name is assumed to be the one of a top-level constant, no matter
+ # whether it starts with "::" or not. No lexical context is taken into
+ # account:
+ #
+ # C = 'outside'
+ # module M
+ # C = 'inside'
+ # C # => 'inside'
+ # 'C'.constantize # => 'outside', same as ::C
+ # end
+ #
+ # NameError is raised when the name is not in CamelCase or the constant is
+ # unknown.
+ def constantize(camel_cased_word)
+ names = camel_cased_word.split('::')
+
+ # Trigger a built-in NameError exception including the ill-formed constant in the message.
+ Object.const_get(camel_cased_word) if names.empty?
+
+ # Remove the first blank element in case of '::ClassName' notation.
+ names.shift if names.size > 1 && names.first.empty?
+
+ names.inject(Object) do |constant, name|
+ if constant == Object
+ constant.const_get(name)
+ else
+ candidate = constant.const_get(name)
+ next candidate if constant.const_defined?(name, false)
+ next candidate unless Object.const_defined?(name)
+
+ # Go down the ancestors to check if it is owned directly. The check
+ # stops when we reach Object or the end of ancestors tree.
+ constant = constant.ancestors.inject do |const, ancestor|
+ break const if ancestor == Object
+ break ancestor if ancestor.const_defined?(name, false)
+ const
+ end
+
+ # owner is in Object, so raise
+ constant.const_get(name, false)
+ end
+ end
+ end
+
end
end
end
diff --git a/lib/chef/mixin/deep_merge.rb b/lib/chef/mixin/deep_merge.rb
index 5e3327a526..825406a93e 100644
--- a/lib/chef/mixin/deep_merge.rb
+++ b/lib/chef/mixin/deep_merge.rb
@@ -27,16 +27,6 @@ class Chef
# http://trac.misuse.org/science/wiki/DeepMerge
module DeepMerge
- class InvalidSubtractiveMerge < ArgumentError; end
-
- OLD_KNOCKOUT_PREFIX = "!merge:".freeze
-
- # Regex to match the "knockout prefix" that was used to indicate
- # subtractive merging in Chef 10.x and previous. Subtractive merging is
- # removed as of Chef 11, but we detect attempted use of it and raise an
- # error (see: raise_if_knockout_used!)
- OLD_KNOCKOUT_MATCH = %r[!merge].freeze
-
extend self
def merge(first, second)
@@ -46,15 +36,6 @@ class Chef
DeepMerge.deep_merge(second, first)
end
- # Inherited roles use the knockout_prefix array subtraction functionality
- # This is likely to go away in Chef >= 0.11
- def role_merge(first, second)
- first = Mash.new(first) unless first.kind_of?(Mash)
- second = Mash.new(second) unless second.kind_of?(Mash)
-
- DeepMerge.deep_merge(second, first)
- end
-
class InvalidParameter < StandardError; end
# Deep Merge core documentation.
@@ -77,22 +58,15 @@ class Chef
dest = source; return dest
end
- raise_if_knockout_used!(source)
- raise_if_knockout_used!(dest)
case source
when nil
dest
when Hash
if dest.kind_of?(Hash)
source.each do |src_key, src_value|
- if dest.has_key? src_key
- if dest[src_key].nil?
- dest[src_key] = nil
- else
- dest[src_key] = deep_merge!(src_value, dest[src_key])
- end
+ if dest[src_key]
+ dest[src_key] = deep_merge!(src_value, dest[src_key])
else # dest[src_key] doesn't exist so we take whatever source has
- raise_if_knockout_used!(src_value)
dest[src_key] = src_value
end
end
@@ -131,11 +105,19 @@ class Chef
# If there are two Hashes, recursively merge.
if merge_onto.kind_of?(Hash) && merge_with.kind_of?(Hash)
merge_with.each do |key, merge_with_value|
- merge_onto[key] = if merge_onto.has_key?(key)
- hash_only_merge(merge_onto[key], merge_with_value)
- else
- merge_with_value
- end
+ value =
+ if merge_onto.has_key?(key)
+ hash_only_merge(merge_onto[key], merge_with_value)
+ else
+ merge_with_value
+ end
+
+ if merge_onto.respond_to?(:public_method_that_only_deep_merge_should_use)
+ # we can't call ImmutableMash#[]= because its immutable, but we need to mutate it to build it in-place
+ merge_onto.public_method_that_only_deep_merge_should_use(key, value)
+ else
+ merge_onto[key] = value
+ end
end
merge_onto
@@ -149,27 +131,6 @@ class Chef
end
end
- # Checks for attempted use of subtractive merge, which was removed for
- # Chef 11.0. If subtractive merge use is detected, will raise an
- # InvalidSubtractiveMerge exception.
- def raise_if_knockout_used!(obj)
- if uses_knockout?(obj)
- raise InvalidSubtractiveMerge, "subtractive merge with !merge is no longer supported"
- end
- end
-
- # Checks for attempted use of subtractive merge in +obj+.
- def uses_knockout?(obj)
- case obj
- when String
- obj =~ OLD_KNOCKOUT_MATCH
- when Array
- obj.any? {|element| element.respond_to?(:gsub) && element =~ OLD_KNOCKOUT_MATCH }
- else
- false
- end
- end
-
def deep_merge(source, dest)
deep_merge!(safe_dup(source), safe_dup(dest))
end
diff --git a/lib/chef/mixin/descendants_tracker.rb b/lib/chef/mixin/descendants_tracker.rb
new file mode 100644
index 0000000000..75d1f620d4
--- /dev/null
+++ b/lib/chef/mixin/descendants_tracker.rb
@@ -0,0 +1,82 @@
+#
+# Copyright (c) 2005-2012 David Heinemeier Hansson
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+
+# This is lifted from rails activesupport (note the copyright above):
+# https://github.com/rails/rails/blob/9f84e60ac9d7bf07d6ae1bc94f3941f5b8f1a228/activesupport/lib/active_support/descendants_tracker.rb
+
+class Chef
+ module Mixin
+ module DescendantsTracker
+ @@direct_descendants = {}
+
+ class << self
+ def direct_descendants(klass)
+ @@direct_descendants[klass] || []
+ end
+
+ def descendants(klass)
+ arr = []
+ accumulate_descendants(klass, arr)
+ arr
+ end
+
+ def find_descendants_by_name(klass, name)
+ descendants(klass).first {|c| c.name == name }
+ end
+
+ # This is the only method that is not thread safe, but is only ever called
+ # during the eager loading phase.
+ def store_inherited(klass, descendant)
+ (@@direct_descendants[klass] ||= []) << descendant
+ end
+
+ private
+
+ def accumulate_descendants(klass, acc)
+ if direct_descendants = @@direct_descendants[klass]
+ acc.concat(direct_descendants)
+ direct_descendants.each { |direct_descendant| accumulate_descendants(direct_descendant, acc) }
+ end
+ end
+ end
+
+ def inherited(base)
+ DescendantsTracker.store_inherited(self, base)
+ super
+ end
+
+ def direct_descendants
+ DescendantsTracker.direct_descendants(self)
+ end
+
+ def find_descendants_by_name(name)
+ DescendantsTracker.find_descendants_by_name(self, name)
+ end
+
+ def descendants
+ DescendantsTracker.descendants(self)
+ end
+ end
+ end
+end
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index 82772b584a..5b05e788db 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -15,10 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# chef/shell_out has been deprecated in favor of mixlib/shellout
-# chef/shell_out is still required here to ensure backward compatibility
-require 'chef/shell_out'
-
require 'mixlib/shellout'
class Chef
diff --git a/lib/chef/mixin/which.rb b/lib/chef/mixin/which.rb
new file mode 100644
index 0000000000..4179c97b62
--- /dev/null
+++ b/lib/chef/mixin/which.rb
@@ -0,0 +1,37 @@
+#--
+# Author:: Lamont Granquist <lamont@getchef.io>
+# Copyright:: Copyright (c) 2010 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+class Chef
+ module Mixin
+ module Which
+ def which(cmd, opts = {})
+ extra_path =
+ if opts[:extra_path].nil?
+ [ '/bin', '/usr/bin', '/sbin', '/usr/sbin' ]
+ else
+ [ opts[:extra_path] ].flatten
+ end
+ paths = ENV['PATH'].split(File::PATH_SEPARATOR) + extra_path
+ paths.each do |path|
+ filename = File.join(path, cmd)
+ return filename if File.executable?(filename)
+ end
+ false
+ end
+ end
+ end
+end
diff --git a/lib/chef/monkey_patches/securerandom.rb b/lib/chef/monkey_patches/securerandom.rb
deleted file mode 100644
index 7a41a1dbb0..0000000000
--- a/lib/chef/monkey_patches/securerandom.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Author:: James Casey <james@opscode.com>
-# Copyright:: Copyright (c) 2013 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# == SecureRandom (Patch)
-# On ruby 1.9, SecureRandom has a uuid method which generates a v4 UUID. The
-# backport of SecureRandom to 1.8.7 is missing this method
-
-require 'securerandom'
-
-module SecureRandom
- unless respond_to?(:uuid)
- # SecureRandom.uuid generates a v4 random UUID (Universally Unique IDentifier).
- #
- # p SecureRandom.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
- # p SecureRandom.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
- # p SecureRandom.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
- #
- # The version 4 UUID is purely random (except the version).
- # It doesn't contain meaningful information such as MAC address, time, etc.
- #
- # See RFC 4122 for details of UUID.
- def self.uuid
- ary = self.random_bytes(16).unpack("NnnnnN")
- ary[2] = (ary[2] & 0x0fff) | 0x4000
- ary[3] = (ary[3] & 0x3fff) | 0x8000
- "%08x-%04x-%04x-%04x-%04x%08x" % ary
- end
- end
-end
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index 327da67b1c..6055f0e1e9 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -42,6 +42,8 @@ class Chef
extend Forwardable
def_delegators :attributes, :keys, :each_key, :each_value, :key?, :has_key?
+ def_delegators :attributes, :rm, :rm_default, :rm_normal, :rm_override
+ def_delegators :attributes, :default!, :normal!, :override!, :force_default!, :force_override!
attr_accessor :recipe_list, :run_state, :override_runlist
@@ -125,6 +127,7 @@ class Chef
# Set a normal attribute of this node, but auto-vivify any Mashes that
# might be missing
def normal
+ attributes.top_level_breadcrumb = nil
attributes.set_unless_value_present = false
attributes.normal
end
@@ -134,28 +137,25 @@ class Chef
# Set a normal attribute of this node, auto-vivifying any mashes that are
# missing, but if the final value already exists, don't set it
def normal_unless
+ attributes.top_level_breadcrumb = nil
attributes.set_unless_value_present = true
attributes.normal
end
+
alias_method :set_unless, :normal_unless
# Set a default of this node, but auto-vivify any Mashes that might
# be missing
def default
+ attributes.top_level_breadcrumb = nil
attributes.set_unless_value_present = false
attributes.default
end
- # Set a force default attribute. Intermediate mashes will be created by
- # auto-vivify if necessary.
- def default!
- attributes.set_unless_value_present = false
- attributes.default!
- end
-
# Set a default attribute of this node, auto-vivifying any mashes that are
# missing, but if the final value already exists, don't set it
def default_unless
+ attributes.top_level_breadcrumb = nil
attributes.set_unless_value_present = true
attributes.default
end
@@ -163,49 +163,38 @@ class Chef
# Set an override attribute of this node, but auto-vivify any Mashes that
# might be missing
def override
+ attributes.top_level_breadcrumb = nil
attributes.set_unless_value_present = false
attributes.override
end
- # Set a force override attribute. Intermediate mashes will be created by
- # auto-vivify if needed.
- def override!
- attributes.set_unless_value_present = false
- attributes.override!
- end
-
# Set an override attribute of this node, auto-vivifying any mashes that
# are missing, but if the final value already exists, don't set it
def override_unless
+ attributes.top_level_breadcrumb = nil
attributes.set_unless_value_present = true
attributes.override
end
- def override_attrs
- attributes.override
- end
+ alias :override_attrs :override
+ alias :default_attrs :default
+ alias :normal_attrs :normal
def override_attrs=(new_values)
attributes.override = new_values
end
- def default_attrs
- attributes.default
- end
-
def default_attrs=(new_values)
attributes.default = new_values
end
- def normal_attrs
- attributes.normal
- end
-
def normal_attrs=(new_values)
attributes.normal = new_values
end
def automatic_attrs
+ attributes.top_level_breadcrumb = nil
+ attributes.set_unless_value_present = false
attributes.automatic
end
@@ -397,7 +386,7 @@ class Chef
end
index_hash["recipe"] = run_list.recipe_names if run_list.recipe_names.length > 0
index_hash["role"] = run_list.role_names if run_list.role_names.length > 0
- index_hash["run_list"] = run_list.run_list if run_list.run_list.length > 0
+ index_hash["run_list"] = run_list.run_list_items
index_hash
end
@@ -409,7 +398,7 @@ class Chef
display["normal"] = normal_attrs
display["default"] = attributes.combined_default
display["override"] = attributes.combined_override
- display["run_list"] = run_list.run_list
+ display["run_list"] = run_list.run_list_items
display
end
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb
index 66569cf0e1..3c48f653eb 100644
--- a/lib/chef/node/attribute.rb
+++ b/lib/chef/node/attribute.rb
@@ -58,7 +58,6 @@ class Chef
:@force_default
]
-
OVERRIDE_COMPONENTS = [
:@override,
:@role_override,
@@ -146,7 +145,6 @@ class Chef
METHOD_DEFN
end
-
# return the cookbook level default attribute component
attr_reader :default
@@ -159,11 +157,6 @@ class Chef
# return the force_default level attribute component
attr_reader :force_default
- # default! is the "advertised" method for force_default, but is
- # implemented as an alias because instance variables can't (easily) have
- # +!+ characters.
- alias :default! :force_default
-
# return the "normal" level attribute component
attr_reader :normal
@@ -179,14 +172,22 @@ class Chef
# return the force override level attribute component
attr_reader :force_override
- # +override!+ is the "advertised" method for +force_override+ but is
- # implemented as an alias because instance variables can't easily have
- # +!+ characters.
- alias :override! :force_override
-
# return the automatic level attribute component
attr_reader :automatic
+ # This is used to track the top level key as we descend through method chaining into
+ # a precedence level (e.g. node.default['foo']['bar']['baz']= results in 'foo' here). We
+ # need this so that when we hit the end of a method chain which results in a mutator method
+ # that we can invalidate the whole top-level deep merge cache for the top-level key. It is
+ # the responsibility of the accessor on the Chef::Node object to reset this to nil, and then
+ # the first VividMash#[] call can ||= and set this to the first key we encounter.
+ attr_accessor :top_level_breadcrumb
+
+ # Cache of deep merged values by top-level key. This is a simple hash which has keys that are the
+ # top-level keys of the node object, and we save the computed deep-merge for that key here. There is
+ # no cache of subtrees.
+ attr_accessor :deep_merge_cache
+
def initialize(normal, default, override, automatic)
@set_unless_present = false
@@ -207,6 +208,8 @@ class Chef
@merged_attributes = nil
@combined_override = nil
@combined_default = nil
+ @top_level_breadcrumb = nil
+ @deep_merge_cache = {}
end
# Debug what's going on with an attribute. +args+ is a path spec to the
@@ -242,13 +245,16 @@ class Chef
@set_unless_present = setting
end
- # Clears merged_attributes, which will cause it to be recomputed on the
- # next access.
- def reset_cache
- @merged_attributes = nil
- @combined_default = nil
- @combined_override = nil
- @set_unless_present = false
+ # Invalidate a key in the deep_merge_cache. If called with nil, or no arg, this will invalidate
+ # the entire deep_merge cache. In the case of the user doing node.default['foo']['bar']['baz']=
+ # that eventually results in a call to reset_cache('foo') here. A node.default=hash_thing call
+ # must invalidate the entire cache and re-deep-merge the entire node object.
+ def reset_cache(path = nil)
+ if path.nil?
+ @deep_merge_cache = {}
+ else
+ deep_merge_cache.delete(path)
+ end
end
alias :reset :reset_cache
@@ -311,30 +317,136 @@ class Chef
@automatic = VividMash.new(self, new_data)
end
- def merged_attributes
- @merged_attributes ||= begin
- components = [merge_defaults, @normal, merge_overrides, @automatic]
- resolved_attrs = components.inject(Mash.new) do |merged, component|
- Chef::Mixin::DeepMerge.hash_only_merge(merged, component)
- end
- immutablize(resolved_attrs)
- end
+ #
+ # Deleting attributes
+ #
+
+ # clears attributes from all precedence levels
+ def rm(*args)
+ reset(args[0])
+ # just easier to compute our retval, rather than collect+merge sub-retvals
+ ret = args.inject(merged_attributes) do |attr, arg|
+ if attr.nil? || !attr.respond_to?(:[])
+ nil
+ else
+ begin
+ attr[arg]
+ rescue TypeError
+ raise TypeError, "Wrong type in index of attribute (did you use a Hash index on an Array?)"
+ end
+ end
+ end
+ rm_default(*args)
+ rm_normal(*args)
+ rm_override(*args)
+ ret
+ end
+
+ # does <level>['foo']['bar'].delete('baz')
+ def remove_from_precedence_level(level, *args, key)
+ multimash = level.element(*args)
+ multimash.nil? ? nil : multimash.delete(key)
+ end
+
+ private :remove_from_precedence_level
+
+ # clears attributes from all default precedence levels
+ #
+ # equivalent to: force_default!['foo']['bar'].delete('baz')
+ def rm_default(*args)
+ reset(args[0])
+ remove_from_precedence_level(force_default!(autovivify: false), *args)
+ end
+
+ # clears attributes from normal precedence
+ #
+ # equivalent to: normal!['foo']['bar'].delete('baz')
+ def rm_normal(*args)
+ reset(args[0])
+ remove_from_precedence_level(normal!(autovivify: false), *args)
+ end
+
+ # clears attributes from all override precedence levels
+ #
+ # equivalent to: force_override!['foo']['bar'].delete('baz')
+ def rm_override(*args)
+ reset(args[0])
+ remove_from_precedence_level(force_override!(autovivify: false), *args)
+ end
+
+ #
+ # Replacing attributes without merging
+ #
+
+ # sets default attributes without merging
+ def default!(opts={})
+ # FIXME: do not flush whole cache
+ reset
+ MultiMash.new(self, @default, [], opts)
+ end
+
+ # sets normal attributes without merging
+ def normal!(opts={})
+ # FIXME: do not flush whole cache
+ reset
+ MultiMash.new(self, @normal, [], opts)
+ end
+
+ # sets override attributes without merging
+ def override!(opts={})
+ # FIXME: do not flush whole cache
+ reset
+ MultiMash.new(self, @override, [], opts)
end
- def combined_override
- @combined_override ||= immutablize(merge_overrides)
+ # clears from all default precedence levels and then sets force_default
+ def force_default!(opts={})
+ # FIXME: do not flush whole cache
+ reset
+ MultiMash.new(self, @force_default, [@default, @env_default, @role_default], opts)
end
- def combined_default
- @combined_default ||= immutablize(merge_defaults)
+ # clears from all override precedence levels and then sets force_override
+ def force_override!(opts={})
+ # FIXME: do not flush whole cache
+ reset
+ MultiMash.new(self, @force_override, [@override, @env_override, @role_override], opts)
+ end
+
+ #
+ # Accessing merged attributes.
+ #
+ # Note that merged_attributes('foo', 'bar', 'baz') can be called to compute only the
+ # deep merge of node['foo']['bar']['baz'], but in practice we currently always compute
+ # all of node['foo'] even if the user only requires node['foo']['bar']['baz'].
+ #
+
+ def merged_attributes(*path)
+ # immutablize(
+ merge_all(path)
+ # )
+ end
+
+ def combined_override(*path)
+ immutablize(merge_overrides(path))
+ end
+
+ def combined_default(*path)
+ immutablize(merge_defaults(path))
end
def [](key)
- merged_attributes[key]
+ if deep_merge_cache.has_key?(key)
+ # return the cache of the deep merged values by top-level key
+ deep_merge_cache[key]
+ else
+ # save all the work of computing node[key]
+ deep_merge_cache[key] = merged_attributes(key)
+ end
end
def []=(key, value)
- merged_attributes[key] = value
+ raise Exceptions::ImmutableAttributeModification
end
def has_key?(key)
@@ -377,20 +489,94 @@ class Chef
private
- def merge_defaults
- DEFAULT_COMPONENTS.inject(Mash.new) do |merged, component_ivar|
- component_value = instance_variable_get(component_ivar)
- Chef::Mixin::DeepMerge.merge(merged, component_value)
+ # Helper method for merge_all/merge_defaults/merge_overrides.
+ #
+ # apply_path(thing, [ "foo", "bar", "baz" ]) = thing["foo"]["bar"]["baz"]
+ #
+ # The path value can be nil in which case the whole component is returned.
+ #
+ # It returns nil (does not raise an exception) if it walks off the end of an Mash/Hash/Array, it does not
+ # raise any TypeError if it attempts to apply a hash key to an Integer/String/TrueClass, and just returns
+ # nil in that case.
+ #
+ def apply_path(component, path)
+ path ||= []
+ path.inject(component) do |val, path_arg|
+ if val.respond_to?(:[])
+ # Have an Array-like or Hash-like thing
+ if !val.respond_to?(:has_key?)
+ # Have an Array-like thing
+ val[path_arg]
+ elsif val.has_key?(path_arg)
+ # Hash-like thing (must check has_key? first to protect against Autovivification)
+ val[path_arg]
+ else
+ nil
+ end
+ else
+ nil
+ end
+ end
+ end
+
+ # For elements like Fixnums, true, nil...
+ def safe_dup(e)
+ e.dup
+ rescue TypeError
+ e
+ end
+
+ # Deep merge all attribute levels using hash-only merging between different precidence
+ # levels (so override arrays completely replace arrays set at any default level).
+ #
+ # The path allows for selectively deep-merging a subtree of the node object.
+ #
+ # @param path [Array] Array of args to method chain to descend into the node object
+ # @return [attr] Deep Merged values (may be VividMash, Hash, Array, etc) from the node object
+ def merge_all(path)
+ components = [
+ merge_defaults(path),
+ apply_path(@normal, path),
+ merge_overrides(path),
+ apply_path(@automatic, path),
+ ]
+
+ components.map! do |component|
+ safe_dup(component)
+ end
+
+ return nil if components.compact.empty?
+
+ components.inject(ImmutableMash.new({})) do |merged, component|
+ Chef::Mixin::DeepMerge.hash_only_merge!(merged, component)
end
end
- def merge_overrides
- OVERRIDE_COMPONENTS.inject(Mash.new) do |merged, component_ivar|
- component_value = instance_variable_get(component_ivar)
- Chef::Mixin::DeepMerge.merge(merged, component_value)
+ # Deep merge the default attribute levels with array merging.
+ #
+ # The path allows for selectively deep-merging a subtree of the node object.
+ #
+ # @param path [Array] Array of args to method chain to descend into the node object
+ # @return [attr] Deep Merged values (may be VividMash, Hash, Array, etc) from the node object
+ def merge_defaults(path)
+ DEFAULT_COMPONENTS.inject(nil) do |merged, component_ivar|
+ component_value = apply_path(instance_variable_get(component_ivar), path)
+ Chef::Mixin::DeepMerge.deep_merge(component_value, merged)
end
end
+ # Deep merge the override attribute levels with array merging.
+ #
+ # The path allows for selectively deep-merging a subtree of the node object.
+ #
+ # @param path [Array] Array of args to method chain to descend into the node object
+ # @return [attr] Deep Merged values (may be VividMash, Hash, Array, etc) from the node object
+ def merge_overrides(path)
+ OVERRIDE_COMPONENTS.inject(nil) do |merged, component_ivar|
+ component_value = apply_path(instance_variable_get(component_ivar), path)
+ Chef::Mixin::DeepMerge.deep_merge(component_value, merged)
+ end
+ end
end
diff --git a/lib/chef/node/attribute_collections.rb b/lib/chef/node/attribute_collections.rb
index f09b02b106..333f4864c6 100644
--- a/lib/chef/node/attribute_collections.rb
+++ b/lib/chef/node/attribute_collections.rb
@@ -63,7 +63,7 @@ class Chef
MUTATOR_METHODS.each do |mutator|
class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator}(*args, &block)
- root.reset_cache
+ root.reset_cache(root.top_level_breadcrumb)
super
end
METHOD_DEFN
@@ -128,7 +128,7 @@ class Chef
MUTATOR_METHODS.each do |mutator|
class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator}(*args, &block)
- root.reset_cache
+ root.reset_cache(root.top_level_breadcrumb)
super
end
METHOD_DEFN
@@ -140,6 +140,7 @@ class Chef
end
def [](key)
+ root.top_level_breadcrumb ||= key
value = super
if !key?(key)
value = self.class.new(root)
@@ -150,10 +151,11 @@ class Chef
end
def []=(key, value)
+ root.top_level_breadcrumb ||= key
if set_unless? && key?(key)
self[key]
else
- root.reset_cache
+ root.reset_cache(root.top_level_breadcrumb)
super
end
end
@@ -209,5 +211,117 @@ class Chef
end
+ # == MultiMash
+ # This is a Hash-like object that contains multiple VividMashes in it. Its
+ # purpose is so that the user can descend into the mash and delete a subtree
+ # from all of the Mash objects (used to delete all values in a subtree from
+ # default, force_default, role_default and env_default at the same time). The
+ # assignment operator strictly does assignment (does no merging) and works
+ # by deleting the subtree and then assigning to the last mash which passed in
+ # the initializer.
+ #
+ # A lot of the complexity of this class comes from the fact that at any key
+ # value some or all of the mashes may walk off their ends and become nil or
+ # true or something. The schema may change so that one precidence leve may
+ # be 'true' object and another may be a VividMash. It is also possible that
+ # one or many of them may transition from VividMashes to Hashes or Arrays.
+ #
+ # It also supports the case where you may be deleting a key using node.rm
+ # in which case if intermediate keys all walk off into nil then you don't want
+ # to be autovivifying keys as you go. On the other hand you may be using
+ # node.force_default! in which case you'll wind up with a []= operator at the
+ # end and you want autovivification, so we conditionally have to support either
+ # operation.
+ #
+ # @todo: can we have an autovivify class that decorates a class that doesn't
+ # autovivify or something so that the code is less awful?
+ #
+ class MultiMash
+ attr_reader :root
+ attr_reader :mashes
+ attr_reader :opts
+ attr_reader :primary_mash
+
+ # Initialize with an array of mashes. For the delete return value to work
+ # properly the mashes must come from the same attribute level (i.e. all
+ # override or all default, but not a mix of both).
+ def initialize(root, primary_mash, mashes, opts={})
+ @root = root
+ @primary_mash = primary_mash
+ @mashes = mashes
+ @opts = opts
+ @opts[:autovivify] = true if @opts[:autovivify].nil?
+ end
+
+ def [](key)
+ # handle the secondary mashes
+ new_mashes = []
+ mashes.each do |mash|
+ new_mash = safe_evalute_key(mash, key)
+ # secondary mashes never autovivify so once they fall into nil, we just stop tracking them
+ new_mashes.push(new_mash) unless new_mash.nil?
+ end
+
+ new_primary_mash = safe_evalute_key(primary_mash, key)
+
+ if new_primary_mash.nil? && @opts[:autovivify]
+ primary_mash[key] = VividMash.new(root)
+ new_primary_mash = primary_mash[key]
+ end
+
+ MultiMash.new(root, new_primary_mash, new_mashes, opts)
+ end
+
+ def []=(key, value)
+ if primary_mash.nil?
+ # This theoretically should never happen since node#force_default! setter methods will autovivify and
+ # node#rm methods do not end in #[]= operators.
+ raise TypeError, "No autovivification was specified initially on a method chain ending in assignment"
+ end
+ ret = delete(key)
+ primary_mash[key] = value
+ ret
+ end
+
+ # mash.element('foo', 'bar') is the same as mash['foo']['bar']
+ def element(key = nil, *subkeys)
+ return self if key.nil?
+ submash = self[key]
+ subkeys.empty? ? submash : submash.element(*subkeys)
+ end
+
+ def delete(key)
+ # the return value is a deep merge which is correct semantics when
+ # merging between attributes on the same level (this would be incorrect
+ # if passed both override and default attributes which would need hash_only
+ # merging).
+ ret = mashes.inject(Mash.new) do |merged, mash|
+ Chef::Mixin::DeepMerge.merge(merged, mash)
+ end
+ ret = Chef::Mixin::DeepMerge.merge(ret, primary_mash)
+ mashes.each do |mash|
+ mash.delete(key) if mash.respond_to?(:delete)
+ end
+ primary_mash.delete(key) if primary_mash.respond_to?(:delete)
+ ret[key]
+ end
+
+ private
+
+ def safe_evalute_key(mash, key)
+ if mash.respond_to?(:[])
+ if mash.respond_to?(:has_key?)
+ if mash.has_key?(key)
+ return mash[key] if mash[key].respond_to?(:[])
+ end
+ elsif !mash[key].nil?
+ return mash[key] if mash[key].respond_to?(:[])
+ end
+ end
+ return nil
+ end
+
+ end
+
end
end
diff --git a/lib/chef/node/immutable_collections.rb b/lib/chef/node/immutable_collections.rb
index 3558ba3a86..56b8fed3b7 100644
--- a/lib/chef/node/immutable_collections.rb
+++ b/lib/chef/node/immutable_collections.rb
@@ -78,9 +78,7 @@ class Chef
# Ruby 1.8 blocks can't have block arguments, so we must use string eval:
class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator_method_name}(*args, &block)
- msg = "Node attributes are read-only when you do not specify which precedence level to set. " +
- %Q(To set an attribute use code like `node.default["key"] = "value"')
- raise Exceptions::ImmutableAttributeModification, msg
+ raise Exceptions::ImmutableAttributeModification
end
METHOD_DEFN
end
@@ -157,6 +155,10 @@ class Chef
end
end
+ def public_method_that_only_deep_merge_should_use(key, value)
+ internal_set(key, immutablize(value))
+ end
+
alias :attribute? :has_key?
# Redefine all of the methods that mutate a Hash to raise an error when called.
@@ -165,9 +167,7 @@ class Chef
# Ruby 1.8 blocks can't have block arguments, so we must use string eval:
class_eval(<<-METHOD_DEFN, __FILE__, __LINE__)
def #{mutator_method_name}(*args, &block)
- msg = "Node attributes are read-only when you do not specify which precedence level to set. " +
- %Q(To set an attribute use code like `node.default["key"] = "value"')
- raise Exceptions::ImmutableAttributeModification, msg
+ raise Exceptions::ImmutableAttributeModification
end
METHOD_DEFN
end
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
new file mode 100644
index 0000000000..2ca6d9ba17
--- /dev/null
+++ b/lib/chef/node_map.rb
@@ -0,0 +1,146 @@
+#
+# Author:: Lamont Granquist (<lamont@chef.io>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class Chef
+ class NodeMap
+
+ VALID_OPTS = [
+ :on_platform,
+ :on_platforms,
+ :platform,
+ :os,
+ :platform_family,
+ ]
+
+ DEPRECATED_OPTS = [
+ :on_platform,
+ :on_platforms,
+ ]
+
+ # Create a new NodeMap
+ #
+ def initialize
+ @map = {}
+ end
+
+ # Set a key/value pair on the map with a filter. The filter must be true
+ # when applied to the node in order to retrieve the value.
+ #
+ # @param key [Object] Key to store
+ # @param value [Object] Value associated with the key
+ # @param filters [Hash] Node filter options to apply to key retrieval
+ # @yield [node] Arbitrary node filter as a block which takes a node argument
+ # @return [NodeMap] Returns self for possible chaining
+ #
+ def set(key, value, filters = {}, &block)
+ validate_filter!(filters)
+ deprecate_filter!(filters)
+ @map[key] ||= []
+ # we match on the first value we find, so we want to unshift so that the
+ # last setter wins
+ # FIXME: need a test for this behavior
+ @map[key].unshift({ filters: filters, block: block, value: value })
+ self
+ end
+
+ # Get a value from the NodeMap via applying the node to the filters that
+ # were set on the key.
+ #
+ # @param node [Chef::Node] The Chef::Node object for the run
+ # @param key [Object] Key to look up
+ # @return [Object] Value
+ #
+ def get(node, key)
+ # FIXME: real exception
+ raise "first argument must be a Chef::Node" unless node.is_a?(Chef::Node)
+ return nil unless @map.has_key?(key)
+ @map[key].each do |matcher|
+ if filters_match?(node, matcher[:filters]) &&
+ block_matches?(node, matcher[:block])
+ return matcher[:value]
+ end
+ end
+ nil
+ end
+
+ private
+
+ # only allow valid filter options
+ def validate_filter!(filters)
+ filters.each_key do |key|
+ # FIXME: real exception
+ raise "Bad key #{key} in Chef::NodeMap filter expression" unless VALID_OPTS.include?(key)
+ end
+ end
+
+ # warn on deprecated filter options
+ def deprecate_filter!(filters)
+ filters.each_key do |key|
+ Chef::Log.warn "The #{key} option to node_map has been deprecated" if DEPRECATED_OPTS.include?(key)
+ end
+ end
+
+ # @todo: this works fine, but is probably hard to understand
+ def negative_match(filter, param)
+ # We support strings prefaced by '!' to mean 'not'. In particular, this is most useful
+ # for os matching on '!windows'.
+ negative_matches = filter.select { |f| f[0] == '!' }
+ return true if !negative_matches.empty? && negative_matches.include?('!' + param)
+
+ # We support the symbol :all to match everything, for backcompat, but this can and should
+ # simply be ommitted.
+ positive_matches = filter.reject { |f| f[0] == '!' || f == :all }
+ return true if !positive_matches.empty? && !positive_matches.include?(param)
+
+ # sorry double-negative: this means we pass this filter.
+ false
+ end
+
+ def filters_match?(node, filters)
+ return true if filters.empty?
+
+ # each filter is applied in turn. if any fail, then it shortcuts and returns false.
+ # if it passes or does not exist it succeeds and continues on. so multiple filters are
+ # effectively joined by 'and'. all filters can be single strings, or arrays which are
+ # effectively joined by 'or'.
+
+ os_filter = [ filters[:os] ].flatten.compact
+ unless os_filter.empty?
+ return false if negative_match(os_filter, node[:os])
+ end
+
+ platform_family_filter = [ filters[:platform_family] ].flatten.compact
+ unless platform_family_filter.empty?
+ return false if negative_match(platform_family_filter, node[:platform_family])
+ end
+
+ # :on_platform and :on_platforms here are synonyms which are deprecated
+ platform_filter = [ filters[:platform] || filters[:on_platform] || filters[:on_platforms] ].flatten.compact
+ unless platform_filter.empty?
+ return false if negative_match(platform_filter, node[:platform])
+ end
+
+ return true
+ end
+
+ def block_matches?(node, block)
+ return true if block.nil?
+ block.call node
+ end
+ end
+end
diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb
index 9e15ea5658..271e72f761 100644
--- a/lib/chef/platform/provider_mapping.rb
+++ b/lib/chef/platform/provider_mapping.rb
@@ -41,7 +41,6 @@ class Chef
:mac_os_x => {
:default => {
:package => Chef::Provider::Package::Homebrew,
- :service => Chef::Provider::Service::Macosx,
:user => Chef::Provider::User::Dscl,
:group => Chef::Provider::Group::Dscl
}
@@ -49,7 +48,6 @@ class Chef
:mac_os_x_server => {
:default => {
:package => Chef::Provider::Package::Homebrew,
- :service => Chef::Provider::Service::Macosx,
:user => Chef::Provider::User::Dscl,
:group => Chef::Provider::Group::Dscl
}
@@ -57,7 +55,6 @@ class Chef
:freebsd => {
:default => {
:group => Chef::Provider::Group::Pw,
- :service => Chef::Provider::Service::Freebsd,
:user => Chef::Provider::User::Pw,
:cron => Chef::Provider::Cron
}
@@ -203,7 +200,7 @@ class Chef
:group => Chef::Provider::Group::Gpasswd
},
"< 12.0" => {
- :group => Chef::Provider::Group::Suse,
+ :group => Chef::Provider::Group::Suse,
:service => Chef::Provider::Service::Redhat
}
},
@@ -276,7 +273,6 @@ class Chef
:mswin => {
:default => {
:env => Chef::Provider::Env::Windows,
- :service => Chef::Provider::Service::Windows,
:user => Chef::Provider::User::Windows,
:group => Chef::Provider::Group::Windows,
:mount => Chef::Provider::Mount::Windows,
@@ -287,7 +283,6 @@ class Chef
:mingw32 => {
:default => {
:env => Chef::Provider::Env::Windows,
- :service => Chef::Provider::Service::Windows,
:user => Chef::Provider::User::Windows,
:group => Chef::Provider::Group::Windows,
:mount => Chef::Provider::Mount::Windows,
@@ -298,7 +293,6 @@ class Chef
:windows => {
:default => {
:env => Chef::Provider::Env::Windows,
- :service => Chef::Provider::Service::Windows,
:user => Chef::Provider::User::Windows,
:group => Chef::Provider::Group::Windows,
:mount => Chef::Provider::Mount::Windows,
@@ -310,7 +304,6 @@ class Chef
:openindiana => {
:default => {
:mount => Chef::Provider::Mount::Solaris,
- :service => Chef::Provider::Service::Solaris,
:package => Chef::Provider::Package::Ips,
:cron => Chef::Provider::Cron::Solaris,
:group => Chef::Provider::Group::Usermod
@@ -319,7 +312,6 @@ class Chef
:opensolaris => {
:default => {
:mount => Chef::Provider::Mount::Solaris,
- :service => Chef::Provider::Service::Solaris,
:package => Chef::Provider::Package::Ips,
:cron => Chef::Provider::Cron::Solaris,
:group => Chef::Provider::Group::Usermod
@@ -328,7 +320,6 @@ class Chef
:nexentacore => {
:default => {
:mount => Chef::Provider::Mount::Solaris,
- :service => Chef::Provider::Service::Solaris,
:package => Chef::Provider::Package::Solaris,
:cron => Chef::Provider::Cron::Solaris,
:group => Chef::Provider::Group::Usermod
@@ -337,7 +328,6 @@ class Chef
:omnios => {
:default => {
:mount => Chef::Provider::Mount::Solaris,
- :service => Chef::Provider::Service::Solaris,
:package => Chef::Provider::Package::Ips,
:cron => Chef::Provider::Cron::Solaris,
:group => Chef::Provider::Group::Usermod,
@@ -347,7 +337,6 @@ class Chef
:solaris2 => {
:default => {
:mount => Chef::Provider::Mount::Solaris,
- :service => Chef::Provider::Service::Solaris,
:package => Chef::Provider::Package::Ips,
:cron => Chef::Provider::Cron::Solaris,
:group => Chef::Provider::Group::Usermod,
@@ -355,7 +344,6 @@ class Chef
},
"< 5.11" => {
:mount => Chef::Provider::Mount::Solaris,
- :service => Chef::Provider::Service::Solaris,
:package => Chef::Provider::Package::Solaris,
:cron => Chef::Provider::Cron::Solaris,
:group => Chef::Provider::Group::Usermod,
@@ -365,7 +353,6 @@ class Chef
:smartos => {
:default => {
:mount => Chef::Provider::Mount::Solaris,
- :service => Chef::Provider::Service::Solaris,
:package => Chef::Provider::Package::SmartOS,
:cron => Chef::Provider::Cron::Solaris,
:group => Chef::Provider::Group::Usermod
@@ -373,13 +360,13 @@ class Chef
},
:netbsd => {
:default => {
- :service => Chef::Provider::Service::Freebsd,
:group => Chef::Provider::Group::Groupmod
}
},
:openbsd => {
:default => {
- :group => Chef::Provider::Group::Usermod
+ :group => Chef::Provider::Group::Usermod,
+ :package => Chef::Provider::Package::Openbsd
}
},
:hpux => {
@@ -394,7 +381,8 @@ class Chef
:ifconfig => Chef::Provider::Ifconfig::Aix,
:cron => Chef::Provider::Cron::Aix,
:package => Chef::Provider::Package::Aix,
- :user => Chef::Provider::User::Aix
+ :user => Chef::Provider::User::Aix,
+ :service => Chef::Provider::Service::Aix
}
},
:exherbo => {
@@ -406,29 +394,10 @@ class Chef
}
},
:default => {
- :file => Chef::Provider::File,
- :directory => Chef::Provider::Directory,
- :link => Chef::Provider::Link,
- :template => Chef::Provider::Template,
- :remote_directory => Chef::Provider::RemoteDirectory,
- :execute => Chef::Provider::Execute,
:mount => Chef::Provider::Mount::Mount,
- :script => Chef::Provider::Script,
- :service => Chef::Provider::Service::Init,
- :perl => Chef::Provider::Script,
- :python => Chef::Provider::Script,
- :ruby => Chef::Provider::Script,
- :bash => Chef::Provider::Script,
- :csh => Chef::Provider::Script,
:user => Chef::Provider::User::Useradd,
:group => Chef::Provider::Group::Gpasswd,
- :http_request => Chef::Provider::HttpRequest,
- :route => Chef::Provider::Route,
:ifconfig => Chef::Provider::Ifconfig,
- :ruby_block => Chef::Provider::RubyBlock,
- :whyrun_safe_ruby_block => Chef::Provider::WhyrunSafeRubyBlock,
- :erl_call => Chef::Provider::ErlCall,
- :log => Chef::Provider::Log::ChefLog
}
}
end
diff --git a/lib/chef/platform/provider_priority_map.rb b/lib/chef/platform/provider_priority_map.rb
new file mode 100644
index 0000000000..765dd74859
--- /dev/null
+++ b/lib/chef/platform/provider_priority_map.rb
@@ -0,0 +1,81 @@
+
+require 'chef/providers'
+
+class Chef
+ class Platform
+ class ProviderPriorityMap
+ include Singleton
+
+ def initialize
+ load_default_map
+ end
+
+ def load_default_map
+
+ #
+ # Linux
+ #
+
+ # default block for linux O/Sen must come before platform_family exceptions
+ priority :service, [
+ Chef::Provider::Service::Systemd,
+ Chef::Provider::Service::Insserv,
+ Chef::Provider::Service::Redhat,
+ ], os: "linux"
+
+ priority :service, [
+ Chef::Provider::Service::Systemd,
+ Chef::Provider::Service::Arch,
+ ], platform_family: "arch"
+
+ priority :service, [
+ Chef::Provider::Service::Systemd,
+ Chef::Provider::Service::Gentoo,
+ ], platform_family: "gentoo"
+
+ priority :service, [
+ # we can determine what systemd supports accurately
+ Chef::Provider::Service::Systemd,
+ # on debian-ish system if an upstart script exists that must win over sysv types
+ Chef::Provider::Service::Upstart,
+ Chef::Provider::Service::Insserv,
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Invokercd,
+ ], platform_family: "debian"
+
+ priority :service, [
+ Chef::Provider::Service::Systemd,
+ Chef::Provider::Service::Insserv,
+ Chef::Provider::Service::Redhat,
+ ], platform_family: [ "rhel", "fedora", "suse" ]
+
+ #
+ # BSDen
+ #
+
+ priority :service, Chef::Provider::Service::Freebsd, os: [ "freebsd", "netbsd" ]
+
+ #
+ # Solaris-en
+ #
+
+ priority :service, Chef::Provider::Service::Solaris, os: "solaris2"
+
+ #
+ # Mac
+ #
+
+ priority :service, Chef::Provider::Service::Macosx, os: "darwin"
+ end
+
+ def priority_map
+ @priority_map ||= Chef::NodeMap.new
+ end
+
+ def priority(*args)
+ priority_map.set(*args)
+ end
+
+ end
+ end
+end
diff --git a/lib/chef/platform/service_helpers.rb b/lib/chef/platform/service_helpers.rb
new file mode 100644
index 0000000000..dc0a808c06
--- /dev/null
+++ b/lib/chef/platform/service_helpers.rb
@@ -0,0 +1,142 @@
+#
+# Author:: Lamont Granquist (<lamont@chef.io>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# XXX: mixing shellout into a mixin into classes has to be code smell
+require 'chef/mixin/shell_out'
+require 'chef/mixin/which'
+
+class Chef
+ class Platform
+ class ServiceHelpers
+ class << self
+
+ include Chef::Mixin::ShellOut
+ include Chef::Mixin::Which
+
+ # This helper is mostly used to sort out the mess of different
+ # linux mechanisms that can be used to start services. It does
+ # not necessarily need to linux-specific, but currently all our
+ # other service providers are narrowly platform-specific with no
+ # alternatives.
+ #
+ # NOTE: if a system has (for example) chkconfig installed then we
+ # should report that chkconfig is installed. The fact that a system
+ # may also have systemd installed does not mean that we do not
+ # report that systemd is also installed. This module is purely for
+ # discovery of all the alternatives, handling the priority of the
+ # different services is NOT a design concern of this module.
+ #
+ def service_resource_providers
+ service_resource_providers = []
+
+ if ::File.exist?("/usr/sbin/update-rc.d")
+ service_resource_providers << :debian
+ end
+
+ if ::File.exist?("/usr/sbin/invoke-rc.d")
+ service_resource_providers << :invokercd
+ end
+
+ if ::File.exist?("/sbin/insserv")
+ service_resource_providers << :insserv
+ end
+
+ # debian >= 6.0 has /etc/init but does not have upstart
+ if ::File.exist?("/etc/init") && ::File.exist?("/sbin/start")
+ service_resource_providers << :upstart
+ end
+
+ if ::File.exist?("/sbin/chkconfig")
+ service_resource_providers << :redhat
+ end
+
+ if systemd_sanity_check?
+ service_resource_providers << :systemd
+ end
+
+ service_resource_providers
+ end
+
+ def config_for_service(service_name)
+ configs = []
+
+ if ::File.exist?("/etc/init.d/#{service_name}")
+ configs << :initd
+ end
+
+ if ::File.exist?("/etc/init/#{service_name}.conf")
+ configs << :upstart
+ end
+
+ if ::File.exist?("/etc/xinetd.d/#{service_name}")
+ configs << :xinetd
+ end
+
+ if ::File.exist?("/etc/rc.d/#{service_name}")
+ configs << :etc_rcd
+ end
+
+ if ::File.exist?("/usr/local/etc/rc.d/#{service_name}")
+ configs << :usr_local_etc_rcd
+ end
+
+ if systemd_sanity_check? && platform_has_systemd_unit?(service_name)
+ configs << :systemd
+ end
+
+ configs
+ end
+
+ private
+
+ def systemctl_path
+ if @systemctl_path.nil?
+ @systemctl_path = which("systemctl")
+ end
+ @systemctl_path
+ end
+
+ def systemd_sanity_check?
+ systemctl_path && File.exist?("/proc/1/comm") && File.open("/proc/1/comm").gets.chomp == "systemd"
+ end
+
+ def extract_systemd_services(command)
+ output = shell_out!(command).stdout
+ # first line finds e.g. "sshd.service"
+ services = []
+ output.each_line do |line|
+ fields = line.split
+ services << fields[0] if fields[1] == "loaded" || fields[1] == "not-found"
+ end
+ # this splits off the suffix after the last dot to return "sshd"
+ services += services.select {|s| s.match(/\.service$/) }.map { |s| s.sub(/(.*)\.service$/, '\1') }
+ rescue Mixlib::ShellOut::ShellCommandFailed
+ false
+ end
+
+ def platform_has_systemd_unit?(service_name)
+ services = extract_systemd_services("#{systemctl_path} --all") +
+ extract_systemd_services("#{systemctl_path} list-unit-files")
+ services.include?(service_name)
+ rescue Mixlib::ShellOut::ShellCommandFailed
+ false
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index bdfe826944..680fe9782f 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -22,11 +22,35 @@ require 'chef/mixin/convert_to_class_name'
require 'chef/mixin/enforce_ownership_and_permissions'
require 'chef/mixin/why_run'
require 'chef/mixin/shell_out'
+require 'chef/mixin/descendants_tracker'
+require 'chef/platform/service_helpers'
+require 'chef/node_map'
class Chef
class Provider
include Chef::Mixin::WhyRun
include Chef::Mixin::ShellOut
+ extend Chef::Mixin::DescendantsTracker
+
+ class << self
+ def node_map
+ @node_map ||= Chef::NodeMap.new
+ end
+
+ def provides(resource_name, opts={}, &block)
+ node_map.set(resource_name.to_sym, true, opts, &block)
+ end
+
+ # provides a node on the resource (early binding)
+ def provides?(node, resource)
+ node_map.get(node, resource.resource_name)
+ end
+
+ # supports the given resource and action (late binding)
+ def supports?(resource, action)
+ true
+ end
+ end
attr_accessor :new_resource
attr_accessor :current_resource
diff --git a/lib/chef/provider/breakpoint.rb b/lib/chef/provider/breakpoint.rb
index 224e2758eb..663d558f66 100644
--- a/lib/chef/provider/breakpoint.rb
+++ b/lib/chef/provider/breakpoint.rb
@@ -20,6 +20,8 @@ class Chef
class Provider
class Breakpoint < Chef::Provider
+ provides :breakpoint
+
def load_current_resource
end
diff --git a/lib/chef/provider/cookbook_file.rb b/lib/chef/provider/cookbook_file.rb
index 26d6ebf1d9..b501a9b41d 100644
--- a/lib/chef/provider/cookbook_file.rb
+++ b/lib/chef/provider/cookbook_file.rb
@@ -24,6 +24,8 @@ class Chef
class Provider
class CookbookFile < Chef::Provider::File
+ provides :cookbook_file
+
extend Chef::Deprecation::Warnings
include Chef::Deprecation::Provider::CookbookFile
add_deprecation_warnings_for(Chef::Deprecation::Provider::CookbookFile.instance_methods)
diff --git a/lib/chef/provider/cron.rb b/lib/chef/provider/cron.rb
index c3be9746df..1590c624f6 100644
--- a/lib/chef/provider/cron.rb
+++ b/lib/chef/provider/cron.rb
@@ -28,7 +28,7 @@ class Chef
SPECIAL_TIME_VALUES = [:reboot, :yearly, :annually, :monthly, :weekly, :daily, :midnight, :hourly]
CRON_ATTRIBUTES = [:minute, :hour, :day, :month, :weekday, :time, :command, :mailto, :path, :shell, :home, :environment]
WEEKDAY_SYMBOLS = [:sunday, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday]
-
+
CRON_PATTERN = /\A([-0-9*,\/]+)\s([-0-9*,\/]+)\s([-0-9*,\/]+)\s([-0-9*,\/]+|[a-zA-Z]{3})\s([-0-9*,\/]+|[a-zA-Z]{3})\s(.*)/
SPECIAL_PATTERN = /\A(@(#{SPECIAL_TIME_VALUES.join('|')}))\s(.*)/
ENV_PATTERN = /\A(\S+)=(\S*)/
diff --git a/lib/chef/provider/deploy.rb b/lib/chef/provider/deploy.rb
index db147278c2..b30f7ed17e 100644
--- a/lib/chef/provider/deploy.rb
+++ b/lib/chef/provider/deploy.rb
@@ -375,7 +375,7 @@ class Chef
def gem_resource_collection_runner
gems_collection = Chef::ResourceCollection.new
- gem_packages.each { |rbgem| gems_collection << rbgem }
+ gem_packages.each { |rbgem| gems_collection.insert(rbgem) }
gems_run_context = run_context.dup
gems_run_context.resource_collection = gems_collection
Chef::Runner.new(gems_run_context)
diff --git a/lib/chef/provider/deploy/revision.rb b/lib/chef/provider/deploy/revision.rb
index c98c1e5c75..62aa0e87f6 100644
--- a/lib/chef/provider/deploy/revision.rb
+++ b/lib/chef/provider/deploy/revision.rb
@@ -27,6 +27,8 @@ class Chef
class Provider
class Deploy
class Revision < Chef::Provider::Deploy
+ provides :deploy_revision
+ provides :deploy_branch
def all_releases
sorted_releases
diff --git a/lib/chef/provider/deploy/timestamped.rb b/lib/chef/provider/deploy/timestamped.rb
index ce921161e0..ba3f6683f0 100644
--- a/lib/chef/provider/deploy/timestamped.rb
+++ b/lib/chef/provider/deploy/timestamped.rb
@@ -20,6 +20,8 @@ class Chef
class Provider
class Deploy
class Timestamped < Chef::Provider::Deploy
+ provides :timestamped_deploy
+ provides :deploy
protected
diff --git a/lib/chef/provider/directory.rb b/lib/chef/provider/directory.rb
index 067737b9d4..c9c3d466b9 100644
--- a/lib/chef/provider/directory.rb
+++ b/lib/chef/provider/directory.rb
@@ -27,6 +27,8 @@ class Chef
class Provider
class Directory < Chef::Provider::File
+ provides :directory
+
def whyrun_supported?
true
end
diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb
index a70f4b5048..5db50e74b3 100644
--- a/lib/chef/provider/dsc_script.rb
+++ b/lib/chef/provider/dsc_script.rb
@@ -24,6 +24,9 @@ require 'chef/util/path_helper'
class Chef
class Provider
class DscScript < Chef::Provider
+
+ provides :dsc_script, os: "windows"
+
def initialize(dsc_resource, run_context)
super(dsc_resource, run_context)
@dsc_resource = dsc_resource
diff --git a/lib/chef/provider/env.rb b/lib/chef/provider/env.rb
index e91b8bbb97..600cac1e6b 100644
--- a/lib/chef/provider/env.rb
+++ b/lib/chef/provider/env.rb
@@ -58,20 +58,22 @@ class Chef
# ==== Returns
# <true>:: If a change is required
# <false>:: If a change is not required
- def compare_value
+ def requires_modify_or_create?
if @new_resource.delim
#e.g. check for existing value within PATH
- not @current_resource.value.split(@new_resource.delim).any? do |val|
- val == @new_resource.value
+ not new_values.all? do |val|
+ current_values.include? val
end
else
@new_resource.value != @current_resource.value
end
end
+ alias_method :compare_value, :requires_modify_or_create?
+
def action_create
if @key_exists
- if compare_value
+ if requires_modify_or_create?
modify_env
Chef::Log.info("#{@new_resource} altered")
@new_resource.updated_by_last_action(true)
@@ -91,13 +93,14 @@ class Chef
# after we removed the element.
def delete_element
return false unless @new_resource.delim #no delim: delete the key
- if compare_value
+ needs_delete = new_values.any? { |v| current_values.include?(v) }
+ if !needs_delete
Chef::Log.debug("#{@new_resource} element '#{@new_resource.value}' does not exist")
return true #do not delete the key
else
new_value =
- @current_resource.value.split(@new_resource.delim).select { |item|
- item != @new_resource.value
+ current_values.select { |item|
+ not new_values.include?(item)
}.join(@new_resource.delim)
if new_value.empty?
@@ -122,7 +125,7 @@ class Chef
def action_modify
if @key_exists
- if compare_value
+ if requires_modify_or_create?
modify_env
Chef::Log.info("#{@new_resource} modified")
@new_resource.updated_by_last_action(true)
@@ -142,11 +145,23 @@ class Chef
def modify_env
if @new_resource.delim
- #e.g. add to PATH
- @new_resource.value(@new_resource.value + @new_resource.delim + @current_resource.value)
+ values = new_values.reject do |v|
+ current_values.include?(v)
+ end
+ @new_resource.value((values + [@current_resource.value]).join(@new_resource.delim))
end
create_env
end
+
+ # Returns the current values to split by delimiter
+ def current_values
+ @current_values ||= @current_resource.value.split(@new_resource.delim)
+ end
+
+ # Returns the new values to split by delimiter
+ def new_values
+ @new_values ||= @new_resource.value.split(@new_resource.delim)
+ end
end
end
end
diff --git a/lib/chef/provider/env/windows.rb b/lib/chef/provider/env/windows.rb
index 572ec5c633..dd7cb1bc46 100644
--- a/lib/chef/provider/env/windows.rb
+++ b/lib/chef/provider/env/windows.rb
@@ -43,14 +43,16 @@ class Chef
obj = env_obj(@new_resource.key_name)
if obj
obj.delete_
- ENV.delete(@new_resource.key_name)
broadcast_env_change
end
+ if ENV[@new_resource.key_name]
+ ENV.delete(@new_resource.key_name)
+ end
end
def env_value(key_name)
obj = env_obj(key_name)
- return obj ? obj.variablevalue : nil
+ return obj ? obj.variablevalue : ENV[key_name]
end
def env_obj(key_name)
diff --git a/lib/chef/provider/erl_call.rb b/lib/chef/provider/erl_call.rb
index cdd494a243..f5855bcce6 100644
--- a/lib/chef/provider/erl_call.rb
+++ b/lib/chef/provider/erl_call.rb
@@ -25,6 +25,8 @@ class Chef
class ErlCall < Chef::Provider
include Chef::Mixin::Command
+ provides :erl_call
+
def initialize(node, new_resource)
super(node, new_resource)
end
diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb
index 54632c0684..48b2a344d1 100644
--- a/lib/chef/provider/execute.rb
+++ b/lib/chef/provider/execute.rb
@@ -23,6 +23,8 @@ class Chef
class Provider
class Execute < Chef::Provider
+ provides :execute
+
def load_current_resource
true
end
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 256248f240..a9390cc45c 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -54,6 +54,8 @@ class Chef
include Chef::Deprecation::Provider::File
add_deprecation_warnings_for(Chef::Deprecation::Provider::File.instance_methods)
+ provides :file
+
attr_reader :deployment_strategy
attr_accessor :needs_creating
diff --git a/lib/chef/provider/git.rb b/lib/chef/provider/git.rb
index 2ef119e839..8418f22933 100644
--- a/lib/chef/provider/git.rb
+++ b/lib/chef/provider/git.rb
@@ -25,6 +25,8 @@ class Chef
class Provider
class Git < Chef::Provider
+ provides :git
+
def whyrun_supported?
true
end
diff --git a/lib/chef/provider/group/dscl.rb b/lib/chef/provider/group/dscl.rb
index 04ca9bc929..e06c090f50 100644
--- a/lib/chef/provider/group/dscl.rb
+++ b/lib/chef/provider/group/dscl.rb
@@ -41,10 +41,10 @@ class Chef
def load_current_resource
@current_resource = Chef::Resource::Group.new(@new_resource.name)
- @current_resource.group_name(@new_resource.name)
+ @current_resource.group_name(@new_resource.group_name)
group_info = nil
begin
- group_info = safe_dscl("read /Groups/#{@new_resource.name}")
+ group_info = safe_dscl("read /Groups/#{@new_resource.group_name}")
rescue Chef::Exceptions::Group
@group_exists = false
Chef::Log.debug("#{@new_resource} group does not exist")
diff --git a/lib/chef/provider/group/pw.rb b/lib/chef/provider/group/pw.rb
index c39c20da67..7a66ab4d69 100644
--- a/lib/chef/provider/group/pw.rb
+++ b/lib/chef/provider/group/pw.rb
@@ -40,20 +40,16 @@ class Chef
command = "pw groupadd"
command << set_options
- # pw group[add|mod] -M is used to set the full membership list on a
- # new or existing group. Because pw groupadd does not support the -m
- # and -d options used by manage_group, we treat group creation as a
- # special case and use -M.
- Chef::Log.debug("#{@new_resource} setting group members: #{@new_resource.members.join(',')}")
- member_options = [" -M #{@new_resource.members.join(',')}"]
-
- if member_options.empty?
- run_command(:command => command)
- else
- member_options.each do |option|
- run_command(:command => command + option)
- end
+ unless @new_resource.members.empty?
+ # pw group[add|mod] -M is used to set the full membership list on a
+ # new or existing group. Because pw groupadd does not support the -m
+ # and -d options used by manage_group, we treat group creation as a
+ # special case and use -M.
+ Chef::Log.debug("#{@new_resource} setting group members: #{@new_resource.members.join(',')}")
+ command += " -M #{@new_resource.members.join(',')}"
end
+
+ run_command(:command => command)
end
# Manage the group when it already exists
diff --git a/lib/chef/provider/http_request.rb b/lib/chef/provider/http_request.rb
index ba54b10195..61aff434ed 100644
--- a/lib/chef/provider/http_request.rb
+++ b/lib/chef/provider/http_request.rb
@@ -23,6 +23,8 @@ class Chef
class Provider
class HttpRequest < Chef::Provider
+ provides :http_request
+
attr_accessor :http
def whyrun_supported?
diff --git a/lib/chef/provider/link.rb b/lib/chef/provider/link.rb
index 639dc4f3ff..417d6a21b0 100644
--- a/lib/chef/provider/link.rb
+++ b/lib/chef/provider/link.rb
@@ -28,6 +28,8 @@ class Chef
class Provider
class Link < Chef::Provider
+ provides :link
+
include Chef::Mixin::EnforceOwnershipAndPermissions
include Chef::Mixin::FileClass
diff --git a/lib/chef/provider/log.rb b/lib/chef/provider/log.rb
index 9379ceeefa..40eaf0aa28 100644
--- a/lib/chef/provider/log.rb
+++ b/lib/chef/provider/log.rb
@@ -25,6 +25,8 @@ class Chef
# Chef log provider, allows logging to chef's logs from recipes
class ChefLog < Chef::Provider
+ provides :log
+
def whyrun_supported?
true
end
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 2d4a5aadef..c1d4fb2223 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -191,7 +191,7 @@ class Chef
def device_should_exist?
( @new_resource.device != "none" ) &&
( not network_device? ) &&
- ( not %w[ tmpfs fuse ].include? @new_resource.fstype )
+ ( not %w[ cgroup tmpfs fuse ].include? @new_resource.fstype )
end
private
diff --git a/lib/chef/provider/package/aix.rb b/lib/chef/provider/package/aix.rb
index da3e6d1684..88de4679ba 100644
--- a/lib/chef/provider/package/aix.rb
+++ b/lib/chef/provider/package/aix.rb
@@ -26,6 +26,8 @@ class Chef
class Package
class Aix < Chef::Provider::Package
+ provides :bff_package, os: "aix"
+
include Chef::Mixin::GetSourceFromPackage
def define_resource_requirements
diff --git a/lib/chef/provider/package/apt.rb b/lib/chef/provider/package/apt.rb
index 0d91d0d1f0..eb2c038eaa 100644
--- a/lib/chef/provider/package/apt.rb
+++ b/lib/chef/provider/package/apt.rb
@@ -25,6 +25,8 @@ class Chef
class Package
class Apt < Chef::Provider::Package
+ provides :apt_package, os: "linux"
+
attr_accessor :is_virtual_package
def load_current_resource
diff --git a/lib/chef/provider/package/dpkg.rb b/lib/chef/provider/package/dpkg.rb
index a1f1c797b1..3a9cecc660 100644
--- a/lib/chef/provider/package/dpkg.rb
+++ b/lib/chef/provider/package/dpkg.rb
@@ -30,6 +30,8 @@ class Chef
DPKG_INSTALLED = /^Status: install ok installed/
DPKG_VERSION = /^Version: (.+)$/
+ provides :dpkg_package, os: "linux"
+
include Chef::Mixin::GetSourceFromPackage
def define_resource_requirements
diff --git a/lib/chef/provider/package/easy_install.rb b/lib/chef/provider/package/easy_install.rb
index 2af8a72e61..90727b738d 100644
--- a/lib/chef/provider/package/easy_install.rb
+++ b/lib/chef/provider/package/easy_install.rb
@@ -25,6 +25,8 @@ class Chef
class Package
class EasyInstall < Chef::Provider::Package
+ provides :easy_install_package
+
def install_check(name)
check = false
diff --git a/lib/chef/provider/package/homebrew.rb b/lib/chef/provider/package/homebrew.rb
index a9aeea1415..822f4c8a42 100644
--- a/lib/chef/provider/package/homebrew.rb
+++ b/lib/chef/provider/package/homebrew.rb
@@ -25,7 +25,11 @@ class Chef
class Provider
class Package
class Homebrew < Chef::Provider::Package
+
+ provides :homebrew_package, os: "mac_os_x"
+
include Chef::Mixin::HomebrewUser
+
def load_current_resource
self.current_resource = Chef::Resource::Package.new(new_resource.name)
current_resource.package_name(new_resource.package_name)
diff --git a/lib/chef/provider/package/ips.rb b/lib/chef/provider/package/ips.rb
index 4090507303..87022d770a 100644
--- a/lib/chef/provider/package/ips.rb
+++ b/lib/chef/provider/package/ips.rb
@@ -27,6 +27,8 @@ class Chef
class Package
class Ips < Chef::Provider::Package
+ provides :ips_package, os: "solaris2"
+
attr_accessor :virtual
def define_resource_requirements
diff --git a/lib/chef/provider/package/macports.rb b/lib/chef/provider/package/macports.rb
index 05247e6d31..cd142eca42 100644
--- a/lib/chef/provider/package/macports.rb
+++ b/lib/chef/provider/package/macports.rb
@@ -2,6 +2,9 @@ class Chef
class Provider
class Package
class Macports < Chef::Provider::Package
+
+ provides :macports_package, os: "mac_os_x"
+
def load_current_resource
@current_resource = Chef::Resource::Package.new(@new_resource.name)
@current_resource.package_name(@new_resource.package_name)
diff --git a/lib/chef/provider/package/openbsd.rb b/lib/chef/provider/package/openbsd.rb
new file mode 100644
index 0000000000..f0931d7555
--- /dev/null
+++ b/lib/chef/provider/package/openbsd.rb
@@ -0,0 +1,107 @@
+#
+# Authors:: Bryan McLellan (btm@loftninjas.org)
+# Matthew Landauer (matthew@openaustralia.org)
+# Richard Manyanza (liseki@nyikacraftsmen.com)
+# Scott Bonds (scott@ggr.com)
+# Copyright:: Copyright (c) 2009 Bryan McLellan, Matthew Landauer
+# Copyright:: Copyright (c) 2014 Richard Manyanza, Scott Bonds
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/resource/package'
+require 'chef/provider/package'
+require 'chef/mixin/shell_out'
+require 'chef/mixin/get_source_from_package'
+
+class Chef
+ class Provider
+ class Package
+ class Openbsd < Chef::Provider::Package
+
+ provides :package, os: "openbsd"
+
+ include Chef::Mixin::ShellOut
+ include Chef::Mixin::GetSourceFromPackage
+
+ def initialize(*args)
+ super
+ @current_resource = Chef::Resource::Package.new(@new_resource.name)
+ @new_resource.source(pkg_path) if !@new_resource.source
+ end
+
+ def load_current_resource
+ @current_resource.package_name(@new_resource.package_name)
+ @current_resource.version(installed_version)
+ @current_resource
+ end
+
+ def install_package(name, version)
+ unless @current_resource.version
+ version_string = ''
+ version_string += "-#{version}" if version
+ if parts = name.match(/^(.+?)--(.+)/) # use double-dash for stems with flavors, see man page for pkg_add
+ name = parts[1]
+ end
+ shell_out!("pkg_add -r #{name}#{version_string}", :env => {"PKG_PATH" => @new_resource.source}).status
+ Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}")
+ end
+ end
+
+ def remove_package(name, version)
+ version_string = ''
+ version_string += "-#{version}" if version
+ if parts = name.match(/^(.+?)--(.+)/)
+ name = parts[1]
+ end
+ shell_out!("pkg_delete #{name}#{version_string}", :env => nil).status
+ end
+
+ private
+
+ def installed_version
+ if parts = @new_resource.package_name.match(/^(.+?)--(.+)/)
+ name = parts[1]
+ else
+ name = @new_resource.package_name
+ end
+ pkg_info = shell_out!("pkg_info -e \"#{name}->0\"", :env => nil, :returns => [0,1])
+ result = pkg_info.stdout[/^inst:#{Regexp.escape(name)}-(.+?)\s/, 1]
+ Chef::Log.debug("installed_version of '#{@new_resource.package_name}' is '#{result}'")
+ result
+ end
+
+ def candidate_version
+ @candidate_version ||= begin
+ version_string = ''
+ version_string += "-#{version}" if @new_resource.version
+ pkg_info = shell_out!("pkg_info -I \"#{@new_resource.package_name}#{version_string}\"", :env => nil, :returns => [0,1])
+ if parts = @new_resource.package_name.match(/^(.+?)--(.+)/)
+ result = pkg_info.stdout[/^#{Regexp.escape(parts[1])}-(.+?)\s/, 1]
+ else
+ result = pkg_info.stdout[/^#{Regexp.escape(@new_resource.package_name)}-(.+?)\s/, 1]
+ end
+ Chef::Log.debug("candidate_version of '#{@new_resource.package_name}' is '#{result}'")
+ result
+ end
+ end
+
+ def pkg_path
+ ENV['PKG_PATH'] || "http://ftp.OpenBSD.org/pub/#{node.kernel.name}/#{node.kernel.release}/packages/#{node.kernel.machine}/"
+ end
+
+ end
+ end
+ end
+end
diff --git a/lib/chef/provider/package/pacman.rb b/lib/chef/provider/package/pacman.rb
index a9ff0edf7f..45edda5c5d 100644
--- a/lib/chef/provider/package/pacman.rb
+++ b/lib/chef/provider/package/pacman.rb
@@ -25,6 +25,8 @@ class Chef
class Package
class Pacman < Chef::Provider::Package
+ provides :pacman_package, os: "linux"
+
def load_current_resource
@current_resource = Chef::Resource::Package.new(@new_resource.name)
@current_resource.package_name(@new_resource.package_name)
@@ -34,7 +36,6 @@ class Chef
Chef::Log.debug("#{@new_resource} checking pacman for #{@new_resource.package_name}")
status = popen4("pacman -Qi #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
stdout.each do |line|
- line.force_encoding(Encoding::UTF_8) if line.respond_to?(:force_encoding)
case line
when /^Version(\s?)*: (.+)$/
Chef::Log.debug("#{@new_resource} current version is #{$2}")
diff --git a/lib/chef/provider/package/paludis.rb b/lib/chef/provider/package/paludis.rb
index f363b38e50..407e0d0110 100644
--- a/lib/chef/provider/package/paludis.rb
+++ b/lib/chef/provider/package/paludis.rb
@@ -24,6 +24,8 @@ class Chef
class Package
class Paludis < Chef::Provider::Package
+ provides :paludis_package, os: "linux"
+
def load_current_resource
@current_resource = Chef::Resource::Package.new(@new_resource.package_name)
@current_resource.package_name(@new_resource.package_name)
@@ -45,7 +47,7 @@ class Chef
@current_resource.version(res[2])
else
@candidate_version = res[2]
- @current_resource.version(nil)
+ @current_resource.version(nil)
end
end
end
diff --git a/lib/chef/provider/package/rpm.rb b/lib/chef/provider/package/rpm.rb
index c0a6444252..131587e066 100644
--- a/lib/chef/provider/package/rpm.rb
+++ b/lib/chef/provider/package/rpm.rb
@@ -25,6 +25,8 @@ class Chef
class Package
class Rpm < Chef::Provider::Package
+ provides :rpm_package, os: [ "linux", "aix" ]
+
include Chef::Mixin::GetSourceFromPackage
def define_resource_requirements
diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb
index 6c7e1c066e..6304a7ef63 100644
--- a/lib/chef/provider/package/rubygems.rb
+++ b/lib/chef/provider/package/rubygems.rb
@@ -359,6 +359,9 @@ class Chef
Chef::Log.logger
end
+ provides :chef_gem
+ provides :gem_package
+
include Chef::Mixin::GetSourceFromPackage
def initialize(new_resource, run_context=nil)
@@ -531,7 +534,7 @@ class Chef
if @new_resource.source =~ /\.gem$/i
name = @new_resource.source
else
- src = @new_resource.source && " --source=#{@new_resource.source} --source=http://rubygems.org"
+ src = @new_resource.source && " --source=#{@new_resource.source} --source=https://rubygems.org"
end
if version
shell_out!("#{gem_binary_path} install #{name} -q --no-rdoc --no-ri -v \"#{version}\"#{src}#{opts}", :env=>nil)
diff --git a/lib/chef/provider/package/smartos.rb b/lib/chef/provider/package/smartos.rb
index 19a6b9efef..7cef91953a 100644
--- a/lib/chef/provider/package/smartos.rb
+++ b/lib/chef/provider/package/smartos.rb
@@ -29,6 +29,8 @@ class Chef
class SmartOS < Chef::Provider::Package
attr_accessor :is_virtual_package
+ provides :smartos_package, os: "solaris2", platform_family: "smartos"
+
def load_current_resource
Chef::Log.debug("#{@new_resource} loading current resource")
@current_resource = Chef::Resource::Package.new(@new_resource.name)
diff --git a/lib/chef/provider/package/solaris.rb b/lib/chef/provider/package/solaris.rb
index 19f844b66a..53dd00dd07 100644
--- a/lib/chef/provider/package/solaris.rb
+++ b/lib/chef/provider/package/solaris.rb
@@ -27,6 +27,8 @@ class Chef
include Chef::Mixin::GetSourceFromPackage
+ provides :solaris_package, os: "solaris2"
+
# def initialize(*args)
# super
# @current_resource = Chef::Resource::Package.new(@new_resource.name)
diff --git a/lib/chef/provider/package/windows.rb b/lib/chef/provider/package/windows.rb
index 25be5b822c..143d82f111 100644
--- a/lib/chef/provider/package/windows.rb
+++ b/lib/chef/provider/package/windows.rb
@@ -25,8 +25,11 @@ class Chef
class Package
class Windows < Chef::Provider::Package
- # Depending on the installer, we may need to examine installer_type or
- # source attributes, or search for text strings in the installer file
+ provides :package, os: "windows"
+ provides :windows_package, os: "windows"
+
+ # Depending on the installer, we may need to examine installer_type or
+ # source attributes, or search for text strings in the installer file
# binary to determine the installer type for the user. Since the file
# must be on disk to do so, we have to make this choice in the provider.
require 'chef/provider/package/windows/msi.rb'
diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb
index e77319c254..505f5fd6a3 100644
--- a/lib/chef/provider/package/yum.rb
+++ b/lib/chef/provider/package/yum.rb
@@ -29,6 +29,8 @@ class Chef
class Package
class Yum < Chef::Provider::Package
+ provides :yum_package, os: "linux"
+
class RPMUtils
class << self
diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb
index 967b2d822b..0e76cd1656 100644
--- a/lib/chef/provider/powershell_script.rb
+++ b/lib/chef/provider/powershell_script.rb
@@ -51,6 +51,8 @@ $chefscriptresult = {
}.invokereturnasis()
if ($interpolatedexitcode -and $chefscriptresult.gettype().name -eq 'boolean') { exit [int32](!$chefscriptresult) } else { exit 0 }
EOH
+ Chef::Log.debug("powershell_script provider called with script code:\n\n#{code}\n")
+ Chef::Log.debug("powershell_script provider will execute transformed code:\n\n#{@code}\n")
end
public
@@ -65,7 +67,7 @@ EOH
"-NoLogo",
"-NonInteractive",
"-NoProfile",
- "-ExecutionPolicy RemoteSigned",
+ "-ExecutionPolicy Unrestricted",
# Powershell will hang if STDIN is redirected
# http://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected
"-InputFormat None",
diff --git a/lib/chef/provider/remote_directory.rb b/lib/chef/provider/remote_directory.rb
index 5bd1cb5493..9a7416e318 100644
--- a/lib/chef/provider/remote_directory.rb
+++ b/lib/chef/provider/remote_directory.rb
@@ -32,6 +32,8 @@ class Chef
class Provider
class RemoteDirectory < Chef::Provider::Directory
+ provides :remote_directory
+
include Chef::Mixin::FileClass
def action_create
@@ -63,7 +65,7 @@ class Chef
def ls(path)
files = Dir.glob(::File.join(Chef::Util::PathHelper.escape_glob(path), '**', '*'),
::File::FNM_DOTMATCH)
-
+
# Remove current directory and previous directory
files.reject! do |name|
basename = Pathname.new(name).basename().to_s
diff --git a/lib/chef/provider/route.rb b/lib/chef/provider/route.rb
index 208a4f4139..72a5029a94 100644
--- a/lib/chef/provider/route.rb
+++ b/lib/chef/provider/route.rb
@@ -24,6 +24,8 @@ require 'ipaddr'
class Chef::Provider::Route < Chef::Provider
include Chef::Mixin::Command
+ provides :route
+
attr_accessor :is_running
MASK = {'0.0.0.0' => '0',
diff --git a/lib/chef/provider/ruby_block.rb b/lib/chef/provider/ruby_block.rb
index b0d94a3f8d..eb93fd5708 100644
--- a/lib/chef/provider/ruby_block.rb
+++ b/lib/chef/provider/ruby_block.rb
@@ -20,6 +20,8 @@
class Chef
class Provider
class RubyBlock < Chef::Provider
+ provides :ruby_block
+
def whyrun_supported?
true
end
diff --git a/lib/chef/provider/script.rb b/lib/chef/provider/script.rb
index 4aacf4f524..1615517553 100644
--- a/lib/chef/provider/script.rb
+++ b/lib/chef/provider/script.rb
@@ -22,6 +22,12 @@ require 'chef/provider/execute'
class Chef
class Provider
class Script < Chef::Provider::Execute
+ provides :bash
+ provides :csh
+ provides :perl
+ provides :python
+ provides :ruby
+ provides :script
def initialize(new_resource, run_context)
super
diff --git a/lib/chef/provider/service/aix.rb b/lib/chef/provider/service/aix.rb
new file mode 100644
index 0000000000..0aef62c62e
--- /dev/null
+++ b/lib/chef/provider/service/aix.rb
@@ -0,0 +1,128 @@
+#
+# Author:: kaustubh (<kaustubh@clogeny.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/provider/service'
+
+class Chef
+ class Provider
+ class Service
+ class Aix < Chef::Provider::Service
+ attr_reader :status_load_success
+
+ provides :service, os: "aix"
+
+ def initialize(new_resource, run_context)
+ super
+ end
+
+ def load_current_resource
+ @current_resource = Chef::Resource::Service.new(@new_resource.name)
+ @current_resource.service_name(@new_resource.service_name)
+
+ @status_load_success = true
+ @priority_success = true
+ @is_resource_group = false
+
+ determine_current_status!
+
+ @current_resource
+ end
+
+ def whyrun_supported?
+ true
+ end
+
+ def start_service
+ if @is_resource_group
+ shell_out!("startsrc -g #{@new_resource.service_name}")
+ else
+ shell_out!("startsrc -s #{@new_resource.service_name}")
+ end
+ end
+
+ def stop_service
+ if @is_resource_group
+ shell_out!("stopsrc -g #{@new_resource.service_name}")
+ else
+ shell_out!("stopsrc -s #{@new_resource.service_name}")
+ end
+ end
+
+ def restart_service
+ stop_service
+ start_service
+ end
+
+ def reload_service
+ if @is_resource_group
+ shell_out!("refresh -g #{@new_resource.service_name}")
+ else
+ shell_out!("refresh -s #{@new_resource.service_name}")
+ end
+ end
+
+ def shared_resource_requirements
+ super
+ requirements.assert(:all_actions) do |a|
+ a.assertion { @status_load_success }
+ a.whyrun ["Service status not available. Assuming a prior action would have installed the service.", "Assuming status of not running."]
+ end
+ end
+
+ def define_resource_requirements
+ # FIXME? need reload from service.rb
+ shared_resource_requirements
+ end
+
+ protected
+ def determine_current_status!
+ Chef::Log.debug "#{@new_resource} using lssrc to check the status "
+ begin
+ services = shell_out!("lssrc -a | grep -w #{@new_resource.service_name}").stdout.split("\n")
+ is_resource_group?(services)
+
+ if services.length == 1 && services[0].split(' ').last == "active"
+ @current_resource.running true
+ else
+ @current_resource.running false
+ end
+ Chef::Log.debug "#{@new_resource} running: #{@current_resource.running}"
+ # ShellOut sometimes throws different types of Exceptions than ShellCommandFailed.
+ # Temporarily catching different types of exceptions here until we get Shellout fixed.
+ # TODO: Remove the line before one we get the ShellOut fix.
+ rescue Mixlib::ShellOut::ShellCommandFailed, SystemCallError
+ @status_load_success = false
+ @current_resource.running false
+ nil
+ end
+ end
+
+ def is_resource_group? (services)
+ if services.length > 1
+ Chef::Log.debug("#{@new_resource.service_name} is a group")
+ @is_resource_group = true
+ elsif services[0].split(' ')[1] == @new_resource.service_name
+ Chef::Log.debug("#{@new_resource.service_name} is a group")
+ @is_resource_group = true
+ end
+ end
+ end
+ end
+ end
+end
+
diff --git a/lib/chef/provider/service/aixinit.rb b/lib/chef/provider/service/aixinit.rb
new file mode 100644
index 0000000000..19beac79f0
--- /dev/null
+++ b/lib/chef/provider/service/aixinit.rb
@@ -0,0 +1,117 @@
+#
+# Author:: kaustubh (<kaustubh@clogeny.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/provider/service/init'
+
+class Chef
+ class Provider
+ class Service
+ class AixInit < Chef::Provider::Service::Init
+ RC_D_SCRIPT_NAME = /\/etc\/rc.d\/rc2.d\/([SK])(\d\d|)/i
+
+ def initialize(new_resource, run_context)
+ super
+ @init_command = "/etc/rc.d/init.d/#{@new_resource.service_name}"
+ end
+
+ def load_current_resource
+ super
+ @priority_success = true
+ @rcd_status = nil
+
+ set_current_resource_attributes
+ @current_resource
+ end
+
+ def action_enable
+ if @new_resource.priority.nil?
+ priority_ok = true
+ else
+ priority_ok = @current_resource.priority == @new_resource.priority
+ end
+ if @current_resource.enabled and priority_ok
+ Chef::Log.debug("#{@new_resource} already enabled - nothing to do")
+ else
+ converge_by("enable service #{@new_resource}") do
+ enable_service
+ Chef::Log.info("#{@new_resource} enabled")
+ end
+ end
+ load_new_resource_state
+ @new_resource.enabled(true)
+ end
+
+ def enable_service
+ Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).each { |f| ::File.delete(f)}
+
+ if @new_resource.priority.is_a? Integer
+ create_symlink(2, 'S', @new_resource.priority)
+
+ elsif @new_resource.priority.is_a? Hash
+ @new_resource.priority.each do |level,o|
+ create_symlink(level,(o[0] == :start ? 'S' : 'K'),o[1])
+ end
+ else
+ create_symlink(2, 'S', '')
+ end
+ end
+
+ def disable_service
+ Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).each { |f| ::File.delete(f) }
+
+ if @new_resource.priority.is_a? Integer
+ create_symlink(2, 'K',100 - @new_resource.priority)
+ elsif @new_resource.priority.is_a? Hash
+ @new_resource.priority.each do |level,o|
+ create_symlink(level, 'K', 100 - o[1]) if o[0] == :stop
+ end
+ else
+ create_symlink(2, 'K', '')
+ end
+ end
+
+ def create_symlink(run_level, status, priority)
+ ::File.symlink("/etc/rc.d/init.d/#{@new_resource.service_name}", "/etc/rc.d/rc#{run_level}.d/#{status}#{priority}#{@new_resource.service_name}")
+ end
+
+ def set_current_resource_attributes
+ # assuming run level 2 for aix
+ is_enabled = false
+ files = Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"])
+
+ priority = {}
+
+ files.each do |file|
+ if (RC_D_SCRIPT_NAME =~ file)
+ priority[2] = [($1 == "S" ? :start : :stop), ($2.empty? ? '' : $2.to_i)]
+ if $1 == "S"
+ is_enabled = true
+ end
+ end
+ end
+
+ if is_enabled && files.length == 1
+ priority = priority[2][1]
+ end
+ @current_resource.enabled(is_enabled)
+ @current_resource.priority(priority)
+ end
+ end
+ end
+ end
+end
diff --git a/lib/chef/provider/service/arch.rb b/lib/chef/provider/service/arch.rb
index 9be5fb6fe3..e7fbcc820c 100644
--- a/lib/chef/provider/service/arch.rb
+++ b/lib/chef/provider/service/arch.rb
@@ -20,6 +20,12 @@ require 'chef/provider/service/init'
class Chef::Provider::Service::Arch < Chef::Provider::Service::Init
+ provides :service, platform_family: "arch"
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:etc_rcd)
+ end
+
def initialize(new_resource, run_context)
super
@init_command = "/etc/rc.d/#{@new_resource.service_name}"
diff --git a/lib/chef/provider/service/debian.rb b/lib/chef/provider/service/debian.rb
index 1ebef90349..01505924cb 100644
--- a/lib/chef/provider/service/debian.rb
+++ b/lib/chef/provider/service/debian.rb
@@ -25,13 +25,23 @@ class Chef
UPDATE_RC_D_ENABLED_MATCHES = /\/rc[\dS].d\/S|not installed/i
UPDATE_RC_D_PRIORITIES = /\/rc([\dS]).d\/([SK])(\d\d)/i
+ provides :service, platform_family: "debian"
+
+ def self.provides?(node, resource)
+ super && Chef::Platform::ServiceHelpers.service_resource_providers.include?(:debian)
+ end
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:initd)
+ end
+
def load_current_resource
super
@priority_success = true
@rcd_status = nil
- @current_resource.priority(get_priority)
- @current_resource.enabled(service_currently_enabled?(@current_resource.priority))
- @current_resource
+ current_resource.priority(get_priority)
+ current_resource.enabled(service_currently_enabled?(current_resource.priority))
+ current_resource
end
def define_resource_requirements
@@ -47,7 +57,7 @@ class Chef
requirements.assert(:all_actions) do |a|
a.assertion { @priority_success }
- a.failure_message Chef::Exceptions::Service, "/usr/sbin/update-rc.d -n -f #{@current_resource.service_name} failed - #{@rcd_status.inspect}"
+ a.failure_message Chef::Exceptions::Service, "/usr/sbin/update-rc.d -n -f #{current_resource.service_name} failed - #{@rcd_status.inspect}"
# This can happen if the service is not yet installed,so we'll fake it.
a.whyrun ["Unable to determine priority of service, assuming service would have been correctly installed earlier in the run.",
"Assigning temporary priorities to continue.",
@@ -59,7 +69,7 @@ class Chef
"3"=>[:start, "20"],
"4"=>[:start, "20"],
"5"=>[:start, "20"]}
- @current_resource.priority(temp_priorities)
+ current_resource.priority(temp_priorities)
end
end
end
@@ -67,7 +77,7 @@ class Chef
def get_priority
priority = {}
- @rcd_status = popen4("/usr/sbin/update-rc.d -n -f #{@current_resource.service_name} remove") do |pid, stdin, stdout, stderr|
+ @rcd_status = popen4("/usr/sbin/update-rc.d -n -f #{current_resource.service_name} remove") do |pid, stdin, stdout, stderr|
[stdout, stderr].each do |iop|
iop.each_line do |line|
@@ -99,7 +109,7 @@ class Chef
def service_currently_enabled?(priority)
enabled = false
priority.each { |runlevel, arguments|
- Chef::Log.debug("#{@new_resource} runlevel #{runlevel}, action #{arguments[0]}, priority #{arguments[1]}")
+ Chef::Log.debug("#{new_resource} runlevel #{runlevel}, action #{arguments[0]}, priority #{arguments[1]}")
# if we are in a update-rc.d default startup runlevel && we start in this runlevel
if %w[ 1 2 3 4 5 S ].include?(runlevel) && arguments[0] == :start
enabled = true
@@ -111,63 +121,63 @@ class Chef
# Override method from parent to ensure priority is up-to-date
def action_enable
- if @new_resource.priority.nil?
+ if new_resource.priority.nil?
priority_ok = true
else
- priority_ok = @current_resource.priority == @new_resource.priority
+ priority_ok = @current_resource.priority == new_resource.priority
end
- if @current_resource.enabled and priority_ok
- Chef::Log.debug("#{@new_resource} already enabled - nothing to do")
+ if current_resource.enabled and priority_ok
+ Chef::Log.debug("#{new_resource} already enabled - nothing to do")
else
- converge_by("enable service #{@new_resource}") do
+ converge_by("enable service #{new_resource}") do
enable_service
- Chef::Log.info("#{@new_resource} enabled")
+ Chef::Log.info("#{new_resource} enabled")
end
end
load_new_resource_state
- @new_resource.enabled(true)
+ new_resource.enabled(true)
end
def enable_service
- if @new_resource.priority.is_a? Integer
- shell_out!("/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
- shell_out!("/usr/sbin/update-rc.d #{@new_resource.service_name} defaults #{@new_resource.priority} #{100 - @new_resource.priority}")
- elsif @new_resource.priority.is_a? Hash
+ if new_resource.priority.is_a? Integer
+ shell_out!("/usr/sbin/update-rc.d -f #{new_resource.service_name} remove")
+ shell_out!("/usr/sbin/update-rc.d #{new_resource.service_name} defaults #{new_resource.priority} #{100 - new_resource.priority}")
+ elsif new_resource.priority.is_a? Hash
# we call the same command regardless of we're enabling or disabling
# users passing a Hash are responsible for setting their own start priorities
set_priority
else # No priority, go with update-rc.d defaults
- shell_out!("/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
- shell_out!("/usr/sbin/update-rc.d #{@new_resource.service_name} defaults")
+ shell_out!("/usr/sbin/update-rc.d -f #{new_resource.service_name} remove")
+ shell_out!("/usr/sbin/update-rc.d #{new_resource.service_name} defaults")
end
end
def disable_service
- if @new_resource.priority.is_a? Integer
+ if new_resource.priority.is_a? Integer
# Stop processes in reverse order of start using '100 - start_priority'
- shell_out!("/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
- shell_out!("/usr/sbin/update-rc.d -f #{@new_resource.service_name} stop #{100 - @new_resource.priority} 2 3 4 5 .")
- elsif @new_resource.priority.is_a? Hash
+ shell_out!("/usr/sbin/update-rc.d -f #{new_resource.service_name} remove")
+ shell_out!("/usr/sbin/update-rc.d -f #{new_resource.service_name} stop #{100 - new_resource.priority} 2 3 4 5 .")
+ elsif new_resource.priority.is_a? Hash
# we call the same command regardless of we're enabling or disabling
# users passing a Hash are responsible for setting their own stop priorities
set_priority
else
# no priority, using '100 - 20 (update-rc.d default)' to stop in reverse order of start
- shell_out!("/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
- shell_out!("/usr/sbin/update-rc.d -f #{@new_resource.service_name} stop 80 2 3 4 5 .")
+ shell_out!("/usr/sbin/update-rc.d -f #{new_resource.service_name} remove")
+ shell_out!("/usr/sbin/update-rc.d -f #{new_resource.service_name} stop 80 2 3 4 5 .")
end
end
def set_priority
args = ""
- @new_resource.priority.each do |level, o|
+ new_resource.priority.each do |level, o|
action = o[0]
priority = o[1]
args += "#{action} #{priority} #{level} . "
end
- shell_out!("/usr/sbin/update-rc.d -f #{@new_resource.service_name} remove")
- shell_out!("/usr/sbin/update-rc.d #{@new_resource.service_name} #{args}")
+ shell_out!("/usr/sbin/update-rc.d -f #{new_resource.service_name} remove")
+ shell_out!("/usr/sbin/update-rc.d #{new_resource.service_name} #{args}")
end
end
end
diff --git a/lib/chef/provider/service/freebsd.rb b/lib/chef/provider/service/freebsd.rb
index 08d58232e1..49ba0d7d16 100644
--- a/lib/chef/provider/service/freebsd.rb
+++ b/lib/chef/provider/service/freebsd.rb
@@ -27,6 +27,10 @@ class Chef
attr_reader :enabled_state_found
+ provides :service, os: [ "freebsd", "netbsd" ]
+
+ include Chef::Mixin::ShellOut
+
def initialize(new_resource, run_context)
super
@enabled_state_found = false
@@ -46,6 +50,7 @@ class Chef
Chef::Log.debug("#{current_resource} found at #{init_command}")
+ @status_load_success = true
determine_current_status! # see Chef::Provider::Service::Simple
determine_enabled_status!
@@ -58,6 +63,7 @@ class Chef
requirements.assert(:start, :enable, :reload, :restart) do |a|
a.assertion { init_command }
a.failure_message Chef::Exceptions::Service, "#{new_resource}: unable to locate the rc.d script"
+ a.whyrun("Assuming rc.d script will be installed by a previous action.")
end
requirements.assert(:all_actions) do |a|
@@ -68,7 +74,7 @@ class Chef
end
requirements.assert(:start, :enable, :reload, :restart) do |a|
- a.assertion { init_command && service_enable_variable_name != nil }
+ a.assertion { service_enable_variable_name != nil }
a.failure_message Chef::Exceptions::Service, "Could not find the service name in #{init_command} and rcvar"
# No recovery in whyrun mode - the init file is present but not correct.
end
diff --git a/lib/chef/provider/service/gentoo.rb b/lib/chef/provider/service/gentoo.rb
index e2dff10994..3dab920f06 100644
--- a/lib/chef/provider/service/gentoo.rb
+++ b/lib/chef/provider/service/gentoo.rb
@@ -22,6 +22,9 @@ require 'chef/mixin/command'
require 'chef/util/path_helper'
class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init
+
+ provides :service, platform_family: "gentoo"
+
def load_current_resource
@new_resource.supports[:status] = true
diff --git a/lib/chef/provider/service/init.rb b/lib/chef/provider/service/init.rb
index 5d8bb5bb38..0a219a69e1 100644
--- a/lib/chef/provider/service/init.rb
+++ b/lib/chef/provider/service/init.rb
@@ -26,6 +26,12 @@ class Chef
attr_accessor :init_command
+ provides :service, os: "!windows"
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:initd)
+ end
+
def initialize(new_resource, run_context)
super
@init_command = "/etc/init.d/#{@new_resource.service_name}"
diff --git a/lib/chef/provider/service/insserv.rb b/lib/chef/provider/service/insserv.rb
index 1ee817707a..31965a4bc6 100644
--- a/lib/chef/provider/service/insserv.rb
+++ b/lib/chef/provider/service/insserv.rb
@@ -24,26 +24,36 @@ class Chef
class Service
class Insserv < Chef::Provider::Service::Init
+ provides :service, os: "linux"
+
+ def self.provides?(node, resource)
+ super && Chef::Platform::ServiceHelpers.service_resource_providers.include?(:insserv)
+ end
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:initd)
+ end
+
def load_current_resource
super
- # Look for a /etc/rc.*/SnnSERVICE link to signifiy that the service would be started in a runlevel
- if Dir.glob("/etc/rc**/S*#{Chef::Util::PathHelper.escape_glob(@current_resource.service_name)}").empty?
- @current_resource.enabled false
+ # Look for a /etc/rc.*/SnnSERVICE link to signify that the service would be started in a runlevel
+ if Dir.glob("/etc/rc**/S*#{Chef::Util::PathHelper.escape_glob(current_resource.service_name)}").empty?
+ current_resource.enabled false
else
- @current_resource.enabled true
+ current_resource.enabled true
end
- @current_resource
+ current_resource
end
def enable_service()
- shell_out!("/sbin/insserv -r -f #{@new_resource.service_name}")
- shell_out!("/sbin/insserv -d -f #{@new_resource.service_name}")
+ shell_out!("/sbin/insserv -r -f #{new_resource.service_name}")
+ shell_out!("/sbin/insserv -d -f #{new_resource.service_name}")
end
def disable_service()
- shell_out!("/sbin/insserv -r -f #{@new_resource.service_name}")
+ shell_out!("/sbin/insserv -r -f #{new_resource.service_name}")
end
end
end
diff --git a/lib/chef/provider/service/invokercd.rb b/lib/chef/provider/service/invokercd.rb
index e6afa7272a..5ff24e0dbb 100644
--- a/lib/chef/provider/service/invokercd.rb
+++ b/lib/chef/provider/service/invokercd.rb
@@ -23,6 +23,16 @@ class Chef
class Service
class Invokercd < Chef::Provider::Service::Init
+ provides :service, platform_family: "debian"
+
+ def self.provides?(node, resource)
+ super && Chef::Platform::ServiceHelpers.service_resource_providers.include?(:invokercd)
+ end
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:initd)
+ end
+
def initialize(new_resource, run_context)
super
@init_command = "/usr/sbin/invoke-rc.d #{@new_resource.service_name}"
diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb
index ad1535327b..10ad1aa29d 100644
--- a/lib/chef/provider/service/macosx.rb
+++ b/lib/chef/provider/service/macosx.rb
@@ -26,6 +26,8 @@ class Chef
class Service
class Macosx < Chef::Provider::Service::Simple
+ provides :service, os: "darwin"
+
def self.gather_plist_dirs
locations = %w{/Library/LaunchAgents
/Library/LaunchDaemons
diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb
index 7a7b2a1c40..850953125e 100644
--- a/lib/chef/provider/service/redhat.rb
+++ b/lib/chef/provider/service/redhat.rb
@@ -26,11 +26,21 @@ class Chef
CHKCONFIG_ON = /\d:on/
CHKCONFIG_MISSING = /No such/
+ provides :service, platform_family: [ "rhel", "fedora", "suse" ]
+
+ def self.provides?(node, resource)
+ super && Chef::Platform::ServiceHelpers.service_resource_providers.include?(:redhat)
+ end
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:initd)
+ end
+
def initialize(new_resource, run_context)
super
- @init_command = "/sbin/service #{@new_resource.service_name}"
- @new_resource.supports[:status] = true
- @service_missing = false
+ @init_command = "/sbin/service #{@new_resource.service_name}"
+ @new_resource.supports[:status] = true
+ @service_missing = false
end
def define_resource_requirements
diff --git a/lib/chef/provider/service/simple.rb b/lib/chef/provider/service/simple.rb
index bd51d15f84..ee403ee163 100644
--- a/lib/chef/provider/service/simple.rb
+++ b/lib/chef/provider/service/simple.rb
@@ -25,6 +25,8 @@ class Chef
class Service
class Simple < Chef::Provider::Service
+ # this must be subclassed to be useful so does not directly implement :service
+
attr_reader :status_load_success
def load_current_resource
diff --git a/lib/chef/provider/service/solaris.rb b/lib/chef/provider/service/solaris.rb
index f0584dcf6d..eaea6bb1ab 100644
--- a/lib/chef/provider/service/solaris.rb
+++ b/lib/chef/provider/service/solaris.rb
@@ -26,6 +26,8 @@ class Chef
class Solaris < Chef::Provider::Service
attr_reader :maintenance
+ provides :service, os: "solaris2"
+
def initialize(new_resource, run_context=nil)
super
@init_command = "/usr/sbin/svcadm"
diff --git a/lib/chef/provider/service/systemd.rb b/lib/chef/provider/service/systemd.rb
index 31feee65d4..9085ffde2e 100644
--- a/lib/chef/provider/service/systemd.rb
+++ b/lib/chef/provider/service/systemd.rb
@@ -18,80 +18,95 @@
require 'chef/resource/service'
require 'chef/provider/service/simple'
+require 'chef/mixin/which'
class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple
+
+ include Chef::Mixin::Which
+
+ provides :service, os: "linux"
+
+ attr_accessor :status_check_success
+
+ def self.provides?(node, resource)
+ super && Chef::Platform::ServiceHelpers.service_resource_providers.include?(:systemd)
+ end
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:systemd)
+ end
+
def load_current_resource
- @current_resource = Chef::Resource::Service.new(@new_resource.name)
- @current_resource.service_name(@new_resource.service_name)
+ @current_resource = Chef::Resource::Service.new(new_resource.name)
+ current_resource.service_name(new_resource.service_name)
@status_check_success = true
- if @new_resource.status_command
- Chef::Log.debug("#{@new_resource} you have specified a status command, running..")
+ if new_resource.status_command
+ Chef::Log.debug("#{new_resource} you have specified a status command, running..")
- unless shell_out(@new_resource.status_command).error?
- @current_resource.running(true)
+ unless shell_out(new_resource.status_command).error?
+ current_resource.running(true)
else
@status_check_success = false
- @current_resource.running(false)
- @current_resource.enabled(false)
- nil
+ current_resource.running(false)
+ current_resource.enabled(false)
end
else
- @current_resource.running(is_active?)
+ current_resource.running(is_active?)
end
- @current_resource.enabled(is_enabled?)
- @current_resource
+ current_resource.enabled(is_enabled?)
+ current_resource
end
def define_resource_requirements
shared_resource_requirements
requirements.assert(:all_actions) do |a|
- a.assertion { @status_check_success }
+ a.assertion { status_check_success }
# We won't stop in any case, but in whyrun warn and tell what we're doing.
- a.whyrun ["Failed to determine status of #{@new_resource}, using command #{@new_resource.status_command}.",
+ a.whyrun ["Failed to determine status of #{new_resource}, using command #{new_resource.status_command}.",
"Assuming service would have been installed and is disabled"]
end
end
def start_service
- if @current_resource.running
- Chef::Log.debug("#{@new_resource} already running, not starting")
+ if current_resource.running
+ Chef::Log.debug("#{new_resource} already running, not starting")
else
- if @new_resource.start_command
+ if new_resource.start_command
super
else
- shell_out_with_systems_locale!("/bin/systemctl start #{@new_resource.service_name}")
+ shell_out_with_systems_locale!("#{systemctl_path} start #{new_resource.service_name}")
end
end
end
def stop_service
- unless @current_resource.running
- Chef::Log.debug("#{@new_resource} not running, not stopping")
+ unless current_resource.running
+ Chef::Log.debug("#{new_resource} not running, not stopping")
else
- if @new_resource.stop_command
+ if new_resource.stop_command
super
else
- shell_out_with_systems_locale!("/bin/systemctl stop #{@new_resource.service_name}")
+ shell_out_with_systems_locale!("#{systemctl_path} stop #{new_resource.service_name}")
end
end
end
def restart_service
- if @new_resource.restart_command
+ if new_resource.restart_command
super
else
- shell_out_with_systems_locale!("/bin/systemctl restart #{@new_resource.service_name}")
+ shell_out_with_systems_locale!("#{systemctl_path} restart #{new_resource.service_name}")
end
end
def reload_service
- if @new_resource.reload_command
+ if new_resource.reload_command
super
else
- if @current_resource.running
- shell_out_with_systems_locale!("/bin/systemctl reload #{@new_resource.service_name}")
+ if current_resource.running
+ shell_out_with_systems_locale!("#{systemctl_path} reload #{new_resource.service_name}")
else
start_service
end
@@ -99,18 +114,28 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple
end
def enable_service
- shell_out!("/bin/systemctl enable #{@new_resource.service_name}")
+ shell_out!("#{systemctl_path} enable #{new_resource.service_name}")
end
def disable_service
- shell_out!("/bin/systemctl disable #{@new_resource.service_name}")
+ shell_out!("#{systemctl_path} disable #{new_resource.service_name}")
end
def is_active?
- shell_out("/bin/systemctl is-active #{@new_resource.service_name} --quiet").exitstatus == 0
+ shell_out("#{systemctl_path} is-active #{new_resource.service_name} --quiet").exitstatus == 0
end
def is_enabled?
- shell_out("/bin/systemctl is-enabled #{@new_resource.service_name} --quiet").exitstatus == 0
+ shell_out("#{systemctl_path} is-enabled #{new_resource.service_name} --quiet").exitstatus == 0
+ end
+
+ private
+
+ def systemctl_path
+ if @systemctl_path.nil?
+ @systemctl_path = which("systemctl")
+ end
+ @systemctl_path
end
+
end
diff --git a/lib/chef/provider/service/upstart.rb b/lib/chef/provider/service/upstart.rb
index 670bf9e5f8..3a3ddb2385 100644
--- a/lib/chef/provider/service/upstart.rb
+++ b/lib/chef/provider/service/upstart.rb
@@ -27,6 +27,16 @@ class Chef
class Upstart < Chef::Provider::Service::Simple
UPSTART_STATE_FORMAT = /\w+ \(?(\w+)\)?[\/ ](\w+)/
+ provides :service, os: "linux"
+
+ def self.provides?(node, resource)
+ super && Chef::Platform::ServiceHelpers.service_resource_providers.include?(:upstart)
+ end
+
+ def self.supports?(resource, action)
+ Chef::Platform::ServiceHelpers.config_for_service(resource.service_name).include?(:upstart)
+ end
+
# Upstart does more than start or stop a service, creating multiple 'states' [1] that a service can be in.
# In chef, when we ask a service to start, we expect it to have started before performing the next step
# since we have top down dependencies. Which is to say we may follow witha resource next that requires
diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb
index d31aad4c9d..d4c272354e 100644
--- a/lib/chef/provider/service/windows.rb
+++ b/lib/chef/provider/service/windows.rb
@@ -25,6 +25,11 @@ end
class Chef::Provider::Service::Windows < Chef::Provider::Service
+ provides :service, os: "windows"
+ provides :windows_service, os: "windows"
+
+ include Chef::Mixin::ShellOut
+
#Win32::Service.get_start_type
AUTO_START = 'auto start'
MANUAL = 'demand start'
diff --git a/lib/chef/provider/subversion.rb b/lib/chef/provider/subversion.rb
index 6cf31c8ec8..f4a0e6fc13 100644
--- a/lib/chef/provider/subversion.rb
+++ b/lib/chef/provider/subversion.rb
@@ -27,6 +27,8 @@ class Chef
class Provider
class Subversion < Chef::Provider
+ provides :subversion
+
SVN_INFO_PATTERN = /^([\w\s]+): (.+)$/
include Chef::Mixin::Command
diff --git a/lib/chef/provider/template.rb b/lib/chef/provider/template.rb
index 48cc45f3a8..1e759074b9 100644
--- a/lib/chef/provider/template.rb
+++ b/lib/chef/provider/template.rb
@@ -25,6 +25,7 @@ require 'chef/deprecation/warnings'
class Chef
class Provider
class Template < Chef::Provider::File
+ provides :template
extend Chef::Deprecation::Warnings
include Chef::Deprecation::Provider::Template
diff --git a/lib/chef/provider/whyrun_safe_ruby_block.rb b/lib/chef/provider/whyrun_safe_ruby_block.rb
index e5f35debd7..3b95752cc4 100644
--- a/lib/chef/provider/whyrun_safe_ruby_block.rb
+++ b/lib/chef/provider/whyrun_safe_ruby_block.rb
@@ -19,6 +19,8 @@
class Chef
class Provider
class WhyrunSafeRubyBlock < Chef::Provider::RubyBlock
+ provides :whyrun_safe_ruby_block
+
def action_run
@new_resource.block.call
@new_resource.updated_by_last_action(true)
diff --git a/lib/chef/provider_resolver.rb b/lib/chef/provider_resolver.rb
new file mode 100644
index 0000000000..d83a3e0468
--- /dev/null
+++ b/lib/chef/provider_resolver.rb
@@ -0,0 +1,117 @@
+#
+# Author:: Richard Manyanza (<liseki@nyikacraftsmen.com>)
+# Copyright:: Copyright (c) 2014 Richard Manyanza.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/exceptions'
+require 'chef/platform/provider_priority_map'
+
+class Chef
+ class ProviderResolver
+
+ attr_reader :node
+ attr_reader :resource
+ attr_reader :action
+
+ def initialize(node, resource, action)
+ @node = node
+ @resource = resource
+ @action = action
+ end
+
+ # return a deterministically sorted list of Chef::Provider subclasses
+ def providers
+ @providers ||= Chef::Provider.descendants
+ end
+
+ def resolve
+ maybe_explicit_provider(resource) ||
+ maybe_dynamic_provider_resolution(resource, action) ||
+ maybe_chef_platform_lookup(resource)
+ end
+
+ # this cut looks at if the provider can handle the resource type on the node
+ def enabled_handlers
+ @enabled_handlers ||=
+ providers.select do |klass|
+ klass.provides?(node, resource)
+ end.sort {|a,b| a.to_s <=> b.to_s }
+ end
+
+ # this cut looks at if the provider can handle the specific resource and action
+ def supported_handlers
+ @supported_handlers ||=
+ enabled_handlers.select do |klass|
+ klass.supports?(resource, action)
+ end
+ end
+
+ private
+
+ # if resource.provider is set, just return one of those objects
+ def maybe_explicit_provider(resource)
+ return nil unless resource.provider
+ resource.provider
+ end
+
+ # try dynamically finding a provider based on querying the providers to see what they support
+ def maybe_dynamic_provider_resolution(resource, action)
+ # log this so we know what providers will work for the generic resource on the node (early cut)
+ Chef::Log.debug "providers for generic #{resource.resource_name} resource enabled on node include: #{enabled_handlers}"
+
+ # what providers were excluded by machine state (late cut)
+ Chef::Log.debug "providers that refused resource #{resource} were: #{enabled_handlers - supported_handlers}"
+ Chef::Log.debug "providers that support resource #{resource} include: #{supported_handlers}"
+
+ # if none of the providers specifically support the resource, we still need to pick one of the providers that are
+ # enabled on the node to handle the why-run use case.
+ handlers = supported_handlers.empty? ? enabled_handlers : supported_handlers
+ Chef::Log.debug "no providers supported the resource, falling back to enabled handlers" if supported_handlers.empty?
+
+ if handlers.count >= 2
+ # this magic stack ranks the providers by where they appear in the provider_priority_map, it is mostly used
+ # to pick amongst N different ways to start init scripts on different debian/ubuntu systems.
+ priority_list = [ get_provider_priority_map(resource.resource_name, node) ].flatten.compact
+ handlers = handlers.sort_by { |x| i = priority_list.index x; i.nil? ? Float::INFINITY : i }
+ handlers = [ handlers.first ]
+ end
+
+ Chef::Log.debug "providers that survived replacement include: #{handlers}"
+
+ raise Chef::Exceptions::AmbiguousProviderResolution.new(resource, handlers) if handlers.count >= 2
+
+ Chef::Log.debug "dynamic provider resolver FAILED to resolve a provider" if handlers.empty?
+
+ return nil if handlers.empty?
+
+ handlers[0]
+ end
+
+ # try the old static lookup of providers by platform
+ def maybe_chef_platform_lookup(resource)
+ Chef::Platform.find_provider_for_node(node, resource)
+ end
+
+ # dep injection hooks
+ def get_provider_priority_map(resource_name, node)
+ provider_priority_map.get(node, resource_name)
+ end
+
+ def provider_priority_map
+ Chef::Platform::ProviderPriorityMap.instance.priority_map
+ end
+ end
+end
diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb
index fec00d0e63..38c0e6fc9a 100644
--- a/lib/chef/providers.rb
+++ b/lib/chef/providers.rb
@@ -63,6 +63,7 @@ require 'chef/provider/package/freebsd/pkgng'
require 'chef/provider/package/homebrew'
require 'chef/provider/package/ips'
require 'chef/provider/package/macports'
+require 'chef/provider/package/openbsd'
require 'chef/provider/package/pacman'
require 'chef/provider/package/portage'
require 'chef/provider/package/paludis'
@@ -75,19 +76,21 @@ require 'chef/provider/package/smartos'
require 'chef/provider/package/aix'
require 'chef/provider/service/arch'
-require 'chef/provider/service/debian'
require 'chef/provider/service/freebsd'
require 'chef/provider/service/gentoo'
require 'chef/provider/service/init'
-require 'chef/provider/service/insserv'
require 'chef/provider/service/invokercd'
+require 'chef/provider/service/debian'
require 'chef/provider/service/redhat'
+require 'chef/provider/service/insserv'
require 'chef/provider/service/simple'
require 'chef/provider/service/systemd'
require 'chef/provider/service/upstart'
require 'chef/provider/service/windows'
require 'chef/provider/service/solaris'
require 'chef/provider/service/macosx'
+require 'chef/provider/service/aixinit'
+require 'chef/provider/service/aix'
require 'chef/provider/user/dscl'
require 'chef/provider/user/pw'
diff --git a/lib/chef/recipe.rb b/lib/chef/recipe.rb
index 32578da5ab..de72a8d0c4 100644
--- a/lib/chef/recipe.rb
+++ b/lib/chef/recipe.rb
@@ -96,6 +96,8 @@ class Chef
# true<TrueClass>:: If all the parameters are present
# false<FalseClass>:: If any of the parameters are missing
def tagged?(*tags)
+ return false if run_context.node[:tags].nil?
+
tags.each do |tag|
return false unless run_context.node[:tags].include?(tag)
end
diff --git a/lib/chef/request_id.rb b/lib/chef/request_id.rb
index 7fc177c633..2c7af01879 100644
--- a/lib/chef/request_id.rb
+++ b/lib/chef/request_id.rb
@@ -15,7 +15,7 @@
# limitations under the License.
#
-require 'chef/monkey_patches/securerandom'
+require 'securerandom'
require 'singleton'
class Chef
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 70abfbcdb0..8d964da66d 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -27,11 +27,13 @@ require 'chef/guard_interpreter/resource_guard_interpreter'
require 'chef/resource/conditional'
require 'chef/resource/conditional_action_not_nothing'
require 'chef/resource_collection'
-require 'chef/resource_platform_map'
+require 'chef/node_map'
require 'chef/node'
+require 'chef/provider_resolver'
require 'chef/platform'
require 'chef/mixin/deprecation'
+require 'chef/mixin/descendants_tracker'
class Chef
class Resource
@@ -133,6 +135,7 @@ F
include Chef::Mixin::Deprecation
extend Chef::Mixin::ConvertToClassName
+ extend Chef::Mixin::DescendantsTracker
if Module.method(:const_defined?).arity == 1
def self.strict_const_defined?(const)
@@ -144,24 +147,13 @@ F
end
end
- # Track all subclasses of Resource. This is used so names can be looked up
- # when attempting to deserialize from JSON. (See: json_compat)
- def self.resource_classes
- # Using a class variable here ensures we have one variable to track
- # subclasses shared by the entire class hierarchy; without this, each
- # subclass would have its own list of subclasses.
- @@resource_classes ||= []
- end
-
- # Callback when subclass is defined. Adds subclass to list of subclasses.
- def self.inherited(subclass)
- resource_classes << subclass
- end
-
- # Look up a subclass by +class_name+ which should be a string that matches
- # `Subclass.name`
- def self.find_subclass_by_name(class_name)
- resource_classes.first {|c| c.name == class_name }
+ class << self
+ # back-compat
+ # NOTE: that we do not support unregistering classes as descendents like
+ # we used to for LWRP unloading because that was horrible and removed in
+ # Chef-12.
+ alias :resource_classes :descendants
+ alias :find_subclass_by_name :find_descendants_by_name
end
# Set or return the list of "state attributes" implemented by the Resource
@@ -229,6 +221,8 @@ F
attr_reader :elapsed_time
+ attr_reader :default_guard_interpreter
+
# Each notify entry is a resource/action pair, modeled as an
# Struct with a #resource and #action member
@@ -250,7 +244,13 @@ F
@not_if = []
@only_if = []
@source_line = nil
- @guard_interpreter = :default
+ # We would like to raise an error when the user gives us a guard
+ # interpreter and a ruby_block to the guard. In order to achieve this
+ # we need to understand when the user overrides the default guard
+ # interpreter. Therefore we store the default separately in a different
+ # attribute.
+ @guard_interpreter = nil
+ @default_guard_interpreter = :default
@elapsed_time = 0
@sensitive = false
end
@@ -297,12 +297,13 @@ F
end
end
- def load_prior_resource
+ def load_prior_resource(resource_type, instance_name)
begin
- prior_resource = run_context.resource_collection.lookup(self.to_s)
+ key = ::Chef::ResourceCollection::ResourceSet.create_key(resource_type, instance_name)
+ prior_resource = run_context.resource_collection.lookup(key)
# if we get here, there is a prior resource (otherwise we'd have jumped
# to the rescue clause).
- Chef::Log.warn("Cloning resource attributes for #{self.to_s} from prior resource (CHEF-3694)")
+ Chef::Log.warn("Cloning resource attributes for #{key} from prior resource (CHEF-3694)")
Chef::Log.warn("Previous #{prior_resource}: #{prior_resource.source_line}") if prior_resource.source_line
Chef::Log.warn("Current #{self}: #{self.source_line}") if self.source_line
prior_resource.instance_variables.each do |iv|
@@ -410,11 +411,15 @@ F
end
def guard_interpreter(arg=nil)
- set_or_return(
- :guard_interpreter,
- arg,
- :kind_of => Symbol
- )
+ if arg.nil?
+ @guard_interpreter || @default_guard_interpreter
+ else
+ set_or_return(
+ :guard_interpreter,
+ arg,
+ :kind_of => Symbol
+ )
+ end
end
# Sets up a notification from this resource to the resource specified by +resource_spec+.
@@ -639,6 +644,11 @@ F
# on accident
updated_by_last_action(false)
+ # Don't modify @retries directly and keep it intact, so that the
+ # recipe_snippet from ResourceFailureInspector can print the value
+ # that was set in the resource block initially.
+ remaining_retries = retries
+
begin
return if should_skip?(action)
provider_for_action(action).run_action
@@ -646,10 +656,10 @@ F
if ignore_failure
Chef::Log.error("#{custom_exception_message(e)}; ignore_failure is set, continuing")
events.resource_failed(self, action, e)
- elsif retries > 0
- events.resource_failed_retriable(self, action, retries, e)
- @retries -= 1
- Chef::Log.info("Retrying execution of #{self}, #{retries} attempt(s) left")
+ elsif remaining_retries > 0
+ events.resource_failed_retriable(self, action, remaining_retries, e)
+ remaining_retries -= 1
+ Chef::Log.info("Retrying execution of #{self}, #{remaining_retries} attempt(s) left")
sleep retry_delay
retry
else
@@ -670,16 +680,9 @@ F
end
def provider_for_action(action)
- # leverage new platform => short_name => resource
- # which requires explicitly setting provider in
- # resource class
- if self.provider
- provider = self.provider.new(self, self.run_context)
- provider.action = action
- provider
- else # fall back to old provider resolution
- Chef::Platform.provider_for_resource(self, action)
- end
+ provider = Chef::ProviderResolver.new(node, self, action).resolve.new(self, run_context)
+ provider.action = action
+ provider
end
def custom_exception_message(e)
@@ -754,8 +757,8 @@ F
@provider_base ||= Chef::Provider
end
- def self.platform_map
- @@platform_map ||= PlatformMap.new
+ def self.node_map
+ @@node_map ||= NodeMap.new
end
# Maps a short_name (and optionally a platform and version) to a
@@ -764,66 +767,55 @@ F
# (I'm looking at you Chef::Resource::Package)
# Ex:
# class WindowsFile < Chef::Resource
- # provides :file, :on_platforms => ["windows"]
+ # provides :file, os: "linux", platform_family: "rhel", platform: "redhat"
+ # provides :file, os: "!windows
+ # provides :file, os: [ "linux", "aix" ]
+ # provides :file, os: "solaris2" do |node|
+ # node['platform_version'].to_f <= 5.11
+ # end
# # ...other stuff
# end
#
- # TODO: 2011-11-02 schisamo - platform_version support
- def self.provides(short_name, opts={})
+ def self.provides(short_name, opts={}, &block)
short_name_sym = short_name
if short_name.kind_of?(String)
+ # YAGNI: this is probably completely unnecessary and can be removed?
+ Chef::Log.warn "[DEPRECATION] Passing a String to Chef::Resource#provides will be removed"
short_name.downcase!
short_name.gsub!(/\s/, "_")
short_name_sym = short_name.to_sym
end
- if opts.has_key?(:on_platforms)
- platforms = [opts[:on_platforms]].flatten
- platforms.each do |p|
- p = :default if :all == p.to_sym
- platform_map.set(
- :platform => p.to_sym,
- :short_name => short_name_sym,
- :resource => self
- )
- end
- else
- platform_map.set(
- :short_name => short_name_sym,
- :resource => self
- )
- end
+ node_map.set(short_name_sym, constantize(self.name), opts, &block)
end
- # Returns a resource based on a short_name anda platform and version.
- #
+ # Returns a resource based on a short_name and node
#
# ==== Parameters
# short_name<Symbol>:: short_name of the resource (ie :directory)
- # platform<Symbol,String>:: platform name
- # version<String>:: platform version
+ # node<Chef::Node>:: Node object to look up platform and version in
#
# === Returns
# <Chef::Resource>:: returns the proper Chef::Resource class
- def self.resource_for_platform(short_name, platform=nil, version=nil)
- platform_map.get(short_name, platform, version)
+ def self.resource_for_node(short_name, node)
+ klass = node_map.get(node, short_name) ||
+ resource_matching_short_name(short_name)
+ raise Chef::Exceptions::NoSuchResourceType.new(short_name, node) if klass.nil?
+ klass
end
- # Returns a resource based on a short_name and a node's
- # platform and version.
- #
+ # Returns the class of a Chef::Resource based on the short name
# ==== Parameters
# short_name<Symbol>:: short_name of the resource (ie :directory)
- # node<Chef::Node>:: Node object to look up platform and version in
#
# === Returns
# <Chef::Resource>:: returns the proper Chef::Resource class
- def self.resource_for_node(short_name, node)
+ def self.resource_matching_short_name(short_name)
begin
- platform, version = Chef::Platform.find_platform_and_version(node)
- rescue ArgumentError
+ rname = convert_to_class_name(short_name.to_s)
+ Chef::Resource.const_get(rname)
+ rescue NameError
+ nil
end
- resource = resource_for_platform(short_name, platform, version)
- resource
end
private
diff --git a/lib/chef/resource/apt_package.rb b/lib/chef/resource/apt_package.rb
index 050cf838ae..f944825ac3 100644
--- a/lib/chef/resource/apt_package.rb
+++ b/lib/chef/resource/apt_package.rb
@@ -23,10 +23,12 @@ class Chef
class Resource
class AptPackage < Chef::Resource::Package
+ provides :apt_package
+ provides :package, os: "linux", platform_family: [ "debian" ]
+
def initialize(name, run_context=nil)
super
@resource_name = :apt_package
- @provider = Chef::Provider::Package::Apt
@default_release = nil
end
diff --git a/lib/chef/resource/bash.rb b/lib/chef/resource/bash.rb
index c56de5fe20..0add0ce501 100644
--- a/lib/chef/resource/bash.rb
+++ b/lib/chef/resource/bash.rb
@@ -17,6 +17,7 @@
#
require 'chef/resource/script'
+require 'chef/provider/script'
class Chef
class Resource
diff --git a/lib/chef/resource/bff_package.rb b/lib/chef/resource/bff_package.rb
index 2d78483e4b..917f0d1d50 100644
--- a/lib/chef/resource/bff_package.rb
+++ b/lib/chef/resource/bff_package.rb
@@ -26,7 +26,6 @@ class Chef
def initialize(name, run_context=nil)
super
@resource_name = :bff_package
- @provider = Chef::Provider::Package::Aix
end
end
diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb
index 83c397bd5b..b2210262d2 100644
--- a/lib/chef/resource/breakpoint.rb
+++ b/lib/chef/resource/breakpoint.rb
@@ -28,7 +28,7 @@ class Chef
super(@name, *args)
@action = "break"
@allowed_actions << :break
- @provider = Chef::Provider::Breakpoint
+ @resource_name = :breakpoint
end
end
end
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb
index af45cb93e6..b4ead11f1d 100644
--- a/lib/chef/resource/chef_gem.rb
+++ b/lib/chef/resource/chef_gem.rb
@@ -23,13 +23,12 @@ class Chef
class Resource
class ChefGem < Chef::Resource::Package::GemPackage
- provides :chef_gem, :on_platforms => :all
+ provides :chef_gem
def initialize(name, run_context=nil)
super
@resource_name = :chef_gem
@gem_binary = RbConfig::CONFIG['bindir'] + "/gem"
- @provider = Chef::Provider::Package::Rubygems
end
# The chef_gem resources is for installing gems to the current gem environment only for use by Chef cookbooks.
diff --git a/lib/chef/resource/conditional.rb b/lib/chef/resource/conditional.rb
index 324c5a4676..8960a4d57f 100644
--- a/lib/chef/resource/conditional.rb
+++ b/lib/chef/resource/conditional.rb
@@ -59,8 +59,10 @@ class Chef
@guard_interpreter = new_guard_interpreter(@parent_resource, @command, @command_opts, &@block)
@block = nil
when nil
- # we should have a block if we get here
- if @parent_resource.guard_interpreter != :default
+ # We should have a block if we get here
+ # Check to see if the user set the guard_interpreter on the parent resource. Note that
+ # this error will not be raised when using the default_guard_interpreter
+ if @parent_resource.guard_interpreter != @parent_resource.default_guard_interpreter
msg = "#{@parent_resource.name} was given a guard_interpreter of #{@parent_resource.guard_interpreter}, "
msg << "but not given a command as a string. guard_interpreter does not support blocks (because they just contain ruby)."
raise ArgumentError, msg
diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb
index 2709cf64f4..7be353b648 100644
--- a/lib/chef/resource/cookbook_file.rb
+++ b/lib/chef/resource/cookbook_file.rb
@@ -27,7 +27,7 @@ class Chef
class CookbookFile < Chef::Resource::File
include Chef::Mixin::Securable
- provides :cookbook_file, :on_platforms => :all
+ provides :cookbook_file
def initialize(name, run_context=nil)
super
@@ -36,7 +36,6 @@ class Chef
@action = "create"
@source = ::File.basename(name)
@cookbook = nil
- @provider = Chef::Provider::CookbookFile
end
def source(source_filename=nil)
diff --git a/lib/chef/resource/csh.rb b/lib/chef/resource/csh.rb
index 95aa8afd7a..36659c349b 100644
--- a/lib/chef/resource/csh.rb
+++ b/lib/chef/resource/csh.rb
@@ -17,6 +17,7 @@
#
require 'chef/resource/script'
+require 'chef/provider/script'
class Chef
class Resource
diff --git a/lib/chef/resource/deploy.rb b/lib/chef/resource/deploy.rb
index a08e8aeeea..4252aa230f 100644
--- a/lib/chef/resource/deploy.rb
+++ b/lib/chef/resource/deploy.rb
@@ -77,7 +77,6 @@ class Chef
@shallow_clone = false
@scm_provider = Chef::Provider::Git
@svn_force_export = false
- @provider = Chef::Provider::Deploy::Timestamped
@allowed_actions.push(:force_deploy, :deploy, :rollback)
@additional_remotes = Hash[]
@keep_releases = 5
diff --git a/lib/chef/resource/deploy_revision.rb b/lib/chef/resource/deploy_revision.rb
index ceac26e91a..e144ce2162 100644
--- a/lib/chef/resource/deploy_revision.rb
+++ b/lib/chef/resource/deploy_revision.rb
@@ -22,14 +22,19 @@ class Chef
# Convenience class for using the deploy resource with the revision
# deployment strategy (provider)
class DeployRevision < Chef::Resource::Deploy
+
+ provides :deploy_revision
+
def initialize(*args, &block)
super
@resource_name = :deploy_revision
- @provider = Chef::Provider::Deploy::Revision
end
end
class DeployBranch < Chef::Resource::DeployRevision
+
+ provides :deploy_branch
+
def initialize(*args, &block)
super
@resource_name = :deploy_branch
diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb
index 423c0bbe27..1ab7f0d16d 100644
--- a/lib/chef/resource/directory.rb
+++ b/lib/chef/resource/directory.rb
@@ -32,7 +32,7 @@ class Chef
include Chef::Mixin::Securable
- provides :directory, :on_platforms => :all
+ provides :directory
def initialize(name, run_context=nil)
super
@@ -41,7 +41,6 @@ class Chef
@action = :create
@recursive = false
@allowed_actions.push(:create, :delete)
- @provider = Chef::Provider::Directory
end
def recursive(arg=nil)
diff --git a/lib/chef/resource/dpkg_package.rb b/lib/chef/resource/dpkg_package.rb
index 2fb5b5c249..35a47e8a82 100644
--- a/lib/chef/resource/dpkg_package.rb
+++ b/lib/chef/resource/dpkg_package.rb
@@ -23,10 +23,11 @@ class Chef
class Resource
class DpkgPackage < Chef::Resource::Package
+ provides :dpkg_package, os: "linux"
+
def initialize(name, run_context=nil)
super
@resource_name = :dpkg_package
- @provider = Chef::Provider::Package::Dpkg
end
end
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index 76ac6659d6..82907c25db 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -22,13 +22,12 @@ class Chef
class Resource
class DscScript < Chef::Resource
- provides :dsc_script, :on_platforms => ["windows"]
+ provides :dsc_script, platform: "windows"
def initialize(name, run_context=nil)
super
@allowed_actions.push(:run)
@action = :run
- @provider = Chef::Provider::DscScript
@resource_name = :dsc_script
end
diff --git a/lib/chef/resource/easy_install_package.rb b/lib/chef/resource/easy_install_package.rb
index f25e1ac22f..5286e9a289 100644
--- a/lib/chef/resource/easy_install_package.rb
+++ b/lib/chef/resource/easy_install_package.rb
@@ -22,10 +22,11 @@ class Chef
class Resource
class EasyInstallPackage < Chef::Resource::Package
+ provides :easy_install_package
+
def initialize(name, run_context=nil)
super
@resource_name = :easy_install_package
- @provider = Chef::Provider::Package::EasyInstall
end
def easy_install_binary(arg=nil)
diff --git a/lib/chef/resource/erl_call.rb b/lib/chef/resource/erl_call.rb
index 959856af66..24009d51c7 100644
--- a/lib/chef/resource/erl_call.rb
+++ b/lib/chef/resource/erl_call.rb
@@ -18,6 +18,7 @@
#
require 'chef/resource'
+require 'chef/provider/erl_call'
class Chef
class Resource
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 7c4fa48c0a..980035b079 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -18,6 +18,7 @@
#
require 'chef/resource'
+require 'chef/provider/execute'
class Chef
class Resource
@@ -35,12 +36,12 @@ class Chef
@cwd = nil
@environment = nil
@group = nil
- @path = nil
@returns = 0
@timeout = nil
@user = nil
@allowed_actions.push(:run)
@umask = nil
+ @default_guard_interpreter = :execute
end
def umask(arg=nil)
@@ -93,14 +94,6 @@ class Chef
)
end
- def path(arg=nil)
- set_or_return(
- :path,
- arg,
- :kind_of => [ Array ]
- )
- end
-
def returns(arg=nil)
set_or_return(
:returns,
@@ -125,6 +118,30 @@ class Chef
)
end
+ def self.set_guard_inherited_attributes(*inherited_attributes)
+ @class_inherited_attributes = inherited_attributes
+ end
+
+ def self.guard_inherited_attributes(*inherited_attributes)
+ # Similar to patterns elsewhere, return attributes from this
+ # class and superclasses as a form of inheritance
+ ancestor_attributes = []
+
+ if superclass.respond_to?(:guard_inherited_attributes)
+ ancestor_attributes = superclass.guard_inherited_attributes
+ end
+
+ ancestor_attributes.concat(@class_inherited_attributes ? @class_inherited_attributes : []).uniq
+ end
+
+ set_guard_inherited_attributes(
+ :cwd,
+ :environment,
+ :group,
+ :user,
+ :umask
+ )
+
end
end
end
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index 3c1f4785ef..16491f9bc8 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -19,7 +19,6 @@
require 'chef/resource'
require 'chef/platform/query_helpers'
-require 'chef/provider/file'
require 'chef/mixin/securable'
class Chef
@@ -38,7 +37,7 @@ class Chef
attr_writer :checksum
- provides :file, :on_platforms => :all
+ provides :file
def initialize(name, run_context=nil)
super
@@ -47,7 +46,6 @@ class Chef
@backup = 5
@action = "create"
@allowed_actions.push(:create, :delete, :touch, :create_if_missing)
- @provider = Chef::Provider::File
@atomic_update = Chef::Config[:file_atomic_update]
@force_unlink = false
@manage_symlink_source = nil
diff --git a/lib/chef/resource/freebsd_package.rb b/lib/chef/resource/freebsd_package.rb
index 40cc63fc55..9c8db506f8 100644
--- a/lib/chef/resource/freebsd_package.rb
+++ b/lib/chef/resource/freebsd_package.rb
@@ -29,29 +29,17 @@ class Chef
class FreebsdPackage < Chef::Resource::Package
include Chef::Mixin::ShellOut
- provides :package, :on_platforms => ["freebsd"]
-
- attr_accessor :created_as_type
+ provides :package, platform: "freebsd"
def initialize(name, run_context=nil)
super
@resource_name = :freebsd_package
- @created_as_type = "freebsd_package"
end
def after_created
assign_provider
end
- # This resource can be invoked with multiple names package & freebsd_package.
- # We override the to_s method to ensure the key in resource collection
- # matches the type resource is declared as using created_as_type. This
- # logic can be removed once Chef does this for all resource in Chef 12:
- # https://github.com/opscode/chef/issues/1817
- def to_s
- "#{created_as_type}[#{name}]"
- end
-
def supports_pkgng?
ships_with_pkgng? || !!shell_out!("make -V WITH_PKGNG", :env => nil).stdout.match(/yes/i)
end
diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb
index 6def7b6653..631aa13f56 100644
--- a/lib/chef/resource/gem_package.rb
+++ b/lib/chef/resource/gem_package.rb
@@ -22,10 +22,11 @@ class Chef
class Resource
class GemPackage < Chef::Resource::Package
+ provides :gem_package
+
def initialize(name, run_context=nil)
super
@resource_name = :gem_package
- @provider = Chef::Provider::Package::Rubygems
end
def source(arg=nil)
diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb
index 774bb24f24..7156873315 100644
--- a/lib/chef/resource/git.rb
+++ b/lib/chef/resource/git.rb
@@ -22,10 +22,11 @@ class Chef
class Resource
class Git < Chef::Resource::Scm
+ provides :git
+
def initialize(name, run_context=nil)
super
@resource_name = :git
- @provider = Chef::Provider::Git
@additional_remotes = Hash[]
end
diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb
index e1d50c1739..952552e3a8 100644
--- a/lib/chef/resource/homebrew_package.rb
+++ b/lib/chef/resource/homebrew_package.rb
@@ -25,10 +25,11 @@ class Chef
class Resource
class HomebrewPackage < Chef::Resource::Package
+ provides :homebrew_package, os: "mac_os_x"
+
def initialize(name, run_context=nil)
super
@resource_name = :homebrew_package
- @provider = Chef::Provider::Package::Homebrew
@homebrew_user = nil
end
diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb
index 47f6286fb4..ccb0a26629 100644
--- a/lib/chef/resource/http_request.rb
+++ b/lib/chef/resource/http_request.rb
@@ -18,6 +18,7 @@
#
require 'chef/resource'
+require 'chef/provider/http_request'
class Chef
class Resource
diff --git a/lib/chef/resource/ips_package.rb b/lib/chef/resource/ips_package.rb
index 88c6e9a538..77b3387946 100644
--- a/lib/chef/resource/ips_package.rb
+++ b/lib/chef/resource/ips_package.rb
@@ -22,10 +22,12 @@ require 'chef/provider/package/ips'
class Chef
class Resource
class IpsPackage < ::Chef::Resource::Package
+
+ provides :ips_package, os: "solaris2"
+
def initialize(name, run_context = nil)
super(name, run_context)
@resource_name = :ips_package
- @provider = Chef::Provider::Package::Ips
@allowed_actions = [ :install, :remove, :upgrade ]
@accept_license = false
end
diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb
index e53b386a74..8726eded1d 100644
--- a/lib/chef/resource/link.rb
+++ b/lib/chef/resource/link.rb
@@ -25,7 +25,7 @@ class Chef
class Link < Chef::Resource
include Chef::Mixin::Securable
- provides :link, :on_platform => :all
+ provides :link
identity_attr :target_file
@@ -40,7 +40,6 @@ class Chef
@link_type = :symbolic
@target_file = name
@allowed_actions.push(:create, :delete)
- @provider = Chef::Provider::Link
end
def to(arg=nil)
diff --git a/lib/chef/resource/log.rb b/lib/chef/resource/log.rb
index 391c3b5393..7f970a87a4 100644
--- a/lib/chef/resource/log.rb
+++ b/lib/chef/resource/log.rb
@@ -16,6 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+require 'chef/resource'
+require 'chef/provider/log'
+
class Chef
class Resource
class Log < Chef::Resource
diff --git a/lib/chef/resource/macports_package.rb b/lib/chef/resource/macports_package.rb
index c9434c9e69..bdc8698155 100644
--- a/lib/chef/resource/macports_package.rb
+++ b/lib/chef/resource/macports_package.rb
@@ -19,10 +19,12 @@
class Chef
class Resource
class MacportsPackage < Chef::Resource::Package
+
+ provides :macports_package, os: "mac_os_x"
+
def initialize(name, run_context=nil)
super
@resource_name = :macports_package
- @provider = Chef::Provider::Package::Macports
end
end
end
diff --git a/lib/chef/resource/openbsd_package.rb b/lib/chef/resource/openbsd_package.rb
new file mode 100644
index 0000000000..20a2523e3a
--- /dev/null
+++ b/lib/chef/resource/openbsd_package.rb
@@ -0,0 +1,51 @@
+#
+# Authors:: AJ Christensen (<aj@opscode.com>)
+# Richard Manyanza (<liseki@nyikacraftsmen.com>)
+# Scott Bonds (<scott@ggr.com>)
+# Copyright:: Copyright (c) 2008 Opscode, Inc.
+# Copyright:: Copyright (c) 2014 Richard Manyanza, Scott Bonds
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/resource/package'
+require 'chef/provider/package/openbsd'
+require 'chef/mixin/shell_out'
+
+class Chef
+ class Resource
+ class OpenbsdPackage < Chef::Resource::Package
+ include Chef::Mixin::ShellOut
+
+ provides :package, os: "openbsd"
+
+ def initialize(name, run_context=nil)
+ super
+ @resource_name = :openbsd_package
+ end
+
+ def after_created
+ assign_provider
+ end
+
+ private
+
+ def assign_provider
+ @provider = Chef::Provider::Package::Openbsd
+ end
+
+ end
+ end
+end
+
diff --git a/lib/chef/resource/pacman_package.rb b/lib/chef/resource/pacman_package.rb
index 2894e415ac..4c45dd004f 100644
--- a/lib/chef/resource/pacman_package.rb
+++ b/lib/chef/resource/pacman_package.rb
@@ -22,10 +22,11 @@ class Chef
class Resource
class PacmanPackage < Chef::Resource::Package
+ provides :pacman_package, os: "linux"
+
def initialize(name, run_context=nil)
super
@resource_name = :pacman_package
- @provider = Chef::Provider::Package::Pacman
end
end
diff --git a/lib/chef/resource/paludis_package.rb b/lib/chef/resource/paludis_package.rb
index fde25e69b3..7eddf8690b 100644
--- a/lib/chef/resource/paludis_package.rb
+++ b/lib/chef/resource/paludis_package.rb
@@ -22,10 +22,12 @@ require 'chef/provider/package/paludis'
class Chef
class Resource
class PaludisPackage < Chef::Resource::Package
+
+ provides :paludis_package, os: "linux"
+
def initialize(name, run_context=nil)
super(name, run_context)
@resource_name = :paludis_package
- @provider = Chef::Provider::Package::Paludis
@allowed_actions = [ :install, :remove, :upgrade ]
@timeout = 3600
end
diff --git a/lib/chef/resource/perl.rb b/lib/chef/resource/perl.rb
index 546f639e1f..c4bdb6e130 100644
--- a/lib/chef/resource/perl.rb
+++ b/lib/chef/resource/perl.rb
@@ -17,6 +17,7 @@
#
require 'chef/resource/script'
+require 'chef/provider/script'
class Chef
class Resource
diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb
index 1b47e7411a..a88fb5701b 100644
--- a/lib/chef/resource/powershell_script.rb
+++ b/lib/chef/resource/powershell_script.rb
@@ -21,8 +21,6 @@ class Chef
class Resource
class PowershellScript < Chef::Resource::WindowsScript
- set_guard_inherited_attributes(:architecture)
-
def initialize(name, run_context=nil)
super(name, run_context, :powershell_script, "powershell.exe")
@convert_boolean_return = false
diff --git a/lib/chef/resource/python.rb b/lib/chef/resource/python.rb
index f340afdb39..b1f23d13ce 100644
--- a/lib/chef/resource/python.rb
+++ b/lib/chef/resource/python.rb
@@ -1,4 +1,3 @@
-#
# Author:: Adam Jacob (<adam@opscode.com>)
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
@@ -17,6 +16,7 @@
#
require 'chef/resource/script'
+require 'chef/provider/script'
class Chef
class Resource
diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb
index 0f7e0eb5de..d4108da47a 100644
--- a/lib/chef/resource/remote_directory.rb
+++ b/lib/chef/resource/remote_directory.rb
@@ -26,7 +26,7 @@ class Chef
class RemoteDirectory < Chef::Resource::Directory
include Chef::Mixin::Securable
- provides :remote_directory, :on_platforms => :all
+ provides :remote_directory
identity_attr :path
@@ -48,7 +48,6 @@ class Chef
@overwrite = true
@allowed_actions.push(:create, :create_if_missing, :delete)
@cookbook = nil
- @provider = Chef::Provider::RemoteDirectory
end
if Chef::Platform.windows?
diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb
index 6334b1bf44..46516fd3fb 100644
--- a/lib/chef/resource/remote_file.rb
+++ b/lib/chef/resource/remote_file.rb
@@ -26,7 +26,7 @@ class Chef
class RemoteFile < Chef::Resource::File
include Chef::Mixin::Securable
- provides :remote_file, :on_platforms => :all
+ provides :remote_file
def initialize(name, run_context=nil)
super
diff --git a/lib/chef/resource/rpm_package.rb b/lib/chef/resource/rpm_package.rb
index 200a9633ce..8634f1e25d 100644
--- a/lib/chef/resource/rpm_package.rb
+++ b/lib/chef/resource/rpm_package.rb
@@ -23,10 +23,11 @@ class Chef
class Resource
class RpmPackage < Chef::Resource::Package
+ provides :rpm_package, os: [ "linux", "aix" ]
+
def initialize(name, run_context=nil)
super
@resource_name = :rpm_package
- @provider = Chef::Provider::Package::Rpm
end
end
diff --git a/lib/chef/resource/ruby.rb b/lib/chef/resource/ruby.rb
index 605d27b00d..2b2aa0249d 100644
--- a/lib/chef/resource/ruby.rb
+++ b/lib/chef/resource/ruby.rb
@@ -17,6 +17,7 @@
#
require 'chef/resource/script'
+require 'chef/provider/script'
class Chef
class Resource
diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb
index d9b8954a90..a9cbf234cf 100644
--- a/lib/chef/resource/ruby_block.rb
+++ b/lib/chef/resource/ruby_block.rb
@@ -17,6 +17,9 @@
# limitations under the License.
#
+require 'chef/resource'
+require 'chef/provider/ruby_block'
+
class Chef
class Resource
class RubyBlock < Chef::Resource
diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb
index 6f66fb9094..479295922c 100644
--- a/lib/chef/resource/script.rb
+++ b/lib/chef/resource/script.rb
@@ -18,6 +18,7 @@
#
require 'chef/resource/execute'
+require 'chef/provider/script'
class Chef
class Resource
@@ -32,6 +33,7 @@ class Chef
@code = nil
@interpreter = nil
@flags = nil
+ @default_guard_interpreter = :default
end
def code(arg=nil)
@@ -58,31 +60,6 @@ class Chef
)
end
- def self.set_guard_inherited_attributes(*inherited_attributes)
- @class_inherited_attributes = inherited_attributes
- end
-
- def self.guard_inherited_attributes(*inherited_attributes)
- # Similar to patterns elsewhere, return attributes from this
- # class and superclasses as a form of inheritance
- ancestor_attributes = []
-
- if superclass.respond_to?(:guard_inherited_attributes)
- ancestor_attributes = superclass.guard_inherited_attributes
- end
-
- ancestor_attributes.concat(@class_inherited_attributes ? @class_inherited_attributes : []).uniq
- end
-
- set_guard_inherited_attributes(
- :cwd,
- :environment,
- :group,
- :path,
- :user,
- :umask
- )
-
end
end
end
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb
index 4d64c3e3f4..36df7c859a 100644
--- a/lib/chef/resource/service.rb
+++ b/lib/chef/resource/service.rb
@@ -46,10 +46,6 @@ class Chef
@action = "nothing"
@supports = { :restart => false, :reload => false, :status => false }
@allowed_actions.push(:enable, :disable, :start, :stop, :restart, :reload)
-
- if(run_context && run_context.node[:init_package] == "systemd")
- @provider = Chef::Provider::Service::Systemd
- end
end
def service_name(arg=nil)
diff --git a/lib/chef/resource/smartos_package.rb b/lib/chef/resource/smartos_package.rb
index 0f4f6d8b0a..99b3b953b0 100644
--- a/lib/chef/resource/smartos_package.rb
+++ b/lib/chef/resource/smartos_package.rb
@@ -23,16 +23,15 @@ class Chef
class Resource
class SmartosPackage < Chef::Resource::Package
+ provides :smartos_package
+ provides :package, os: "solaris2", platform_family: "smartos"
+
def initialize(name, run_context=nil)
super
@resource_name = :smartos_package
- @provider = Chef::Provider::Package::SmartOS
end
end
end
end
-# Backwards compatability
-# @todo remove in Chef 12
-Chef::Resource::SmartOSPackage = Chef::Resource::SmartosPackage
diff --git a/lib/chef/resource/solaris_package.rb b/lib/chef/resource/solaris_package.rb
index 3513703076..94be4693b6 100644
--- a/lib/chef/resource/solaris_package.rb
+++ b/lib/chef/resource/solaris_package.rb
@@ -24,10 +24,16 @@ class Chef
class Resource
class SolarisPackage < Chef::Resource::Package
+ provides :solaris_package
+ provides :package, os: "solaris2", platform_family: "nexentacore"
+ provides :package, os: "solaris2", platform_family: "solaris2" do |node|
+ # on >= Solaris 11 we default to IPS packages instead
+ node[:platform_version].to_f <= 5.10
+ end
+
def initialize(name, run_context=nil)
super
@resource_name = :solaris_package
- @provider = Chef::Provider::Package::Solaris
end
end
diff --git a/lib/chef/resource/subversion.rb b/lib/chef/resource/subversion.rb
index 44158cb080..3afbe0baaf 100644
--- a/lib/chef/resource/subversion.rb
+++ b/lib/chef/resource/subversion.rb
@@ -28,7 +28,6 @@ class Chef
@svn_arguments = '--no-auth-cache'
@svn_info_args = '--no-auth-cache'
@resource_name = :subversion
- @provider = Chef::Provider::Subversion
allowed_actions << :force_export
end
diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb
index 8473f5b677..8c9607ee07 100644
--- a/lib/chef/resource/template.rb
+++ b/lib/chef/resource/template.rb
@@ -27,7 +27,7 @@ class Chef
class Template < Chef::Resource::File
include Chef::Mixin::Securable
- provides :template, :on_platforms => :all
+ provides :template
attr_reader :inline_helper_blocks
attr_reader :inline_helper_modules
@@ -40,7 +40,6 @@ class Chef
@cookbook = nil
@local = false
@variables = Hash.new
- @provider = Chef::Provider::Template
@inline_helper_blocks = {}
@inline_helper_modules = []
@helper_modules = []
diff --git a/lib/chef/resource/timestamped_deploy.rb b/lib/chef/resource/timestamped_deploy.rb
index 4032ae9854..b2109db85c 100644
--- a/lib/chef/resource/timestamped_deploy.rb
+++ b/lib/chef/resource/timestamped_deploy.rb
@@ -18,13 +18,12 @@
class Chef
class Resource
-
# Convenience class for using the deploy resource with the timestamped
# deployment strategy (provider)
class TimestampedDeploy < Chef::Resource::Deploy
+ provides :timestamped_deploy
def initialize(*args, &block)
super(*args, &block)
- @provider = Chef::Provider::Deploy::Timestamped
end
end
end
diff --git a/lib/chef/resource/whyrun_safe_ruby_block.rb b/lib/chef/resource/whyrun_safe_ruby_block.rb
index ddb9d91dc3..6fa5383f5d 100644
--- a/lib/chef/resource/whyrun_safe_ruby_block.rb
+++ b/lib/chef/resource/whyrun_safe_ruby_block.rb
@@ -23,7 +23,6 @@ class Chef
def initialize(name, run_context=nil)
super
@resource_name = :whyrun_safe_ruby_block
- @provider = Chef::Provider::WhyrunSafeRubyBlock
end
end
diff --git a/lib/chef/resource/windows_package.rb b/lib/chef/resource/windows_package.rb
index 8bd41e0cb7..b1ef2c288e 100644
--- a/lib/chef/resource/windows_package.rb
+++ b/lib/chef/resource/windows_package.rb
@@ -24,12 +24,12 @@ class Chef
class Resource
class WindowsPackage < Chef::Resource::Package
- provides :package, :on_platforms => ["windows"]
+ provides :package, os: "windows"
+ provides :windows_package, os: "windows"
def initialize(name, run_context=nil)
super
@allowed_actions = [ :install, :remove ]
- @provider = Chef::Provider::Package::Windows
@resource_name = :windows_package
@source ||= source(@package_name)
@@ -44,7 +44,7 @@ class Chef
set_or_return(
:installer_type,
arg,
- :kind_of => [ String ]
+ :kind_of => [ Symbol ]
)
end
@@ -76,4 +76,3 @@ class Chef
end
end
end
-
diff --git a/lib/chef/resource/windows_script.rb b/lib/chef/resource/windows_script.rb
index 108891e9ba..6b0827b77c 100644
--- a/lib/chef/resource/windows_script.rb
+++ b/lib/chef/resource/windows_script.rb
@@ -23,12 +23,15 @@ class Chef
class Resource
class WindowsScript < Chef::Resource::Script
+ set_guard_inherited_attributes(:architecture)
+
protected
def initialize(name, run_context, resource_name, interpreter_command)
super(name, run_context)
@interpreter = interpreter_command
@resource_name = resource_name
+ @default_guard_interpreter = resource_name
end
include Chef::Mixin::WindowsArchitectureHelper
diff --git a/lib/chef/resource/windows_service.rb b/lib/chef/resource/windows_service.rb
index 5ed8e76cbd..2aec4d6304 100644
--- a/lib/chef/resource/windows_service.rb
+++ b/lib/chef/resource/windows_service.rb
@@ -25,7 +25,8 @@ class Chef
# Until #1773 is resolved, you need to manually specify the windows_service resource
# to use action :configure_startup and attribute startup_type
- # provides :service, :on_platforms => ["windows"]
+ provides :service, os: "windows"
+ provides :windows_service, os: "windows"
identity_attr :service_name
@@ -34,7 +35,6 @@ class Chef
def initialize(name, run_context=nil)
super
@resource_name = :windows_service
- @provider = Chef::Provider::Service::Windows
@allowed_actions.push(:configure_startup)
@startup_type = :automatic
end
diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb
index dff70bcf62..8fbca9b097 100644
--- a/lib/chef/resource/yum_package.rb
+++ b/lib/chef/resource/yum_package.rb
@@ -23,10 +23,12 @@ class Chef
class Resource
class YumPackage < Chef::Resource::Package
+ provides :yum_package
+ provides :package, os: "linux", platform_family: [ "rhel", "fedora" ]
+
def initialize(name, run_context=nil)
super
@resource_name = :yum_package
- @provider = Chef::Provider::Package::Yum
@flush_cache = { :before => false, :after => false }
@allow_downgrade = false
end
diff --git a/lib/chef/resource_collection.rb b/lib/chef/resource_collection.rb
index cc14a03962..4fd6fcad24 100644
--- a/lib/chef/resource_collection.rb
+++ b/lib/chef/resource_collection.rb
@@ -17,250 +17,73 @@
# limitations under the License.
#
-require 'chef/resource'
-require 'chef/resource_collection/stepable_iterator'
-
+require 'chef/resource_collection/resource_set'
+require 'chef/resource_collection/resource_list'
+require 'chef/resource_collection/resource_collection_serialization'
+require 'chef/log'
+require 'forwardable'
+
+##
+# ResourceCollection currently handles two tasks:
+# 1) Keeps an ordered list of resources to use when converging the node
+# 2) Keeps a unique list of resources (keyed as `type[name]`) used for notifications
class Chef
class ResourceCollection
- include Enumerable
-
- # Matches a multiple resource lookup specification,
- # e.g., "service[nginx,unicorn]"
- MULTIPLE_RESOURCE_MATCH = /^(.+)\[(.+?),(.+)\]$/
+ include ResourceCollectionSerialization
+ extend Forwardable
- # Matches a single resource lookup specification,
- # e.g., "service[nginx]"
- SINGLE_RESOURCE_MATCH = /^(.+)\[(.+)\]$/
-
- attr_reader :iterator
+ attr_reader :resource_set, :resource_list
+ private :resource_set, :resource_list
def initialize
- @resources = Array.new
- @resources_by_name = Hash.new
- @insert_after_idx = nil
- end
-
- def all_resources
- @resources
- end
-
- def [](index)
- @resources[index]
- end
-
- def []=(index, arg)
- is_chef_resource(arg)
- @resources[index] = arg
- @resources_by_name[arg.to_s] = index
- end
-
- def <<(*args)
- args.flatten.each do |a|
- is_chef_resource(a)
- @resources << a
- @resources_by_name[a.to_s] = @resources.length - 1
- end
- self
- end
-
- # 'push' is an alias method to <<
- alias_method :push, :<<
-
- def insert(resource)
- if @insert_after_idx
- # in the middle of executing a run, so any resources inserted now should
- # be placed after the most recent addition done by the currently executing
- # resource
- insert_at(@insert_after_idx + 1, resource)
- @insert_after_idx += 1
+ @resource_set = ResourceSet.new
+ @resource_list = ResourceList.new
+ end
+
+ # @param resource [Chef::Resource] The resource to insert
+ # @param resource_type [String,Symbol] If known, the resource type used in the recipe, Eg `package`, `execute`
+ # @param instance_name [String] If known, the recource name as used in the recipe, IE `vim` in `package 'vim'`
+ # This method is meant to be the 1 insert method necessary in the future. It should support all known use cases
+ # for writing into the ResourceCollection.
+ def insert(resource, opts={})
+ resource_type ||= opts[:resource_type] # Would rather use Ruby 2.x syntax, but oh well
+ instance_name ||= opts[:instance_name]
+ resource_list.insert(resource)
+ if !(resource_type.nil? && instance_name.nil?)
+ resource_set.insert_as(resource, resource_type, instance_name)
else
- is_chef_resource(resource)
- @resources << resource
- @resources_by_name[resource.to_s] = @resources.length - 1
+ resource_set.insert_as(resource)
end
end
- def insert_at(insert_at_index, *resources)
- resources.each do |resource|
- is_chef_resource(resource)
- end
- @resources.insert(insert_at_index, *resources)
- # update name -> location mappings and register new resource
- @resources_by_name.each_key do |key|
- @resources_by_name[key] += resources.size if @resources_by_name[key] >= insert_at_index
- end
- resources.each_with_index do |resource, i|
- @resources_by_name[resource.to_s] = insert_at_index + i
- end
+ # @deprecated
+ def []=(index, resource)
+ Chef::Log.warn("`[]=` is deprecated, use `insert` (which only inserts at the end)")
+ resource_list[index] = resource
+ resource_set.insert_as(resource)
end
- def each
- @resources.each do |resource|
- yield resource
+ # @deprecated
+ def push(*resources)
+ Chef::Log.warn("`push` is deprecated, use `insert`")
+ resources.flatten.each do |res|
+ insert(res)
end
+ self
end
- def execute_each_resource(&resource_exec_block)
- @iterator = StepableIterator.for_collection(@resources)
- @iterator.each_with_index do |resource, idx|
- @insert_after_idx = idx
- yield resource
- end
- end
-
- def each_index
- @resources.each_index do |i|
- yield i
- end
- end
-
- def empty?
- @resources.empty?
- end
-
- def lookup(resource)
- lookup_by = nil
- if resource.kind_of?(Chef::Resource)
- lookup_by = resource.to_s
- elsif resource.kind_of?(String)
- lookup_by = resource
- else
- raise ArgumentError, "Must pass a Chef::Resource or String to lookup"
- end
- res = @resources_by_name[lookup_by]
- unless res
- raise Chef::Exceptions::ResourceNotFound, "Cannot find a resource matching #{lookup_by} (did you define it first?)"
- end
- @resources[res]
- end
-
- # Find existing resources by searching the list of existing resources. Possible
- # forms are:
- #
- # find(:file => "foobar")
- # find(:file => [ "foobar", "baz" ])
- # find("file[foobar]", "file[baz]")
- # find("file[foobar,baz]")
- #
- # Returns the matching resource, or an Array of matching resources.
- #
- # Raises an ArgumentError if you feed it bad lookup information
- # Raises a Runtime Error if it can't find the resources you are looking for.
- def find(*args)
- results = Array.new
- args.each do |arg|
- case arg
- when Hash
- results << find_resource_by_hash(arg)
- when String
- results << find_resource_by_string(arg)
- else
- msg = "arguments to #{self.class.name}#find should be of the form :resource => 'name' or resource[name]"
- raise Chef::Exceptions::InvalidResourceSpecification, msg
- end
- end
- flat_results = results.flatten
- flat_results.length == 1 ? flat_results[0] : flat_results
- end
-
- # resources is a poorly named, but we have to maintain it for back
- # compat.
- alias_method :resources, :find
-
- # Returns true if +query_object+ is a valid string for looking up a
- # resource, or raises InvalidResourceSpecification if not.
- # === Arguments
- # * query_object should be a string of the form
- # "resource_type[resource_name]", a single element Hash (e.g., :service =>
- # "apache2"), or a Chef::Resource (this is the happy path). Other arguments
- # will raise an exception.
- # === Returns
- # * true returns true for all valid input.
- # === Raises
- # * Chef::Exceptions::InvalidResourceSpecification for all invalid input.
- def validate_lookup_spec!(query_object)
- case query_object
- when Chef::Resource
- true
- when SINGLE_RESOURCE_MATCH, MULTIPLE_RESOURCE_MATCH
- true
- when Hash
- true
- when String
- raise Chef::Exceptions::InvalidResourceSpecification,
- "The string `#{query_object}' is not valid for resource collection lookup. Correct syntax is `resource_type[resource_name]'"
- else
- raise Chef::Exceptions::InvalidResourceSpecification,
- "The object `#{query_object.inspect}' is not valid for resource collection lookup. " +
- "Use a String like `resource_type[resource_name]' or a Chef::Resource object"
- end
- end
-
- # Serialize this object as a hash
- def to_hash
- instance_vars = Hash.new
- self.instance_variables.each do |iv|
- instance_vars[iv] = self.instance_variable_get(iv)
- end
- {
- 'json_class' => self.class.name,
- 'instance_vars' => instance_vars
- }
- end
-
- def to_json(*a)
- Chef::JSONCompat.to_json(to_hash, *a)
- end
-
- def self.json_create(o)
- collection = self.new()
- o["instance_vars"].each do |k,v|
- collection.instance_variable_set(k.to_sym, v)
- end
- collection
- end
+ # @deprecated
+ alias_method :<<, :insert
- private
+ # Read-only methods are simple to delegate - doing that below
- def find_resource_by_hash(arg)
- results = Array.new
- arg.each do |resource_name, name_list|
- names = name_list.kind_of?(Array) ? name_list : [ name_list ]
- names.each do |name|
- res_name = "#{resource_name.to_s}[#{name}]"
- results << lookup(res_name)
- end
- end
- return results
- end
+ resource_list_methods = Enumerable.instance_methods +
+ [:iterator, :all_resources, :[], :each, :execute_each_resource, :each_index, :empty?] -
+ [:find] # find needs to run on the set
+ resource_set_methods = [:lookup, :find, :resources, :keys, :validate_lookup_spec!]
- def find_resource_by_string(arg)
- results = Array.new
- case arg
- when MULTIPLE_RESOURCE_MATCH
- resource_type = $1
- arg =~ /^.+\[(.+)\]$/
- resource_list = $1
- resource_list.split(",").each do |name|
- resource_name = "#{resource_type}[#{name}]"
- results << lookup(resource_name)
- end
- when SINGLE_RESOURCE_MATCH
- resource_type = $1
- name = $2
- resource_name = "#{resource_type}[#{name}]"
- results << lookup(resource_name)
- else
- raise ArgumentError, "Bad string format #{arg}, you must have a string like resource_type[name]!"
- end
- return results
- end
+ def_delegators :resource_list, *resource_list_methods
+ def_delegators :resource_set, *resource_set_methods
- def is_chef_resource(arg)
- unless arg.kind_of?(Chef::Resource)
- raise ArgumentError, "Cannot insert a #{arg.class} into a resource collection: must be a subclass of Chef::Resource"
- end
- true
- end
end
end
diff --git a/lib/chef/resource_collection/resource_collection_serialization.rb b/lib/chef/resource_collection/resource_collection_serialization.rb
new file mode 100644
index 0000000000..3651fb2a2a
--- /dev/null
+++ b/lib/chef/resource_collection/resource_collection_serialization.rb
@@ -0,0 +1,59 @@
+#
+# Author:: Tyler Ball (<tball@getchef.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+class Chef
+ class ResourceCollection
+ module ResourceCollectionSerialization
+ # Serialize this object as a hash
+ def to_hash
+ instance_vars = Hash.new
+ self.instance_variables.each do |iv|
+ instance_vars[iv] = self.instance_variable_get(iv)
+ end
+ {
+ 'json_class' => self.class.name,
+ 'instance_vars' => instance_vars
+ }
+ end
+
+ def to_json(*a)
+ Chef::JSONCompat.to_json(to_hash, *a)
+ end
+
+ def self.included(base)
+ base.extend(ClassMethods)
+ end
+
+ module ClassMethods
+ def json_create(o)
+ collection = self.new()
+ o["instance_vars"].each do |k,v|
+ collection.instance_variable_set(k.to_sym, v)
+ end
+ collection
+ end
+ end
+
+ def is_chef_resource!(arg)
+ unless arg.kind_of?(Chef::Resource)
+ raise ArgumentError, "Cannot insert a #{arg.class} into a resource collection: must be a subclass of Chef::Resource"
+ end
+ true
+ end
+ end
+ end
+end
diff --git a/lib/chef/resource_collection/resource_list.rb b/lib/chef/resource_collection/resource_list.rb
new file mode 100644
index 0000000000..a26bd347aa
--- /dev/null
+++ b/lib/chef/resource_collection/resource_list.rb
@@ -0,0 +1,89 @@
+#
+# Author:: Tyler Ball (<tball@getchef.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/resource'
+require 'chef/resource_collection/stepable_iterator'
+require 'chef/resource_collection/resource_collection_serialization'
+require 'forwardable'
+
+# This class keeps the list of all known Resources in the order they are to be executed in. It also keeps a pointer
+# to the most recently executed resource so we can add resources-to-execute after this point.
+class Chef
+ class ResourceCollection
+ class ResourceList
+ include ResourceCollection::ResourceCollectionSerialization
+ include Enumerable
+ extend Forwardable
+
+ attr_reader :iterator
+
+ attr_reader :resources
+ private :resources
+ # Delegate direct access methods to the @resources array
+ # 4 extra methods here are not included in the Enumerable's instance methods
+ direct_access_methods = Enumerable.instance_methods + [ :[], :each, :each_index, :empty? ]
+ def_delegators :resources, *(direct_access_methods)
+
+ def initialize
+ @resources = Array.new
+ @insert_after_idx = nil
+ end
+
+ # @param resource [Chef::Resource] The resource to insert
+ # If @insert_after_idx is nil, we are not currently executing a converge so the Resource is appended to the
+ # end of the list. If @insert_after_idx is NOT nil, we ARE currently executing a converge so the resource
+ # is inserted into the middle of the list after the last resource that was converged. If it is called multiple
+ # times (when an LWRP contains multiple resources) it keeps track of that. See this example ResourceList:
+ # [File1, LWRP1, File2] # The iterator starts and points to File1. It is executed and @insert_after_idx=0
+ # [File1, LWRP1, File2] # The iterator moves to LWRP1. It is executed and @insert_after_idx=1
+ # [File1, LWRP1, Service1, File2] # The LWRP execution inserts Service1 and @insert_after_idx=2
+ # [File1, LWRP1, Service1, Service2, File2] # The LWRP inserts Service2 and @insert_after_idx=3. The LWRP
+ # finishes executing
+ # [File1, LWRP1, Service1, Service2, File2] # The iterator moves to Service1 since it is the next non-executed
+ # resource. The execute_each_resource call below resets @insert_after_idx=2
+ # If Service1 was another LWRP, it would insert its resources between Service1 and Service2. The iterator keeps
+ # track of executed resources and @insert_after_idx keeps track of where the next resource to insert should be.
+ def insert(resource)
+ is_chef_resource!(resource)
+ if @insert_after_idx
+ @resources.insert(@insert_after_idx += 1, resource)
+ else
+ @resources << resource
+ end
+ end
+
+ # @deprecated - can be removed when it is removed from resource_collection.rb
+ def []=(index, resource)
+ @resources[index] = resource
+ end
+
+ def all_resources
+ @resources
+ end
+
+ def execute_each_resource(&resource_exec_block)
+ @iterator = ResourceCollection::StepableIterator.for_collection(@resources)
+ @iterator.each_with_index do |resource, idx|
+ @insert_after_idx = idx
+ yield resource
+ end
+ end
+
+ end
+ end
+end
diff --git a/lib/chef/resource_collection/resource_set.rb b/lib/chef/resource_collection/resource_set.rb
new file mode 100644
index 0000000000..6425c2ab08
--- /dev/null
+++ b/lib/chef/resource_collection/resource_set.rb
@@ -0,0 +1,170 @@
+#
+# Author:: Tyler Ball (<tball@getchef.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'chef/resource'
+require 'chef/resource_collection/resource_collection_serialization'
+
+class Chef
+ class ResourceCollection
+ class ResourceSet
+ include ResourceCollection::ResourceCollectionSerialization
+
+ # Matches a multiple resource lookup specification,
+ # e.g., "service[nginx,unicorn]"
+ MULTIPLE_RESOURCE_MATCH = /^(.+)\[(.+?),(.+)\]$/
+
+ # Matches a single resource lookup specification,
+ # e.g., "service[nginx]"
+ SINGLE_RESOURCE_MATCH = /^(.+)\[(.+)\]$/
+
+ def initialize
+ @resources_by_key = Hash.new
+ end
+
+ def keys
+ @resources_by_key.keys
+ end
+
+ def insert_as(resource, resource_type=nil, instance_name=nil)
+ is_chef_resource!(resource)
+ resource_type ||= resource.resource_name
+ instance_name ||= resource.name
+ key = ResourceSet.create_key(resource_type, instance_name)
+ @resources_by_key[key] = resource
+ end
+
+ def lookup(key)
+ case
+ when key.kind_of?(String)
+ lookup_by = key
+ when key.kind_of?(Chef::Resource)
+ lookup_by = ResourceSet.create_key(key.resource_name, key.name)
+ else
+ raise ArgumentError, "Must pass a Chef::Resource or String to lookup"
+ end
+
+ res = @resources_by_key[lookup_by]
+ unless res
+ raise Chef::Exceptions::ResourceNotFound, "Cannot find a resource matching #{lookup_by} (did you define it first?)"
+ end
+ res
+ end
+
+ # Find existing resources by searching the list of existing resources. Possible
+ # forms are:
+ #
+ # find(:file => "foobar")
+ # find(:file => [ "foobar", "baz" ])
+ # find("file[foobar]", "file[baz]")
+ # find("file[foobar,baz]")
+ #
+ # Returns the matching resource, or an Array of matching resources.
+ #
+ # Raises an ArgumentError if you feed it bad lookup information
+ # Raises a Runtime Error if it can't find the resources you are looking for.
+ def find(*args)
+ results = Array.new
+ args.each do |arg|
+ case arg
+ when Hash
+ results << find_resource_by_hash(arg)
+ when String
+ results << find_resource_by_string(arg)
+ else
+ msg = "arguments to #{self.class.name}#find should be of the form :resource => 'name' or 'resource[name]'"
+ raise Chef::Exceptions::InvalidResourceSpecification, msg
+ end
+ end
+ flat_results = results.flatten
+ flat_results.length == 1 ? flat_results[0] : flat_results
+ end
+
+ # @deprecated
+ # resources is a poorly named, but we have to maintain it for back
+ # compat.
+ alias_method :resources, :find
+
+ # Returns true if +query_object+ is a valid string for looking up a
+ # resource, or raises InvalidResourceSpecification if not.
+ # === Arguments
+ # * query_object should be a string of the form
+ # "resource_type[resource_name]", a single element Hash (e.g., :service =>
+ # "apache2"), or a Chef::Resource (this is the happy path). Other arguments
+ # will raise an exception.
+ # === Returns
+ # * true returns true for all valid input.
+ # === Raises
+ # * Chef::Exceptions::InvalidResourceSpecification for all invalid input.
+ def validate_lookup_spec!(query_object)
+ case query_object
+ when Chef::Resource
+ true
+ when SINGLE_RESOURCE_MATCH, MULTIPLE_RESOURCE_MATCH
+ true
+ when Hash
+ true
+ when String
+ raise Chef::Exceptions::InvalidResourceSpecification,
+ "The string `#{query_object}' is not valid for resource collection lookup. Correct syntax is `resource_type[resource_name]'"
+ else
+ raise Chef::Exceptions::InvalidResourceSpecification,
+ "The object `#{query_object.inspect}' is not valid for resource collection lookup. " +
+ "Use a String like `resource_type[resource_name]' or a Chef::Resource object"
+ end
+ end
+
+ def self.create_key(resource_type, instance_name)
+ "#{resource_type}[#{instance_name}]"
+ end
+
+ private
+
+ def find_resource_by_hash(arg)
+ results = Array.new
+ arg.each do |resource_type, name_list|
+ instance_names = name_list.kind_of?(Array) ? name_list : [ name_list ]
+ instance_names.each do |instance_name|
+ results << lookup(ResourceSet.create_key(resource_type, instance_name))
+ end
+ end
+ return results
+ end
+
+ def find_resource_by_string(arg)
+ results = Array.new
+ case arg
+ when MULTIPLE_RESOURCE_MATCH
+ resource_type = $1
+ arg =~ /^.+\[(.+)\]$/
+ resource_list = $1
+ resource_list.split(",").each do |instance_name|
+ results << lookup(ResourceSet.create_key(resource_type, instance_name))
+ end
+ when SINGLE_RESOURCE_MATCH
+ resource_type = $1
+ name = $2
+ results << lookup(ResourceSet.create_key(resource_type, name))
+ else
+ raise ArgumentError, "Bad string format #{arg}, you must have a string like resource_type[name]!"
+ end
+ return results
+ end
+
+ end
+ end
+end
diff --git a/lib/chef/resource_platform_map.rb b/lib/chef/resource_platform_map.rb
deleted file mode 100644
index a678f5be4b..0000000000
--- a/lib/chef/resource_platform_map.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-#
-# Author:: Seth Chisamore (<schisamo@opscode.com>)
-# Copyright:: Copyright (c) 2011 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require 'chef/mixin/params_validate'
-require 'chef/mixin/convert_to_class_name'
-
-class Chef
- class Resource
- class PlatformMap
-
- include Chef::Mixin::ParamsValidate
- include Chef::Mixin::ConvertToClassName
-
- attr_reader :map
-
- def initialize(map={:default => {}})
- @map = map
- end
-
- def filter(platform, version)
- resource_map = map[:default].clone
- platform_sym = platform
- if platform.kind_of?(String)
- platform.downcase!
- platform.gsub!(/\s/, "_")
- platform_sym = platform.to_sym
- end
-
- if map.has_key?(platform_sym)
- if map[platform_sym].has_key?(version)
- if map[platform_sym].has_key?(:default)
- resource_map.merge!(map[platform_sym][:default])
- end
- resource_map.merge!(map[platform_sym][version])
- elsif map[platform_sym].has_key?(:default)
- resource_map.merge!(map[platform_sym][:default])
- end
- end
- resource_map
- end
-
- def set(args)
- validate(
- args,
- {
- :platform => {
- :kind_of => Symbol,
- :required => false
- },
- :version => {
- :kind_of => String,
- :required => false
- },
- :short_name => {
- :kind_of => Symbol,
- :required => true
- },
- :resource => {
- :kind_of => [ String, Symbol, Class ],
- :required => true
- }
- }
- )
- if args.has_key?(:platform)
- if args.has_key?(:version)
- if map.has_key?(args[:platform])
- if map[args[:platform]].has_key?(args[:version])
- map[args[:platform]][args[:version]][args[:short_name].to_sym] = args[:resource]
- else
- map[args[:platform]][args[:version]] = {
- args[:short_name].to_sym => args[:resource]
- }
- end
- else
- map[args[:platform]] = {
- args[:version] => {
- args[:short_name].to_sym => args[:resource]
- }
- }
- end
- else
- if map.has_key?(args[:platform])
- if map[args[:platform]].has_key?(:default)
- map[args[:platform]][:default][args[:short_name].to_sym] = args[:resource]
- else
- map[args[:platform]] = { :default => { args[:short_name].to_sym => args[:resource] } }
- end
- else
- map[args[:platform]] = {
- :default => {
- args[:short_name].to_sym => args[:resource]
- }
- }
- end
- end
- else
- if map.has_key?(:default)
- map[:default][args[:short_name].to_sym] = args[:resource]
- else
- map[:default] = {
- args[:short_name].to_sym => args[:resource]
- }
- end
- end
- end
-
- def get(short_name, platform=nil, version=nil)
- resource_klass = platform_resource(short_name, platform, version) ||
- resource_matching_short_name(short_name)
-
- raise Exceptions::NoSuchResourceType, "Cannot find a resource for #{short_name} on #{platform} version #{version}" if resource_klass.nil?
-
- resource_klass
- end
-
- private
-
- def platform_resource(short_name, platform, version)
- pmap = filter(platform, version)
- rtkey = short_name.kind_of?(Chef::Resource) ? short_name.resource_name.to_sym : short_name
-
- pmap.has_key?(rtkey) ? pmap[rtkey] : nil
- end
-
- def resource_matching_short_name(short_name)
- begin
- rname = convert_to_class_name(short_name.to_s)
- Chef::Resource.const_get(rname)
- rescue NameError
- nil
- end
- end
-
- end
- end
-end
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb
index a19f26125e..1816fc857d 100644
--- a/lib/chef/resource_reporter.rb
+++ b/lib/chef/resource_reporter.rb
@@ -20,7 +20,7 @@
#
require 'uri'
-require 'chef/monkey_patches/securerandom'
+require 'securerandom'
require 'chef/event_dispatch/base'
class Chef
diff --git a/lib/chef/resources.rb b/lib/chef/resources.rb
index 5b938095c6..680b393741 100644
--- a/lib/chef/resources.rb
+++ b/lib/chef/resources.rb
@@ -48,6 +48,7 @@ require 'chef/resource/macports_package'
require 'chef/resource/mdadm'
require 'chef/resource/mount'
require 'chef/resource/ohai'
+require 'chef/resource/openbsd_package'
require 'chef/resource/package'
require 'chef/resource/pacman_package'
require 'chef/resource/paludis_package'
@@ -78,3 +79,10 @@ require 'chef/resource/windows_package'
require 'chef/resource/yum_package'
require 'chef/resource/lwrp_base'
require 'chef/resource/bff_package'
+
+begin
+ # Optional resources chef_node, chef_client, machine, machine_image, etc.
+ require 'cheffish'
+ require 'chef/provisioning'
+rescue LoadError
+end
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb
index bbe2f9eba0..1a2d7ba3a3 100644
--- a/lib/chef/run_context.rb
+++ b/lib/chef/run_context.rb
@@ -82,7 +82,6 @@ class Chef
@reboot_info = {}
@node.run_context = self
-
@cookbook_compiler = nil
end
diff --git a/lib/chef/run_list/run_list_expansion.rb b/lib/chef/run_list/run_list_expansion.rb
index 73665f39e7..46b45f1d9e 100644
--- a/lib/chef/run_list/run_list_expansion.rb
+++ b/lib/chef/run_list/run_list_expansion.rb
@@ -96,8 +96,8 @@ class Chef
end
def apply_role_attributes(role)
- @default_attrs = Chef::Mixin::DeepMerge.role_merge(@default_attrs, role.default_attributes)
- @override_attrs = Chef::Mixin::DeepMerge.role_merge(@override_attrs, role.override_attributes)
+ @default_attrs = Chef::Mixin::DeepMerge.merge(@default_attrs, role.default_attributes)
+ @override_attrs = Chef::Mixin::DeepMerge.merge(@override_attrs, role.override_attributes)
end
def applied_role?(role_name)
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index 33c10e22a6..fed32b3795 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -308,9 +308,9 @@ FOOTER
elsif ENV['HOME'] && ::File.exist?(File.join(ENV['HOME'], '.chef', 'chef_shell.rb'))
File.join(ENV['HOME'], '.chef', 'chef_shell.rb')
elsif config[:solo]
- "/etc/chef/solo.rb"
+ Chef::Config.platform_specific_path("/etc/chef/solo.rb")
elsif config[:client]
- "/etc/chef/client.rb"
+ Chef::Config.platform_specific_path("/etc/chef/client.rb")
else
nil
end
diff --git a/lib/chef/shell/ext.rb b/lib/chef/shell/ext.rb
index bc4e955169..fd785e2f79 100644
--- a/lib/chef/shell/ext.rb
+++ b/lib/chef/shell/ext.rb
@@ -547,7 +547,7 @@ E
desc "list all the resources on the current recipe"
def resources(*args)
if args.empty?
- pp run_context.resource_collection.instance_variable_get(:@resources_by_name).keys
+ pp run_context.resource_collection.keys
else
pp resources = original_resources(*args)
resources
diff --git a/lib/chef/util/dsc/local_configuration_manager.rb b/lib/chef/util/dsc/local_configuration_manager.rb
index 7395dd5bbf..f498a2bfea 100644
--- a/lib/chef/util/dsc/local_configuration_manager.rb
+++ b/lib/chef/util/dsc/local_configuration_manager.rb
@@ -79,17 +79,21 @@ EOH
end
def log_what_if_exception(what_if_exception_output)
- if what_if_exception_output.gsub(/\s+/, ' ') =~ /A parameter cannot be found that matches parameter name 'Whatif'/i
- # LCM returns an error if any of the resources do not support the opptional What-If
- Chef::Log::warn("Received error while testing configuration due to resource not supporting 'WhatIf'")
- elsif output_has_dsc_module_failure?(what_if_exception_output)
- Chef::Log::warn("Received error while testing configuration due to a module for an imported resource possibly not being fully installed:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
- else
- Chef::Log::warn("Received error while testing configuration:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
- end
+ if whatif_not_supported?(what_if_exception_output)
+ # LCM returns an error if any of the resources do not support the opptional What-If
+ Chef::Log::warn("Received error while testing configuration due to resource not supporting 'WhatIf'")
+ elsif dsc_module_import_failure?(what_if_exception_output)
+ Chef::Log::warn("Received error while testing configuration due to a module for an imported resource possibly not being fully installed:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
+ else
+ Chef::Log::warn("Received error while testing configuration:\n#{what_if_exception_output.gsub(/\s+/, ' ')}")
+ end
+ end
+
+ def whatif_not_supported?(what_if_exception_output)
+ !! (what_if_exception_output.gsub(/[\r\n]+/, '').gsub(/\s+/, ' ') =~ /A parameter cannot be found that matches parameter name 'Whatif'/i)
end
- def output_has_dsc_module_failure?(what_if_output)
+ def dsc_module_import_failure?(what_if_output)
!! (what_if_output =~ /\sCimException/ &&
what_if_output =~ /ProviderOperationExecutionFailure/ &&
what_if_output =~ /\smodule\s+is\s+installed/)
diff --git a/lib/chef/util/selinux.rb b/lib/chef/util/selinux.rb
index 92d5756552..778da042e3 100644
--- a/lib/chef/util/selinux.rb
+++ b/lib/chef/util/selinux.rb
@@ -21,6 +21,7 @@
# limitations under the License.
require 'chef/mixin/shell_out'
+require 'chef/mixin/which'
class Chef
class Util
@@ -32,6 +33,7 @@ class Chef
module Selinux
include Chef::Mixin::ShellOut
+ include Chef::Mixin::Which
# We want to initialize below variables once during a
# chef-client run therefore they are class variables.
@@ -67,15 +69,6 @@ class Chef
@@selinuxenabled_path
end
- def which(cmd)
- paths = ENV['PATH'].split(File::PATH_SEPARATOR) + [ '/bin', '/usr/bin', '/sbin', '/usr/sbin' ]
- paths.each do |path|
- filename = File.join(path, cmd)
- return filename if File.executable?(filename)
- end
- false
- end
-
def check_selinux_enabled?
if selinuxenabled_path
cmd = shell_out!(selinuxenabled_path, :returns => [0,1])
@@ -97,4 +90,3 @@ class Chef
end
end
end
-
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index b2d3fe57ee..e0aa4c47c5 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -17,7 +17,7 @@
class Chef
CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
- VERSION = '12.0.0.alpha.2'
+ VERSION = '12.2.0.dev.0'
end
#
diff --git a/pedant.gemfile b/pedant.gemfile
index d4ac849707..baa3e9aece 100644
--- a/pedant.gemfile
+++ b/pedant.gemfile
@@ -2,7 +2,6 @@ source "https://rubygems.org"
gemspec :name => "chef"
gem 'rest-client', :github => 'opscode/rest-client', :branch => 'lcg/1.6.7-version-lying'
-gem 'chef-pedant', :github => 'opscode/chef-pedant', :branch => "metadata-name-fix"
# TODO figure out how to grab this stuff from the main Gemfile
gem "activesupport", "< 4.0.0", :group => :compat_testing, :platform => "ruby"
diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb
index 4a0fdff8f8..00ff0f702a 100644
--- a/spec/functional/application_spec.rb
+++ b/spec/functional/application_spec.rb
@@ -52,7 +52,7 @@ describe Chef::Application do
shell_out("echo $http_proxy")
end
- so.stdout.chomp.should == "http://proxy.example.org:8080"
+ expect(so.stdout.chomp).to eq("http://proxy.example.org:8080")
end
end
end
diff --git a/spec/functional/assets/chefinittest b/spec/functional/assets/chefinittest
new file mode 100755
index 0000000000..79e064cd5f
--- /dev/null
+++ b/spec/functional/assets/chefinittest
@@ -0,0 +1,34 @@
+#!/bin/ksh
+
+function create_chef_txt {
+ touch /tmp/chefinittest.txt
+}
+
+function delete_chef_txt {
+ rm /tmp/chefinittest.txt
+}
+
+function rename_chef_txt {
+ mv /tmp/chefinittest.txt /tmp/$1
+}
+
+case "$1" in
+start )
+ create_chef_txt
+ ;;
+stop )
+ delete_chef_txt
+ ;;
+status )
+ [ -f /tmp/chefinittest.txt ] || [ -f /tmp/chefinittest_reload.txt ] || [ -f /tmp/chefinittest_restart.txt ]
+ ;;
+reload )
+ rename_chef_txt "chefinittest_reload.txt"
+ ;;
+restart )
+ rename_chef_txt "chefinittest_restart.txt"
+ ;;
+* )
+ echo "Usage: $0 (start | stop | restart | reload)"
+ exit 1
+esac
diff --git a/spec/functional/assets/testchefsubsys b/spec/functional/assets/testchefsubsys
new file mode 100755
index 0000000000..e9ff30d4aa
--- /dev/null
+++ b/spec/functional/assets/testchefsubsys
@@ -0,0 +1,11 @@
+#!/bin/bash
+# trapchild
+
+sleep 120 &
+
+pid="$!"
+
+trap 'echo I am going down, so killing off my processes..; kill $pid; exit' SIGHUP SIGINT
+ SIGQUIT SIGTERM
+
+wait \ No newline at end of file
diff --git a/spec/functional/dsl/reboot_pending_spec.rb b/spec/functional/dsl/reboot_pending_spec.rb
index 114754ccba..14dd9412d5 100644
--- a/spec/functional/dsl/reboot_pending_spec.rb
+++ b/spec/functional/dsl/reboot_pending_spec.rb
@@ -30,11 +30,11 @@ describe Chef::DSL::RebootPending, :windows_only do
ohai
end
- def registry_safe?
- !registry.value_exists?('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }) ||
- !registry.key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired') ||
- !registry.key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired') ||
- !registry.key_exists?('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile')
+ def registry_unsafe?
+ registry.value_exists?('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }) ||
+ registry.key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired')
+ registry.key_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired') ||
+ registry.key_exists?('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile')
end
let(:node) { Chef::Node.new }
@@ -48,22 +48,22 @@ describe Chef::DSL::RebootPending, :windows_only do
describe "when there is nothing to indicate a reboot is pending" do
it "should return false" do
- pending "Found existing registry keys" unless registry_safe?
- expect(recipe.reboot_pending?).to be_false
+ skip "Found existing registry keys" if registry_unsafe?
+ expect(recipe.reboot_pending?).to be_falsey
end
end
describe 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations' do
it "returns true if the registry value exists" do
- pending "Found existing registry keys" unless registry_safe?
- registry.set_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager',
+ skip "Found existing registry keys" if registry_unsafe?
+ registry.set_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager',
{ :name => 'PendingFileRenameOperations', :type => :multi_string, :data => ['\??\C:\foo.txt|\??\C:\bar.txt'] })
- expect(recipe.reboot_pending?).to be_true
+ expect(recipe.reboot_pending?).to be_truthy
end
after do
- if registry_safe?
+ unless registry_unsafe?
registry.delete_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' })
end
end
@@ -71,14 +71,14 @@ describe Chef::DSL::RebootPending, :windows_only do
describe 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired' do
it "returns true if the registry key exists" do
- pending "Found existing registry keys" unless registry_safe?
+ skip "Found existing registry keys" if registry_unsafe?
registry.create_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired', false)
- expect(recipe.reboot_pending?).to be_true
+ expect(recipe.reboot_pending?).to be_truthy
end
after do
- if registry_safe?
+ unless registry_unsafe?
registry.delete_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired', false)
end
end
@@ -87,14 +87,14 @@ describe Chef::DSL::RebootPending, :windows_only do
describe 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired' do
it "returns true if the registry key exists" do
pending "Permissions are limited to 'TrustedInstaller' by default"
- pending "Found existing registry keys" unless registry_safe?
+ skip "Found existing registry keys" if registry_unsafe?
registry.create_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired', false)
- expect(recipe.reboot_pending?).to be_true
+ expect(recipe.reboot_pending?).to be_truthy
end
after do
- if registry_safe?
+ unless registry_unsafe?
registry.delete_key('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired', false)
end
end
@@ -102,16 +102,16 @@ describe Chef::DSL::RebootPending, :windows_only do
describe 'HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile\Flags' do
it "returns true if the registry key exists" do
- pending "Found existing registry keys" unless registry_safe?
+ skip "Found existing registry keys" if registry_unsafe?
registry.create_key('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', true)
registry.set_value('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile',
{ :name => 'Flags', :type => :dword, :data => 3 })
- expect(recipe.reboot_pending?).to be_true
+ expect(recipe.reboot_pending?).to be_truthy
end
after do
- if registry_safe?
+ unless registry_unsafe?
registry.delete_value('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', { :name => 'Flags' })
registry.delete_key('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile', false)
end
diff --git a/spec/functional/dsl/registry_helper_spec.rb b/spec/functional/dsl/registry_helper_spec.rb
index 452c4c2799..df5b09f1f6 100644
--- a/spec/functional/dsl/registry_helper_spec.rb
+++ b/spec/functional/dsl/registry_helper_spec.rb
@@ -40,24 +40,24 @@ describe Chef::Resource::RegistryKey, :windows_only do
context "tests registry dsl" do
it "returns true if registry_key_exists" do
- @resource.registry_key_exists?("HKCU\\Software\\Root").should == true
+ expect(@resource.registry_key_exists?("HKCU\\Software\\Root")).to eq(true)
end
it "returns true if registry has specified value" do
values = @resource.registry_get_values("HKCU\\Software\\Root")
- values.include?({:name=>"RootType1",:type=>:string,:data=>"fibrous"}).should == true
+ expect(values.include?({:name=>"RootType1",:type=>:string,:data=>"fibrous"})).to eq(true)
end
it "returns true if specified registry_has_subkey" do
- @resource.registry_has_subkeys?("HKCU\\Software\\Root").should == true
+ expect(@resource.registry_has_subkeys?("HKCU\\Software\\Root")).to eq(true)
end
it "returns true if specified key has specified subkey" do
subkeys = @resource.registry_get_subkeys("HKCU\\Software\\Root")
- subkeys.include?("Branch").should == true
+ expect(subkeys.include?("Branch")).to eq(true)
end
it "returns true if registry_value_exists" do
- @resource.registry_value_exists?("HKCU\\Software\\Root", {:name=>"RootType1", :type=>:string, :data=>"fibrous"}).should == true
+ expect(@resource.registry_value_exists?("HKCU\\Software\\Root", {:name=>"RootType1", :type=>:string, :data=>"fibrous"})).to eq(true)
end
it "returns true if data_value_exists" do
- @resource.registry_data_exists?("HKCU\\Software\\Root", {:name=>"RootType1", :type=>:string, :data=>"fibrous"}).should == true
+ expect(@resource.registry_data_exists?("HKCU\\Software\\Root", {:name=>"RootType1", :type=>:string, :data=>"fibrous"})).to eq(true)
end
end
end
diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb
new file mode 100644
index 0000000000..4e383dd429
--- /dev/null
+++ b/spec/functional/event_loggers/windows_eventlog_spec.rb
@@ -0,0 +1,82 @@
+#
+# Author:: Jay Mundrawala (<jdm@getchef.com>)
+#
+# Copyright:: 2014, Chef Software, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'securerandom'
+require 'chef/event_loggers/windows_eventlog'
+if Chef::Platform.windows? and not Chef::Platform::windows_server_2003?
+ require 'win32/eventlog'
+ include Win32
+end
+
+describe Chef::EventLoggers::WindowsEventLogger, :windows_only, :not_supported_on_win2k3 do
+ let(:run_id) { SecureRandom.uuid }
+ let(:version) { SecureRandom.uuid }
+ let(:elapsed_time) { SecureRandom.random_number(100) }
+ let(:logger) { Chef::EventLoggers::WindowsEventLogger.new }
+ let(:flags) { nil }
+ let(:node) { nil }
+ let(:run_status) { double('Run Status', {run_id: run_id, elapsed_time: elapsed_time }) }
+ let(:event_log) { EventLog.new("Application") }
+ let!(:offset) { event_log.read_last_event.record_number }
+ let(:mock_exception) { double('Exception', {message: SecureRandom.uuid, backtrace:[SecureRandom.uuid, SecureRandom.uuid]})}
+
+ it 'is available' do
+ expect(Chef::EventLoggers::WindowsEventLogger.available?).to be_truthy
+ end
+
+ it 'writes run_start event with event_id 10000 and contains version' do
+ logger.run_start(version)
+
+ expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10000 &&
+ e.string_inserts[0].include?(version)}).to be_truthy
+ end
+
+ it 'writes run_started event with event_id 10001 and contains the run_id' do
+ logger.run_started(run_status)
+
+ expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10001 &&
+ e.string_inserts[0].include?(run_id)}).to be_truthy
+ end
+
+ it 'writes run_completed event with event_id 10002 and contains the run_id and elapsed time' do
+ logger.run_started(run_status)
+ logger.run_completed(node)
+
+ expect(event_log.read(flags, offset).any? { |e| e.source == 'Chef' && e.event_id == 10002 &&
+ e.string_inserts[0].include?(run_id) &&
+ e.string_inserts[1].include?(elapsed_time.to_s)
+ }).to be_truthy
+ end
+
+ it 'writes run_failed event with event_id 10003 and contains the run_id, elapsed time, and exception info' do
+ logger.run_started(run_status)
+ logger.run_failed(mock_exception)
+
+ expect(event_log.read(flags, offset).any? do |e|
+ e.source == 'Chef' && e.event_id == 10003 &&
+ e.string_inserts[0].include?(run_id) &&
+ e.string_inserts[1].include?(elapsed_time.to_s) &&
+ e.string_inserts[2].include?(mock_exception.class.name) &&
+ e.string_inserts[3].include?(mock_exception.message) &&
+ e.string_inserts[4].include?(mock_exception.backtrace[0]) &&
+ e.string_inserts[4].include?(mock_exception.backtrace[1])
+ end).to be_truthy
+ end
+
+end
diff --git a/spec/functional/file_content_management/deploy_strategies_spec.rb b/spec/functional/file_content_management/deploy_strategies_spec.rb
index dd1ef6228f..bcd171eb73 100644
--- a/spec/functional/file_content_management/deploy_strategies_spec.rb
+++ b/spec/functional/file_content_management/deploy_strategies_spec.rb
@@ -56,11 +56,11 @@ shared_examples_for "a content deploy strategy" do
it "touches the file to create it (UNIX)", :unix_only do
content_deployer.create(target_file_path)
- File.should exist(target_file_path)
+ expect(File).to exist(target_file_path)
file_info = File.stat(target_file_path)
- file_info.should be_owned
- file_info.should be_file
- normalize_mode(file_info.mode).should == default_mode
+ expect(file_info).to be_owned
+ expect(file_info).to be_file
+ expect(normalize_mode(file_info.mode)).to eq(default_mode)
end
##
@@ -89,10 +89,10 @@ shared_examples_for "a content deploy strategy" do
it "touches the file to create it (Windows)", :windows_only do
content_deployer.create(target_file_path)
- File.should exist(target_file_path)
+ expect(File).to exist(target_file_path)
file_info = File.stat(target_file_path)
- file_info.should be_owned
- file_info.should be_file
+ expect(file_info).to be_owned
+ expect(file_info).to be_file
parent_aces = parent_inheritable_aces
security_obj = Chef::ReservedNames::Win32::Security::SecurableObject.new(target_file_path)
@@ -106,7 +106,7 @@ shared_examples_for "a content deploy strategy" do
end
self_aces.each_with_index do |ace, index|
- ace.mask.should == parent_aces[index].mask
+ expect(ace.mask).to eq(parent_aces[index].mask)
end
end
end
@@ -147,7 +147,7 @@ shared_examples_for "a content deploy strategy" do
content_deployer.deploy(staging_file_path, target_file_path)
updated_info = File.stat(target_file_path)
- unix_invariant_properies(original_info).should == unix_invariant_properies(updated_info)
+ expect(unix_invariant_properies(original_info)).to eq(unix_invariant_properies(updated_info))
end
it "maintains invariant properties on Windows", :windows_only do
@@ -155,12 +155,12 @@ shared_examples_for "a content deploy strategy" do
content_deployer.deploy(staging_file_path, target_file_path)
updated_info = Chef::ReservedNames::Win32::Security::SecurableObject.new(target_file_path)
- win_invariant_properties(original_info).should == win_invariant_properties(updated_info)
+ expect(win_invariant_properties(original_info)).to eq(win_invariant_properties(updated_info))
end
it "updates the target with content from staged" do
content_deployer.deploy(staging_file_path, target_file_path)
- binread(target_file_path).should == staging_file_content
+ expect(binread(target_file_path)).to eq(staging_file_content)
end
context "when the owner of the target file is not the owner of the staging file", :requires_root do
@@ -174,7 +174,7 @@ shared_examples_for "a content deploy strategy" do
content_deployer.deploy(staging_file_path, target_file_path)
updated_info = File.stat(target_file_path)
- unix_invariant_properies(original_info).should == unix_invariant_properies(updated_info)
+ expect(unix_invariant_properies(original_info)).to eq(unix_invariant_properies(updated_info))
end
end
diff --git a/spec/functional/http/simple_spec.rb b/spec/functional/http/simple_spec.rb
index fec71351df..36468b4eba 100644
--- a/spec/functional/http/simple_spec.rb
+++ b/spec/functional/http/simple_spec.rb
@@ -85,7 +85,7 @@ describe Chef::HTTP::Simple do
before do
Chef::Log.level = :debug
@debug_log = ''
- Chef::Log.stub(:debug) { |str| @debug_log << str }
+ allow(Chef::Log).to receive(:debug) { |str| @debug_log << str }
end
let(:source) { 'http://localhost:9000' }
diff --git a/spec/functional/knife/cookbook_delete_spec.rb b/spec/functional/knife/cookbook_delete_spec.rb
index 4773fd2185..15ac8f55ab 100644
--- a/spec/functional/knife/cookbook_delete_spec.rb
+++ b/spec/functional/knife/cookbook_delete_spec.rb
@@ -51,9 +51,9 @@ describe Chef::Knife::CookbookDelete do
end
it "logs an error and exits" do
- @knife.ui.stub(:stderr).and_return(@log_output)
- lambda {@knife.run}.should raise_error(SystemExit)
- @log_output.string.should match(/Cannot find a cookbook named no-such-cookbook to delete/)
+ allow(@knife.ui).to receive(:stderr).and_return(@log_output)
+ expect {@knife.run}.to raise_error(SystemExit)
+ expect(@log_output.string).to match(/Cannot find a cookbook named no-such-cookbook to delete/)
end
end
@@ -67,33 +67,33 @@ describe Chef::Knife::CookbookDelete do
it "asks for confirmation, then deletes the cookbook" do
stdin, stdout = StringIO.new("y\n"), StringIO.new
- @knife.ui.stub(:stdin).and_return(stdin)
- @knife.ui.stub(:stdout).and_return(stdout)
+ allow(@knife.ui).to receive(:stdin).and_return(stdin)
+ allow(@knife.ui).to receive(:stdout).and_return(stdout)
cb100_deleted = false
@api.delete("/cookbooks/obsolete-cookbook/1.0.0", 200) { cb100_deleted = true; "[\"true\"]" }
@knife.run
- stdout.string.should match(/#{Regexp.escape('Do you really want to delete obsolete-cookbook version 1.0.0? (Y/N)')}/)
- cb100_deleted.should be_true
+ expect(stdout.string).to match(/#{Regexp.escape('Do you really want to delete obsolete-cookbook version 1.0.0? (Y/N)')}/)
+ expect(cb100_deleted).to be_truthy
end
it "asks for confirmation before purging" do
@knife.config[:purge] = true
stdin, stdout = StringIO.new("y\ny\n"), StringIO.new
- @knife.ui.stub(:stdin).and_return(stdin)
- @knife.ui.stub(:stdout).and_return(stdout)
+ allow(@knife.ui).to receive(:stdin).and_return(stdin)
+ allow(@knife.ui).to receive(:stdout).and_return(stdout)
cb100_deleted = false
@api.delete("/cookbooks/obsolete-cookbook/1.0.0?purge=true", 200) { cb100_deleted = true; "[\"true\"]" }
@knife.run
- stdout.string.should match(/#{Regexp.escape('Are you sure you want to purge files')}/)
- stdout.string.should match(/#{Regexp.escape('Do you really want to delete obsolete-cookbook version 1.0.0? (Y/N)')}/)
- cb100_deleted.should be_true
+ expect(stdout.string).to match(/#{Regexp.escape('Are you sure you want to purge files')}/)
+ expect(stdout.string).to match(/#{Regexp.escape('Do you really want to delete obsolete-cookbook version 1.0.0? (Y/N)')}/)
+ expect(cb100_deleted).to be_truthy
end
@@ -117,22 +117,22 @@ describe Chef::Knife::CookbookDelete do
@api.delete("/cookbooks/obsolete-cookbook/1.2.0", 200) { cb120_deleted = true; "[\"true\"]" }
@knife.run
- cb100_deleted.should be_true
- cb110_deleted.should be_true
- cb120_deleted.should be_true
+ expect(cb100_deleted).to be_truthy
+ expect(cb110_deleted).to be_truthy
+ expect(cb120_deleted).to be_truthy
end
it "asks which version to delete and deletes that when not given the -a flag" do
cb100_deleted = cb110_deleted = cb120_deleted = nil
@api.delete("/cookbooks/obsolete-cookbook/1.0.0", 200) { cb100_deleted = true; "[\"true\"]" }
stdin, stdout = StringIO.new, StringIO.new
- @knife.ui.stub(:stdin).and_return(stdin)
- @knife.ui.stub(:stdout).and_return(stdout)
+ allow(@knife.ui).to receive(:stdin).and_return(stdin)
+ allow(@knife.ui).to receive(:stdout).and_return(stdout)
stdin << "1\n"
stdin.rewind
@knife.run
- cb100_deleted.should be_true
- stdout.string.should match(/Which version\(s\) do you want to delete\?/)
+ expect(cb100_deleted).to be_truthy
+ expect(stdout.string).to match(/Which version\(s\) do you want to delete\?/)
end
it "deletes all versions of the cookbook when not given the -a flag and the user chooses to delete all" do
@@ -142,14 +142,14 @@ describe Chef::Knife::CookbookDelete do
@api.delete("/cookbooks/obsolete-cookbook/1.2.0", 200) { cb120_deleted = true; "[\"true\"]" }
stdin, stdout = StringIO.new("4\n"), StringIO.new
- @knife.ui.stub(:stdin).and_return(stdin)
- @knife.ui.stub(:stdout).and_return(stdout)
+ allow(@knife.ui).to receive(:stdin).and_return(stdin)
+ allow(@knife.ui).to receive(:stdout).and_return(stdout)
@knife.run
- cb100_deleted.should be_true
- cb110_deleted.should be_true
- cb120_deleted.should be_true
+ expect(cb100_deleted).to be_truthy
+ expect(cb110_deleted).to be_truthy
+ expect(cb120_deleted).to be_truthy
end
end
diff --git a/spec/functional/knife/exec_spec.rb b/spec/functional/knife/exec_spec.rb
index 7eb52d01df..0a9177b5e8 100644
--- a/spec/functional/knife/exec_spec.rb
+++ b/spec/functional/knife/exec_spec.rb
@@ -41,7 +41,7 @@ describe Chef::Knife::Exec do
@server.stop
end
- pending "executes a script in the context of the chef-shell main context", :ruby_18_only
+ skip "executes a script in the context of the chef-shell main context", :ruby_18_only
it "executes a script in the context of the chef-shell main context", :ruby_gte_19_only do
@node = Chef::Node.new
@@ -51,7 +51,7 @@ describe Chef::Knife::Exec do
code = "$output.puts nodes.all"
@knife.config[:exec] = code
@knife.run
- $output.string.should match(%r{node\[ohai-world\]})
+ expect($output.string).to match(%r{node\[ohai-world\]})
end
end
diff --git a/spec/functional/knife/smoke_test.rb b/spec/functional/knife/smoke_test.rb
index 6ccd462516..607e8065cf 100644
--- a/spec/functional/knife/smoke_test.rb
+++ b/spec/functional/knife/smoke_test.rb
@@ -29,6 +29,6 @@ describe "knife smoke tests" do
knife_cmd = Mixlib::ShellOut.new("#{knife_path} -v")
knife_cmd.run_command
knife_cmd.error!
- knife_cmd.stdout.should include(Chef::VERSION)
+ expect(knife_cmd.stdout).to include(Chef::VERSION)
end
end
diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb
index 40d71859c7..cde702e8b2 100644
--- a/spec/functional/knife/ssh_spec.rb
+++ b/spec/functional/knife/ssh_spec.rb
@@ -40,7 +40,7 @@ describe Chef::Knife::Ssh do
it "uses the ssh_identity_file" do
@knife.run
- @knife.config[:identity_file].should == "~/.ssh/aws.rsa"
+ expect(@knife.config[:identity_file]).to eq("~/.ssh/aws.rsa")
end
end
@@ -52,7 +52,7 @@ describe Chef::Knife::Ssh do
it "uses the ssh_identity_file" do
@knife.run
- @knife.config[:identity_file].should == "~/.ssh/aws.rsa"
+ expect(@knife.config[:identity_file]).to eq("~/.ssh/aws.rsa")
end
end
@@ -64,13 +64,13 @@ describe Chef::Knife::Ssh do
it "should use the value on the command line" do
@knife.run
- @knife.config[:identity_file].should == "~/.ssh/aws.rsa"
+ expect(@knife.config[:identity_file]).to eq("~/.ssh/aws.rsa")
end
it "should override what is set in knife.rb" do
Chef::Config[:knife][:ssh_identity_file] = "~/.ssh/other.rsa"
@knife.run
- @knife.config[:identity_file].should == "~/.ssh/aws.rsa"
+ expect(@knife.config[:identity_file]).to eq("~/.ssh/aws.rsa")
end
end
@@ -82,7 +82,7 @@ describe Chef::Knife::Ssh do
it "uses the default" do
@knife.run
- @knife.config[:identity_file].should == nil
+ expect(@knife.config[:identity_file]).to eq(nil)
end
end
end
@@ -95,7 +95,7 @@ describe Chef::Knife::Ssh do
it "uses the ssh_port" do
@knife.run
- @knife.config[:ssh_port].should == "31337"
+ expect(@knife.config[:ssh_port]).to eq("31337")
end
end
end
@@ -109,7 +109,7 @@ describe Chef::Knife::Ssh do
it "uses the ssh_user" do
@knife.run
- @knife.config[:ssh_user].should == "ubuntu"
+ expect(@knife.config[:ssh_user]).to eq("ubuntu")
end
end
@@ -121,7 +121,7 @@ describe Chef::Knife::Ssh do
it "uses the ssh_user" do
@knife.run
- @knife.config[:ssh_user].should == "ubuntu"
+ expect(@knife.config[:ssh_user]).to eq("ubuntu")
end
end
@@ -133,13 +133,13 @@ describe Chef::Knife::Ssh do
it "should use the value on the command line" do
@knife.run
- @knife.config[:ssh_user].should == "ubuntu"
+ expect(@knife.config[:ssh_user]).to eq("ubuntu")
end
it "should override what is set in knife.rb" do
Chef::Config[:knife][:ssh_user] = "root"
@knife.run
- @knife.config[:ssh_user].should == "ubuntu"
+ expect(@knife.config[:ssh_user]).to eq("ubuntu")
end
end
@@ -151,7 +151,7 @@ describe Chef::Knife::Ssh do
it "uses the default (current user)" do
@knife.run
- @knife.config[:ssh_user].should == nil
+ expect(@knife.config[:ssh_user]).to eq(nil)
end
end
end
@@ -165,7 +165,7 @@ describe Chef::Knife::Ssh do
it "uses the ssh_attribute" do
@knife.run
- @knife.config[:attribute].should == "ec2.public_hostname"
+ expect(@knife.config[:attribute]).to eq("ec2.public_hostname")
end
end
@@ -177,7 +177,7 @@ describe Chef::Knife::Ssh do
it "uses the default" do
@knife.run
- @knife.config[:attribute].should == "fqdn"
+ expect(@knife.config[:attribute]).to eq("fqdn")
end
end
@@ -189,7 +189,7 @@ describe Chef::Knife::Ssh do
it "should use the value on the command line" do
@knife.run
- @knife.config[:attribute].should == "ec2.public_hostname"
+ expect(@knife.config[:attribute]).to eq("ec2.public_hostname")
end
it "should override what is set in knife.rb" do
@@ -198,7 +198,7 @@ describe Chef::Knife::Ssh do
# Then we run knife with the -a flag, which sets the above variable
setup_knife(['-a ec2.public_hostname', '*:*', 'uptime'])
@knife.run
- @knife.config[:attribute].should == "ec2.public_hostname"
+ expect(@knife.config[:attribute]).to eq("ec2.public_hostname")
end
end
end
@@ -211,9 +211,9 @@ describe Chef::Knife::Ssh do
end
it "uses the ssh_gateway" do
- @knife.session.should_receive(:via).with("ec2.public_hostname", "user", {})
+ expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", {})
@knife.run
- @knife.config[:ssh_gateway].should == "user@ec2.public_hostname"
+ expect(@knife.config[:ssh_gateway]).to eq("user@ec2.public_hostname")
end
end
@@ -224,9 +224,9 @@ describe Chef::Knife::Ssh do
end
it "uses the ssh_gateway" do
- @knife.session.should_receive(:via).with("ec2.public_hostname", "user", {})
+ expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", {})
@knife.run
- @knife.config[:ssh_gateway].should == "user@ec2.public_hostname"
+ expect(@knife.config[:ssh_gateway]).to eq("user@ec2.public_hostname")
end
end
@@ -234,13 +234,13 @@ describe Chef::Knife::Ssh do
before do
setup_knife(['-G user@ec2.public_hostname', '*:*', 'uptime'])
Chef::Config[:knife][:ssh_gateway] = nil
- @knife.session.stub(:via) do |host, user, options|
+ allow(@knife.session).to receive(:via) do |host, user, options|
raise Net::SSH::AuthenticationFailed unless options[:password]
end
end
it "should prompt the user for a password" do
- @knife.ui.should_receive(:ask).with("Enter the password for user@ec2.public_hostname: ").and_return("password")
+ expect(@knife.ui).to receive(:ask).with("Enter the password for user@ec2.public_hostname: ").and_return("password")
@knife.run
end
end
@@ -252,7 +252,7 @@ describe Chef::Knife::Ssh do
# if available, but #merge_configs (which is called by #configure_chef) is
# necessary to have default options merged in.
@knife.merge_configs
- @knife.stub(:ssh_command).and_return { 0 }
+ allow(@knife).to receive(:ssh_command) { 0 }
@api = TinyServer::API.instance
@api.clear
diff --git a/spec/functional/provider/remote_file/cache_control_data_spec.rb b/spec/functional/provider/remote_file/cache_control_data_spec.rb
index 63a4578c69..41f228ae3c 100755
--- a/spec/functional/provider/remote_file/cache_control_data_spec.rb
+++ b/spec/functional/provider/remote_file/cache_control_data_spec.rb
@@ -64,9 +64,9 @@ describe Chef::Provider::RemoteFile::CacheControlData do
it "writes the data to the cache and the same data can be read back" do
cache_control_data.save
saved_cache_control_data = Chef::Provider::RemoteFile::CacheControlData.load_and_validate(uri, file_checksum)
- saved_cache_control_data.etag.should == cache_control_data.etag
- saved_cache_control_data.mtime.should == cache_control_data.mtime
- saved_cache_control_data.checksum.should == cache_control_data.checksum
+ expect(saved_cache_control_data.etag).to eq(cache_control_data.etag)
+ expect(saved_cache_control_data.mtime).to eq(cache_control_data.mtime)
+ expect(saved_cache_control_data.checksum).to eq(cache_control_data.checksum)
end
# Cover the very long remote file path case -- see CHEF-4422 where
@@ -81,17 +81,17 @@ describe Chef::Provider::RemoteFile::CacheControlData do
let(:uri) { uri_exceeds_file_system_limit }
it "writes data to the cache" do
- lambda do
+ expect do
cache_control_data.save
- end.should_not raise_error
+ end.not_to raise_error
end
it "writes the data to the cache and the same data can be read back" do
cache_control_data.save
saved_cache_control_data = Chef::Provider::RemoteFile::CacheControlData.load_and_validate(uri, file_checksum)
- saved_cache_control_data.etag.should == cache_control_data.etag
- saved_cache_control_data.mtime.should == cache_control_data.mtime
- saved_cache_control_data.checksum.should == cache_control_data.checksum
+ expect(saved_cache_control_data.etag).to eq(cache_control_data.etag)
+ expect(saved_cache_control_data.mtime).to eq(cache_control_data.mtime)
+ expect(saved_cache_control_data.checksum).to eq(cache_control_data.checksum)
end
end
diff --git a/spec/functional/provider/whyrun_safe_ruby_block_spec.rb b/spec/functional/provider/whyrun_safe_ruby_block_spec.rb
index 150d46d384..b3c2333e9a 100644
--- a/spec/functional/provider/whyrun_safe_ruby_block_spec.rb
+++ b/spec/functional/provider/whyrun_safe_ruby_block_spec.rb
@@ -44,8 +44,8 @@ describe Chef::Resource::WhyrunSafeRubyBlock do
it "updates the evil laugh, even in why-run mode" do
new_resource.run_action(new_resource.action)
- $evil_global_evil_laugh.should == :mwahahaha
- new_resource.should be_updated
+ expect($evil_global_evil_laugh).to eq(:mwahahaha)
+ expect(new_resource).to be_updated
end
end
end
diff --git a/spec/functional/rebooter_spec.rb b/spec/functional/rebooter_spec.rb
index 8006580d5c..763021607b 100644
--- a/spec/functional/rebooter_spec.rb
+++ b/spec/functional/rebooter_spec.rb
@@ -70,7 +70,7 @@ describe Chef::Platform::Rebooter do
shared_context 'test a reboot method' do
def test_rebooter_method(method_sym, is_windows, expected_reboot_str)
- Chef::Platform.stub(:windows?).and_return(is_windows)
+ allow(Chef::Platform).to receive(:windows?).and_return(is_windows)
expect(rebooter).to receive(:shell_out!).once.with(expected_reboot_str)
expect(rebooter).to receive(method_sym).once.and_call_original
rebooter.send(method_sym, run_context.node)
diff --git a/spec/functional/resource/aix_service_spec.rb b/spec/functional/resource/aix_service_spec.rb
new file mode 100755
index 0000000000..6008fdea8f
--- /dev/null
+++ b/spec/functional/resource/aix_service_spec.rb
@@ -0,0 +1,136 @@
+# encoding: UTF-8
+#
+# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'functional/resource/base'
+require 'chef/mixin/shell_out'
+
+shared_examples "src service" do
+
+ include Chef::Mixin::ShellOut
+
+ def service_should_be_started
+ expect(shell_out!("lssrc -a | grep #{new_resource.service_name}").stdout.split(' ').last).to eq("active")
+ end
+
+ def service_should_be_stopped
+ expect(shell_out!("lssrc -a | grep #{new_resource.service_name}").stdout.split(' ').last).to eq("inoperative")
+ end
+
+ def get_service_pid
+ args = shell_out!("lssrc -a | grep #{new_resource.service_name}").stdout.split(' ')
+ if args.length == 3
+ args[1]
+ else
+ args[2]
+ end
+ end
+
+ describe "start service" do
+ it "should start the service" do
+ new_resource.run_action(:start)
+ service_should_be_started
+ end
+ end
+
+ describe "stop service" do
+ before do
+ new_resource.run_action(:start)
+ end
+
+ it "should stop the service" do
+ new_resource.run_action(:stop)
+ service_should_be_stopped
+ end
+ end
+
+ describe "restart service" do
+ before do
+ new_resource.run_action(:start)
+ end
+
+ it "should restart the service" do
+ new_resource.run_action(:restart)
+ service_should_be_started
+ end
+ end
+end
+
+describe Chef::Resource::Service, :requires_root, :aix_only do
+ def get_user_id
+ shell_out("id -u #{ENV['USER']}").stdout.chomp
+ end
+
+ describe "When service is a subsystem" do
+ before(:all) do
+ script_dir = File.join(File.dirname(__FILE__), "/../assets/")
+ shell_out!("mkssys -s ctestsys -p #{script_dir}/testchefsubsys -u #{get_user_id} -S -n 15 -f 9 -R -Q")
+ end
+
+ after(:each) do
+ shell_out("stopsrc -s ctestsys")
+ end
+
+ after(:all) do
+ shell_out!("rmssys -s ctestsys")
+ end
+
+
+ let(:new_resource) do
+ new_resource = Chef::Resource::Service.new("ctestsys", run_context)
+ new_resource
+ end
+
+ let(:provider) do
+ provider = new_resource.provider_for_action(new_resource.action)
+ provider
+ end
+
+ it_behaves_like "src service"
+ end
+
+
+ describe "When service is a group" do
+ before(:all) do
+ script_dir = File.join(File.dirname(__FILE__), "/../assets/")
+ shell_out!("mkssys -s ctestsys -p #{script_dir}/testchefsubsys -u #{get_user_id} -S -n 15 -f 9 -R -Q -G ctestgrp")
+ end
+
+ after(:each) do
+ shell_out("stopsrc -g ctestgrp")
+ end
+
+ after(:all) do
+ # rmssys supports only -s option.
+ shell_out!("rmssys -s ctestsys")
+ end
+
+ let(:new_resource) do
+ new_resource = Chef::Resource::Service.new("ctestgrp", run_context)
+ new_resource
+ end
+
+ let(:provider) do
+ provider = new_resource.provider_for_action(new_resource.action)
+ provider
+ end
+
+ it_behaves_like "src service"
+ end
+end
diff --git a/spec/functional/resource/aixinit_service_spec.rb b/spec/functional/resource/aixinit_service_spec.rb
new file mode 100755
index 0000000000..3d3234f0f7
--- /dev/null
+++ b/spec/functional/resource/aixinit_service_spec.rb
@@ -0,0 +1,211 @@
+# encoding: UTF-8
+#
+# Author:: Kaustubh Deorukhkar (<kaustubh@clogeny.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'functional/resource/base'
+require 'chef/mixin/shell_out'
+require 'fileutils'
+
+describe Chef::Resource::Service, :requires_root, :aix_only do
+
+ include Chef::Mixin::ShellOut
+
+ # Platform specific validation routines.
+ def service_should_be_started(file_name)
+ # The existance of this file indicates that the service was started.
+ expect(File.exists?("/tmp/#{file_name}")).to be_truthy
+ end
+
+ def service_should_be_stopped(file_name)
+ expect(File.exists?("/tmp/#{file_name}")).to be_falsey
+ end
+
+ def valide_symlinks(expected_output, run_level = nil, status = nil, priority = nil)
+ directory = []
+ if priority.is_a?Hash
+ priority.each do |level,o|
+ directory << "/etc/rc.d/rc#{level}.d/#{(o[0] == :start ? 'S' : 'K')}#{o[1]}#{new_resource.service_name}"
+ end
+ directory
+ else
+ directory << "/etc/rc.d/rc#{run_level}.d/#{status}#{priority}#{new_resource.service_name}"
+ end
+ expect(Dir.glob(directory)).to eq(expected_output)
+ File.delete(*directory)
+ end
+
+ def delete_test_files
+ files = Dir.glob("/tmp/chefinit[a-z_]*.txt")
+ File.delete(*files)
+ end
+
+ # Actual tests
+ let(:new_resource) do
+ new_resource = Chef::Resource::Service.new("chefinittest", run_context)
+ new_resource.provider Chef::Provider::Service::AixInit
+ new_resource.supports({:status => true, :restart => true, :reload => true})
+ new_resource
+ end
+
+ let(:provider) do
+ provider = new_resource.provider_for_action(new_resource.action)
+ provider
+ end
+
+ before(:all) do
+ File.delete("/etc/rc.d/init.d/chefinittest") if File.exists?("/etc/rc.d/init.d/chefinittest")
+ FileUtils.cp("#{File.join(File.dirname(__FILE__), "/../assets/chefinittest")}", "/etc/rc.d/init.d/chefinittest")
+ end
+
+ after(:all) do
+ File.delete("/etc/rc.d/init.d/chefinittest") if File.exists?("/etc/rc.d/init.d/chefinittest")
+ end
+
+ before(:each) do
+ delete_test_files
+ end
+
+ after(:each) do
+ delete_test_files
+ end
+
+ describe "start service" do
+ it "should start the service" do
+ new_resource.run_action(:start)
+ service_should_be_started("chefinittest.txt")
+ end
+ end
+
+ describe "stop service" do
+ before do
+ new_resource.run_action(:start)
+ end
+
+ it "should stop the service" do
+ new_resource.run_action(:stop)
+ service_should_be_stopped("chefinittest.txt")
+ end
+ end
+
+ describe "restart service" do
+ before do
+ new_resource.run_action(:start)
+ end
+
+ it "should restart the service" do
+ new_resource.run_action(:restart)
+ service_should_be_started("chefinittest_restart.txt")
+ end
+ end
+
+ describe "reload service" do
+ before do
+ new_resource.run_action(:start)
+ end
+
+ it "should reload the service" do
+ new_resource.run_action(:reload)
+ service_should_be_started("chefinittest_reload.txt")
+ end
+ end
+
+ describe "enable service" do
+
+ context "when the service doesn't set a priority" do
+ it "creates symlink with status S" do
+ new_resource.run_action(:enable)
+ valide_symlinks(["/etc/rc.d/rc2.d/Schefinittest"],2,'S')
+ end
+ end
+
+ context "when the service sets a simple priority (integer)" do
+ before do
+ new_resource.priority(75)
+ end
+
+ it "creates a symlink with status S and a priority" do
+ new_resource.run_action(:enable)
+ valide_symlinks(["/etc/rc.d/rc2.d/S75chefinittest"], 2,'S',75)
+ end
+ end
+
+ context "when the service sets complex priorities (hash)" do
+ before do
+ priority = {2 => [:start, 20], 3 => [:stop, 10]}
+ new_resource.priority(priority)
+ end
+
+ it "create symlink with status start (S) or stop (K) and a priority " do
+ new_resource.run_action(:enable)
+ valide_symlinks(["/etc/rc.d/rc2.d/S20chefinittest", "/etc/rc.d/rc3.d/K10chefinittest"], 2,'S',new_resource.priority)
+ end
+ end
+ end
+
+ describe "disable_service" do
+
+ context "when the service doesn't set a priority" do
+ before do
+ File.symlink("/etc/rc.d/init.d/chefinittest", "/etc/rc.d/rc2.d/Schefinittest")
+ end
+
+ after do
+ File.delete("/etc/rc.d/rc2.d/Schefinittest") if File.exists?("/etc/rc.d/rc2.d/chefinittest")
+ end
+
+ it "creates symlink with status K" do
+ new_resource.run_action(:disable)
+ valide_symlinks(["/etc/rc.d/rc2.d/Kchefinittest"], 2,'K')
+ end
+ end
+
+ context "when the service sets a simple priority (integer)" do
+ before do
+ new_resource.priority(75)
+ File.symlink("/etc/rc.d/init.d/chefinittest", "/etc/rc.d/rc2.d/Schefinittest")
+ end
+
+ after do
+ File.delete("/etc/rc.d/rc2.d/Schefinittest") if File.exists?("/etc/rc.d/rc2.d/chefinittest")
+ end
+
+ it "creates a symlink with status K and a priority" do
+ new_resource.run_action(:disable)
+ valide_symlinks(["/etc/rc.d/rc2.d/K25chefinittest"], 2,'K',25)
+ end
+ end
+
+ context "when the service sets complex priorities (hash)" do
+ before do
+ @priority = {2 => [:stop, 20], 3 => [:start, 10]}
+ new_resource.priority(@priority)
+ File.symlink("/etc/rc.d/init.d/chefinittest", "/etc/rc.d/rc2.d/Schefinittest")
+ end
+
+ after do
+ File.delete("/etc/rc.d/rc2.d/Schefinittest") if File.exists?("/etc/rc.d/rc2.d/chefinittest")
+ end
+
+ it "create symlink with status stop (K) and a priority " do
+ new_resource.run_action(:disable)
+ valide_symlinks(["/etc/rc.d/rc2.d/K80chefinittest"], 2,'K',80)
+ end
+ end
+ end
+end \ No newline at end of file
diff --git a/spec/functional/resource/base.rb b/spec/functional/resource/base.rb
index cdb52fbc1b..10b26f924f 100644
--- a/spec/functional/resource/base.rb
+++ b/spec/functional/resource/base.rb
@@ -22,6 +22,7 @@ def run_context
node = Chef::Node.new
node.default[:platform] = ohai[:platform]
node.default[:platform_version] = ohai[:platform_version]
+ node.default[:os] = ohai[:os]
events = Chef::EventDispatch::Dispatcher.new
Chef::RunContext.new(node, {}, events)
end
diff --git a/spec/functional/resource/batch_spec.rb b/spec/functional/resource/batch_spec.rb
index baa01ee5d9..39133fd40b 100644
--- a/spec/functional/resource/batch_spec.rb
+++ b/spec/functional/resource/batch_spec.rb
@@ -21,17 +21,10 @@ require 'spec_helper'
describe Chef::Resource::WindowsScript::Batch, :windows_only do
include_context Chef::Resource::WindowsScript
- let(:script_content) { "whoami" }
+ let(:output_command) { ' > ' }
- let!(:resource) do
- Chef::Resource::WindowsScript::Batch.new("Batch resource functional test", @run_context)
- end
+ let (:architecture_command) { '@echo %PROCESSOR_ARCHITECTURE%' }
+
+ it_behaves_like "a Windows script running on Windows"
- describe "when the run action is invoked on Windows" do
- it "executes the script code" do
- resource.code(script_content + " > #{script_output_path}")
- resource.returns(0)
- resource.run_action(:run)
- end
- end
end
diff --git a/spec/functional/resource/cron_spec.rb b/spec/functional/resource/cron_spec.rb
index 0a19fae0ed..ed30756583 100644
--- a/spec/functional/resource/cron_spec.rb
+++ b/spec/functional/resource/cron_spec.rb
@@ -17,6 +17,7 @@
# limitations under the License.
#
+require 'spec_helper'
require 'functional/resource/base'
require 'chef/mixin/shell_out'
@@ -55,7 +56,12 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
let(:new_resource) do
new_resource = Chef::Resource::Cron.new("Chef functional test cron", run_context)
new_resource.user 'root'
- new_resource.minute '@hourly'
+ # @hourly is not supported on solaris, aix
+ if ohai[:platform] == "solaris" || ohai[:platform] == "solaris2" || ohai[:platform] == "aix"
+ new_resource.minute "0 * * * *"
+ else
+ new_resource.minute '@hourly'
+ end
new_resource.hour ''
new_resource.day ''
new_resource.month ''
diff --git a/spec/functional/resource/deploy_revision_spec.rb b/spec/functional/resource/deploy_revision_spec.rb
index eae422ac1d..7bc3da9a05 100644
--- a/spec/functional/resource/deploy_revision_spec.rb
+++ b/spec/functional/resource/deploy_revision_spec.rb
@@ -173,12 +173,12 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
it "deploys the app to the target revision (#{target_rev_spec})" do
target_rev = send(target_rev_spec)
- File.should exist(rel_path("current"))
+ expect(File).to exist(rel_path("current"))
- actual_current_rev.should == target_rev
+ expect(actual_current_rev).to eq(target_rev)
# Is the app code actually there?
- File.should exist(rel_path("current/app/app.rb"))
+ expect(File).to exist(rel_path("current/app/app.rb"))
end
end
@@ -193,12 +193,12 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:latest_rev)
it "restarts the application" do
- File.should exist(rel_path("current/restart.txt"))
- actual_operations_order.should == %w[deploy_to_latest_rev]
+ expect(File).to exist(rel_path("current/restart.txt"))
+ expect(actual_operations_order).to eq(%w[deploy_to_latest_rev])
end
it "is marked as updated" do
- deploy_to_latest_rev.should be_updated_by_last_action
+ expect(deploy_to_latest_rev).to be_updated_by_last_action
end
end
@@ -215,15 +215,15 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:latest_rev)
it "restarts the application after rolling back" do
- actual_operations_order.should == %w[deploy_to_latest_rev deploy_to_previous_rev deploy_to_latest_rev_again]
+ expect(actual_operations_order).to eq(%w[deploy_to_latest_rev deploy_to_previous_rev deploy_to_latest_rev_again])
end
it "is marked updated" do
- deploy_to_latest_rev_again.should be_updated_by_last_action
+ expect(deploy_to_latest_rev_again).to be_updated_by_last_action
end
it "deploys the right code" do
- IO.read(rel_path("current/app/app.rb")).should include("this is the fourth version of the app")
+ expect(IO.read(rel_path("current/app/app.rb"))).to include("this is the fourth version of the app")
end
end
@@ -233,27 +233,27 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
end
it "creates the required directory tree" do
- File.should be_directory(rel_path("releases"))
- File.should be_directory(rel_path("shared"))
- File.should be_directory(rel_path("releases/#{latest_rev}"))
+ expect(File).to be_directory(rel_path("releases"))
+ expect(File).to be_directory(rel_path("shared"))
+ expect(File).to be_directory(rel_path("releases/#{latest_rev}"))
- File.should be_directory(rel_path("current/tmp"))
- File.should be_directory(rel_path("current/config"))
- File.should be_directory(rel_path("current/public"))
+ expect(File).to be_directory(rel_path("current/tmp"))
+ expect(File).to be_directory(rel_path("current/config"))
+ expect(File).to be_directory(rel_path("current/public"))
- File.should be_symlink(rel_path("current"))
- File.readlink(rel_path("current")).should == rel_path("releases/#{latest_rev}")
+ expect(File).to be_symlink(rel_path("current"))
+ expect(File.readlink(rel_path("current"))).to eq(rel_path("releases/#{latest_rev}"))
end
the_app_is_deployed_at_revision(:latest_rev)
it "restarts the application" do
- File.should exist(rel_path("current/restart.txt"))
- actual_operations_order.should == %w[deploy_to_latest_rev]
+ expect(File).to exist(rel_path("current/restart.txt"))
+ expect(actual_operations_order).to eq(%w[deploy_to_latest_rev])
end
it "is marked as updated" do
- deploy_to_latest_rev.should be_updated_by_last_action
+ expect(deploy_to_latest_rev).to be_updated_by_last_action
end
end
@@ -266,11 +266,11 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:latest_rev)
it "does not restart the app" do
- actual_operations_order.should == %w[deploy_to_latest_rev]
+ expect(actual_operations_order).to eq(%w[deploy_to_latest_rev])
end
it "is not marked updated" do
- deploy_to_latest_rev.should_not be_updated_by_last_action
+ expect(deploy_to_latest_rev).not_to be_updated_by_last_action
end
end
@@ -284,11 +284,11 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:latest_rev)
it "restarts the app" do
- actual_operations_order.should == %w[deploy_to_latest_rev deploy_to_latest_rev_again]
+ expect(actual_operations_order).to eq(%w[deploy_to_latest_rev deploy_to_latest_rev_again])
end
it "is marked updated" do
- deploy_to_latest_rev.should be_updated_by_last_action
+ expect(deploy_to_latest_rev).to be_updated_by_last_action
end
end
@@ -302,15 +302,15 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:latest_rev)
it "restarts the application after the new deploy" do
- actual_operations_order.should == %w[deploy_to_previous_rev deploy_to_latest_rev]
+ expect(actual_operations_order).to eq(%w[deploy_to_previous_rev deploy_to_latest_rev])
end
it "is marked updated" do
- deploy_to_previous_rev.should be_updated_by_last_action
+ expect(deploy_to_previous_rev).to be_updated_by_last_action
end
it "leaves the old copy of the app around for rollback" do
- File.should exist(File.join(deploy_directory, "releases", previous_rev))
+ expect(File).to exist(File.join(deploy_directory, "releases", previous_rev))
end
end
@@ -325,15 +325,15 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:latest_rev)
it "restarts the application after rolling back" do
- actual_operations_order.should == %w[deploy_to_latest_rev deploy_to_previous_rev deploy_to_latest_rev_again]
+ expect(actual_operations_order).to eq(%w[deploy_to_latest_rev deploy_to_previous_rev deploy_to_latest_rev_again])
end
it "is marked updated" do
- deploy_to_latest_rev_again.should be_updated_by_last_action
+ expect(deploy_to_latest_rev_again).to be_updated_by_last_action
end
it "deploys the right code" do
- IO.read(rel_path("current/app/app.rb")).should include("this is the fourth version of the app")
+ expect(IO.read(rel_path("current/app/app.rb"))).to include("this is the fourth version of the app")
end
end
@@ -350,31 +350,31 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:previous_rev)
it "restarts the application after rolling back" do
- actual_operations_order.should == %w[deploy_to_previous_rev deploy_to_latest_rev deploy_to_latest_rev_again]
+ expect(actual_operations_order).to eq(%w[deploy_to_previous_rev deploy_to_latest_rev deploy_to_latest_rev_again])
end
it "is marked updated" do
- deploy_to_latest_rev_again.should be_updated_by_last_action
+ expect(deploy_to_latest_rev_again).to be_updated_by_last_action
end
it "deploys the right code" do
- IO.read(rel_path("current/app/app.rb")).should include("this is the third version of the app")
+ expect(IO.read(rel_path("current/app/app.rb"))).to include("this is the third version of the app")
end
it "all_releases after first deploy should have one entry" do
- @previous_rev_all_releases.length.should == 1
+ expect(@previous_rev_all_releases.length).to eq(1)
end
it "all_releases after second deploy should have two entries" do
- @latest_rev_all_releases.length.should == 2
+ expect(@latest_rev_all_releases.length).to eq(2)
end
it "all_releases after rollback should have one entry" do
- @previous_rev_again_all_releases.length.should == 1
+ expect(@previous_rev_again_all_releases.length).to eq(1)
end
it "all_releases after rollback should be the same as after the first deploy" do
- @previous_rev_again_all_releases.should == @previous_rev_all_releases
+ expect(@previous_rev_again_all_releases).to eq(@previous_rev_all_releases)
end
end
@@ -393,31 +393,31 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:previous_rev)
it "restarts the application after rolling back" do
- actual_operations_order.should == %w[deploy_to_previous_rev deploy_to_latest_rev deploy_to_previous_rev_again]
+ expect(actual_operations_order).to eq(%w[deploy_to_previous_rev deploy_to_latest_rev deploy_to_previous_rev_again])
end
it "is marked updated" do
- deploy_to_previous_rev_again.should be_updated_by_last_action
+ expect(deploy_to_previous_rev_again).to be_updated_by_last_action
end
it "deploys the right code" do
- IO.read(rel_path("current/app/app.rb")).should include("this is the third version of the app")
+ expect(IO.read(rel_path("current/app/app.rb"))).to include("this is the third version of the app")
end
it "all_releases after first deploy should have one entry" do
- @previous_rev_all_releases.length.should == 1
+ expect(@previous_rev_all_releases.length).to eq(1)
end
it "all_releases after second deploy should have two entries" do
- @latest_rev_all_releases.length.should == 2
+ expect(@latest_rev_all_releases.length).to eq(2)
end
it "all_releases after rollback should have one entry" do
- @previous_rev_again_all_releases.length.should == 1
+ expect(@previous_rev_again_all_releases.length).to eq(1)
end
it "all_releases after rollback should be the same as after the first deploy" do
- @previous_rev_again_all_releases.should == @previous_rev_all_releases
+ expect(@previous_rev_again_all_releases).to eq(@previous_rev_all_releases)
end
end
@@ -438,23 +438,23 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:second_rev)
it "restarts the application after rolling back" do
- actual_operations_order.should == %w[deploy_to_second_rev deploy_to_previous_rev deploy_to_previous_rev_again deploy_to_latest_rev deploy_to_latest_rev_again]
+ expect(actual_operations_order).to eq(%w[deploy_to_second_rev deploy_to_previous_rev deploy_to_previous_rev_again deploy_to_latest_rev deploy_to_latest_rev_again])
end
it "is marked updated" do
- deploy_to_latest_rev_again.should be_updated_by_last_action
+ expect(deploy_to_latest_rev_again).to be_updated_by_last_action
end
it "deploys the right code" do
- IO.read(rel_path("current/app/app.rb")).should include("this is the second version of the app")
+ expect(IO.read(rel_path("current/app/app.rb"))).to include("this is the second version of the app")
end
it "all_releases after rollback should have one entry" do
- @fifth_deploy_all_releases.length.should == 1
+ expect(@fifth_deploy_all_releases.length).to eq(1)
end
it "all_releases after rollback should be the same as after the first deploy" do
- @fifth_deploy_all_releases.should == @first_deploy_all_releases
+ expect(@fifth_deploy_all_releases).to eq(@first_deploy_all_releases)
end
end
@@ -475,23 +475,23 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:second_rev)
it "restarts the application after rolling back" do
- actual_operations_order.should == %w[deploy_to_second_rev deploy_to_previous_rev deploy_to_second_rev_again deploy_to_latest_rev deploy_to_second_rev_again_again]
+ expect(actual_operations_order).to eq(%w[deploy_to_second_rev deploy_to_previous_rev deploy_to_second_rev_again deploy_to_latest_rev deploy_to_second_rev_again_again])
end
it "is marked updated" do
- deploy_to_second_rev_again_again.should be_updated_by_last_action
+ expect(deploy_to_second_rev_again_again).to be_updated_by_last_action
end
it "deploys the right code" do
- IO.read(rel_path("current/app/app.rb")).should include("this is the second version of the app")
+ expect(IO.read(rel_path("current/app/app.rb"))).to include("this is the second version of the app")
end
it "all_releases after rollback should have one entry" do
- @fifth_deploy_all_releases.length.should == 1
+ expect(@fifth_deploy_all_releases.length).to eq(1)
end
it "all_releases after rollback should be the same as after the first deploy" do
- @fifth_deploy_all_releases.should == @first_deploy_all_releases
+ expect(@fifth_deploy_all_releases).to eq(@first_deploy_all_releases)
end
end
@@ -510,21 +510,21 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
end
before do
- File.should_not exist(deploy_directory)
+ expect(File).not_to exist(deploy_directory)
deploy_to_latest_rev.run_action(:deploy)
end
it "creates the required directory tree" do
- File.should be_directory(rel_path("releases"))
- File.should be_directory(rel_path("shared"))
- File.should be_directory(rel_path("releases/#{latest_rev}"))
+ expect(File).to be_directory(rel_path("releases"))
+ expect(File).to be_directory(rel_path("shared"))
+ expect(File).to be_directory(rel_path("releases/#{latest_rev}"))
- File.should be_directory(rel_path("current/tmp"))
- File.should be_directory(rel_path("current/config"))
- File.should be_directory(rel_path("current/public"))
+ expect(File).to be_directory(rel_path("current/tmp"))
+ expect(File).to be_directory(rel_path("current/config"))
+ expect(File).to be_directory(rel_path("current/public"))
- File.should be_symlink(rel_path("current"))
- File.readlink(rel_path("current")).should == rel_path("releases/#{latest_rev}")
+ expect(File).to be_symlink(rel_path("current"))
+ expect(File.readlink(rel_path("current"))).to eq(rel_path("releases/#{latest_rev}"))
end
the_app_is_deployed_at_revision(:latest_rev)
@@ -599,18 +599,18 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:latest_rev)
it "is marked updated" do
- deploy_to_latest_with_inline_recipes.should be_updated_by_last_action
+ expect(deploy_to_latest_with_inline_recipes).to be_updated_by_last_action
end
it "calls the callbacks in order" do
- callback_order.should == [:before_migrate, :before_symlink, :before_restart, :after_restart]
+ expect(callback_order).to eq([:before_migrate, :before_symlink, :before_restart, :after_restart])
end
it "runs chef resources in the callbacks" do
- File.should exist(rel_path("current/before_migrate.txt"))
- File.should exist(rel_path("current/before_symlink.txt"))
- File.should exist(rel_path("current/tmp/before_restart.txt"))
- File.should exist(rel_path("current/tmp/after_restart.txt"))
+ expect(File).to exist(rel_path("current/before_migrate.txt"))
+ expect(File).to exist(rel_path("current/before_symlink.txt"))
+ expect(File).to exist(rel_path("current/tmp/before_restart.txt"))
+ expect(File).to exist(rel_path("current/tmp/after_restart.txt"))
end
end
@@ -629,10 +629,10 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
the_app_is_deployed_at_revision(:rev_with_in_repo_callbacks)
it "runs chef resources in the callbacks" do
- File.should exist(rel_path("current/before_migrate.txt"))
- File.should exist(rel_path("current/before_symlink.txt"))
- File.should exist(rel_path("current/tmp/before_restart.txt"))
- File.should exist(rel_path("current/tmp/after_restart.txt"))
+ expect(File).to exist(rel_path("current/before_migrate.txt"))
+ expect(File).to exist(rel_path("current/before_symlink.txt"))
+ expect(File).to exist(rel_path("current/tmp/before_restart.txt"))
+ expect(File).to exist(rel_path("current/tmp/after_restart.txt"))
end
end
@@ -690,7 +690,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
end
it "runs migrations in between the before_migrate and before_symlink steps" do
- actual_operations_order.should == %w[before_migrate migration before_symlink before_restart after_restart]
+ expect(actual_operations_order).to eq(%w[before_migrate migration before_symlink before_restart after_restart])
end
end
@@ -703,7 +703,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
end
it "should not raise an exception calling File.utime on symlinks" do
- lambda { deploy_with_in_repo_symlinks.run_action(:deploy) }.should_not raise_error
+ expect { deploy_with_in_repo_symlinks.run_action(:deploy) }.not_to raise_error
end
end
@@ -712,16 +712,16 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
shared_examples_for "a redeployed application" do
it "should redeploy the application" do
- File.should be_directory(rel_path("releases"))
- File.should be_directory(rel_path("shared"))
- File.should be_directory(rel_path("releases/#{latest_rev}"))
+ expect(File).to be_directory(rel_path("releases"))
+ expect(File).to be_directory(rel_path("shared"))
+ expect(File).to be_directory(rel_path("releases/#{latest_rev}"))
- File.should be_directory(rel_path("current/tmp"))
- File.should be_directory(rel_path("current/config"))
- File.should be_directory(rel_path("current/public"))
+ expect(File).to be_directory(rel_path("current/tmp"))
+ expect(File).to be_directory(rel_path("current/config"))
+ expect(File).to be_directory(rel_path("current/public"))
- File.should be_symlink(rel_path("current"))
- File.readlink(rel_path("current")).should == rel_path("releases/#{latest_rev}")
+ expect(File).to be_symlink(rel_path("current"))
+ expect(File.readlink(rel_path("current"))).to eq(rel_path("releases/#{latest_rev}"))
end
end
@@ -758,23 +758,23 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
shared_examples_for "a recovered deployment" do
it "should redeploy the application" do
- File.should be_directory(rel_path("releases"))
- File.should be_directory(rel_path("shared"))
- File.should be_directory(rel_path("releases/#{latest_rev}"))
+ expect(File).to be_directory(rel_path("releases"))
+ expect(File).to be_directory(rel_path("shared"))
+ expect(File).to be_directory(rel_path("releases/#{latest_rev}"))
- File.should be_directory(rel_path("current/tmp"))
- File.should be_directory(rel_path("current/config"))
- File.should be_directory(rel_path("current/public"))
+ expect(File).to be_directory(rel_path("current/tmp"))
+ expect(File).to be_directory(rel_path("current/config"))
+ expect(File).to be_directory(rel_path("current/public"))
- File.should be_symlink(rel_path("current"))
- File.readlink(rel_path("current")).should == rel_path("releases/#{latest_rev}")
+ expect(File).to be_symlink(rel_path("current"))
+ expect(File.readlink(rel_path("current"))).to eq(rel_path("releases/#{latest_rev}"))
# if callbacks ran, we know the app was deployed and not merely rolled
# back to a (busted) prior deployment.
- callback_order.should == [:before_migrate,
+ expect(callback_order).to eq([:before_migrate,
:before_symlink,
:before_restart,
- :after_restart ]
+ :after_restart ])
end
end
@@ -794,7 +794,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
context "in the `#{callback}' callback" do
before do
- lambda { deploy_that_fails.run_action(:deploy) }.should raise_error(Exception, %r{I am a failed deploy})
+ expect { deploy_that_fails.run_action(:deploy) }.to raise_error(Exception, %r{I am a failed deploy})
deploy_to_latest_with_callback_tracking.run_action(:deploy)
end
@@ -820,7 +820,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
end
before do
- lambda { deploy_that_fails.run_action(:deploy) }.should raise_error(Chef::Exceptions::Exec)
+ expect { deploy_that_fails.run_action(:deploy) }.to raise_error(Chef::Exceptions::Exec)
deploy_to_latest_with_callback_tracking.run_action(:deploy)
end
@@ -852,7 +852,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
end
before do
- lambda { deploy_that_fails.run_action(:deploy) }.should raise_error(RuntimeError, /network error/)
+ expect { deploy_that_fails.run_action(:deploy) }.to raise_error(RuntimeError, /network error/)
deploy_to_latest_with_callback_tracking.run_action(:deploy)
end
@@ -868,12 +868,12 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
end
before do
- lambda { deploy_that_fails.run_action(:deploy) }.should raise_error(Exception, %r{I am a failed deploy})
+ expect { deploy_that_fails.run_action(:deploy) }.to raise_error(Exception, %r{I am a failed deploy})
deploy_to_latest_rev.run_action(:deploy)
end
it "removes the unsuccessful deploy after a later successful deploy" do
- ::File.should_not exist(File.join(deploy_directory, "releases", previous_rev))
+ expect(::File).not_to exist(File.join(deploy_directory, "releases", previous_rev))
end
end
diff --git a/spec/functional/resource/env_spec.rb b/spec/functional/resource/env_spec.rb
index cf77fef703..16caec14bf 100755
--- a/spec/functional/resource/env_spec.rb
+++ b/spec/functional/resource/env_spec.rb
@@ -22,6 +22,7 @@ describe Chef::Resource::Env, :windows_only do
context 'when running on Windows' do
let(:chef_env_test_lower_case) { 'chefenvtest' }
let(:chef_env_test_mixed_case) { 'chefENVtest' }
+ let(:env_dne_key) { 'env_dne_key' }
let(:env_value1) { 'value1' }
let(:env_value2) { 'value2' }
@@ -130,12 +131,12 @@ describe Chef::Resource::Env, :windows_only do
let!(:env_path_before) { ENV['PATH'] }
it 'should expand PATH' do
- path_before.should_not include(env_val)
+ expect(path_before).not_to include(env_val)
test_resource.key_name('PATH')
test_resource.value("#{path_before};#{env_val}")
test_resource.run_action(:create)
- ENV['PATH'].should_not include(env_val)
- ENV['PATH'].should include("#{random_name}")
+ expect(ENV['PATH']).not_to include(env_val)
+ expect(ENV['PATH']).to include("#{random_name}")
end
after(:each) do
@@ -177,6 +178,14 @@ describe Chef::Resource::Env, :windows_only do
expect(ENV[chef_env_test_lower_case]).to eq(nil)
expect(ENV[chef_env_test_mixed_case]).to eq(nil)
end
+
+ it "should delete a value from the current process even if it is not in the registry" do
+ expect(ENV[env_dne_key]).to eq(nil)
+ ENV[env_dne_key] = env_value1
+ test_resource.key_name(env_dne_key)
+ test_resource.run_action(:delete)
+ expect(ENV[env_dne_key]).to eq(nil)
+ end
end
end
end
diff --git a/spec/functional/resource/execute_spec.rb b/spec/functional/resource/execute_spec.rb
new file mode 100644
index 0000000000..39fef76ab0
--- /dev/null
+++ b/spec/functional/resource/execute_spec.rb
@@ -0,0 +1,113 @@
+#
+# Author:: Serdar Sutay (<serdar@opscode.com>)
+# Copyright:: Copyright (c) 2014 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'functional/resource/base'
+
+describe Chef::Resource::Execute do
+ let(:execute_resource) {
+ exec_resource = Chef::Resource::Execute.new("foo_resource", run_context)
+
+ exec_resource.environment(resource_environment) if resource_environment
+ exec_resource.cwd(resource_cwd) if resource_cwd
+ exec_resource.command("echo hello")
+ if guard
+ if guard_options
+ exec_resource.only_if(guard, guard_options)
+ else
+ exec_resource.only_if(guard)
+ end
+ end
+ exec_resource
+ }
+
+ let(:resource_environment) { nil }
+ let(:resource_cwd) { nil }
+ let(:guard) { nil }
+ let(:guard_options) { nil }
+
+ describe "when guard is ruby block" do
+ it "guard can still run" do
+ execute_resource.only_if do
+ true
+ end
+ execute_resource.run_action(:run)
+ expect(execute_resource).to be_updated_by_last_action
+ end
+ end
+
+ describe "when parent resource sets :cwd" do
+ let(:resource_cwd) { CHEF_SPEC_DATA }
+
+ let(:guard) { %{ruby -e 'exit 1 unless File.exists?("./big_json_plus_one.json")'} }
+
+ it "guard inherits :cwd from resource" do
+ execute_resource.run_action(:run)
+ expect(execute_resource).to be_updated_by_last_action
+ end
+ end
+
+ describe "when parent resource sets :environment" do
+ let(:resource_environment) do
+ {
+ "SAWS_SECRET" => "supersecret",
+ "SAWS_KEY" => "qwerty"
+ }
+ end
+
+ # We use ruby command so that we don't need to deal with platform specific
+ # commands while testing execute resource. We set it so that the resource
+ # will be updated if the ENV variable is set to what we are intending
+ let(:guard) { %{ruby -e 'exit 1 if ENV["SAWS_SECRET"] != "supersecret"'} }
+
+ it "guard inherits :environment value from resource" do
+ execute_resource.run_action(:run)
+ expect(execute_resource).to be_updated_by_last_action
+ end
+
+ describe "when guard sets additional values in the :environment" do
+ let(:guard) { %{ruby -e 'exit 1 if ENV["SGCE_SECRET"] != "regularsecret"'} }
+
+ let(:guard_options) do
+ {
+ :environment => { 'SGCE_SECRET' => "regularsecret" }
+ }
+ end
+
+ it "guard sees merged value for in its ENV" do
+ execute_resource.run_action(:run)
+ expect(execute_resource).to be_updated_by_last_action
+ end
+ end
+
+ describe "when guard sets same value in the :environment" do
+ let(:guard) { %{ruby -e 'exit 1 if ENV["SAWS_SECRET"] != "regularsecret"'} }
+
+ let(:guard_options) do
+ {
+ :environment => { 'SAWS_SECRET' => "regularsecret" }
+ }
+ end
+
+ it "guard sees value from guard options in its ENV" do
+ execute_resource.run_action(:run)
+ expect(execute_resource).to be_updated_by_last_action
+ end
+ end
+ end
+end
diff --git a/spec/functional/resource/file_spec.rb b/spec/functional/resource/file_spec.rb
index 99966f85c8..cf70c349fb 100644
--- a/spec/functional/resource/file_spec.rb
+++ b/spec/functional/resource/file_spec.rb
@@ -17,6 +17,7 @@
#
require 'spec_helper'
+require 'tmpdir'
describe Chef::Resource::File do
include_context Chef::Resource::File
@@ -30,6 +31,7 @@ describe Chef::Resource::File do
run_context = Chef::RunContext.new(node, {}, events)
use_path = if opts[:use_relative_path]
+ Dir.chdir(Dir.tmpdir)
File.basename(path)
else
path
@@ -75,11 +77,11 @@ describe Chef::Resource::File do
context "and the target file does not exist" do
it "creates the file" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "is marked updated by last action" do
- resource_without_content.should be_updated_by_last_action
+ expect(resource_without_content).to be_updated_by_last_action
end
end
end
@@ -104,11 +106,11 @@ describe Chef::Resource::File do
end
it "it creates the file" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "is marked updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
@@ -126,15 +128,15 @@ describe Chef::Resource::File do
end
it "updates the mtime of the file" do
- File.stat(path).mtime.should > @expected_mtime
+ expect(File.stat(path).mtime).to be > @expected_mtime
end
it "does not change the content" do
- sha256_checksum(path).should == @expected_checksum
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
end
diff --git a/spec/functional/resource/git_spec.rb b/spec/functional/resource/git_spec.rb
index f0bd94b0c0..4f462b7cb6 100644
--- a/spec/functional/resource/git_spec.rb
+++ b/spec/functional/resource/git_spec.rb
@@ -130,10 +130,10 @@ E
it "checks out the revision pointed to by the tag commit, not the tag commit itself" do
basic_git_resource.run_action(:sync)
head_rev = shell_out!('git rev-parse HEAD', :cwd => deploy_directory, :returns => [0]).stdout.strip
- head_rev.should == v1_commit
+ expect(head_rev).to eq(v1_commit)
# also verify the tag commit itself is what we expect as an extra sanity check
rev = shell_out!('git rev-parse v1.0.0', :cwd => deploy_directory, :returns => [0]).stdout.strip
- rev.should == v1_tag
+ expect(rev).to eq(v1_tag)
end
it "doesn't update if up-to-date" do
@@ -141,10 +141,10 @@ E
# properly to the pointed to commit.
basic_git_resource.run_action(:sync)
head_rev = shell_out!('git rev-parse HEAD', :cwd => deploy_directory, :returns => [0]).stdout.strip
- head_rev.should == v1_commit
+ expect(head_rev).to eq(v1_commit)
copy_git_resource.run_action(:sync)
- copy_git_resource.should_not be_updated
+ expect(copy_git_resource).not_to be_updated
end
end
@@ -167,25 +167,25 @@ E
basic_git_resource.revision rev_foo
basic_git_resource.run_action(:sync)
head_rev = shell_out!('git rev-parse HEAD', :cwd => deploy_directory, :returns => [0]).stdout.strip
- head_rev.should == rev_foo
+ expect(head_rev).to eq(rev_foo)
end
it "doesn't update if up-to-date" do
basic_git_resource.revision rev_foo
basic_git_resource.run_action(:sync)
head_rev = shell_out!('git rev-parse HEAD', :cwd => deploy_directory, :returns => [0]).stdout.strip
- head_rev.should == rev_foo
+ expect(head_rev).to eq(rev_foo)
copy_git_resource.revision rev_foo
copy_git_resource.run_action(:sync)
- copy_git_resource.should_not be_updated
+ expect(copy_git_resource).not_to be_updated
end
it "checks out the expected revision 972d" do
basic_git_resource.revision rev_testing
basic_git_resource.run_action(:sync)
head_rev = shell_out!('git rev-parse HEAD', :cwd => deploy_directory, :returns => [0]).stdout.strip
- head_rev.should == rev_testing
+ expect(head_rev).to eq(rev_testing)
end
end
@@ -200,7 +200,7 @@ E
it "checks out the expected revision" do
basic_git_resource.run_action(:sync)
head_rev = shell_out!('git rev-parse HEAD', :cwd => deploy_directory, :returns => [0]).stdout.strip
- head_rev.should == rev_head
+ expect(head_rev).to eq(rev_head)
end
end
@@ -215,7 +215,7 @@ E
it "checks out HEAD as the default revision" do
basic_git_resource.run_action(:sync)
head_rev = shell_out!('git rev-parse HEAD', :cwd => deploy_directory, :returns => [0]).stdout.strip
- head_rev.should == rev_head
+ expect(head_rev).to eq(rev_head)
end
end
@@ -244,7 +244,7 @@ E
head_rev = shell_out!('git rev-parse HEAD',
:cwd => deploy_directory,
:returns => [0]).stdout.strip
- head_rev.should == rev_head
+ expect(head_rev).to eq(rev_head)
end
it "checks out the (master) HEAD revision when no revision is specified (ignores tag)" do
@@ -252,7 +252,7 @@ E
head_rev = shell_out!('git rev-parse HEAD',
:cwd => deploy_directory,
:returns => [0]).stdout.strip
- head_rev.should == rev_head
+ expect(head_rev).to eq(rev_head)
end
end
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb
index 9c14232071..01e79f96bf 100644
--- a/spec/functional/resource/group_spec.rb
+++ b/spec/functional/resource/group_spec.rb
@@ -108,7 +108,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
temp_resource.append(true)
temp_resource.run_action(:modify)
members.each do |member|
- user_exist_in_group?(member).should == true
+ expect(user_exist_in_group?(member)).to eq(true)
end
end
@@ -119,7 +119,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
temp_resource.run_action(:create)
group_should_exist(group_name)
included_members.each do |member|
- user_exist_in_group?(member).should == false
+ expect(user_exist_in_group?(member)).to eq(false)
end
end
@@ -149,8 +149,8 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
it "should remove the existing users and add the new users to the group" do
group_resource.run_action(tested_action)
- user_exist_in_group?(spec_members[1]).should == true
- user_exist_in_group?(spec_members[0]).should == false
+ expect(user_exist_in_group?(spec_members[1])).to eq(true)
+ expect(user_exist_in_group?(spec_members[0])).to eq(false)
end
end
@@ -176,10 +176,10 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
group_resource.run_action(tested_action)
included_members.each do |member|
- user_exist_in_group?(member).should == true
+ expect(user_exist_in_group?(member)).to eq(true)
end
excluded_members.each do |member|
- user_exist_in_group?(member).should == false
+ expect(user_exist_in_group?(member)).to eq(false)
end
end
@@ -192,10 +192,10 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
group_resource.run_action(tested_action)
included_members.each do |member|
- user_exist_in_group?(member).should == true
+ expect(user_exist_in_group?(member)).to eq(true)
end
excluded_members.each do |member|
- user_exist_in_group?(member).should == false
+ expect(user_exist_in_group?(member)).to eq(false)
end
end
end
@@ -204,13 +204,13 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
describe "when the users doesn't exist" do
describe "when append is not set" do
it "should raise an error" do
- lambda { @grp_resource.run_action(tested_action) }.should raise_error
+ expect { @grp_resource.run_action(tested_action) }.to raise_error
end
end
describe "when append is set" do
it "should raise an error" do
- lambda { @grp_resource.run_action(tested_action) }.should raise_error
+ expect { @grp_resource.run_action(tested_action) }.to raise_error
end
end
end
@@ -231,24 +231,24 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
describe "when updating membership" do
it "raises an error for a non well-formed domain name" do
group_resource.members [invalid_domain_user_name]
- lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError
+ expect { group_resource.run_action(tested_action) }.to raise_error Chef::Exceptions::Win32APIError
end
it "raises an error for a nonexistent domain" do
group_resource.members [nonexistent_domain_user_name]
- lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError
+ expect { group_resource.run_action(tested_action) }.to raise_error Chef::Exceptions::Win32APIError
end
end
describe "when removing members" do
it "raises an error for a non well-formed domain name" do
group_resource.excluded_members [invalid_domain_user_name]
- lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError
+ expect { group_resource.run_action(tested_action) }.to raise_error Chef::Exceptions::Win32APIError
end
it "raises an error for a nonexistent domain" do
group_resource.excluded_members [nonexistent_domain_user_name]
- lambda { group_resource.run_action(tested_action) }.should raise_error Chef::Exceptions::Win32APIError
+ expect { group_resource.run_action(tested_action) }.to raise_error Chef::Exceptions::Win32APIError
end
end
end
@@ -264,7 +264,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte
}
it "append should be false by default" do
- group_resource.append.should == false
+ expect(group_resource.append).to eq(false)
end
describe "group create action" do
@@ -297,7 +297,7 @@ theoldmanwalkingdownthestreetalwayshadagoodsmileonhisfacetheoldmanwalking\
downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
it "should not create a group" do
- lambda { group_resource.run_action(:create) }.should raise_error
+ expect { group_resource.run_action(:create) }.to raise_error
group_should_not_exist(group_name)
end
end
@@ -308,7 +308,7 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
invalid_resource = group_resource.dup
invalid_resource.members(["Jack"])
invalid_resource.excluded_members(["Jack"])
- lambda { invalid_resource.run_action(:create)}.should raise_error(Chef::Exceptions::ConflictingMembersInGroup)
+ expect { invalid_resource.run_action(:create)}.to raise_error(Chef::Exceptions::ConflictingMembersInGroup)
end
end
end
@@ -342,7 +342,7 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
describe "when there is no group" do
it "should raise an error" do
- lambda { group_resource.run_action(:modify) }.should raise_error
+ expect { group_resource.run_action(:modify) }.to raise_error
end
end
@@ -370,11 +370,11 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
describe "when there is no group" do
it "raises an error on modify" do
- lambda { group_resource.run_action(:modify) }.should raise_error
+ expect { group_resource.run_action(:modify) }.to raise_error
end
it "does not raise an error on manage" do
- lambda { group_resource.run_action(:manage) }.should_not raise_error
+ expect { group_resource.run_action(:manage) }.not_to raise_error
end
end
@@ -399,15 +399,15 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
let(:excluded_members) { ["Anthony"] }
it ":manage should raise an error" do
- lambda {group_resource.run_action(:manage) }.should raise_error
+ expect {group_resource.run_action(:manage) }.to raise_error
end
it ":modify should raise an error" do
- lambda {group_resource.run_action(:modify) }.should raise_error
+ expect {group_resource.run_action(:modify) }.to raise_error
end
it ":create should raise an error" do
- lambda {group_resource.run_action(:create) }.should raise_error
+ expect {group_resource.run_action(:create) }.to raise_error
end
end
@@ -419,11 +419,11 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
end
it ":manage should raise an error" do
- lambda {group_resource.run_action(:manage) }.should raise_error
+ expect {group_resource.run_action(:manage) }.to raise_error
end
it ":modify should raise an error" do
- lambda {group_resource.run_action(:modify) }.should raise_error
+ expect {group_resource.run_action(:modify) }.to raise_error
end
end
end
diff --git a/spec/functional/resource/ifconfig_spec.rb b/spec/functional/resource/ifconfig_spec.rb
index c36288498b..9c613544ac 100644
--- a/spec/functional/resource/ifconfig_spec.rb
+++ b/spec/functional/resource/ifconfig_spec.rb
@@ -143,7 +143,7 @@ describe Chef::Resource::Ifconfig, :requires_root, :external => include_flag do
end
it "should disable interface (vip)" do
new_resource.run_action(:disable)
- new_resource.should be_updated_by_last_action
+ expect(new_resource).to be_updated_by_last_action
interface_should_not_exists(network_interface_alias(en0_interface_for_test))
end
end
@@ -155,7 +155,7 @@ describe Chef::Resource::Ifconfig, :requires_root, :external => include_flag do
end
it "should delete interface (vip)" do
new_resource.run_action(:delete)
- new_resource.should be_updated_by_last_action
+ expect(new_resource).to be_updated_by_last_action
interface_should_not_exists(network_interface_alias(en0_interface_for_test))
interface_persistence_should_not_exists(network_interface_alias(en0_interface_for_test))
end
diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb
index 2220e973cf..b4c6412e5d 100644
--- a/spec/functional/resource/link_spec.rb
+++ b/spec/functional/resource/link_spec.rb
@@ -123,8 +123,8 @@ describe Chef::Resource::Link do
describe "when supported on platform", :not_supported_on_win2k3 do
shared_examples_for 'delete errors out' do
it 'delete errors out' do
- lambda { resource.run_action(:delete) }.should raise_error(Chef::Exceptions::Link)
- (File.exist?(target_file) || symlink?(target_file)).should be_true
+ expect { resource.run_action(:delete) }.to raise_error(Chef::Exceptions::Link)
+ expect(File.exist?(target_file) || symlink?(target_file)).to be_truthy
end
end
@@ -132,19 +132,19 @@ describe Chef::Resource::Link do
describe 'the :delete action' do
before(:each) do
@info = []
- Chef::Log.stub(:info) { |msg| @info << msg }
+ allow(Chef::Log).to receive(:info) { |msg| @info << msg }
resource.run_action(:delete)
end
it 'leaves the file deleted' do
- File.exist?(target_file).should be_false
- symlink?(target_file).should be_false
+ expect(File.exist?(target_file)).to be_falsey
+ expect(symlink?(target_file)).to be_falsey
end
it 'does not mark the resource updated' do
- resource.should_not be_updated
+ expect(resource).not_to be_updated
end
it 'does not log that it deleted' do
- @info.include?("link[#{target_file}] deleted").should be_false
+ expect(@info.include?("link[#{target_file}] deleted")).to be_falsey
end
end
end
@@ -153,19 +153,19 @@ describe Chef::Resource::Link do
describe 'the :delete action' do
before(:each) do
@info = []
- Chef::Log.stub(:info) { |msg| @info << msg }
+ allow(Chef::Log).to receive(:info) { |msg| @info << msg }
resource.run_action(:delete)
end
it 'deletes the file' do
- File.exist?(target_file).should be_false
- symlink?(target_file).should be_false
+ expect(File.exist?(target_file)).to be_falsey
+ expect(symlink?(target_file)).to be_falsey
end
it 'marks the resource updated' do
- resource.should be_updated
+ expect(resource).to be_updated
end
it 'logs that it deleted' do
- @info.include?("link[#{target_file}] deleted").should be_true
+ expect(@info.include?("link[#{target_file}] deleted")).to be_truthy
end
end
end
@@ -174,19 +174,19 @@ describe Chef::Resource::Link do
describe 'the :create action' do
before(:each) do
@info = []
- Chef::Log.stub(:info) { |msg| @info << msg }
+ allow(Chef::Log).to receive(:info) { |msg| @info << msg }
resource.run_action(:create)
end
it 'links to the target file' do
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), to).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), to)).to be_truthy
end
it 'marks the resource updated' do
- resource.should be_updated
+ expect(resource).to be_updated
end
it 'logs that it created' do
- @info.include?("link[#{target_file}] created").should be_true
+ expect(@info.include?("link[#{target_file}] created")).to be_truthy
end
end
end
@@ -195,19 +195,19 @@ describe Chef::Resource::Link do
describe 'the :create action' do
before(:each) do
@info = []
- Chef::Log.stub(:info) { |msg| @info << msg }
+ allow(Chef::Log).to receive(:info) { |msg| @info << msg }
resource.run_action(:create)
end
it 'leaves the file linked' do
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), to).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), to)).to be_truthy
end
it 'does not mark the resource updated' do
- resource.should_not be_updated
+ expect(resource).not_to be_updated
end
it 'does not log that it created' do
- @info.include?("link[#{target_file}] created").should be_false
+ expect(@info.include?("link[#{target_file}] created")).to be_falsey
end
end
end
@@ -216,23 +216,23 @@ describe Chef::Resource::Link do
describe 'the :create action' do
before(:each) do
@info = []
- Chef::Log.stub(:info) { |msg| @info << msg }
+ allow(Chef::Log).to receive(:info) { |msg| @info << msg }
resource.run_action(:create)
end
it 'preserves the hard link' do
- File.exists?(target_file).should be_true
- symlink?(target_file).should be_false
+ expect(File.exists?(target_file)).to be_truthy
+ expect(symlink?(target_file)).to be_falsey
# Writing to one hardlinked file should cause both
# to have the new value.
- IO.read(to).should == IO.read(target_file)
+ expect(IO.read(to)).to eq(IO.read(target_file))
File.open(to, "w") { |file| file.write('wowzers') }
- IO.read(target_file).should == 'wowzers'
+ expect(IO.read(target_file)).to eq('wowzers')
end
it 'marks the resource updated' do
- resource.should be_updated
+ expect(resource).to be_updated
end
it 'logs that it created' do
- @info.include?("link[#{target_file}] created").should be_true
+ expect(@info.include?("link[#{target_file}] created")).to be_truthy
end
end
end
@@ -241,23 +241,23 @@ describe Chef::Resource::Link do
describe 'the :create action' do
before(:each) do
@info = []
- Chef::Log.stub(:info) { |msg| @info << msg }
+ allow(Chef::Log).to receive(:info) { |msg| @info << msg }
resource.run_action(:create)
end
it 'links to the target file' do
- File.exists?(target_file).should be_true
- symlink?(target_file).should be_false
+ expect(File.exists?(target_file)).to be_truthy
+ expect(symlink?(target_file)).to be_falsey
# Writing to one hardlinked file should cause both
# to have the new value.
- IO.read(to).should == IO.read(target_file)
+ expect(IO.read(to)).to eq(IO.read(target_file))
File.open(to, "w") { |file| file.write('wowzers') }
- IO.read(target_file).should == 'wowzers'
+ expect(IO.read(target_file)).to eq('wowzers')
end
it 'does not mark the resource updated' do
- resource.should_not be_updated
+ expect(resource).not_to be_updated
end
it 'does not log that it created' do
- @info.include?("link[#{target_file}] created").should be_false
+ expect(@info.include?("link[#{target_file}] created")).to be_falsey
end
end
end
@@ -278,14 +278,14 @@ describe Chef::Resource::Link do
context 'pointing at the target' do
before(:each) do
symlink(to, target_file)
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), to).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), to)).to be_truthy
end
include_context 'create symbolic link is noop'
include_context 'delete succeeds'
it 'the :delete action does not delete the target file' do
resource.run_action(:delete)
- File.exists?(to).should be_true
+ expect(File.exists?(to)).to be_truthy
end
end
context 'pointing somewhere else' do
@@ -293,8 +293,8 @@ describe Chef::Resource::Link do
@other_target = File.join(test_file_dir, make_tmpname('other_spec'))
File.open(@other_target, 'w') { |file| file.write('eek') }
symlink(@other_target, target_file)
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), @other_target).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), @other_target)).to be_truthy
end
after(:each) do
File.delete(@other_target)
@@ -303,15 +303,15 @@ describe Chef::Resource::Link do
include_context 'delete succeeds'
it 'the :delete action does not delete the target file' do
resource.run_action(:delete)
- File.exists?(to).should be_true
+ expect(File.exists?(to)).to be_truthy
end
end
context 'pointing nowhere' do
before(:each) do
nonexistent = File.join(test_file_dir, make_tmpname('nonexistent_spec'))
symlink(nonexistent, target_file)
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), nonexistent).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), nonexistent)).to be_truthy
end
include_context 'create symbolic link succeeds'
include_context 'delete succeeds'
@@ -320,8 +320,8 @@ describe Chef::Resource::Link do
context 'and the link already exists and is a hard link to the file' do
before(:each) do
link(to, target_file)
- File.exists?(target_file).should be_true
- symlink?(target_file).should be_false
+ expect(File.exists?(target_file)).to be_truthy
+ expect(symlink?(target_file)).to be_falsey
end
include_context 'create symbolic link succeeds'
it_behaves_like 'delete errors out'
@@ -339,16 +339,16 @@ describe Chef::Resource::Link do
end
it 'create errors out' do
if windows?
- lambda { resource.run_action(:create) }.should raise_error(Errno::EACCES)
+ expect { resource.run_action(:create) }.to raise_error(Errno::EACCES)
elsif os_x? or solaris? or freebsd? or aix?
- lambda { resource.run_action(:create) }.should raise_error(Errno::EPERM)
+ expect { resource.run_action(:create) }.to raise_error(Errno::EPERM)
else
- lambda { resource.run_action(:create) }.should raise_error(Errno::EISDIR)
+ expect { resource.run_action(:create) }.to raise_error(Errno::EISDIR)
end
end
it_behaves_like 'delete errors out'
end
- context 'and the link already exists and is not writeable to this user', :pending do
+ context 'and the link already exists and is not writeable to this user', :skip => true do
end
it_behaves_like 'a securable resource without existing target' do
let(:path) { target_file }
@@ -392,8 +392,8 @@ describe Chef::Resource::Link do
@other_target = File.join(test_file_dir, make_tmpname("other_spec"))
File.open(@other_target, "w") { |file| file.write("eek") }
symlink(@other_target, to)
- symlink?(to).should be_true
- paths_eql?(readlink(to), @other_target).should be_true
+ expect(symlink?(to)).to be_truthy
+ expect(paths_eql?(readlink(to), @other_target)).to be_truthy
end
after(:each) do
File.delete(@other_target)
@@ -407,8 +407,8 @@ describe Chef::Resource::Link do
before(:each) do
@other_target = File.join(test_file_dir, make_tmpname("other_spec"))
symlink(@other_target, to)
- symlink?(to).should be_true
- paths_eql?(readlink(to), @other_target).should be_true
+ expect(symlink?(to)).to be_truthy
+ expect(paths_eql?(readlink(to), @other_target)).to be_truthy
end
context 'and the link does not yet exist' do
include_context 'create symbolic link succeeds'
@@ -416,7 +416,7 @@ describe Chef::Resource::Link do
end
end
end
- context "when the link destination is not readable to this user", :pending do
+ context "when the link destination is not readable to this user", :skip => true do
end
context "when the link destination does not exist" do
include_context 'create symbolic link succeeds'
@@ -440,8 +440,8 @@ describe Chef::Resource::Link do
context 'when the link already exists and points at the target' do
before(:each) do
symlink(to, target_file)
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), to).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), to)).to be_truthy
end
include_context 'create symbolic link is noop'
include_context 'delete succeeds'
@@ -449,8 +449,8 @@ describe Chef::Resource::Link do
context 'when the link already exists and points at the target with an absolute path' do
before(:each) do
symlink(absolute_to, target_file)
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), absolute_to).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), absolute_to)).to be_truthy
end
include_context 'create symbolic link succeeds'
include_context 'delete succeeds'
@@ -477,8 +477,8 @@ describe Chef::Resource::Link do
context "and the link already exists and is a symbolic link pointing at the same file" do
before(:each) do
symlink(to, target_file)
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), to).should be_true
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), to)).to be_truthy
end
include_context 'create hard link succeeds'
it_behaves_like 'delete errors out'
@@ -486,14 +486,14 @@ describe Chef::Resource::Link do
context 'and the link already exists and is a hard link to the file' do
before(:each) do
link(to, target_file)
- File.exists?(target_file).should be_true
- symlink?(target_file).should be_false
+ expect(File.exists?(target_file)).to be_truthy
+ expect(symlink?(target_file)).to be_falsey
end
include_context 'create hard link is noop'
include_context 'delete succeeds'
it 'the :delete action does not delete the target file' do
resource.run_action(:delete)
- File.exists?(to).should be_true
+ expect(File.exists?(to)).to be_truthy
end
end
context "and the link already exists and is a file" do
@@ -509,16 +509,16 @@ describe Chef::Resource::Link do
end
it 'errors out' do
if windows?
- lambda { resource.run_action(:create) }.should raise_error(Errno::EACCES)
+ expect { resource.run_action(:create) }.to raise_error(Errno::EACCES)
elsif os_x? or solaris? or freebsd? or aix?
- lambda { resource.run_action(:create) }.should raise_error(Errno::EPERM)
+ expect { resource.run_action(:create) }.to raise_error(Errno::EPERM)
else
- lambda { resource.run_action(:create) }.should raise_error(Errno::EISDIR)
+ expect { resource.run_action(:create) }.to raise_error(Errno::EISDIR)
end
end
it_behaves_like 'delete errors out'
end
- context "and the link already exists and is not writeable to this user", :pending do
+ context "and the link already exists and is not writeable to this user", :skip => true do
end
context "and specifies security attributes" do
before(:each) do
@@ -527,9 +527,9 @@ describe Chef::Resource::Link do
it 'ignores them' do
resource.run_action(:create)
if windows?
- Chef::ReservedNames::Win32::Security.get_named_security_info(target_file).owner.should_not == SID.Guest
+ expect(Chef::ReservedNames::Win32::Security.get_named_security_info(target_file).owner).not_to eq(SID.Guest)
else
- File.lstat(target_file).uid.should_not == Etc.getpwnam('nobody').uid
+ expect(File.lstat(target_file).uid).not_to eq(Etc.getpwnam('nobody').uid)
end
end
end
@@ -540,7 +540,7 @@ describe Chef::Resource::Link do
end
context 'and the link does not yet exist' do
it 'create errors out' do
- lambda { resource.run_action(:create) }.should raise_error(windows? ? Chef::Exceptions::Win32APIError : Errno::EPERM)
+ expect { resource.run_action(:create) }.to raise_error(windows? ? Chef::Exceptions::Win32APIError : Errno::EPERM)
end
include_context 'delete is noop'
end
@@ -551,8 +551,8 @@ describe Chef::Resource::Link do
@other_target = File.join(test_file_dir, make_tmpname("other_spec"))
File.open(@other_target, "w") { |file| file.write("eek") }
symlink(@other_target, to)
- symlink?(to).should be_true
- paths_eql?(readlink(to), @other_target).should be_true
+ expect(symlink?(to)).to be_truthy
+ expect(paths_eql?(readlink(to), @other_target)).to be_truthy
end
after(:each) do
File.delete(@other_target)
@@ -560,12 +560,11 @@ describe Chef::Resource::Link do
context 'and the link does not yet exist' do
it 'links to the target file' do
resource.run_action(:create)
- File.exists?(target_file).should be_true
+ expect(File.exists?(target_file)).to be_truthy
# OS X gets angry about this sort of link. Bug in OS X, IMO.
- pending('OS X/FreeBSD/AIX symlink? and readlink working on hard links to symlinks', :if => (os_x? or freebsd? or aix?)) do
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), @other_target).should be_true
- end
+ pending('OS X/FreeBSD/AIX symlink? and readlink working on hard links to symlinks') if (os_x? or freebsd? or aix?)
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), @other_target)).to be_truthy
end
include_context 'delete is noop'
end
@@ -574,33 +573,32 @@ describe Chef::Resource::Link do
before(:each) do
@other_target = File.join(test_file_dir, make_tmpname("other_spec"))
symlink(@other_target, to)
- symlink?(to).should be_true
- paths_eql?(readlink(to), @other_target).should be_true
+ expect(symlink?(to)).to be_truthy
+ expect(paths_eql?(readlink(to), @other_target)).to be_truthy
end
context 'and the link does not yet exist' do
it 'links to the target file' do
- pending('OS X/FreeBSD/AIX fails to create hardlinks to broken symlinks', :if => (os_x? or freebsd? or aix?)) do
- resource.run_action(:create)
- # Windows and Unix have different definitions of exists? here, and that's OK.
- if windows?
- File.exists?(target_file).should be_true
- else
- File.exists?(target_file).should be_false
- end
- symlink?(target_file).should be_true
- paths_eql?(readlink(target_file), @other_target).should be_true
+ pending('OS X/FreeBSD/AIX fails to create hardlinks to broken symlinks') if (os_x? or freebsd? or aix?)
+ resource.run_action(:create)
+ # Windows and Unix have different definitions of exists? here, and that's OK.
+ if windows?
+ expect(File.exists?(target_file)).to be_truthy
+ else
+ expect(File.exists?(target_file)).to be_falsey
end
+ expect(symlink?(target_file)).to be_truthy
+ expect(paths_eql?(readlink(target_file), @other_target)).to be_truthy
end
include_context 'delete is noop'
end
end
end
- context "when the link destination is not readable to this user", :pending do
+ context "when the link destination is not readable to this user", :skip => true do
end
context "when the link destination does not exist" do
context 'and the link does not yet exist' do
it 'create errors out' do
- lambda { resource.run_action(:create) }.should raise_error(Errno::ENOENT)
+ expect { resource.run_action(:create) }.to raise_error(Errno::ENOENT)
end
include_context 'delete is noop'
end
@@ -610,7 +608,7 @@ describe Chef::Resource::Link do
describe "when not supported on platform", :win2k3_only do
it "raises error" do
- lambda {resource}.should raise_error(Chef::Exceptions::Win32APIFunctionNotImplemented)
+ expect {resource}.to raise_error(Chef::Exceptions::Win32APIFunctionNotImplemented)
end
end
end
diff --git a/spec/functional/resource/mount_spec.rb b/spec/functional/resource/mount_spec.rb
index 962c02670c..a016d12293 100644
--- a/spec/functional/resource/mount_spec.rb
+++ b/spec/functional/resource/mount_spec.rb
@@ -82,7 +82,7 @@ describe Chef::Resource::Mount, :requires_root, :external => include_flag do
end
def mount_should_not_exists(mount_point)
- shell_out("mount").stdout.should_not include(mount_point)
+ expect(shell_out("mount").stdout).not_to include(mount_point)
end
def unix_mount_config_file
@@ -106,7 +106,7 @@ describe Chef::Resource::Mount, :requires_root, :external => include_flag do
end
def mount_should_be_disabled(mount_point)
- shell_out("cat #{unix_mount_config_file}").stdout.should_not include("#{mount_point}:")
+ expect(shell_out("cat #{unix_mount_config_file}").stdout).not_to include("#{mount_point}:")
end
let(:new_resource) do
@@ -155,10 +155,10 @@ describe Chef::Resource::Mount, :requires_root, :external => include_flag do
describe "when the target state is a mounted filesystem" do
it "should mount the filesystem if it isn't mounted" do
- current_resource.enabled.should be_false
- current_resource.mounted.should be_false
+ expect(current_resource.enabled).to be_falsey
+ expect(current_resource.mounted).to be_falsey
new_resource.run_action(:mount)
- new_resource.should be_updated
+ expect(new_resource).to be_updated
mount_should_exist(new_resource.mount_point, new_resource.device)
end
end
diff --git a/spec/functional/resource/ohai_spec.rb b/spec/functional/resource/ohai_spec.rb
index b1e4891293..da47b9e140 100644
--- a/spec/functional/resource/ohai_spec.rb
+++ b/spec/functional/resource/ohai_spec.rb
@@ -42,7 +42,7 @@ describe Chef::Resource::Ohai do
sleep 1
ohai_resource.run_action(:reload)
- node[:uptime].should_not == initial_uptime
+ expect(node[:uptime]).not_to eq(initial_uptime)
end
end
diff --git a/spec/functional/resource/package_spec.rb b/spec/functional/resource/package_spec.rb
index 548db40e79..5c17ca0107 100644
--- a/spec/functional/resource/package_spec.rb
+++ b/spec/functional/resource/package_spec.rb
@@ -159,25 +159,25 @@ describe Chef::Resource::Package, metadata do
it "installs the package with action :install" do
package_resource.run_action(:install)
shell_out!("dpkg -l chef-integration-test")
- package_resource.should be_updated_by_last_action
+ expect(package_resource).to be_updated_by_last_action
end
it "installs the package for action :upgrade" do
package_resource.run_action(:upgrade)
shell_out!("dpkg -l chef-integration-test")
- package_resource.should be_updated_by_last_action
+ expect(package_resource).to be_updated_by_last_action
end
it "does nothing for action :remove" do
package_resource.run_action(:remove)
shell_out!("dpkg -l chef-integration-test", :returns => [1])
- package_resource.should_not be_updated_by_last_action
+ expect(package_resource).not_to be_updated_by_last_action
end
it "does nothing for action :purge" do
package_resource.run_action(:purge)
shell_out!("dpkg -l chef-integration-test", :returns => [1])
- package_resource.should_not be_updated_by_last_action
+ expect(package_resource).not_to be_updated_by_last_action
end
context "and a not-available package version is specified" do
@@ -221,8 +221,8 @@ describe Chef::Resource::Package, metadata do
it "preseeds the package, then installs it" do
package_resource.run_action(:install)
cmd = shell_out!("debconf-show chef-integration-test")
- cmd.stdout.should include('chef-integration-test/sample-var: "hello world"')
- package_resource.should be_updated_by_last_action
+ expect(cmd.stdout).to include('chef-integration-test/sample-var: "hello world"')
+ expect(package_resource).to be_updated_by_last_action
end
context "and the preseed file exists and is up-to-date" do
@@ -239,8 +239,8 @@ describe Chef::Resource::Package, metadata do
it "does not update the package configuration" do
package_resource.run_action(:install)
cmd = shell_out!("debconf-show chef-integration-test")
- cmd.stdout.should include('chef-integration-test/sample-var: INVALID')
- package_resource.should be_updated_by_last_action
+ expect(cmd.stdout).to include('chef-integration-test/sample-var: INVALID')
+ expect(package_resource).to be_updated_by_last_action
end
end
@@ -267,8 +267,8 @@ describe Chef::Resource::Package, metadata do
it "preseeds the package, then installs it" do
package_resource.run_action(:install)
cmd = shell_out!("debconf-show chef-integration-test")
- cmd.stdout.should include('chef-integration-test/sample-var: "FROM TEMPLATE"')
- package_resource.should be_updated_by_last_action
+ expect(cmd.stdout).to include('chef-integration-test/sample-var: "FROM TEMPLATE"')
+ expect(package_resource).to be_updated_by_last_action
end
context "with variables" do
@@ -283,8 +283,8 @@ describe Chef::Resource::Package, metadata do
it "preseeds the package, then installs it" do
package_resource.run_action(:install)
cmd = shell_out!("debconf-show chef-integration-test")
- cmd.stdout.should include('chef-integration-test/sample-var: "SUPPORTS VARIABLES"')
- package_resource.should be_updated_by_last_action
+ expect(cmd.stdout).to include('chef-integration-test/sample-var: "SUPPORTS VARIABLES"')
+ expect(package_resource).to be_updated_by_last_action
end
end
@@ -302,13 +302,13 @@ describe Chef::Resource::Package, metadata do
it "does nothing for action :install" do
package_resource.run_action(:install)
shell_out!("dpkg -l chef-integration-test", :returns => [0])
- package_resource.should_not be_updated_by_last_action
+ expect(package_resource).not_to be_updated_by_last_action
end
it "does nothing for action :upgrade" do
package_resource.run_action(:upgrade)
shell_out!("dpkg -l chef-integration-test", :returns => [0])
- package_resource.should_not be_updated_by_last_action
+ expect(package_resource).not_to be_updated_by_last_action
end
# Verify that the package is removed by running `dpkg -l PACKAGE`
@@ -328,7 +328,7 @@ describe Chef::Resource::Package, metadata do
pkg_check = shell_out!("dpkg -l chef-integration-test", :returns => [0,1])
if pkg_check.exitstatus == 0
- pkg_check.stdout.should =~ /un[\s]+chef-integration-test/
+ expect(pkg_check.stdout).to match(/un[\s]+chef-integration-test/)
end
end
@@ -336,13 +336,13 @@ describe Chef::Resource::Package, metadata do
it "removes the package for action :remove" do
package_resource.run_action(:remove)
pkg_should_be_removed
- package_resource.should be_updated_by_last_action
+ expect(package_resource).to be_updated_by_last_action
end
it "removes the package for action :purge" do
package_resource.run_action(:purge)
pkg_should_be_removed
- package_resource.should be_updated_by_last_action
+ expect(package_resource).to be_updated_by_last_action
end
end
@@ -356,14 +356,14 @@ describe Chef::Resource::Package, metadata do
it "does nothing for action :install" do
package_resource.run_action(:install)
shell_out!("dpkg -l chef-integration-test", :returns => [0])
- package_resource.should_not be_updated_by_last_action
+ expect(package_resource).not_to be_updated_by_last_action
end
it "upgrades the package for action :upgrade" do
package_resource.run_action(:upgrade)
dpkg_l = shell_out!("dpkg -l chef-integration-test", :returns => [0])
- dpkg_l.stdout.should =~ /chef\-integration\-test[\s]+1\.1\-1/
- package_resource.should be_updated_by_last_action
+ expect(dpkg_l.stdout).to match(/chef\-integration\-test[\s]+1\.1\-1/)
+ expect(package_resource).to be_updated_by_last_action
end
context "and the resource specifies the new version" do
@@ -376,8 +376,8 @@ describe Chef::Resource::Package, metadata do
it "upgrades the package for action :install" do
package_resource.run_action(:install)
dpkg_l = shell_out!("dpkg -l chef-integration-test", :returns => [0])
- dpkg_l.stdout.should =~ /chef\-integration\-test[\s]+1\.1\-1/
- package_resource.should be_updated_by_last_action
+ expect(dpkg_l.stdout).to match(/chef\-integration\-test[\s]+1\.1\-1/)
+ expect(package_resource).to be_updated_by_last_action
end
end
diff --git a/spec/functional/resource/powershell_spec.rb b/spec/functional/resource/powershell_spec.rb
index 96a356f441..033f34e256 100644
--- a/spec/functional/resource/powershell_spec.rb
+++ b/spec/functional/resource/powershell_spec.rb
@@ -22,6 +22,12 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
include_context Chef::Resource::WindowsScript
+ let (:architecture_command) { 'echo $env:PROCESSOR_ARCHITECTURE' }
+ let (:output_command) { ' | out-file -encoding ASCII ' }
+
+ it_behaves_like "a Windows script running on Windows"
+
+
let(:successful_executable_script_content) { "#{ENV['SystemRoot']}\\system32\\attrib.exe $env:systemroot" }
let(:failed_executable_script_content) { "#{ENV['SystemRoot']}\\system32\\attrib.exe /badargument" }
let(:processor_architecture_script_content) { "echo $env:PROCESSOR_ARCHITECTURE" }
@@ -36,6 +42,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
let(:arbitrary_nonzero_process_exit_code_content) { "exit #{arbitrary_nonzero_process_exit_code}" }
let(:invalid_powershell_interpreter_flag) { "/thisflagisinvalid" }
let(:valid_powershell_interpreter_flag) { "-Sta" }
+
let!(:resource) do
r = Chef::Resource::WindowsScript::PowershellScript.new("Powershell resource functional test", @run_context)
r.code(successful_executable_script_content)
@@ -146,7 +153,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
detected_64_bit = source_contains_case_insensitive_content?( get_script_output, 'AMD64' )
- is_64_bit.should == detected_64_bit
+ expect(is_64_bit).to eq(detected_64_bit)
end
it "returns 1 if an invalid flag is passed to the interpreter" do
@@ -179,12 +186,12 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
resource.returns(0)
resource.run_action(:run)
- source_contains_case_insensitive_content?( get_script_output, 'x86' ).should == true
+ expect(source_contains_case_insensitive_content?( get_script_output, 'x86' )).to eq(true)
end
it "raises an exception if :x86_64 process architecture is specified" do
begin
- resource.architecture(:x86_64).should raise_error Chef::Exceptions::Win32ArchitectureIncorrect
+ expect(resource.architecture(:x86_64)).to raise_error Chef::Exceptions::Win32ArchitectureIncorrect
rescue Chef::Exceptions::Win32ArchitectureIncorrect
end
end
@@ -197,7 +204,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
resource.returns(0)
resource.run_action(:run)
- source_contains_case_insensitive_content?( get_script_output, 'AMD64' ).should == true
+ expect(source_contains_case_insensitive_content?( get_script_output, 'AMD64' )).to eq(true)
end
it "executes a script with a 32-bit process if :i386 arch is specified" do
@@ -206,7 +213,7 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
resource.returns(0)
resource.run_action(:run)
- source_contains_case_insensitive_content?( get_script_output, 'x86' ).should == true
+ expect(source_contains_case_insensitive_content?( get_script_output, 'x86' )).to eq(true)
end
end
@@ -214,227 +221,232 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
before(:each) do
resource.not_if.clear
resource.only_if.clear
- # resource.guard_interpreter should be :default by default
end
- it "evaluates a succeeding not_if block using cmd.exe as false by default" do
- resource.not_if "exit /b 0"
- resource.should_skip?(:run).should be_true
- end
+ context "when the guard_interpreter's default value of :powershell_script is overridden to :default" do
+ before(:each) do
+ resource.guard_interpreter :default
+ end
- it "evaluates a failing not_if block using cmd.exe as true by default" do
- resource.not_if "exit /b 2"
- resource.should_skip?(:run).should be_false
- end
+ it "evaluates a succeeding not_if block using cmd.exe as false by default" do
+ resource.not_if "exit /b 0"
+ expect(resource.should_skip?(:run)).to be_truthy
+ end
- it "evaluates an succeeding only_if block using cmd.exe as true by default" do
- resource.only_if "exit /b 0"
- resource.should_skip?(:run).should be_false
- end
+ it "evaluates a failing not_if block using cmd.exe as true by default" do
+ resource.not_if "exit /b 2"
+ expect(resource.should_skip?(:run)).to be_falsey
+ end
+
+ it "evaluates an succeeding only_if block using cmd.exe as true by default" do
+ resource.only_if "exit /b 0"
+ expect(resource.should_skip?(:run)).to be_falsey
+ end
- it "evaluates a failing only_if block using cmd.exe as false by default" do
- resource.only_if "exit /b 2"
- resource.should_skip?(:run).should be_true
+ it "evaluates a failing only_if block using cmd.exe as false by default" do
+ resource.only_if "exit /b 2"
+ expect(resource.should_skip?(:run)).to be_truthy
+ end
end
context "the only_if is specified before the guard" do
before do
- # force the guard_interpreter to :default in case the default changes later
resource.guard_interpreter :default
end
it "evaluates a powershell $true for a only_if block as true" do
resource.only_if "$true"
resource.guard_interpreter :powershell_script
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
end
context "with powershell_script as the guard_interpreter" do
- before(:each) do
- resource.guard_interpreter :powershell_script
+
+ it "has a guard_interpreter attribute set to :powershell_script" do
+ expect(resource.guard_interpreter).to eq(:powershell_script)
end
it "evaluates a powershell $false for a not_if block as true" do
resource.not_if "$false"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a powershell $true for a not_if block as false" do
resource.not_if "$true"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a powershell $false for an only_if block as false" do
resource.only_if "$false"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a powershell $true for a only_if block as true" do
resource.only_if "$true"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a not_if block using powershell.exe" do
resource.not_if "exit([int32](![System.Environment]::CommandLine.Contains('powershell.exe')))"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates an only_if block using powershell.exe" do
resource.only_if "exit([int32](![System.Environment]::CommandLine.Contains('powershell.exe')))"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a non-zero powershell exit status for not_if as true" do
resource.not_if "exit 37"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a zero powershell exit status for not_if as false" do
resource.not_if "exit 0"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a failed executable exit status for not_if as false" do
resource.not_if windows_process_exit_code_not_found_content
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a successful executable exit status for not_if as true" do
resource.not_if windows_process_exit_code_success_content
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a failed executable exit status for only_if as false" do
resource.only_if windows_process_exit_code_not_found_content
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a successful executable exit status for only_if as true" do
resource.only_if windows_process_exit_code_success_content
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a failed cmdlet exit status for not_if as true" do
resource.not_if "throw 'up'"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a successful cmdlet exit status for not_if as true" do
resource.not_if "cd ."
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a failed cmdlet exit status for only_if as false" do
resource.only_if "throw 'up'"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a successful cmdlet exit status for only_if as true" do
resource.only_if "cd ."
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a not_if block using the cwd guard parameter" do
custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
resource.not_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')", :cwd => custom_cwd
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates an only_if block using the cwd guard parameter" do
custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
resource.only_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')", :cwd => custom_cwd
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "inherits cwd from the parent resource for only_if" do
custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
resource.cwd custom_cwd
resource.only_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "inherits cwd from the parent resource for not_if" do
custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
resource.cwd custom_cwd
resource.not_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a 64-bit resource with a 64-bit guard and interprets boolean false as zero status code", :windows64_only do
resource.architecture :x86_64
resource.only_if "exit [int32]($env:PROCESSOR_ARCHITECTURE -ne 'AMD64')"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a 64-bit resource with a 64-bit guard and interprets boolean true as nonzero status code", :windows64_only do
resource.architecture :x86_64
resource.only_if "exit [int32]($env:PROCESSOR_ARCHITECTURE -eq 'AMD64')"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a 32-bit resource with a 32-bit guard and interprets boolean false as zero status code" do
resource.architecture :i386
resource.only_if "exit [int32]($env:PROCESSOR_ARCHITECTURE -ne 'X86')"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a 32-bit resource with a 32-bit guard and interprets boolean true as nonzero status code" do
resource.architecture :i386
resource.only_if "exit [int32]($env:PROCESSOR_ARCHITECTURE -eq 'X86')"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a simple boolean false as nonzero status code when convert_boolean_return is true for only_if" do
resource.convert_boolean_return true
resource.only_if "$false"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a simple boolean false as nonzero status code when convert_boolean_return is true for not_if" do
resource.convert_boolean_return true
resource.not_if "$false"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a simple boolean true as 0 status code when convert_boolean_return is true for only_if" do
resource.convert_boolean_return true
resource.only_if "$true"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a simple boolean true as 0 status code when convert_boolean_return is true for not_if" do
resource.convert_boolean_return true
resource.not_if "$true"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a 32-bit resource with a 32-bit guard and interprets boolean false as zero status code using convert_boolean_return for only_if" do
resource.convert_boolean_return true
resource.architecture :i386
resource.only_if "$env:PROCESSOR_ARCHITECTURE -eq 'X86'"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a 32-bit resource with a 32-bit guard and interprets boolean false as zero status code using convert_boolean_return for not_if" do
resource.convert_boolean_return true
resource.architecture :i386
resource.not_if "$env:PROCESSOR_ARCHITECTURE -ne 'X86'"
- resource.should_skip?(:run).should be_false
+ expect(resource.should_skip?(:run)).to be_falsey
end
it "evaluates a 32-bit resource with a 32-bit guard and interprets boolean true as nonzero status code using convert_boolean_return for only_if" do
resource.convert_boolean_return true
resource.architecture :i386
resource.only_if "$env:PROCESSOR_ARCHITECTURE -ne 'X86'"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates a 32-bit resource with a 32-bit guard and interprets boolean true as nonzero status code using convert_boolean_return for not_if" do
resource.convert_boolean_return true
resource.architecture :i386
resource.not_if "$env:PROCESSOR_ARCHITECTURE -eq 'X86'"
- resource.should_skip?(:run).should be_true
+ expect(resource.should_skip?(:run)).to be_truthy
end
end
end
diff --git a/spec/functional/resource/reboot_spec.rb b/spec/functional/resource/reboot_spec.rb
index 735ca994c8..99de136827 100644
--- a/spec/functional/resource/reboot_spec.rb
+++ b/spec/functional/resource/reboot_spec.rb
@@ -50,7 +50,7 @@ describe Chef::Resource::Reboot do
expect(reboot_info[:reason]).to eq(expected[:reason])
expect(reboot_info[:requested_by]).to eq(expected[:requested_by])
- expect(resource.run_context.reboot_requested?).to be_true
+ expect(resource.run_context.reboot_requested?).to be_truthy
end
end
@@ -97,7 +97,7 @@ describe Chef::Resource::Reboot do
it 'should have cleared the reboot request' do
# arguably we shouldn't be querying RunContext's internal data directly.
expect(resource.run_context.reboot_info).to eq({})
- expect(resource.run_context.reboot_requested?).to be_false
+ expect(resource.run_context.reboot_requested?).to be_falsey
end
end
end
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb
index 2d24eee6a3..d3120ac77c 100644
--- a/spec/functional/resource/registry_spec.rb
+++ b/spec/functional/resource/registry_spec.rb
@@ -35,12 +35,12 @@ describe Chef::Resource::RegistryKey, :unix_only do
it "throws an exception because you don't have a windows registry (derp)" do
@resource.key("HKCU\\Software\\Opscode")
@resource.values([{:name=>"Color", :type=>:string, :data=>"Orange"}])
- lambda{@resource.run_action(:create)}.should raise_error(Chef::Exceptions::Win32NotWindows)
+ expect{@resource.run_action(:create)}.to raise_error(Chef::Exceptions::Win32NotWindows)
end
end
end
-describe Chef::Resource::RegistryKey, :windows_only do
+describe Chef::Resource::RegistryKey, :windows_only, :pending => "Refactor helper methods" do
# parent and key must be single keys, not paths
let(:parent) { 'Opscode' }
@@ -112,9 +112,9 @@ describe Chef::Resource::RegistryKey, :windows_only do
@node.name("windowsbox")
@rest_client = double("Chef::REST (mock)")
- @rest_client.stub(:create_url).and_return("reports/nodes/windowsbox/runs/#{@run_id}");
- @rest_client.stub(:raw_http_request).and_return({"result"=>"ok"});
- @rest_client.stub(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/windowsbox/runs/#{@run_id}"});
+ allow(@rest_client).to receive(:create_url).and_return("reports/nodes/windowsbox/runs/#{@run_id}");
+ allow(@rest_client).to receive(:raw_http_request).and_return({"result"=>"ok"});
+ allow(@rest_client).to receive(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/windowsbox/runs/#{@run_id}"});
@resource_reporter = Chef::ResourceReporter.new(@rest_client)
@events.register(@resource_reporter)
@@ -125,7 +125,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.cookbook_name = "monkey"
@cookbook_version = double("Cookbook::Version", :version => "1.2.3")
- @new_resource.stub(:cookbook_version).and_return(@cookbook_version)
+ allow(@new_resource).to receive(:cookbook_version).and_return(@cookbook_version)
end
after (:all) do
@@ -141,8 +141,8 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Color", :type=>:string, :data=>"Orange"}])
@new_resource.run_action(:create)
- @registry.key_exists?(reg_child).should == true
- @registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"}).should == true
+ expect(@registry.key_exists?(reg_child)).to eq(true)
+ expect(@registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(true)
end
it "does not create the key if it already exists with same value, type and data" do
@@ -150,8 +150,8 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Color", :type=>:string, :data=>"Orange"}])
@new_resource.run_action(:create)
- @registry.key_exists?(reg_child).should == true
- @registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"}).should == true
+ expect(@registry.key_exists?(reg_child)).to eq(true)
+ expect(@registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(true)
end
it "creates a value if it does not exist" do
@@ -159,7 +159,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Mango", :type=>:string, :data=>"Yellow"}])
@new_resource.run_action(:create)
- @registry.data_exists?(reg_child, {:name=>"Mango", :type=>:string, :data=>"Yellow"}).should == true
+ expect(@registry.data_exists?(reg_child, {:name=>"Mango", :type=>:string, :data=>"Yellow"})).to eq(true)
end
it "modifies the data if the key and value exist and type matches" do
@@ -167,7 +167,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Color", :type=>:string, :data=>"Not just Orange - OpscodeOrange!"}])
@new_resource.run_action(:create)
- @registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Not just Orange - OpscodeOrange!"}).should == true
+ expect(@registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Not just Orange - OpscodeOrange!"})).to eq(true)
end
it "modifys the type if the key and value exist and the type does not match" do
@@ -175,7 +175,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Color", :type=>:multi_string, :data=>["Not just Orange - OpscodeOrange!"]}])
@new_resource.run_action(:create)
- @registry.data_exists?(reg_child, {:name=>"Color", :type=>:multi_string, :data=>["Not just Orange - OpscodeOrange!"]}).should == true
+ expect(@registry.data_exists?(reg_child, {:name=>"Color", :type=>:multi_string, :data=>["Not just Orange - OpscodeOrange!"]})).to eq(true)
end
it "creates subkey if parent exists" do
@@ -184,15 +184,15 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(false)
@new_resource.run_action(:create)
- @registry.key_exists?(reg_child + '\OpscodeTest').should == true
- @registry.value_exists?(reg_child + '\OpscodeTest', {:name=>"Chef", :type=>:multi_string, :data=>["OpscodeOrange", "Rules"]}).should == true
+ expect(@registry.key_exists?(reg_child + '\OpscodeTest')).to eq(true)
+ expect(@registry.value_exists?(reg_child + '\OpscodeTest', {:name=>"Chef", :type=>:multi_string, :data=>["OpscodeOrange", "Rules"]})).to eq(true)
end
it "gives error if action create and parent does not exist and recursive is set to false" do
@new_resource.key(reg_child + '\Missing1\Missing2')
@new_resource.values([{:name=>"OC", :type=>:string, :data=>"MissingData"}])
@new_resource.recursive(false)
- lambda{@new_resource.run_action(:create)}.should raise_error(Chef::Exceptions::Win32RegNoRecursive)
+ expect{@new_resource.run_action(:create)}.to raise_error(Chef::Exceptions::Win32RegNoRecursive)
end
it "creates missing keys if action create and parent does not exist and recursive is set to true" do
@@ -201,8 +201,8 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(true)
@new_resource.run_action(:create)
- @registry.key_exists?(reg_child + '\Missing1\Missing2').should == true
- @registry.value_exists?(reg_child + '\Missing1\Missing2', {:name=>"OC", :type=>:string, :data=>"MissingData"}).should == true
+ expect(@registry.key_exists?(reg_child + '\Missing1\Missing2')).to eq(true)
+ expect(@registry.value_exists?(reg_child + '\Missing1\Missing2', {:name=>"OC", :type=>:string, :data=>"MissingData"})).to eq(true)
end
it "creates key with multiple value as specified" do
@@ -212,7 +212,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.run_action(:create)
@new_resource.values.each do |value|
- @registry.value_exists?(reg_child, value).should == true
+ expect(@registry.value_exists?(reg_child, value)).to eq(true)
end
end
@@ -231,9 +231,9 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.architecture(:i386)
@new_resource.run_action(:create)
@registry.architecture = :i386
- @registry.data_exists?(reg_child + '\Atraxi', {:name=>"OC", :type=>:string, :data=>"Data"}).should == true
+ expect(@registry.data_exists?(reg_child + '\Atraxi', {:name=>"OC", :type=>:string, :data=>"Data"})).to eq(true)
@registry.architecture = :x86_64
- @registry.key_exists?(reg_child + '\Atraxi').should == false
+ expect(@registry.key_exists?(reg_child + '\Atraxi')).to eq(false)
end
end
@@ -244,16 +244,16 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.run_action(:create)
@report = @resource_reporter.prepare_run_data
- @report["action"].should == "end"
- @report["resources"][0]["type"].should == "registry_key"
- @report["resources"][0]["name"].should == resource_name
- @report["resources"][0]["id"].should == reg_child + '\Ood'
- @report["resources"][0]["after"][:values].should == [{:name=>"ReportingVal1", :type=>:string, :data=>"report1"},
- {:name=>"ReportingVal2", :type=>:string, :data=>"report2"}]
- @report["resources"][0]["before"][:values].should == []
- @report["resources"][0]["result"].should == "create"
- @report["status"].should == "success"
- @report["total_res_count"].should == "1"
+ expect(@report["action"]).to eq("end")
+ expect(@report["resources"][0]["type"]).to eq("registry_key")
+ expect(@report["resources"][0]["name"]).to eq(resource_name)
+ expect(@report["resources"][0]["id"]).to eq(reg_child + '\Ood')
+ expect(@report["resources"][0]["after"][:values]).to eq([{:name=>"ReportingVal1", :type=>:string, :data=>"report1"},
+ {:name=>"ReportingVal2", :type=>:string, :data=>"report2"}])
+ expect(@report["resources"][0]["before"][:values]).to eq([])
+ expect(@report["resources"][0]["result"]).to eq("create")
+ expect(@report["status"]).to eq("success")
+ expect(@report["total_res_count"]).to eq("1")
end
context "while running in whyrun mode" do
@@ -266,15 +266,15 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}])
@new_resource.recursive(false)
@new_resource.run_action(:create) # should not raise_error
- @registry.key_exists?(reg_child + '\Slitheen').should == false
- @registry.key_exists?(reg_child + '\Slitheen\Raxicoricofallapatorius').should == false
+ expect(@registry.key_exists?(reg_child + '\Slitheen')).to eq(false)
+ expect(@registry.key_exists?(reg_child + '\Slitheen\Raxicoricofallapatorius')).to eq(false)
end
it "does not create key if the action is create" do
@new_resource.key(reg_child + '\Slitheen')
@new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}])
@new_resource.recursive(false)
@new_resource.run_action(:create)
- @registry.key_exists?(reg_child + '\Slitheen').should == false
+ expect(@registry.key_exists?(reg_child + '\Slitheen')).to eq(false)
end
end
end
@@ -289,9 +289,9 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Color", :type=>:string, :data=>"Orange"}])
@new_resource.run_action(:create_if_missing)
- @registry.key_exists?(reg_parent).should == true
- @registry.key_exists?(reg_child).should == true
- @registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"}).should == true
+ expect(@registry.key_exists?(reg_parent)).to eq(true)
+ expect(@registry.key_exists?(reg_child)).to eq(true)
+ expect(@registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(true)
end
it "does not create the key if it already exists with same value, type and data" do
@@ -299,8 +299,8 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Color", :type=>:string, :data=>"Orange"}])
@new_resource.run_action(:create_if_missing)
- @registry.key_exists?(reg_child).should == true
- @registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"}).should == true
+ expect(@registry.key_exists?(reg_child)).to eq(true)
+ expect(@registry.data_exists?(reg_child, {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(true)
end
it "creates a value if it does not exist" do
@@ -308,7 +308,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"Mango", :type=>:string, :data=>"Yellow"}])
@new_resource.run_action(:create_if_missing)
- @registry.data_exists?(reg_child, {:name=>"Mango", :type=>:string, :data=>"Yellow"}).should == true
+ expect(@registry.data_exists?(reg_child, {:name=>"Mango", :type=>:string, :data=>"Yellow"})).to eq(true)
end
it "creates subkey if parent exists" do
@@ -317,15 +317,15 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(false)
@new_resource.run_action(:create_if_missing)
- @registry.key_exists?(reg_child + '\Pyrovile').should == true
- @registry.value_exists?(reg_child + '\Pyrovile', {:name=>"Chef", :type=>:multi_string, :data=>["OpscodeOrange", "Rules"]}).should == true
+ expect(@registry.key_exists?(reg_child + '\Pyrovile')).to eq(true)
+ expect(@registry.value_exists?(reg_child + '\Pyrovile', {:name=>"Chef", :type=>:multi_string, :data=>["OpscodeOrange", "Rules"]})).to eq(true)
end
it "gives error if action create and parent does not exist and recursive is set to false" do
@new_resource.key(reg_child + '\Sontaran\Sontar')
@new_resource.values([{:name=>"OC", :type=>:string, :data=>"MissingData"}])
@new_resource.recursive(false)
- lambda{@new_resource.run_action(:create_if_missing)}.should raise_error(Chef::Exceptions::Win32RegNoRecursive)
+ expect{@new_resource.run_action(:create_if_missing)}.to raise_error(Chef::Exceptions::Win32RegNoRecursive)
end
it "creates missing keys if action create and parent does not exist and recursive is set to true" do
@@ -334,8 +334,8 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(true)
@new_resource.run_action(:create_if_missing)
- @registry.key_exists?(reg_child + '\Sontaran\Sontar').should == true
- @registry.value_exists?(reg_child + '\Sontaran\Sontar', {:name=>"OC", :type=>:string, :data=>"MissingData"}).should == true
+ expect(@registry.key_exists?(reg_child + '\Sontaran\Sontar')).to eq(true)
+ expect(@registry.value_exists?(reg_child + '\Sontaran\Sontar', {:name=>"OC", :type=>:string, :data=>"MissingData"})).to eq(true)
end
it "creates key with multiple value as specified" do
@@ -345,7 +345,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.run_action(:create_if_missing)
@new_resource.values.each do |value|
- @registry.value_exists?(reg_child + '\Adipose', value).should == true
+ expect(@registry.value_exists?(reg_child + '\Adipose', value)).to eq(true)
end
end
@@ -356,15 +356,15 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.run_action(:create_if_missing)
@report = @resource_reporter.prepare_run_data
- @report["action"].should == "end"
- @report["resources"][0]["type"].should == "registry_key"
- @report["resources"][0]["name"].should == resource_name
- @report["resources"][0]["id"].should == reg_child + '\Judoon'
- @report["resources"][0]["after"][:values].should == [{:name=>"ReportingVal3", :type=>:string, :data=>"report3"}]
- @report["resources"][0]["before"][:values].should == []
- @report["resources"][0]["result"].should == "create_if_missing"
- @report["status"].should == "success"
- @report["total_res_count"].should == "1"
+ expect(@report["action"]).to eq("end")
+ expect(@report["resources"][0]["type"]).to eq("registry_key")
+ expect(@report["resources"][0]["name"]).to eq(resource_name)
+ expect(@report["resources"][0]["id"]).to eq(reg_child + '\Judoon')
+ expect(@report["resources"][0]["after"][:values]).to eq([{:name=>"ReportingVal3", :type=>:string, :data=>"report3"}])
+ expect(@report["resources"][0]["before"][:values]).to eq([])
+ expect(@report["resources"][0]["result"]).to eq("create_if_missing")
+ expect(@report["status"]).to eq("success")
+ expect(@report["total_res_count"]).to eq("1")
end
context "while running in whyrun mode" do
@@ -377,15 +377,15 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}])
@new_resource.recursive(false)
@new_resource.run_action(:create_if_missing) # should not raise_error
- @registry.key_exists?(reg_child + '\Zygons').should == false
- @registry.key_exists?(reg_child + '\Zygons\Zygor').should == false
+ expect(@registry.key_exists?(reg_child + '\Zygons')).to eq(false)
+ expect(@registry.key_exists?(reg_child + '\Zygons\Zygor')).to eq(false)
end
it "does nothing if the action is create_if_missing" do
@new_resource.key(reg_child + '\Zygons')
@new_resource.values([{:name=>"BriskWalk",:type=>:string,:data=>"is good for health"}])
@new_resource.recursive(false)
@new_resource.run_action(:create_if_missing)
- @registry.key_exists?(reg_child + '\Zygons').should == false
+ expect(@registry.key_exists?(reg_child + '\Zygons')).to eq(false)
end
end
end
@@ -397,24 +397,24 @@ describe Chef::Resource::RegistryKey, :windows_only do
end
it "takes no action if the specified key path does not exist in the system" do
- @registry.key_exists?(reg_parent + '\Osirian').should == false
+ expect(@registry.key_exists?(reg_parent + '\Osirian')).to eq(false)
@new_resource.key(reg_parent+ '\Osirian')
@new_resource.recursive(false)
@new_resource.run_action(:delete)
- @registry.key_exists?(reg_parent + '\Osirian').should == false
+ expect(@registry.key_exists?(reg_parent + '\Osirian')).to eq(false)
end
it "takes no action if the key exists but the value does not" do
- @registry.data_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"}).should == true
+ expect(@registry.data_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(true)
@new_resource.key(reg_parent + '\Opscode')
@new_resource.values([{:name=>"LooksLike", :type=>:multi_string, :data=>["SeattleGrey", "OCOrange"]}])
@new_resource.recursive(false)
@new_resource.run_action(:delete)
- @registry.data_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"}).should == true
+ expect(@registry.data_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(true)
end
it "deletes only specified values under a key path" do
@@ -423,9 +423,9 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(false)
@new_resource.run_action(:delete)
- @registry.data_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"}).should == true
- @registry.value_exists?(reg_parent + '\Opscode', {:name=>"AKA", :type=>:string, :data=>"OC"}).should == false
- @registry.value_exists?(reg_parent + '\Opscode', {:name=>"Opscode", :type=>:multi_string, :data=>["Seattle", "Washington"]}).should == false
+ expect(@registry.data_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(true)
+ expect(@registry.value_exists?(reg_parent + '\Opscode', {:name=>"AKA", :type=>:string, :data=>"OC"})).to eq(false)
+ expect(@registry.value_exists?(reg_parent + '\Opscode', {:name=>"Opscode", :type=>:multi_string, :data=>["Seattle", "Washington"]})).to eq(false)
end
it "it deletes the values with the same name irrespective of it type and data" do
@@ -434,7 +434,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(false)
@new_resource.run_action(:delete)
- @registry.value_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"}).should == false
+ expect(@registry.value_exists?(reg_parent + '\Opscode', {:name=>"Color", :type=>:string, :data=>"Orange"})).to eq(false)
end
it "prepares the reporting data for action :delete" do
@@ -445,19 +445,19 @@ describe Chef::Resource::RegistryKey, :windows_only do
@report = @resource_reporter.prepare_run_data
- @registry.value_exists?(reg_parent + '\ReportKey', [{:name=>"ReportVal4", :type=>:string, :data=>"report4"},{:name=>"ReportVal5", :type=>:string, :data=>"report5"}]).should == false
+ expect(@registry.value_exists?(reg_parent + '\ReportKey', [{:name=>"ReportVal4", :type=>:string, :data=>"report4"},{:name=>"ReportVal5", :type=>:string, :data=>"report5"}])).to eq(false)
- @report["action"].should == "end"
- @report["resources"].count.should == 1
- @report["resources"][0]["type"].should == "registry_key"
- @report["resources"][0]["name"].should == resource_name
- @report["resources"][0]["id"].should == reg_parent + '\ReportKey'
- @report["resources"][0]["before"][:values].should == [{:name=>"ReportVal4", :type=>:string, :data=>"report4"},
- {:name=>"ReportVal5", :type=>:string, :data=>"report5"}]
+ expect(@report["action"]).to eq("end")
+ expect(@report["resources"].count).to eq(1)
+ expect(@report["resources"][0]["type"]).to eq("registry_key")
+ expect(@report["resources"][0]["name"]).to eq(resource_name)
+ expect(@report["resources"][0]["id"]).to eq(reg_parent + '\ReportKey')
+ expect(@report["resources"][0]["before"][:values]).to eq([{:name=>"ReportVal4", :type=>:string, :data=>"report4"},
+ {:name=>"ReportVal5", :type=>:string, :data=>"report5"}])
#Not testing for after values to match since after -> new_resource values.
- @report["resources"][0]["result"].should == "delete"
- @report["status"].should == "success"
- @report["total_res_count"].should == "1"
+ expect(@report["resources"][0]["result"]).to eq("delete")
+ expect(@report["status"]).to eq("success")
+ expect(@report["total_res_count"]).to eq("1")
end
context "while running in whyrun mode" do
@@ -470,7 +470,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(false)
@new_resource.run_action(:delete)
- @registry.key_exists?(reg_parent + '\OpscodeWhyRun').should == true
+ expect(@registry.key_exists?(reg_parent + '\OpscodeWhyRun')).to eq(true)
end
end
end
@@ -482,13 +482,13 @@ describe Chef::Resource::RegistryKey, :windows_only do
end
it "takes no action if the specified key path does not exist in the system" do
- @registry.key_exists?(reg_parent + '\Osirian').should == false
+ expect(@registry.key_exists?(reg_parent + '\Osirian')).to eq(false)
@new_resource.key(reg_parent + '\Osirian')
@new_resource.recursive(false)
@new_resource.run_action(:delete_key)
- @registry.key_exists?(reg_parent + '\Osirian').should == false
+ expect(@registry.key_exists?(reg_parent + '\Osirian')).to eq(false)
end
it "deletes key if it has no subkeys and recursive == false" do
@@ -496,13 +496,13 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(false)
@new_resource.run_action(:delete_key)
- @registry.key_exists?(reg_parent + '\OpscodeTest').should == false
+ expect(@registry.key_exists?(reg_parent + '\OpscodeTest')).to eq(false)
end
it "raises an exception if the key has subkeys and recursive == false" do
@new_resource.key(reg_parent)
@new_resource.recursive(false)
- lambda{@new_resource.run_action(:delete_key)}.should raise_error(Chef::Exceptions::Win32RegNoRecursive)
+ expect{@new_resource.run_action(:delete_key)}.to raise_error(Chef::Exceptions::Win32RegNoRecursive)
end
it "ignores the values under a key" do
@@ -517,7 +517,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(true)
@new_resource.run_action(:delete_key)
- @registry.key_exists?(reg_parent + '\Opscode').should == false
+ expect(@registry.key_exists?(reg_parent + '\Opscode')).to eq(false)
end
it "prepares the reporting data for action :delete_key" do
@@ -526,16 +526,16 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.run_action(:delete_key)
@report = @resource_reporter.prepare_run_data
- @report["action"].should == "end"
- @report["resources"][0]["type"].should == "registry_key"
- @report["resources"][0]["name"].should == resource_name
- @report["resources"][0]["id"].should == reg_parent + '\ReportKey'
+ expect(@report["action"]).to eq("end")
+ expect(@report["resources"][0]["type"]).to eq("registry_key")
+ expect(@report["resources"][0]["name"]).to eq(resource_name)
+ expect(@report["resources"][0]["id"]).to eq(reg_parent + '\ReportKey')
#Not testing for before or after values to match since
#after -> new_resource.values and
#before -> current_resource.values
- @report["resources"][0]["result"].should == "delete_key"
- @report["status"].should == "success"
- @report["total_res_count"].should == "1"
+ expect(@report["resources"][0]["result"]).to eq("delete_key")
+ expect(@report["status"]).to eq("success")
+ expect(@report["total_res_count"]).to eq("1")
end
context "while running in whyrun mode" do
before (:each) do
@@ -554,7 +554,7 @@ describe Chef::Resource::RegistryKey, :windows_only do
@new_resource.recursive(false)
@new_resource.run_action(:delete_key)
- @registry.key_exists?(reg_parent + '\OpscodeWhyRun').should == true
+ expect(@registry.key_exists?(reg_parent + '\OpscodeWhyRun')).to eq(true)
end
end
end
diff --git a/spec/functional/resource/remote_directory_spec.rb b/spec/functional/resource/remote_directory_spec.rb
index f9eb20711e..bcafca7399 100644
--- a/spec/functional/resource/remote_directory_spec.rb
+++ b/spec/functional/resource/remote_directory_spec.rb
@@ -81,12 +81,12 @@ describe Chef::Resource::RemoteDirectory do
it "transfers the directory with all contents" do
expected_files.each do |file_path|
- File.should exist(file_path)
+ expect(File).to exist(file_path)
end
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
@@ -98,13 +98,13 @@ describe Chef::Resource::RemoteDirectory do
it "does not modify the expected state of the directory" do
expected_files.each do |file_path|
- File.should exist(file_path)
+ expect(File).to exist(file_path)
end
end
it "does not remove unmanaged files" do
- File.should exist(@existing1)
- File.should exist(@existing2)
+ expect(File).to exist(@existing1)
+ expect(File).to exist(@existing2)
end
end
@@ -116,12 +116,12 @@ describe Chef::Resource::RemoteDirectory do
it "does not modify the expected state of the directory" do
expected_files.each do |file_path|
- File.should exist(file_path)
+ expect(File).to exist(file_path)
end
end
it "is not marked as updated by last action" do
- resource_second_pass.should_not be_updated_by_last_action
+ expect(resource_second_pass).not_to be_updated_by_last_action
end
end
@@ -142,8 +142,8 @@ describe Chef::Resource::RemoteDirectory do
modified_subdir_file_checksum = sha256_checksum(modified_subdir_file)
resource.run_action(:create)
- sha256_checksum(modified_file).should == modified_file_checksum
- sha256_checksum(modified_subdir_file).should == modified_subdir_file_checksum
+ expect(sha256_checksum(modified_file)).to eq(modified_file_checksum)
+ expect(sha256_checksum(modified_subdir_file)).to eq(modified_subdir_file_checksum)
end
end
end
@@ -160,7 +160,7 @@ describe Chef::Resource::RemoteDirectory do
it "creates the directory contents as normal" do
expected_files.each do |file_path|
- File.should exist(file_path)
+ expect(File).to exist(file_path)
end
end
@@ -173,18 +173,18 @@ describe Chef::Resource::RemoteDirectory do
end
it "removes unmanaged files" do
- File.should_not exist(@existing1)
- File.should_not exist(@existing2)
+ expect(File).not_to exist(@existing1)
+ expect(File).not_to exist(@existing2)
end
it "does not modify managed files" do
expected_files.each do |file_path|
- File.should exist(file_path)
+ expect(File).to exist(file_path)
end
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
@@ -204,14 +204,14 @@ describe Chef::Resource::RemoteDirectory do
end
it "removes files in subdirectories before files above" do
- File.should_not exist(@existing1)
- File.should_not exist(@existing2)
- File.should_not exist(@existing3)
- File.should_not exist(@existing4)
+ expect(File).not_to exist(@existing1)
+ expect(File).not_to exist(@existing2)
+ expect(File).not_to exist(@existing3)
+ expect(File).not_to exist(@existing4)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
diff --git a/spec/functional/resource/remote_file_spec.rb b/spec/functional/resource/remote_file_spec.rb
index ccdf1cb812..29091fd785 100644
--- a/spec/functional/resource/remote_file_spec.rb
+++ b/spec/functional/resource/remote_file_spec.rb
@@ -137,20 +137,20 @@ describe Chef::Resource::RemoteFile do
let(:source) { 'http://localhost:9000/nyan_cat_content_length_compressed.png' }
before do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
resource.run_action(:create)
end
it "should create the file" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "should mark the resource as updated" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
it "has the correct content" do
- binread(path).should == expected_content
+ expect(binread(path)).to eq(expected_content)
end
end
@@ -159,20 +159,20 @@ describe Chef::Resource::RemoteFile do
let(:source) { 'http://localhost:9000/nyan_cat_content_length.png' }
before do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
resource.run_action(:create)
end
it "should create the file" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "should mark the resource as updated" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
it "has the correct content" do
- binread(path).should == expected_content
+ expect(binread(path)).to eq(expected_content)
end
end
@@ -180,11 +180,11 @@ describe Chef::Resource::RemoteFile do
let(:source) { 'http://localhost:9000/nyan_cat_truncated_compressed.png' }
before do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
it "should raise ContentLengthMismatch" do
- lambda { resource.run_action(:create) }.should raise_error(Chef::Exceptions::ContentLengthMismatch)
+ expect { resource.run_action(:create) }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
#File.should_not exist(path) # XXX: CHEF-5081
end
end
@@ -193,11 +193,11 @@ describe Chef::Resource::RemoteFile do
let(:source) { 'http://localhost:9000/nyan_cat_truncated.png' }
before do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
it "should raise ContentLengthMismatch" do
- lambda { resource.run_action(:create) }.should raise_error(Chef::Exceptions::ContentLengthMismatch)
+ expect { resource.run_action(:create) }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
#File.should_not exist(path) # XXX: CHEF-5081
end
end
@@ -207,20 +207,20 @@ describe Chef::Resource::RemoteFile do
let(:source) { 'http://localhost:9000/nyan_cat_transfer_encoding.png' }
before do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
resource.run_action(:create)
end
it "should create the file" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "should mark the resource as updated" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
it "has the correct content" do
- binread(path).should == expected_content
+ expect(binread(path)).to eq(expected_content)
end
end
@@ -228,12 +228,12 @@ describe Chef::Resource::RemoteFile do
let(:source) { 'http://localhost:0000/seattle_capo.png' }
before do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
it "should not create the file" do
expect{ resource.run_action(:create) }.to raise_error
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
end
end
diff --git a/spec/functional/resource/rpm_spec.rb b/spec/functional/resource/rpm_spec.rb
index 7825377c6b..b37ee781f1 100644
--- a/spec/functional/resource/rpm_spec.rb
+++ b/spec/functional/resource/rpm_spec.rb
@@ -16,6 +16,7 @@
# limitations under the License.
#
+require 'spec_helper'
require 'functional/resource/base'
require 'chef/mixin/shell_out'
@@ -60,12 +61,12 @@ describe Chef::Resource::RpmPackage, :requires_root, :external => exclude_test d
@pkg_name = "dummy"
@pkg_version = "1-0"
@pkg_path = "/tmp/dummy-1-0.aix6.1.noarch.rpm"
- FileUtils.cp 'spec/functional/assets/dummy-1-0.aix6.1.noarch.rpm' , @pkg_path
+ FileUtils.cp(File.join(CHEF_SPEC_ASSETS, 'dummy-1-0.aix6.1.noarch.rpm') , @pkg_path)
when "centos", "redhat", "suse"
@pkg_name = "mytest"
@pkg_version = "1.0-1"
@pkg_path = "/tmp/mytest-1.0-1.noarch.rpm"
- FileUtils.cp 'spec/functional/assets/mytest-1.0-1.noarch.rpm' , @pkg_path
+ FileUtils.cp(File.join(CHEF_SPEC_ASSETS, 'mytest-1.0-1.noarch.rpm') , @pkg_path)
end
end
@@ -101,11 +102,11 @@ describe Chef::Resource::RpmPackage, :requires_root, :external => exclude_test d
if ohai[:platform] == 'aix'
@pkg_version = "2-0"
@pkg_path = "/tmp/dummy-2-0.aix6.1.noarch.rpm"
- FileUtils.cp 'spec/functional/assets/dummy-2-0.aix6.1.noarch.rpm' , @pkg_path
+ FileUtils.cp(File.join(CHEF_SPEC_ASSETS, 'dummy-2-0.aix6.1.noarch.rpm') , @pkg_path)
else
@pkg_version = "2.0-1"
@pkg_path = "/tmp/mytest-2.0-1.noarch.rpm"
- FileUtils.cp 'spec/functional/assets/mytest-2.0-1.noarch.rpm' , @pkg_path
+ FileUtils.cp(File.join(CHEF_SPEC_ASSETS, 'mytest-2.0-1.noarch.rpm') , @pkg_path)
end
end
diff --git a/spec/functional/resource/template_spec.rb b/spec/functional/resource/template_spec.rb
index fefd995743..d7b35e7450 100644
--- a/spec/functional/resource/template_spec.rb
+++ b/spec/functional/resource/template_spec.rb
@@ -69,7 +69,7 @@ describe Chef::Resource::Template do
resource.source('openldap_variable_stuff.conf.erb')
resource.variables(:secret => "nutella")
resource.run_action(:create)
- IO.read(path).should == "super secret is nutella"
+ expect(IO.read(path)).to eq("super secret is nutella")
end
it "creates the template with the rendered content using a local erb file when the :create action is run" do
@@ -77,7 +77,7 @@ describe Chef::Resource::Template do
resource.cookbook(nil)
resource.local(true)
resource.run_action(:create)
- IO.read(path).should == expected_content
+ expect(IO.read(path)).to eq(expected_content)
end
end
@@ -96,7 +96,7 @@ describe Chef::Resource::Template do
shared_examples "a template with helpers" do
it "generates expected content by calling helper methods" do
resource.run_action(:create)
- binread(path).strip.should == expected_content
+ expect(binread(path).strip).to eq(expected_content)
end
end
@@ -202,7 +202,7 @@ describe Chef::Resource::Template do
it "output should contain platform's line endings" do
resource.run_action(:create)
binread(path).each_line do |line|
- line.should end_with(Chef::Platform.windows? ? "\r\n" : "\n")
+ expect(line).to end_with(Chef::Platform.windows? ? "\r\n" : "\n")
end
end
end
diff --git a/spec/functional/resource/user/dscl_spec.rb b/spec/functional/resource/user/dscl_spec.rb
index ba508e3258..45b6754453 100644
--- a/spec/functional/resource/user/dscl_spec.rb
+++ b/spec/functional/resource/user/dscl_spec.rb
@@ -37,15 +37,15 @@ describe "Chef::Resource::User with Chef::Provider::User::Dscl provider", metada
end
def user_should_exist
- shell_out("/usr/bin/dscl . -ls /Users").stdout.should include username
+ expect(shell_out("/usr/bin/dscl . -ls /Users").stdout).to include username
end
def check_password(pass)
# In order to test the password we use dscl passwd command since
# that's the only command that gets the user password from CLI.
- shell_out("dscl . -passwd /Users/greatchef #{pass} new_password").exitstatus.should == 0
+ expect(shell_out("dscl . -passwd /Users/greatchef #{pass} new_password").exitstatus).to eq(0)
# Now reset the password back
- shell_out("dscl . -passwd /Users/greatchef new_password #{pass}").exitstatus.should == 0
+ expect(shell_out("dscl . -passwd /Users/greatchef new_password #{pass}").exitstatus).to eq(0)
end
let(:node) do
@@ -191,7 +191,7 @@ c5adbbac718b7eb99463a7b679571e0f\
user_resource.run_action(:remove)
groups.each do |group|
# Do not raise an error when group is empty
- shell_out("dscl . read /Groups/staff GroupMembership").stdout.should_not include(group)
+ expect(shell_out("dscl . read /Groups/staff GroupMembership").stdout).not_to include(group)
end
end
end
diff --git a/spec/functional/resource/user/useradd_spec.rb b/spec/functional/resource/user/useradd_spec.rb
index 1fbe6fcb4d..6b962c19aa 100644
--- a/spec/functional/resource/user/useradd_spec.rb
+++ b/spec/functional/resource/user/useradd_spec.rb
@@ -70,9 +70,9 @@ describe Chef::Provider::User::Useradd, metadata do
def password_should_be_set
if ohai[:platform] == "aix"
- pw_entry.passwd.should == "!"
+ expect(pw_entry.passwd).to eq("!")
else
- pw_entry.passwd.should == "x"
+ expect(pw_entry.passwd).to eq("x")
end
end
@@ -145,12 +145,12 @@ describe Chef::Provider::User::Useradd, metadata do
pending(reason)
end
user_resource.run_action(:create)
- user_resource.should be_updated_by_last_action
+ expect(user_resource).to be_updated_by_last_action
end
it "ensures the user exists" do
- pw_entry.name.should == username
+ expect(pw_entry.name).to eq(username)
end
# On Debian, the only constraints are that usernames must neither start
@@ -171,7 +171,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:username) { "t'bilisi" }
it "ensures the user exists" do
- pw_entry.name.should == username
+ expect(pw_entry.name).to eq(username)
end
end
@@ -181,7 +181,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:uid) { 1999 }
it "ensures the user has the given uid" do
- pw_entry.uid.should == "1999"
+ expect(pw_entry.uid).to eq("1999")
end
end
@@ -189,14 +189,14 @@ describe Chef::Provider::User::Useradd, metadata do
let(:comment) { "hello this is dog" }
it "ensures the comment is set" do
- pw_entry.gecos.should == "hello this is dog"
+ expect(pw_entry.gecos).to eq("hello this is dog")
end
context "in standard gecos format" do
let(:comment) { "Bobo T. Clown,some building,555-555-5555,@boboclown" }
it "ensures the comment is set" do
- pw_entry.gecos.should == comment
+ expect(pw_entry.gecos).to eq(comment)
end
end
@@ -206,7 +206,7 @@ describe Chef::Provider::User::Useradd, metadata do
it "ensures the comment is set" do
actual = pw_entry.gecos
actual.force_encoding(Encoding::UTF_8) if "".respond_to?(:force_encoding)
- actual.should == comment
+ expect(actual).to eq(comment)
end
end
@@ -214,7 +214,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:comment) { "don't go" }
it "ensures the comment is set" do
- pw_entry.gecos.should == comment
+ expect(pw_entry.gecos).to eq(comment)
end
end
end
@@ -223,17 +223,17 @@ describe Chef::Provider::User::Useradd, metadata do
let(:home) { "/home/#{username}" }
it "ensures the user's home is set to the given path" do
- pw_entry.home.should == "/home/#{username}"
+ expect(pw_entry.home).to eq("/home/#{username}")
end
if %w{rhel fedora}.include?(OHAI_SYSTEM["platform_family"])
# Inconsistent behavior. See: CHEF-2205
it "creates the home dir when not explicitly asked to on RHEL (XXX)" do
- File.should exist("/home/#{username}")
+ expect(File).to exist("/home/#{username}")
end
else
it "does not create the home dir without `manage_home'" do
- File.should_not exist("/home/#{username}")
+ expect(File).not_to exist("/home/#{username}")
end
end
@@ -241,7 +241,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:manage_home) { true }
it "ensures the user's home directory exists" do
- File.should exist("/home/#{username}")
+ expect(File).to exist("/home/#{username}")
end
end
end
@@ -259,7 +259,7 @@ describe Chef::Provider::User::Useradd, metadata do
it "sets the user's shadow password" do
password_should_be_set
- etc_shadow.should include(expected_shadow)
+ expect(etc_shadow).to include(expected_shadow)
end
end
@@ -284,7 +284,7 @@ describe Chef::Provider::User::Useradd, metadata do
end
it "ensures the user has the properties of a system user" do
- pw_entry.uid.to_i.should be < uid_min.to_i
+ expect(pw_entry.uid.to_i).to be < uid_min.to_i
end
end
end # when the user does not exist beforehand
@@ -318,9 +318,9 @@ describe Chef::Provider::User::Useradd, metadata do
pending(reason)
end
existing_user.run_action(:create)
- existing_user.should be_updated_by_last_action
+ expect(existing_user).to be_updated_by_last_action
user_resource.run_action(:create)
- user_resource.updated_by_last_action?.should == expect_updated?
+ expect(user_resource.updated_by_last_action?).to eq(expect_updated?)
end
context "and all properties are in the desired state" do
@@ -350,7 +350,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:expect_updated?) { false }
it "does not update the user" do
- user_resource.should_not be_updated
+ expect(user_resource).not_to be_updated
end
end
@@ -359,7 +359,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:existing_uid) { 1998 }
it "ensures the uid is set to the desired value" do
- pw_entry.uid.should == "1999"
+ expect(pw_entry.uid).to eq("1999")
end
end
@@ -368,7 +368,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:existing_comment) { "woof" }
it "ensures the comment field is set to the desired value" do
- pw_entry.gecos.should == "hello this is dog"
+ expect(pw_entry.gecos).to eq("hello this is dog")
end
end
@@ -376,15 +376,15 @@ describe Chef::Provider::User::Useradd, metadata do
let(:existing_home) { "/home/foo" }
let(:home) { "/home/bar" }
it "ensures the home directory is set to the desired value" do
- pw_entry.home.should == "/home/bar"
+ expect(pw_entry.home).to eq("/home/bar")
end
context "and manage_home is enabled" do
let(:existing_manage_home) { true }
let(:manage_home) { true }
it "moves the home directory to the new location" do
- File.should_not exist("/home/foo")
- File.should exist("/home/bar")
+ expect(File).not_to exist("/home/foo")
+ expect(File).to exist("/home/bar")
end
end
@@ -396,19 +396,19 @@ describe Chef::Provider::User::Useradd, metadata do
# Inconsistent behavior. See: CHEF-2205
it "created the home dir b/c of CHEF-2205 so it still exists" do
# This behavior seems contrary to expectation and non-convergent.
- File.should_not exist("/home/foo")
- File.should exist("/home/bar")
+ expect(File).not_to exist("/home/foo")
+ expect(File).to exist("/home/bar")
end
elsif ohai[:platform] == "aix"
it "creates the home dir in the desired location" do
- File.should_not exist("/home/foo")
- File.should exist("/home/bar")
+ expect(File).not_to exist("/home/foo")
+ expect(File).to exist("/home/bar")
end
else
it "does not create the home dir in the desired location (XXX)" do
# This behavior seems contrary to expectation and non-convergent.
- File.should_not exist("/home/foo")
- File.should_not exist("/home/bar")
+ expect(File).not_to exist("/home/foo")
+ expect(File).not_to exist("/home/bar")
end
end
end
@@ -419,8 +419,8 @@ describe Chef::Provider::User::Useradd, metadata do
it "leaves the old home directory around (XXX)" do
# Would it be better to remove the old home?
- File.should exist("/home/foo")
- File.should_not exist("/home/bar")
+ expect(File).to exist("/home/foo")
+ expect(File).not_to exist("/home/bar")
end
end
end
@@ -439,7 +439,7 @@ describe Chef::Provider::User::Useradd, metadata do
it "ensures the password is set" do
password_should_be_set
- etc_shadow.should include(expected_shadow)
+ expect(etc_shadow).to include(expected_shadow)
end
end
@@ -468,7 +468,7 @@ describe Chef::Provider::User::Useradd, metadata do
it "ensures the password is set to the desired value" do
password_should_be_set
- etc_shadow.should include(expected_shadow)
+ expect(etc_shadow).to include(expected_shadow)
end
end
@@ -514,18 +514,18 @@ describe Chef::Provider::User::Useradd, metadata do
def user_account_should_be_locked
case ohai[:platform]
when "aix"
- aix_user_lock_status.should == "true"
+ expect(aix_user_lock_status).to eq("true")
else
- shadow_password.should include("!")
+ expect(shadow_password).to include("!")
end
end
def user_account_should_be_unlocked
case ohai[:platform]
when "aix"
- aix_user_lock_status.should == "false"
+ expect(aix_user_lock_status).to eq("false")
else
- shadow_password.should_not include("!")
+ expect(shadow_password).not_to include("!")
end
end
@@ -596,7 +596,7 @@ describe Chef::Provider::User::Useradd, metadata do
let(:user_locked_context?) { true }
it "does not update the user" do
- user_resource.should_not be_updated_by_last_action
+ expect(user_resource).not_to be_updated_by_last_action
end
end
end
@@ -628,8 +628,8 @@ describe Chef::Provider::User::Useradd, metadata do
if %w[suse opensuse].include?(OHAI_SYSTEM["platform_family"])
# suse gets this right:
it "errors out trying to unlock the user" do
- @error.should be_a(Mixlib::ShellOut::ShellCommandFailed)
- @error.message.should include("Cannot unlock the password")
+ expect(@error).to be_a(Mixlib::ShellOut::ShellCommandFailed)
+ expect(@error.message).to include("Cannot unlock the password")
end
else
@@ -644,13 +644,13 @@ describe Chef::Provider::User::Useradd, metadata do
# You should set a password with usermod -p to unlock this user's password.
# DEBUG: ---- End output of usermod -U chef-functional-test ----
# DEBUG: Ran usermod -U chef-functional-test returned 0
- @error.should be_nil
+ expect(@error).to be_nil
if ohai[:platform] == "aix"
- pw_entry.passwd.should == '*'
+ expect(pw_entry.passwd).to eq('*')
user_account_should_be_unlocked
else
- pw_entry.passwd.should == 'x'
- shadow_password.should include("!")
+ expect(pw_entry.passwd).to eq('x')
+ expect(shadow_password).to include("!")
end
end
end
@@ -668,7 +668,7 @@ describe Chef::Provider::User::Useradd, metadata do
context "and the user is not locked" do
it "does not update the user" do
- user_resource.should_not be_updated_by_last_action
+ expect(user_resource).not_to be_updated_by_last_action
end
end
diff --git a/spec/functional/run_lock_spec.rb b/spec/functional/run_lock_spec.rb
index 9eec0dab04..0cb8635256 100644
--- a/spec/functional/run_lock_spec.rb
+++ b/spec/functional/run_lock_spec.rb
@@ -163,13 +163,13 @@ describe Chef::RunLock do
let!(:run_lock) { Chef::RunLock.new(lockfile) }
it "creates the full path to the lockfile" do
- lambda { run_lock.acquire }.should_not raise_error
- File.should exist(lockfile)
+ expect { run_lock.acquire }.not_to raise_error
+ expect(File).to exist(lockfile)
end
it "sets FD_CLOEXEC on the lockfile", :supports_cloexec => true do
run_lock.acquire
- (run_lock.runlock.fcntl(Fcntl::F_GETFD, 0) & Fcntl::FD_CLOEXEC).should == Fcntl::FD_CLOEXEC
+ expect(run_lock.runlock.fcntl(Fcntl::F_GETFD, 0) & Fcntl::FD_CLOEXEC).to eq(Fcntl::FD_CLOEXEC)
end
it "allows only one chef client run per lockfile" do
@@ -208,7 +208,7 @@ p1 has lock
p1 releasing lock
p2 has lock
E
- results.should == expected
+ expect(results).to eq(expected)
end
it "clears the lock if the process dies unexpectedly" do
@@ -233,12 +233,12 @@ E
Process.waitpid2(p2)
- results.should =~ /p2 has lock\Z/
+ expect(results).to match(/p2 has lock\Z/)
end
it "test returns true and acquires the lock" do
p1 = fork do
- run_lock.test.should == true
+ expect(run_lock.test).to eq(true)
sleep 2
exit! 1
end
@@ -246,7 +246,7 @@ E
wait_on_lock
p2 = fork do
- run_lock.test.should == false
+ expect(run_lock.test).to eq(false)
exit! 0
end
@@ -263,7 +263,7 @@ E
wait_on_lock
- run_lock.test.should == false
+ expect(run_lock.test).to eq(false)
Process.waitpid2(p1)
end
@@ -277,7 +277,7 @@ E
wait_on_lock
sleep 0.5 # Possible race condition on Solaris which pid is observed as 0
- File.read(lockfile).should == p1.to_s
+ expect(File.read(lockfile)).to eq(p1.to_s)
Process.waitpid2(p1)
end
diff --git a/spec/functional/shell_spec.rb b/spec/functional/shell_spec.rb
index f2ce3f53e4..fa9de77b0e 100644
--- a/spec/functional/shell_spec.rb
+++ b/spec/functional/shell_spec.rb
@@ -105,7 +105,7 @@ describe Shell do
it "boots correctly with -lauto" do
output, exitstatus = run_chef_shell_with("-lauto")
- output.should include("done")
+ expect(output).to include("done")
expect(exitstatus).to eq(0)
end
@@ -115,7 +115,7 @@ describe Shell do
keyboard.puts(show_log_level_code)
read_until(out, show_log_level_code)
end
- output.should include("===fatal===")
+ expect(output).to include("===fatal===")
expect(exitstatus).to eq(0)
end
@@ -125,7 +125,7 @@ describe Shell do
keyboard.puts(show_recipes_code)
read_until(out, show_recipes_code)
end
- output.should include(%q{["override::foo", "override::bar"]})
+ expect(output).to include(%q{["override::foo", "override::bar"]})
expect(exitstatus).to eq(0)
end
end
diff --git a/spec/functional/tiny_server_spec.rb b/spec/functional/tiny_server_spec.rb
index bfa6ff1ddb..87be948a0d 100644
--- a/spec/functional/tiny_server_spec.rb
+++ b/spec/functional/tiny_server_spec.rb
@@ -26,39 +26,39 @@ describe TinyServer::API do
end
it "is a Singleton" do
- lambda {TinyServer::API.new}.should raise_error
+ expect {TinyServer::API.new}.to raise_error
end
it "clears the router" do
@api.get('/blargh', 200, "blargh")
@api.clear
- @api.routes["GET"].should be_empty
+ expect(@api.routes["GET"]).to be_empty
end
it "creates a route for a GET request" do
@api.get('/foo/bar', 200, 'hello foobar')
# WEBrick gives you the full URI with host, Thin only gave the part after scheme+host+port
response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => 'http://localhost:1974/foo/bar')
- response.should == [200, {'Content-Type' => 'application/json'}, [ 'hello foobar' ]]
+ expect(response).to eq([200, {'Content-Type' => 'application/json'}, [ 'hello foobar' ]])
end
it "creates a route for a request with a block" do
block_called = false
@api.get('/bar/baz', 200) { block_called = true; 'hello barbaz' }
response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => 'http://localhost:1974/bar/baz')
- response.should == [200, {'Content-Type' => 'application/json'}, [ 'hello barbaz' ]]
- block_called.should be_true
+ expect(response).to eq([200, {'Content-Type' => 'application/json'}, [ 'hello barbaz' ]])
+ expect(block_called).to be_truthy
end
it "returns debugging info for 404s" do
response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => '/no_such_thing')
- response[0].should == 404
- response[1].should == {'Content-Type' => 'application/json'}
- response[2].should be_a_kind_of(Array)
+ expect(response[0]).to eq(404)
+ expect(response[1]).to eq({'Content-Type' => 'application/json'})
+ expect(response[2]).to be_a_kind_of(Array)
response_obj = Chef::JSONCompat.from_json(response[2].first)
- response_obj["message"].should == "no data matches the request for /no_such_thing"
- response_obj["available_routes"].should == {"GET"=>[], "PUT"=>[], "POST"=>[], "DELETE"=>[]}
- response_obj["request"].should == {"REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"/no_such_thing"}
+ expect(response_obj["message"]).to eq("no data matches the request for /no_such_thing")
+ expect(response_obj["available_routes"]).to eq({"GET"=>[], "PUT"=>[], "POST"=>[], "DELETE"=>[]})
+ expect(response_obj["request"]).to eq({"REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"/no_such_thing"})
end
end
@@ -71,7 +71,7 @@ describe TinyServer::Manager do
TinyServer::API.instance.get("/index", 200, "[\"hello\"]")
rest = Chef::REST.new('http://localhost:9000', false, false)
- rest.get_rest("index").should == ["hello"]
+ expect(rest.get_rest("index")).to eq(["hello"])
@server.stop
end
diff --git a/spec/functional/util/path_helper_spec.rb b/spec/functional/util/path_helper_spec.rb
index ccdf383c22..0321702bb8 100644
--- a/spec/functional/util/path_helper_spec.rb
+++ b/spec/functional/util/path_helper_spec.rb
@@ -31,7 +31,7 @@ describe Chef::Util::PathHelper, "escape_glob" do
end
pattern = File.join(PathHelper.escape_glob(dir), "*")
- Dir.glob(pattern).map { |x| File.basename(x) }.should match_array(files)
+ expect(Dir.glob(pattern).map { |x| File.basename(x) }).to match_array(files)
end
end
end
diff --git a/spec/functional/version_spec.rb b/spec/functional/version_spec.rb
index a342206161..71ba4d5b2f 100644
--- a/spec/functional/version_spec.rb
+++ b/spec/functional/version_spec.rb
@@ -28,7 +28,7 @@ describe "Chef Versions" do
binaries.each do |binary|
it "#{binary} version should be sane" do
- shell_out!("ruby #{File.join("bin", binary)} -v", :cwd => chef_dir).stdout.chomp.should == "Chef: #{Chef::VERSION}"
+ expect(shell_out!("ruby #{File.join("bin", binary)} -v", :cwd => chef_dir).stdout.chomp).to eq("Chef: #{Chef::VERSION}")
end
end
diff --git a/spec/functional/win32/registry_helper_spec.rb b/spec/functional/win32/registry_helper_spec.rb
index 830d6f4777..7b070e6fe1 100644
--- a/spec/functional/win32/registry_helper_spec.rb
+++ b/spec/functional/win32/registry_helper_spec.rb
@@ -34,7 +34,7 @@ describe Chef::Resource::RegistryKey, :unix_only do
it "throws an exception because you don't have a windows registry (derp)" do
@resource.key("HKCU\\Software\\Opscode")
@resource.values([{:name=>"Color", :type=>:string, :data=>"Orange"}])
- lambda{@resource.run_action(:create)}.should raise_error(Chef::Exceptions::Win32NotWindows)
+ expect{@resource.run_action(:create)}.to raise_error(Chef::Exceptions::Win32NotWindows)
end
end
end
@@ -84,197 +84,197 @@ describe 'Chef::Win32::Registry', :windows_only do
describe "hive_exists?" do
it "returns true if the hive exists" do
- @registry.hive_exists?("HKCU\\Software\\Root").should == true
+ expect(@registry.hive_exists?("HKCU\\Software\\Root")).to eq(true)
end
it "returns false if the hive does not exist" do
- hive = @registry.hive_exists?("LYRU\\Software\\Root").should == false
+ hive = expect(@registry.hive_exists?("LYRU\\Software\\Root")).to eq(false)
end
end
describe "key_exists?" do
it "returns true if the key path exists" do
- @registry.key_exists?("HKCU\\Software\\Root\\Branch\\Flower").should == true
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Branch\\Flower")).to eq(true)
end
it "returns false if the key path does not exist" do
- @registry.key_exists?("HKCU\\Software\\Branch\\Flower").should == false
+ expect(@registry.key_exists?("HKCU\\Software\\Branch\\Flower")).to eq(false)
end
it "throws an exception if the hive does not exist" do
- lambda {@registry.key_exists?("JKLM\\Software\\Branch\\Flower")}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.key_exists?("JKLM\\Software\\Branch\\Flower")}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
end
describe "key_exists!" do
it "returns true if the key path exists" do
- @registry.key_exists!("HKCU\\Software\\Root\\Branch\\Flower").should == true
+ expect(@registry.key_exists!("HKCU\\Software\\Root\\Branch\\Flower")).to eq(true)
end
it "throws an exception if the key path does not exist" do
- lambda {@registry.key_exists!("HKCU\\Software\\Branch\\Flower")}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.key_exists!("HKCU\\Software\\Branch\\Flower")}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "throws an exception if the hive does not exist" do
- lambda {@registry.key_exists!("JKLM\\Software\\Branch\\Flower")}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.key_exists!("JKLM\\Software\\Branch\\Flower")}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
end
describe "value_exists?" do
it "throws an exception if the hive does not exist" do
- lambda {@registry.value_exists?("JKLM\\Software\\Branch\\Flower", {:name=>"Petals"})}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.value_exists?("JKLM\\Software\\Branch\\Flower", {:name=>"Petals"})}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "throws an exception if the key does not exist" do
- lambda {@registry.value_exists?("HKCU\\Software\\Branch\\Flower", {:name=>"Petals"})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.value_exists?("HKCU\\Software\\Branch\\Flower", {:name=>"Petals"})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if the value exists" do
- @registry.value_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals"}).should == true
+ expect(@registry.value_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals"})).to eq(true)
end
it "returns false if the value does not exist" do
- @registry.value_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"FOOBAR"}).should == false
+ expect(@registry.value_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"FOOBAR"})).to eq(false)
end
end
describe "value_exists!" do
it "throws an exception if the hive does not exist" do
- lambda {@registry.value_exists!("JKLM\\Software\\Branch\\Flower", {:name=>"Petals"})}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.value_exists!("JKLM\\Software\\Branch\\Flower", {:name=>"Petals"})}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "throws an exception if the key does not exist" do
- lambda {@registry.value_exists!("HKCU\\Software\\Branch\\Flower", {:name=>"Petals"})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.value_exists!("HKCU\\Software\\Branch\\Flower", {:name=>"Petals"})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if the value exists" do
- @registry.value_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals"}).should == true
+ expect(@registry.value_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals"})).to eq(true)
end
it "throws an exception if the value does not exist" do
- lambda {@registry.value_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"FOOBAR"})}.should raise_error(Chef::Exceptions::Win32RegValueMissing)
+ expect {@registry.value_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"FOOBAR"})}.to raise_error(Chef::Exceptions::Win32RegValueMissing)
end
end
describe "data_exists?" do
it "throws an exception if the hive does not exist" do
- lambda {@registry.data_exists?("JKLM\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.data_exists?("JKLM\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "throws an exception if the key does not exist" do
- lambda {@registry.data_exists?("HKCU\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.data_exists?("HKCU\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if all the data matches" do
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]}).should == true
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})).to eq(true)
end
it "returns false if the name does not exist" do
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"slateP", :type=>:multi_string, :data=>["Pink", "Delicate"]}).should == false
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"slateP", :type=>:multi_string, :data=>["Pink", "Delicate"]})).to eq(false)
end
it "returns false if the types do not match" do
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Pink"}).should == false
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Pink"})).to eq(false)
end
it "returns false if the data does not match" do
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Mauve", "Delicate"]}).should == false
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Mauve", "Delicate"]})).to eq(false)
end
end
describe "data_exists!" do
it "throws an exception if the hive does not exist" do
- lambda {@registry.data_exists!("JKLM\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.data_exists!("JKLM\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "throws an exception if the key does not exist" do
- lambda {@registry.data_exists!("HKCU\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.data_exists!("HKCU\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if all the data matches" do
- @registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]}).should == true
+ expect(@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Pink", "Delicate"]})).to eq(true)
end
it "throws an exception if the name does not exist" do
- lambda {@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"slateP", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.should raise_error(Chef::Exceptions::Win32RegDataMissing)
+ expect {@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"slateP", :type=>:multi_string, :data=>["Pink", "Delicate"]})}.to raise_error(Chef::Exceptions::Win32RegDataMissing)
end
it "throws an exception if the types do not match" do
- lambda {@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Pink"})}.should raise_error(Chef::Exceptions::Win32RegDataMissing)
+ expect {@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Pink"})}.to raise_error(Chef::Exceptions::Win32RegDataMissing)
end
it "throws an exception if the data does not match" do
- lambda {@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Mauve", "Delicate"]})}.should raise_error(Chef::Exceptions::Win32RegDataMissing)
+ expect {@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Mauve", "Delicate"]})}.to raise_error(Chef::Exceptions::Win32RegDataMissing)
end
end
describe "get_values" do
it "returns all values for a key if it exists" do
values = @registry.get_values("HKCU\\Software\\Root")
- values.should be_an_instance_of Array
- values.should == [{:name=>"RootType1", :type=>:string, :data=>"fibrous"},
- {:name=>"Roots", :type=>:multi_string, :data=>["strong roots", "healthy tree"]}]
+ expect(values).to be_an_instance_of Array
+ expect(values).to eq([{:name=>"RootType1", :type=>:string, :data=>"fibrous"},
+ {:name=>"Roots", :type=>:multi_string, :data=>["strong roots", "healthy tree"]}])
end
it "throws an exception if the key does not exist" do
- lambda {@registry.get_values("HKCU\\Software\\Branch\\Flower")}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.get_values("HKCU\\Software\\Branch\\Flower")}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "throws an exception if the hive does not exist" do
- lambda {@registry.get_values("JKLM\\Software\\Branch\\Flower")}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.get_values("JKLM\\Software\\Branch\\Flower")}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
end
describe "set_value" do
it "updates a value if the key, value exist and type matches and value different" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]}).should == true
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})).to eq(true)
end
it "updates a value if the type does match and the values are different" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Yellow"}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Yellow"}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]}).should == false
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Yellow"})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:string, :data=>"Yellow"})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})).to eq(false)
end
it "creates a value if key exists and value does not" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]}).should == true
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})).to eq(true)
end
it "does nothing if data,type and name parameters for the value are same" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]}).should == false
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]}).should == true
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})).to eq(false)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"Stamen", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})).to eq(true)
end
it "throws an exception if the key does not exist" do
- lambda {@registry.set_value("HKCU\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.set_value("HKCU\\Software\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "throws an exception if the hive does not exist" do
- lambda {@registry.set_value("JKLM\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.set_value("JKLM\\Software\\Root\\Branch\\Flower", {:name=>"Petals", :type=>:multi_string, :data=>["Yellow", "Changed Color"]})}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
# we are validating that the data gets .to_i called on it when type is a :dword
it "casts an integer string given as a dword into an integer" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe32767", :type=>:dword, :data=>"32767"}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe32767", :type=>:dword, :data=>32767}).should == true
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe32767", :type=>:dword, :data=>"32767"})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe32767", :type=>:dword, :data=>32767})).to eq(true)
end
it "casts a nonsense string given as a dword into zero" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBeZero", :type=>:dword, :data=>"whatdoesthisdo"}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBeZero", :type=>:dword, :data=>0}).should == true
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBeZero", :type=>:dword, :data=>"whatdoesthisdo"})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBeZero", :type=>:dword, :data=>0})).to eq(true)
end
it "throws an exception when trying to cast an array to an int for a dword" do
- lambda {@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldThrow", :type=>:dword, :data=>["one","two"]})}.should raise_error
+ expect {@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldThrow", :type=>:dword, :data=>["one","two"]})}.to raise_error
end
# we are validating that the data gets .to_s called on it when type is a :string
it "stores the string representation of an array into a string if you pass it an array" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBePainful", :type=>:string, :data=>["one","two"]}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBePainful", :type=>:string, :data=>'["one", "two"]'}).should == true
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBePainful", :type=>:string, :data=>["one","two"]})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBePainful", :type=>:string, :data=>'["one", "two"]'})).to eq(true)
end
it "stores the string representation of a number into a string if you pass it an number" do
- @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe65535", :type=>:string, :data=>65535}).should == true
- @registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe65535", :type=>:string, :data=>"65535"}).should == true
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe65535", :type=>:string, :data=>65535})).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBe65535", :type=>:string, :data=>"65535"})).to eq(true)
end
# we are validating that the data gets .to_a called on it when type is a :multi_string
it "throws an exception when a multi-string is passed a number" do
- lambda {@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldThrow", :type=>:multi_string, :data=>65535})}.should raise_error
+ expect {@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldThrow", :type=>:multi_string, :data=>65535})}.to raise_error
end
it "throws an exception when a multi-string is passed a string" do
- lambda {@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBeWat", :type=>:multi_string, :data=>"foo"})}.should raise_error
+ expect {@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", {:name=>"ShouldBeWat", :type=>:multi_string, :data=>"foo"})}.to raise_error
end
end
@@ -289,22 +289,22 @@ describe 'Chef::Win32::Registry', :windows_only do
end
it "throws an exception if the path has missing keys but recursive set to false" do
- lambda {@registry.create_key("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", false)}.should raise_error(Chef::Exceptions::Win32RegNoRecursive)
- @registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker").should == false
+ expect {@registry.create_key("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", false)}.to raise_error(Chef::Exceptions::Win32RegNoRecursive)
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker")).to eq(false)
end
it "creates the key_path if the keys were missing but recursive was set to true" do
- @registry.create_key("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", true).should == true
- @registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker").should == true
+ expect(@registry.create_key("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", true)).to eq(true)
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker")).to eq(true)
end
it "does nothing if the key already exists" do
- @registry.create_key("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", false).should == true
- @registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker").should == true
+ expect(@registry.create_key("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", false)).to eq(true)
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker")).to eq(true)
end
it "throws an exception of the hive does not exist" do
- lambda {@registry.create_key("JKLM\\Software\\Root\\Trunk\\Peck\\Woodpecker", false)}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.create_key("JKLM\\Software\\Root\\Trunk\\Peck\\Woodpecker", false)}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
end
@@ -317,21 +317,21 @@ describe 'Chef::Win32::Registry', :windows_only do
end
it "deletes values if the value exists" do
- @registry.delete_value("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"}).should == true
- @registry.value_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"}).should == false
+ expect(@registry.delete_value("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})).to eq(true)
+ expect(@registry.value_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})).to eq(false)
end
it "does nothing if value does not exist" do
- @registry.delete_value("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"}).should == true
- @registry.value_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"}).should == false
+ expect(@registry.delete_value("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})).to eq(true)
+ expect(@registry.value_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})).to eq(false)
end
it "throws an exception if the key does not exist?" do
- lambda {@registry.delete_value("HKCU\\Software\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.delete_value("HKCU\\Software\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "throws an exception if the hive does not exist" do
- lambda {@registry.delete_value("JKLM\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.delete_value("JKLM\\Software\\Root\\Trunk\\Peck\\Woodpecker", {:name=>"Peter", :type=>:string, :data=>"Tiny"})}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
end
@@ -348,27 +348,27 @@ describe 'Chef::Win32::Registry', :windows_only do
end
it "deletes a key if it has no subkeys" do
- @registry.delete_key("HKCU\\Software\\Root\\Branch\\Fruit", false).should == true
- @registry.key_exists?("HKCU\\Software\\Root\\Branch\\Fruit").should == false
+ expect(@registry.delete_key("HKCU\\Software\\Root\\Branch\\Fruit", false)).to eq(true)
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Branch\\Fruit")).to eq(false)
end
it "throws an exception if key to delete has subkeys and recursive is false" do
- lambda { @registry.delete_key("HKCU\\Software\\Root\\Trunk", false) }.should raise_error(Chef::Exceptions::Win32RegNoRecursive)
- @registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker").should == true
+ expect { @registry.delete_key("HKCU\\Software\\Root\\Trunk", false) }.to raise_error(Chef::Exceptions::Win32RegNoRecursive)
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Trunk\\Peck\\Woodpecker")).to eq(true)
end
it "deletes a key if it has subkeys and recursive true" do
- @registry.delete_key("HKCU\\Software\\Root\\Trunk", true).should == true
- @registry.key_exists?("HKCU\\Software\\Root\\Trunk").should == false
+ expect(@registry.delete_key("HKCU\\Software\\Root\\Trunk", true)).to eq(true)
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Trunk")).to eq(false)
end
it "does nothing if the key does not exist" do
- @registry.delete_key("HKCU\\Software\\Root\\Trunk", true).should == true
- @registry.key_exists?("HKCU\\Software\\Root\\Trunk").should == false
+ expect(@registry.delete_key("HKCU\\Software\\Root\\Trunk", true)).to eq(true)
+ expect(@registry.key_exists?("HKCU\\Software\\Root\\Trunk")).to eq(false)
end
it "throws an exception if the hive does not exist" do
- lambda {@registry.delete_key("JKLM\\Software\\Root\\Branch\\Flower", false)}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.delete_key("JKLM\\Software\\Root\\Branch\\Flower", false)}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
end
@@ -384,29 +384,29 @@ describe 'Chef::Win32::Registry', :windows_only do
end
it "throws an exception if the hive was missing" do
- lambda {@registry.has_subkeys?("LMNO\\Software\\Root")}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.has_subkeys?("LMNO\\Software\\Root")}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "throws an exception if the key is missing" do
- lambda {@registry.has_subkeys?("HKCU\\Software\\Root\\Trunk\\Red")}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.has_subkeys?("HKCU\\Software\\Root\\Trunk\\Red")}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if the key has subkeys" do
- @registry.has_subkeys?("HKCU\\Software\\Root").should == true
+ expect(@registry.has_subkeys?("HKCU\\Software\\Root")).to eq(true)
end
it "returns false if the key has no subkeys" do
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\Trunk\\Red"
- @registry.has_subkeys?("HKCU\\Software\\Root\\Trunk\\Red").should == false
+ expect(@registry.has_subkeys?("HKCU\\Software\\Root\\Trunk\\Red")).to eq(false)
end
end
describe "get_subkeys" do
it "throws an exception if the key is missing" do
- lambda {@registry.get_subkeys("HKCU\\Software\\Trunk\\Red")}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.get_subkeys("HKCU\\Software\\Trunk\\Red")}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "throws an exception if the hive does not exist" do
- lambda {@registry.get_subkeys("JKLM\\Software\\Root")}.should raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect {@registry.get_subkeys("JKLM\\Software\\Root")}.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "returns the array of subkeys for a given key" do
subkeys = @registry.get_subkeys("HKCU\\Software\\Root")
@@ -414,7 +414,7 @@ describe 'Chef::Win32::Registry', :windows_only do
::Win32::Registry::HKEY_CURRENT_USER.open("Software\\Root", Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg.each_key{|name| reg_subkeys << name}
end
- reg_subkeys.should == subkeys
+ expect(reg_subkeys).to eq(subkeys)
end
end
@@ -431,37 +431,37 @@ describe 'Chef::Win32::Registry', :windows_only do
context "registry constructor" do
it "throws an exception if requested architecture is 64bit but running on 32bit" do
- lambda {Chef::Win32::Registry.new(@run_context, :x86_64)}.should raise_error(Chef::Exceptions::Win32RegArchitectureIncorrect)
+ expect {Chef::Win32::Registry.new(@run_context, :x86_64)}.to raise_error(Chef::Exceptions::Win32RegArchitectureIncorrect)
end
it "can correctly set the requested architecture to 32-bit" do
@r = Chef::Win32::Registry.new(@run_context, :i386)
- @r.architecture.should == :i386
- @r.registry_system_architecture.should == 0x0200
+ expect(@r.architecture).to eq(:i386)
+ expect(@r.registry_system_architecture).to eq(0x0200)
end
it "can correctly set the requested architecture to :machine" do
@r = Chef::Win32::Registry.new(@run_context, :machine)
- @r.architecture.should == :machine
- @r.registry_system_architecture.should == 0x0200
+ expect(@r.architecture).to eq(:machine)
+ expect(@r.registry_system_architecture).to eq(0x0200)
end
end
context "architecture setter" do
it "throws an exception if requested architecture is 64bit but running on 32bit" do
- lambda {@registry.architecture = :x86_64}.should raise_error(Chef::Exceptions::Win32RegArchitectureIncorrect)
+ expect {@registry.architecture = :x86_64}.to raise_error(Chef::Exceptions::Win32RegArchitectureIncorrect)
end
it "sets the requested architecture to :machine if passed :machine" do
@registry.architecture = :machine
- @registry.architecture.should == :machine
- @registry.registry_system_architecture.should == 0x0200
+ expect(@registry.architecture).to eq(:machine)
+ expect(@registry.registry_system_architecture).to eq(0x0200)
end
it "sets the requested architecture to 32-bit if passed i386 as a string" do
@registry.architecture = :i386
- @registry.architecture.should == :i386
- @registry.registry_system_architecture.should == 0x0200
+ expect(@registry.architecture).to eq(:i386)
+ expect(@registry.registry_system_architecture).to eq(0x0200)
end
end
end
@@ -479,40 +479,40 @@ describe 'Chef::Win32::Registry', :windows_only do
context "registry constructor" do
it "can correctly set the requested architecture to 32-bit" do
@r = Chef::Win32::Registry.new(@run_context, :i386)
- @r.architecture.should == :i386
- @r.registry_system_architecture.should == 0x0200
+ expect(@r.architecture).to eq(:i386)
+ expect(@r.registry_system_architecture).to eq(0x0200)
end
it "can correctly set the requested architecture to 64-bit" do
@r = Chef::Win32::Registry.new(@run_context, :x86_64)
- @r.architecture.should == :x86_64
- @r.registry_system_architecture.should == 0x0100
+ expect(@r.architecture).to eq(:x86_64)
+ expect(@r.registry_system_architecture).to eq(0x0100)
end
it "can correctly set the requested architecture to :machine" do
@r = Chef::Win32::Registry.new(@run_context, :machine)
- @r.architecture.should == :machine
- @r.registry_system_architecture.should == 0x0100
+ expect(@r.architecture).to eq(:machine)
+ expect(@r.registry_system_architecture).to eq(0x0100)
end
end
context "architecture setter" do
it "sets the requested architecture to 64-bit if passed 64-bit" do
@registry.architecture = :x86_64
- @registry.architecture.should == :x86_64
- @registry.registry_system_architecture.should == 0x0100
+ expect(@registry.architecture).to eq(:x86_64)
+ expect(@registry.registry_system_architecture).to eq(0x0100)
end
it "sets the requested architecture to :machine if passed :machine" do
@registry.architecture = :machine
- @registry.architecture.should == :machine
- @registry.registry_system_architecture.should == 0x0100
+ expect(@registry.architecture).to eq(:machine)
+ expect(@registry.registry_system_architecture).to eq(0x0100)
end
it "sets the requested architecture to 32-bit if passed 32-bit" do
@registry.architecture = :i386
- @registry.architecture.should == :i386
- @registry.registry_system_architecture.should == 0x0200
+ expect(@registry.architecture).to eq(:i386)
+ expect(@registry.registry_system_architecture).to eq(0x0200)
end
end
end
@@ -555,75 +555,75 @@ describe 'Chef::Win32::Registry', :windows_only do
describe "key_exists?" do
it "does not find 64-bit keys in the 32-bit registry" do
@registry.architecture=:i386
- @registry.key_exists?("HKLM\\Software\\Root\\Mauve").should == false
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Mauve")).to eq(false)
end
it "finds 32-bit keys in the 32-bit registry" do
@registry.architecture=:i386
- @registry.key_exists?("HKLM\\Software\\Root\\Poosh").should == true
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Poosh")).to eq(true)
end
it "does not find 32-bit keys in the 64-bit registry" do
@registry.architecture=:x86_64
- @registry.key_exists?("HKLM\\Software\\Root\\Mauve").should == true
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Mauve")).to eq(true)
end
it "finds 64-bit keys in the 64-bit registry" do
@registry.architecture=:x86_64
- @registry.key_exists?("HKLM\\Software\\Root\\Poosh").should == false
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Poosh")).to eq(false)
end
end
describe "value_exists?" do
it "does not find 64-bit values in the 32-bit registry" do
@registry.architecture=:i386
- lambda{@registry.value_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert"})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect{@registry.value_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert"})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "finds 32-bit values in the 32-bit registry" do
@registry.architecture=:i386
- @registry.value_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status"}).should == true
+ expect(@registry.value_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status"})).to eq(true)
end
it "does not find 32-bit values in the 64-bit registry" do
@registry.architecture=:x86_64
- @registry.value_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert"}).should == true
+ expect(@registry.value_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert"})).to eq(true)
end
it "finds 64-bit values in the 64-bit registry" do
@registry.architecture=:x86_64
- lambda{@registry.value_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status"})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect{@registry.value_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status"})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
end
describe "data_exists?" do
it "does not find 64-bit keys in the 32-bit registry" do
@registry.architecture=:i386
- lambda{@registry.data_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert", :type=>:string, :data=>"Universal"})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect{@registry.data_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert", :type=>:string, :data=>"Universal"})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "finds 32-bit keys in the 32-bit registry" do
@registry.architecture=:i386
- @registry.data_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status", :type=>:string, :data=>"Lost"}).should == true
+ expect(@registry.data_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status", :type=>:string, :data=>"Lost"})).to eq(true)
end
it "does not find 32-bit keys in the 64-bit registry" do
@registry.architecture=:x86_64
- @registry.data_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert", :type=>:string, :data=>"Universal"}).should == true
+ expect(@registry.data_exists?("HKLM\\Software\\Root\\Mauve", {:name=>"Alert", :type=>:string, :data=>"Universal"})).to eq(true)
end
it "finds 64-bit keys in the 64-bit registry" do
@registry.architecture=:x86_64
- lambda{@registry.data_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status", :type=>:string, :data=>"Lost"})}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect{@registry.data_exists?("HKLM\\Software\\Root\\Poosh", {:name=>"Status", :type=>:string, :data=>"Lost"})}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
end
describe "create_key" do
it "can create a 32-bit only registry key" do
@registry.architecture = :i386
- @registry.create_key("HKLM\\Software\\Root\\Trunk\\Red", true).should == true
- @registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Red").should == true
+ expect(@registry.create_key("HKLM\\Software\\Root\\Trunk\\Red", true)).to eq(true)
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Red")).to eq(true)
@registry.architecture = :x86_64
- @registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Red").should == false
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Red")).to eq(false)
end
it "can create a 64-bit only registry key" do
@registry.architecture = :x86_64
- @registry.create_key("HKLM\\Software\\Root\\Trunk\\Blue", true).should == true
- @registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Blue").should == true
+ expect(@registry.create_key("HKLM\\Software\\Root\\Trunk\\Blue", true)).to eq(true)
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Blue")).to eq(true)
@registry.architecture = :i386
- @registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Blue").should == false
+ expect(@registry.key_exists?("HKLM\\Software\\Root\\Trunk\\Blue")).to eq(false)
end
end
diff --git a/spec/functional/win32/security_spec.rb b/spec/functional/win32/security_spec.rb
index 4ad9b07b74..010a4ca557 100644
--- a/spec/functional/win32/security_spec.rb
+++ b/spec/functional/win32/security_spec.rb
@@ -23,7 +23,7 @@ end
describe 'Chef::Win32::Security', :windows_only do
it "has_admin_privileges? returns true when running as admin" do
- Chef::ReservedNames::Win32::Security.has_admin_privileges?.should == true
+ expect(Chef::ReservedNames::Win32::Security.has_admin_privileges?).to eq(true)
end
# We've done some investigation adding a negative test and it turned
@@ -32,6 +32,6 @@ describe 'Chef::Win32::Security', :windows_only do
#
# TODO - Add negative tests once mixlib-shellout has user support
it "has_admin_privileges? returns false when running as non-admin" do
- pending "requires user support in mixlib-shellout"
+ skip "requires user support in mixlib-shellout"
end
end
diff --git a/spec/functional/win32/service_manager_spec.rb b/spec/functional/win32/service_manager_spec.rb
index b5b2e20825..fd21e7d82e 100644
--- a/spec/functional/win32/service_manager_spec.rb
+++ b/spec/functional/win32/service_manager_spec.rb
@@ -93,7 +93,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
context "with invalid service definition" do
it "throws an error when initialized with no service definition" do
- lambda { Chef::Application::WindowsServiceManager.new(nil) }.should raise_error(ArgumentError)
+ expect { Chef::Application::WindowsServiceManager.new(nil) }.to raise_error(ArgumentError)
end
it "throws an error with required missing options" do
@@ -101,7 +101,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
service_def = test_service.dup
service_def.delete(key)
- lambda { Chef::Application::WindowsServiceManager.new(service_def) }.should raise_error(ArgumentError)
+ expect { Chef::Application::WindowsServiceManager.new(service_def) }.to raise_error(ArgumentError)
end
end
end
@@ -111,7 +111,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
@service_manager_output = [ ]
# Uncomment below lines to debug this test
# original_puts = $stdout.method(:puts)
- $stdout.stub(:puts) do |message|
+ allow($stdout).to receive(:puts) do |message|
@service_manager_output << message
# original_puts.call(message)
end
@@ -125,19 +125,19 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
it "default => should say service don't exist" do
service_manager.run
- @service_manager_output.grep(/doesn't exist on the system/).length.should > 0
+ expect(@service_manager_output.grep(/doesn't exist on the system/).length).to be > 0
end
it "install => should install the service" do
service_manager.run(["-a", "install"])
- test_service_exists?.should be_true
+ expect(test_service_exists?).to be_truthy
end
it "other actions => should say service doesn't exist" do
["delete", "start", "stop", "pause", "resume", "uninstall"].each do |action|
service_manager.run(["-a", action])
- @service_manager_output.grep(/doesn't exist on the system/).length.should > 0
+ expect(@service_manager_output.grep(/doesn't exist on the system/).length).to be > 0
@service_manager_output = [ ]
end
end
@@ -150,47 +150,47 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
it "should have an own-process, non-interactive type" do
status = ::Win32::Service.status("spec-service")
- status[:service_type].should == "own process"
- status[:interactive].should be_false
+ expect(status[:service_type]).to eq("own process")
+ expect(status[:interactive]).to be_falsey
end
it "install => should say service already exists" do
service_manager.run(["-a", "install"])
- @service_manager_output.grep(/already exists/).length.should > 0
+ expect(@service_manager_output.grep(/already exists/).length).to be > 0
end
context "and service is stopped" do
["delete", "uninstall"].each do |action|
it "#{action} => should remove the service", :volatile do
service_manager.run(["-a", action])
- test_service_exists?.should be_false
+ expect(test_service_exists?).to be_falsey
end
end
it "default, status => should say service is stopped" do
service_manager.run([ ])
- @service_manager_output.grep(/stopped/).length.should > 0
+ expect(@service_manager_output.grep(/stopped/).length).to be > 0
@service_manager_output = [ ]
service_manager.run(["-a", "status"])
- @service_manager_output.grep(/stopped/).length.should > 0
+ expect(@service_manager_output.grep(/stopped/).length).to be > 0
end
it "start should start the service", :volatile do
service_manager.run(["-a", "start"])
- test_service_state.should == "running"
- File.exists?(test_service_file).should be_true
+ expect(test_service_state).to eq("running")
+ expect(File.exists?(test_service_file)).to be_truthy
end
it "stop should not affect the service" do
service_manager.run(["-a", "stop"])
- test_service_state.should == "stopped"
+ expect(test_service_state).to eq("stopped")
end
["pause", "resume"].each do |action|
it "#{action} => should raise error" do
- lambda {service_manager.run(["-a", action])}.should raise_error(::Win32::Service::Error)
+ expect {service_manager.run(["-a", action])}.to raise_error(::Win32::Service::Error)
end
end
@@ -202,32 +202,32 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
["delete", "uninstall"].each do |action|
it "#{action} => should remove the service", :volatile do
service_manager.run(["-a", action])
- test_service_exists?.should be_false
+ expect(test_service_exists?).to be_falsey
end
end
it "default, status => should say service is running" do
service_manager.run([ ])
- @service_manager_output.grep(/running/).length.should > 0
+ expect(@service_manager_output.grep(/running/).length).to be > 0
@service_manager_output = [ ]
service_manager.run(["-a", "status"])
- @service_manager_output.grep(/running/).length.should > 0
+ expect(@service_manager_output.grep(/running/).length).to be > 0
end
it "stop should stop the service" do
service_manager.run(["-a", "stop"])
- test_service_state.should == "stopped"
+ expect(test_service_state).to eq("stopped")
end
it "pause should pause the service" do
service_manager.run(["-a", "pause"])
- test_service_state.should == "paused"
+ expect(test_service_state).to eq("paused")
end
it "resume should have no affect" do
service_manager.run(["-a", "resume"])
- test_service_state.should == "running"
+ expect(test_service_state).to eq("running")
end
end
@@ -241,31 +241,31 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
actions.each do |action|
it "#{action} => should remove the service" do
service_manager.run(["-a", action])
- test_service_exists?.should be_false
+ expect(test_service_exists?).to be_falsey
end
end
it "default, status => should say service is paused" do
service_manager.run([ ])
- @service_manager_output.grep(/paused/).length.should > 0
+ expect(@service_manager_output.grep(/paused/).length).to be > 0
@service_manager_output = [ ]
service_manager.run(["-a", "status"])
- @service_manager_output.grep(/paused/).length.should > 0
+ expect(@service_manager_output.grep(/paused/).length).to be > 0
end
it "stop should stop the service" do
service_manager.run(["-a", "stop"])
- test_service_state.should == "stopped"
+ expect(test_service_state).to eq("stopped")
end
it "pause should not affect the service" do
service_manager.run(["-a", "pause"])
- test_service_state.should == "paused"
+ expect(test_service_state).to eq("paused")
end
it "start should raise an error" do
- lambda {service_manager.run(["-a", "start"])}.should raise_error(::Win32::Service::Error)
+ expect {service_manager.run(["-a", "start"])}.to raise_error(::Win32::Service::Error)
end
end
diff --git a/spec/functional/win32/versions_spec.rb b/spec/functional/win32/versions_spec.rb
index 6c8f6b2aaa..38af47b0c9 100644
--- a/spec/functional/win32/versions_spec.rb
+++ b/spec/functional/win32/versions_spec.rb
@@ -62,8 +62,8 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on
it "should have have one method for each marketing version" do
versions = 0
for_each_windows_version { versions += 1 }
- versions.should > 0
- versions.should == Chef::ReservedNames::Win32::Version::WIN_VERSIONS.length
+ expect(versions).to be > 0
+ expect(versions).to eq(Chef::ReservedNames::Win32::Version::WIN_VERSIONS.length)
end
it "should only contain version methods with legal method names" do
@@ -71,8 +71,8 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on
for_each_windows_version do |method_name|
method_match = method_name_pattern.match(method_name.to_s)
- method_match.should_not be_nil
- method_name.to_s.should == method_match[0]
+ expect(method_match).not_to be_nil
+ expect(method_name.to_s).to eq(method_match[0])
end
end
@@ -81,7 +81,7 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on
for_each_windows_version do |method_name|
true_versions += 1 if @version.send(method_name)
end
- true_versions.should == 1
+ expect(true_versions).to eq(1)
end
it "should successfully execute all version methods" do
@@ -91,7 +91,7 @@ describe "Chef::ReservedNames::Win32::Version", :windows_only, :not_supported_on
context "Windows Operating System version" do
it "should match the version from WMI" do
- @current_os_version.should include(@version.marketing_name)
+ expect(@current_os_version).to include(@version.marketing_name)
end
end
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 0144ae0ce3..f4bb124781 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -44,7 +44,7 @@ EOM
it 'should fail when cwd is below high above and paths are not specified' do
result = shell_out("#{chef_client} -z -o 'x::default' --disable-config", :cwd => File.expand_path('..', path_to('')))
- result.exitstatus.should == 1
+ expect(result.exitstatus).to eq(1)
end
end
@@ -54,7 +54,7 @@ EOM
it 'should load .chef/knife.rb when -z is specified' do
result = shell_out("#{chef_client} -z -o 'x::default'", :cwd => path_to(''))
# FATAL: Configuration error NoMethodError: undefined method `xxx' for nil:NilClass
- result.stdout.should include("xxx")
+ expect(result.stdout).to include("xxx")
end
end
@@ -135,8 +135,8 @@ EOM
result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" #{path_to('arbitrary.rb')} #{path_to('arbitrary2.rb')}", :cwd => chef_dir)
result.error!
- IO.read(path_to('tempfile.txt')).should == '1'
- IO.read(path_to('tempfile2.txt')).should == '2'
+ expect(IO.read(path_to('tempfile.txt'))).to eq('1')
+ expect(IO.read(path_to('tempfile2.txt'))).to eq('2')
end
it "should run recipes specified as relative paths directly on the command line" do
@@ -155,7 +155,7 @@ EOM
result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" arbitrary.rb", :cwd => path_to(''))
result.error!
- IO.read(path_to('tempfile.txt')).should == '1'
+ expect(IO.read(path_to('tempfile.txt'))).to eq('1')
end
it "should run recipes specified directly on the command line AFTER recipes in the run list" do
@@ -179,7 +179,7 @@ EOM
result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o x::constant_definition arbitrary.rb", :cwd => path_to(''))
result.error!
- IO.read(path_to('tempfile.txt')).should == '1'
+ expect(IO.read(path_to('tempfile.txt'))).to eq('1')
end
end
@@ -211,7 +211,7 @@ cookbook_path "#{path_to('cookbooks')}"
EOM
result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", :cwd => chef_dir)
- result.stdout.should_not include("SSL validation of HTTPS requests is disabled.")
+ expect(result.stdout).not_to include("SSL validation of HTTPS requests is disabled.")
result.error!
end
@@ -232,8 +232,8 @@ cookbook_path "#{path_to('cookbooks')}"
EOM
result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -r 'x::default' -z", :cwd => chef_dir)
- result.stdout.should_not include("Overridden Run List")
- result.stdout.should include("Run List is [recipe[x::default]]")
+ expect(result.stdout).not_to include("Overridden Run List")
+ expect(result.stdout).to include("Run List is [recipe[x::default]]")
#puts result.stdout
result.error!
end
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb
index a4d62673de..eb02db5384 100644
--- a/spec/integration/knife/chef_fs_data_store_spec.rb
+++ b/spec/integration/knife/chef_fs_data_store_spec.rb
@@ -180,9 +180,9 @@ EOM
knife('list --local /users').should_succeed "/users/x.json\n"
end
- it 'After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty', :pending => (RUBY_VERSION < "1.9") do
+ it 'After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty', :skip => (RUBY_VERSION < "1.9") do
knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ )
- IO.read(path_to('roles/x.json')).should == <<EOM.strip
+ expect(IO.read(path_to('roles/x.json'))).to eq <<EOM.strip
{
"name": "x",
"description": "hi there"
@@ -246,9 +246,9 @@ EOM
knife('list --local /users').should_succeed "/users/z.json\n"
end
- it 'After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty', :pending => (RUBY_VERSION < "1.9") do
+ it 'After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty', :skip => (RUBY_VERSION < "1.9") do
knife("raw -z -i #{path_to('rolestuff.json')} -m POST /roles").should_succeed( /uri/ )
- IO.read(path_to('roles/x.json')).should == <<EOM.strip
+ expect(IO.read(path_to('roles/x.json'))).to eq <<EOM.strip
{
"name": "x",
"description": "hi there"
diff --git a/spec/integration/knife/common_options_spec.rb b/spec/integration/knife/common_options_spec.rb
index dfc1e024f9..ec76738b6f 100644
--- a/spec/integration/knife/common_options_spec.rb
+++ b/spec/integration/knife/common_options_spec.rb
@@ -39,7 +39,7 @@ describe 'knife common options', :workstation do
it 'knife raw /nodes/x should retrieve the node' do
knife('raw /nodes/x').should_succeed( /"name": "x"/ )
- Chef::Config.chef_server_url.should == 'http://localhost:9999'
+ expect(Chef::Config.chef_server_url).to eq('http://localhost:9999')
end
end
@@ -101,7 +101,7 @@ EOM
it 'knife raw -z --chef-zero-port=9999 /nodes/x retrieves the node' do
knife('raw -z --chef-zero-port=9999 /nodes/x').should_succeed( /"name": "x"/ )
- Chef::Config.chef_server_url.should == 'http://localhost:9999'
+ expect(Chef::Config.chef_server_url).to eq('http://localhost:9999')
end
context 'when the default port (8889) is already bound' do
@@ -149,7 +149,7 @@ EOM
it 'knife raw -z --chef-zero-port=9999 /nodes/x retrieves the node' do
knife('raw -z --chef-zero-port=9999 /nodes/x').should_succeed( /"name": "x"/ )
- Chef::Config.chef_server_url.should == 'http://localhost:9999'
+ expect(Chef::Config.chef_server_url).to eq('http://localhost:9999')
end
end
end
diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb
index e59c8912bd..3d468be7f6 100644
--- a/spec/integration/knife/cookbook_api_ipv6_spec.rb
+++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb
@@ -92,7 +92,7 @@ END_CLIENT_RB
shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", :cwd => chef_dir)
versions_list_json = Chef::HTTP::Simple.new("http://[::1]:8900").get("/cookbooks/apache2", "accept" => "application/json")
versions_list = Chef::JSONCompat.from_json(versions_list_json)
- versions_list["apache2"]["versions"].should_not be_empty
+ expect(versions_list["apache2"]["versions"]).not_to be_empty
end
context "and the cookbook has been uploaded to the server" do
@@ -102,7 +102,7 @@ END_CLIENT_RB
it "downloads the cookbook" do
shell_out!("knife cookbook download apache2 #{knife_config_flag} -d #{cache_path}", :cwd => chef_dir)
- Dir["#{cache_path}/*"].map {|entry| File.basename(entry)}.should include("apache2-0.0.1")
+ expect(Dir["#{cache_path}/*"].map {|entry| File.basename(entry)}).to include("apache2-0.0.1")
end
end
diff --git a/spec/integration/knife/deps_spec.rb b/spec/integration/knife/deps_spec.rb
index 8b4d71906b..3120db4940 100644
--- a/spec/integration/knife/deps_spec.rb
+++ b/spec/integration/knife/deps_spec.rb
@@ -251,8 +251,8 @@ EOM
end
it 'knife deps --tree prints each once' do
knife('deps --tree /roles/foo.json /roles/self.json') do
- stdout.should == "/roles/foo.json\n /roles/bar.json\n /roles/baz.json\n /roles/foo.json\n/roles/self.json\n /roles/self.json\n"
- stderr.should == "WARNING: No knife configuration file found\n"
+ expect(stdout).to eq("/roles/foo.json\n /roles/bar.json\n /roles/baz.json\n /roles/foo.json\n/roles/self.json\n /roles/self.json\n")
+ expect(stderr).to eq("WARNING: No knife configuration file found\n")
end
end
end
@@ -589,8 +589,8 @@ EOM
end
it 'knife deps --tree prints each once' do
knife('deps --remote --tree /roles/foo.json /roles/self.json') do
- stdout.should == "/roles/foo.json\n /roles/bar.json\n /roles/baz.json\n /roles/foo.json\n/roles/self.json\n /roles/self.json\n"
- stderr.should == "WARNING: No knife configuration file found\n"
+ expect(stdout).to eq("/roles/foo.json\n /roles/bar.json\n /roles/baz.json\n /roles/foo.json\n/roles/self.json\n /roles/self.json\n")
+ expect(stderr).to eq("WARNING: No knife configuration file found\n")
end
end
end
diff --git a/spec/integration/knife/diff_spec.rb b/spec/integration/knife/diff_spec.rb
index c12ebbcf8f..465383437f 100644
--- a/spec/integration/knife/diff_spec.rb
+++ b/spec/integration/knife/diff_spec.rb
@@ -247,7 +247,7 @@ EOM
end
when_the_chef_server 'has an environment with a different value' do
before { environment 'x', { 'description' => 'hi' } }
- it 'knife diff reports the difference', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife diff reports the difference', :skip => (RUBY_VERSION < "1.9") do
knife('diff /environments/x.json').should_succeed(/
{
- "name": "x",
@@ -277,7 +277,7 @@ EOM
environment 'x', {}
end
- it 'knife diff reports the difference', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife diff reports the difference', :skip => (RUBY_VERSION < "1.9") do
knife('diff /environments/x.json').should_succeed(/
{
- "name": "x"
@@ -291,7 +291,7 @@ EOM
before do
environment 'x', { 'description' => 'lo' }
end
- it 'knife diff reports the difference', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife diff reports the difference', :skip => (RUBY_VERSION < "1.9") do
knife('diff /environments/x.json').should_succeed(/
{
"name": "x",
@@ -533,7 +533,7 @@ EOM
end
when_the_chef_server 'has an environment with a different value' do
before { environment 'x', { 'description' => 'hi' } }
- it 'knife diff reports the difference', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife diff reports the difference', :skip => (RUBY_VERSION < "1.9") do
knife('diff /environments/x.json').should_succeed(/
{
- "name": "x",
@@ -560,7 +560,7 @@ EOM
end
when_the_chef_server 'has an environment with no value' do
before { environment 'x', {} }
- it 'knife diff reports the difference', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife diff reports the difference', :skip => (RUBY_VERSION < "1.9") do
knife('diff /environments/x.json').should_succeed(/
{
- "name": "x"
@@ -574,7 +574,7 @@ EOM
before do
environment 'x', { 'description' => 'lo' }
end
- it 'knife diff reports the difference', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife diff reports the difference', :skip => (RUBY_VERSION < "1.9") do
knife('diff /environments/x.json').should_succeed(/
{
"name": "x",
diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb
index 0c2b907f1e..cf1e4fcf0f 100644
--- a/spec/integration/knife/download_spec.rb
+++ b/spec/integration/knife/download_spec.rb
@@ -1073,15 +1073,15 @@ EOM
# Check that BasicClient.request() always gets called with X-OPS-USERID
original_new = Chef::HTTP::BasicClient.method(:new)
- Chef::HTTP::BasicClient.should_receive(:new) do |args|
+ expect(Chef::HTTP::BasicClient).to receive(:new) { |args|
new_result = original_new.call(*args)
original_request = new_result.method(:request)
- new_result.should_receive(:request) do |method, url, body, headers, &response_handler|
- headers['X-OPS-USERID'].should_not be_nil
+ expect(new_result).to receive(:request) { |method, url, body, headers, &response_handler|
+ expect(headers['X-OPS-USERID']).not_to be_nil
original_request.call(method, url, body, headers, &response_handler)
- end.at_least(:once)
+ }.at_least(:once)
new_result
- end.at_least(:once)
+ }.at_least(:once)
knife('download /cookbooks/x').should_succeed <<EOM
Created /cookbooks
diff --git a/spec/integration/knife/list_spec.rb b/spec/integration/knife/list_spec.rb
index 3d8b83001d..911b56ef18 100644
--- a/spec/integration/knife/list_spec.rb
+++ b/spec/integration/knife/list_spec.rb
@@ -471,7 +471,7 @@ EOM
end
end
- when_the_repository 'has a cookbooks directory and a symlinked cookbooks directory', :pending => (Chef::Platform.windows?) do
+ when_the_repository 'has a cookbooks directory and a symlinked cookbooks directory', :skip => (Chef::Platform.windows?) do
before do
directory 'cookbooks'
symlink 'symlinked', 'cookbooks'
@@ -508,7 +508,7 @@ EOM
end
end
- when_the_repository 'has a real_cookbooks directory and a cookbooks symlink to it', :pending => (Chef::Platform.windows?) do
+ when_the_repository 'has a real_cookbooks directory and a cookbooks symlink to it', :skip => (Chef::Platform.windows?) do
before do
directory 'real_cookbooks'
symlink 'cookbooks', 'real_cookbooks'
diff --git a/spec/integration/knife/raw_spec.rb b/spec/integration/knife/raw_spec.rb
index 2b49d2ebb2..75fc8fa55e 100644
--- a/spec/integration/knife/raw_spec.rb
+++ b/spec/integration/knife/raw_spec.rb
@@ -38,7 +38,7 @@ describe 'knife raw', :workstation do
user 'x', '{}'
end
- it 'knife raw /nodes/x returns the node', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife raw /nodes/x returns the node', :skip => (RUBY_VERSION < "1.9") do
knife('raw /nodes/x').should_succeed <<EOM
{
"name": "x",
@@ -68,7 +68,7 @@ EOM
knife('raw /blarghle').should_fail(/ERROR: Server responded with error 404 "Not Found\s*"/)
end
- it 'knife raw -m DELETE /roles/x succeeds', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife raw -m DELETE /roles/x succeeds', :skip => (RUBY_VERSION < "1.9") do
knife('raw -m DELETE /roles/x').should_succeed <<EOM
{
"name": "x",
@@ -92,7 +92,7 @@ EOM
knife('show /roles/x.json').should_fail "ERROR: /roles/x.json: No such file or directory\n"
end
- it 'knife raw -m PUT -i blah.txt /roles/x succeeds', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife raw -m PUT -i blah.txt /roles/x succeeds', :skip => (RUBY_VERSION < "1.9") do
Tempfile.open('raw_put_input') do |file|
file.write <<EOM
{
@@ -146,7 +146,7 @@ EOM
end
end
- it 'knife raw -m POST -i blah.txt /roles succeeds', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife raw -m POST -i blah.txt /roles succeeds', :skip => (RUBY_VERSION < "1.9") do
Tempfile.open('raw_put_input') do |file|
file.write <<EOM
{
@@ -196,7 +196,7 @@ EOM
@raw_server_thread.kill if @raw_server_thread
end
- it 'knife raw /blah returns the prettified json', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife raw /blah returns the prettified json', :skip => (RUBY_VERSION < "1.9") do
knife('raw /blah').should_succeed <<EOM
{
"x": "y",
diff --git a/spec/integration/knife/serve_spec.rb b/spec/integration/knife/serve_spec.rb
index 3c859b794e..7bf7d29b40 100644
--- a/spec/integration/knife/serve_spec.rb
+++ b/spec/integration/knife/serve_spec.rb
@@ -31,18 +31,18 @@ describe 'knife serve', :workstation do
exception = nil
t = Thread.new do
begin
- knife('serve --chef-zero-port=8889')
+ knife('serve --chef-zero-port=8890')
rescue
exception = $!
end
end
begin
Chef::Config.log_level = :debug
- Chef::Config.chef_server_url = 'http://localhost:8889'
+ Chef::Config.chef_server_url = 'http://localhost:8890'
Chef::Config.node_name = nil
Chef::Config.client_key = nil
api = Chef::ServerAPI.new
- api.get('nodes/x')['name'].should == 'x'
+ expect(api.get('nodes/x')['name']).to eq('x')
rescue
if exception
raise exception
diff --git a/spec/integration/knife/show_spec.rb b/spec/integration/knife/show_spec.rb
index bc7f1cf6d3..8f1887e738 100644
--- a/spec/integration/knife/show_spec.rb
+++ b/spec/integration/knife/show_spec.rb
@@ -76,7 +76,7 @@ EOM
}
EOM
end
- it 'knife show /environments/x.json shows the remote version', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife show /environments/x.json shows the remote version', :skip => (RUBY_VERSION < "1.9") do
knife('show /environments/x.json').should_succeed <<EOM
/environments/x.json:
{
@@ -92,7 +92,7 @@ EOM
}
EOM
end
- it 'knife show /roles/x.json shows the remote version', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife show /roles/x.json shows the remote version', :skip => (RUBY_VERSION < "1.9") do
knife('show /roles/x.json').should_succeed <<EOM
/roles/x.json:
{
@@ -135,7 +135,7 @@ EOM
'name' => 'x'
}
end
- it 'knife show shows the attributes in a predetermined order', :pending => (RUBY_VERSION < "1.9") do
+ it 'knife show shows the attributes in a predetermined order', :skip => (RUBY_VERSION < "1.9") do
knife('show /environments/x.json').should_succeed <<EOM
/environments/x.json:
{
diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb
index dade476889..cef4f54e97 100644
--- a/spec/integration/knife/upload_spec.rb
+++ b/spec/integration/knife/upload_spec.rb
@@ -262,7 +262,7 @@ Created /data_bags/x/y.json
EOM
knife('diff --name-status /data_bags').should_succeed <<EOM
EOM
- Chef::JSONCompat.parse(knife('raw /data/x/y').stdout, :create_additions => false).keys.sort.should == [ 'foo', 'id' ]
+ expect(Chef::JSONCompat.parse(knife('raw /data/x/y').stdout, :create_additions => false).keys.sort).to eq([ 'foo', 'id' ])
end
it 'knife upload /data_bags/x /data_bags/x/y.json uploads x once' do
@@ -286,9 +286,9 @@ Created /data_bags/x/y.json
EOM
knife('diff --name-status /data_bags').should_succeed ''
result = Chef::JSONCompat.parse(knife('raw /data/x/y').stdout, :create_additions => false)
- result.keys.sort.should == [ 'chef_type', 'data_bag', 'id' ]
- result['chef_type'].should == 'aaa'
- result['data_bag'].should == 'bbb'
+ expect(result.keys.sort).to eq([ 'chef_type', 'data_bag', 'id' ])
+ expect(result['chef_type']).to eq('aaa')
+ expect(result['data_bag']).to eq('bbb')
end
end
@@ -1268,8 +1268,8 @@ Created /nodes/x.json
Updated /org.json
Created /roles/x.json
EOM
- api.get('association_requests').map { |a| a['username'] }.should == [ 'foo' ]
- api.get('users').map { |a| a['user']['username'] }.should == [ 'bar' ]
+ expect(api.get('association_requests').map { |a| a['username'] }).to eq([ 'foo' ])
+ expect(api.get('users').map { |a| a['user']['username'] }).to eq([ 'bar' ])
end
end
@@ -1280,7 +1280,7 @@ EOM
it 'knife upload / emits a warning for bar and adds foo and foobar' do
knife('upload /').should_succeed ''
- api.get('/')['full_name'].should == 'Something'
+ expect(api.get('/')['full_name']).to eq('Something')
end
end
@@ -1291,7 +1291,7 @@ EOM
it 'knife upload / emits a warning for bar and adds foo and foobar' do
knife('upload /').should_succeed "Updated /org.json\n"
- api.get('/')['full_name'].should == 'Something Else'
+ expect(api.get('/')['full_name']).to eq('Something Else')
end
end
@@ -1306,8 +1306,8 @@ EOM
it 'knife upload / emits a warning for bar and invites foobar' do
knife('upload /').should_succeed "Updated /invitations.json\n", :stderr => "WARN: Could not invite bar to organization foo: User bar is already in organization foo\n"
- api.get('association_requests').map { |a| a['username'] }.should == [ 'foo', 'foobar' ]
- api.get('users').map { |a| a['user']['username'] }.should == [ 'bar' ]
+ expect(api.get('association_requests').map { |a| a['username'] }).to eq([ 'foo', 'foobar' ])
+ expect(api.get('users').map { |a| a['user']['username'] }).to eq([ 'bar' ])
end
end
@@ -1318,8 +1318,8 @@ EOM
it 'knife upload / emits a warning for bar and adds foo and foobar' do
knife('upload /').should_succeed "Updated /members.json\n"
- api.get('association_requests').map { |a| a['username'] }.should == [ ]
- api.get('users').map { |a| a['user']['username'] }.should == [ 'bar', 'foo', 'foobar' ]
+ expect(api.get('association_requests').map { |a| a['username'] }).to eq([ ])
+ expect(api.get('users').map { |a| a['user']['username'] }).to eq([ 'bar', 'foo', 'foobar' ])
end
end
@@ -1331,8 +1331,8 @@ EOM
it 'knife upload / does nothing' do
knife('upload /').should_succeed ''
- api.get('association_requests').map { |a| a['username'] }.should == [ 'foo' ]
- api.get('users').map { |a| a['user']['username'] }.should == [ 'bar' ]
+ expect(api.get('association_requests').map { |a| a['username'] }).to eq([ 'foo' ])
+ expect(api.get('users').map { |a| a['user']['username'] }).to eq([ 'bar' ])
end
end
end
@@ -1347,8 +1347,8 @@ EOM
it 'knife upload / does nothing' do
knife('upload /').should_succeed ''
- api.get('association_requests').map { |a| a['username'] }.should == [ 'bar', 'foo' ]
- api.get('users').map { |a| a['user']['username'] }.should == [ ]
+ expect(api.get('association_requests').map { |a| a['username'] }).to eq([ 'bar', 'foo' ])
+ expect(api.get('users').map { |a| a['user']['username'] }).to eq([ ])
end
end
end
@@ -1363,8 +1363,8 @@ EOM
it 'knife upload / does nothing' do
knife('upload /').should_succeed ''
- api.get('association_requests').map { |a| a['username'] }.should == [ ]
- api.get('users').map { |a| a['user']['username'] }.should == [ 'bar', 'foo' ]
+ expect(api.get('association_requests').map { |a| a['username'] }).to eq([ ])
+ expect(api.get('users').map { |a| a['user']['username'] }).to eq([ 'bar', 'foo' ])
end
end
end
diff --git a/spec/integration/recipes/lwrp_inline_resources_spec.rb b/spec/integration/recipes/lwrp_inline_resources_spec.rb
index a0c13da6f7..a3baba8b0f 100644
--- a/spec/integration/recipes/lwrp_inline_resources_spec.rb
+++ b/spec/integration/recipes/lwrp_inline_resources_spec.rb
@@ -71,7 +71,7 @@ EOM
(up to date)
EOM
expected = expected.lines.map { |l| l.chomp }.join("\n")
- actual.should include(expected)
+ expect(actual).to include(expected)
result.error!
end
end
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb
index 793789b754..cc9ba1abb2 100644
--- a/spec/integration/solo/solo_spec.rb
+++ b/spec/integration/solo/solo_spec.rb
@@ -28,7 +28,7 @@ file_cache_path "#{path_to('config/cache')}"
EOM
result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir)
result.error!
- result.stdout.should include("ITWORKS")
+ expect(result.stdout).to include("ITWORKS")
end
it "should evaluate its node.json file" do
@@ -43,7 +43,7 @@ E
result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -j '#{path_to('config/node.json')}' -l debug", :cwd => chef_dir)
result.error!
- result.stdout.should include("ITWORKS")
+ expect(result.stdout).to include("ITWORKS")
end
end
@@ -63,8 +63,8 @@ cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
EOM
result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir)
- result.exitstatus.should == 0 # For CHEF-5120 this becomes 1
- result.stdout.should include("WARN: MissingCookbookDependency")
+ expect(result.exitstatus).to eq(0) # For CHEF-5120 this becomes 1
+ expect(result.stdout).to include("WARN: MissingCookbookDependency")
end
end
@@ -91,7 +91,7 @@ file_cache_path "#{path_to('config/cache')}"
EOM
# We have a timeout protection here so that if due to some bug
# run_lock gets stuck we can discover it.
- lambda {
+ expect {
Timeout.timeout(120) do
chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..")
@@ -109,7 +109,7 @@ EOM
Process.waitpid(s1)
Process.waitpid(s2)
end
- }.should_not raise_error
+ }.not_to raise_error
# Unfortunately file / directory helpers in integration tests
# are implemented using before(:each) so we need to do all below
@@ -117,13 +117,13 @@ EOM
run_log = File.read(path_to('logs/runs.log'))
# both of the runs should succeed
- run_log.lines.reject {|l| !l.include? "INFO: Chef Run complete in"}.length.should == 2
+ expect(run_log.lines.reject {|l| !l.include? "INFO: Chef Run complete in"}.length).to eq(2)
# second run should have a message which indicates it's waiting for the first run
pid_lines = run_log.lines.reject {|l| !l.include? "Chef-client pid:"}
- pid_lines.length.should == 2
+ expect(pid_lines.length).to eq(2)
pids = pid_lines.map {|l| l.split(" ").last}
- run_log.should include("Chef client #{pids[0]} is running, will wait for it to finish and then run.")
+ expect(run_log).to include("Chef client #{pids[0]} is running, will wait for it to finish and then run.")
# second run should start after first run ends
starts = [ ]
@@ -135,7 +135,7 @@ EOM
ends << index
end
end
- starts[1].should > ends[0]
+ expect(starts[1]).to be > ends[0]
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e282a88100..e3de80f3f1 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -18,12 +18,6 @@
# If you need to add anything in here, don't.
# Add it to one of the files in spec/support
-# Configure this first so it doesn't trigger annoying warning when we use it.
-# Main rspec configuration comes later
-RSpec.configure do |config|
- config.treat_symbols_as_metadata_keys_with_true_values = true
-end
-
# Abuse ruby's constant lookup to avoid undefined constant errors
module Shell
JUST_TESTING_MOVE_ALONG = true unless defined? JUST_TESTING_MOVE_ALONG
@@ -97,8 +91,16 @@ RSpec.configure do |config|
config.filter_run :focus => true
config.filter_run_excluding :external => true
+ # Explicitly disable :should syntax
+ config.expect_with :rspec do |c|
+ c.syntax = :expect
+ end
+ config.mock_with :rspec do |c|
+ c.syntax = :expect
+ end
+
# Only run these tests on platforms that are also chef workstations
- config.filter_run_excluding :workstation if solaris?
+ config.filter_run_excluding :workstation if solaris? or aix?
# Tests that randomly fail, but may have value.
config.filter_run_excluding :volatile => true
@@ -119,6 +121,7 @@ RSpec.configure do |config|
config.filter_run_excluding :solaris_only => true unless solaris?
config.filter_run_excluding :system_windows_service_gem_only => true unless system_windows_service_gem?
config.filter_run_excluding :unix_only => true unless unix?
+ config.filter_run_excluding :aix_only => true unless aix?
config.filter_run_excluding :supports_cloexec => true unless supports_cloexec?
config.filter_run_excluding :selinux_only => true unless selinux_enabled?
config.filter_run_excluding :ruby_18_only => true unless ruby_18?
@@ -133,6 +136,7 @@ RSpec.configure do |config|
config.filter_run_excluding :ruby_gte_20_and_openssl_gte_101 => true unless (ruby_gte_20? && openssl_gte_101?)
config.filter_run_excluding :openssl_lt_101 => true unless openssl_lt_101?
config.filter_run_excluding :ruby_lt_20 => true unless ruby_lt_20?
+ config.filter_run_excluding :aes_256_gcm_only => true unless aes_256_gcm?
running_platform_arch = `uname -m`.strip
@@ -157,7 +161,6 @@ RSpec.configure do |config|
}
config.run_all_when_everything_filtered = true
- config.treat_symbols_as_metadata_keys_with_true_values = true
config.before(:each) do
Chef::Config.reset
diff --git a/spec/stress/win32/file_spec.rb b/spec/stress/win32/file_spec.rb
index caeab352f7..dd1dcd305e 100644
--- a/spec/stress/win32/file_spec.rb
+++ b/spec/stress/win32/file_spec.rb
@@ -26,12 +26,12 @@ describe 'Chef::ReservedNames::Win32::File', :windows_only do
it "should not leak significant memory" do
test = lambda { Chef::ReservedNames::Win32::File.symlink?(@path) }
- test.should_not leak_memory(:warmup => 50000, :iterations => 50000)
+ expect(test).not_to leak_memory(:warmup => 50000, :iterations => 50000)
end
it "should not leak handles" do
test = lambda { Chef::ReservedNames::Win32::File.symlink?(@path) }
- test.should_not leak_handles(:warmup => 50, :iterations => 100)
+ expect(test).not_to leak_handles(:warmup => 50, :iterations => 100)
end
end
diff --git a/spec/stress/win32/security_spec.rb b/spec/stress/win32/security_spec.rb
index e506b71be1..cb520e515e 100644
--- a/spec/stress/win32/security_spec.rb
+++ b/spec/stress/win32/security_spec.rb
@@ -49,21 +49,21 @@ describe 'Chef::ReservedNames::Win32::Security', :windows_only do
end
it "should not leak when retrieving and reading the ACE from a file", :volatile do
- lambda {
+ expect {
sids = Chef::ReservedNames::Win32::Security::SecurableObject.new(@monkeyfoo).security_descriptor.dacl.select { |ace| ace.sid }
GC.start
- }.should_not leak_memory(:warmup => 50, :iterations => 100)
+ }.not_to leak_memory(:warmup => 50, :iterations => 100)
end
it "should not leak when creating a new ACL and setting it on a file", :volatile do
securable_object = Security::SecurableObject.new(@monkeyfoo)
- lambda {
+ expect {
securable_object.dacl = Chef::ReservedNames::Win32::Security::ACL.create([
Chef::ReservedNames::Win32::Security::ACE.access_allowed(Chef::ReservedNames::Win32::Security::SID.Everyone, Chef::ReservedNames::Win32::API::Security::GENERIC_READ),
Chef::ReservedNames::Win32::Security::ACE.access_denied(Chef::ReservedNames::Win32::Security::SID.from_account("Users"), Chef::ReservedNames::Win32::API::Security::GENERIC_ALL)
])
GC.start
- }.should_not leak_memory(:warmup => 50, :iterations => 100)
+ }.not_to leak_memory(:warmup => 50, :iterations => 100)
end
end
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb
index f31355f50a..237543748c 100644
--- a/spec/support/chef_helpers.rb
+++ b/spec/support/chef_helpers.rb
@@ -14,6 +14,7 @@
# limitations under the License.
#
CHEF_SPEC_DATA = File.expand_path(File.dirname(__FILE__) + "/../data/")
+CHEF_SPEC_ASSETS = File.expand_path(File.dirname(__FILE__) + "/../functional/assets/")
CHEF_SPEC_BACKUP_PATH = File.join(Dir.tmpdir, 'test-backup-path')
Chef::Config[:log_level] = :fatal
diff --git a/spec/support/lib/chef/provider/snakeoil.rb b/spec/support/lib/chef/provider/snakeoil.rb
index e9d01f654f..485d37329f 100644
--- a/spec/support/lib/chef/provider/snakeoil.rb
+++ b/spec/support/lib/chef/provider/snakeoil.rb
@@ -19,6 +19,7 @@
class Chef
class Provider
class SnakeOil < Chef::Provider
+
def load_current_resource
true
end
diff --git a/spec/support/lib/chef/resource/zen_follower.rb b/spec/support/lib/chef/resource/zen_follower.rb
index 0fa0c4af5b..ddc289e48d 100644
--- a/spec/support/lib/chef/resource/zen_follower.rb
+++ b/spec/support/lib/chef/resource/zen_follower.rb
@@ -21,20 +21,14 @@ require 'chef/json_compat'
class Chef
class Resource
class ZenFollower < Chef::Resource
- attr_accessor :created_as_type
- provides :follower, :on_platforms => ["zen"]
+ provides :follower, platform: "zen"
def initialize(name, run_context=nil)
@resource_name = :zen_follower
- @created_as_type = "zen_follower"
super
end
- def to_s
- "#{created_as_type}[#{name}]"
- end
-
def master(arg=nil)
if !arg.nil?
@master = arg
diff --git a/spec/support/matchers/leak.rb b/spec/support/matchers/leak.rb
index cc7d265a3c..01d1e53f92 100644
--- a/spec/support/matchers/leak.rb
+++ b/spec/support/matchers/leak.rb
@@ -26,11 +26,11 @@ module Matchers
@variance = opts[:variance] || 5000
end
- def failure_message_for_should
+ def failure_message
"expected final measure [#{@final_measure}] to be greater than or within +/- #{@variance} delta of initial measure [#{@initial_measure}]"
end
- def failure_message_for_should_not
+ def failure_message_when_negated
"expected final measure [#{@final_measure}] to be less than or within +/- #{@variance} delta of initial measure [#{@initial_measure}]"
end
diff --git a/spec/support/mock/platform.rb b/spec/support/mock/platform.rb
index 46e76d48c5..ab2c19baff 100644
--- a/spec/support/mock/platform.rb
+++ b/spec/support/mock/platform.rb
@@ -6,7 +6,7 @@
# testing code that mixes in platform specific modules like +Chef::Mixin::Securable+
# or +Chef::FileAccessControl+
def platform_mock(platform = :unix, &block)
- Chef::Platform.stub(:windows?).and_return(platform == :windows ? true : false)
+ allow(Chef::Platform).to receive(:windows?).and_return(platform == :windows ? true : false)
ENV['SYSTEMDRIVE'] = (platform == :windows ? 'C:' : nil)
if platform == :windows
diff --git a/spec/support/pedant/Gemfile b/spec/support/pedant/Gemfile
new file mode 100644
index 0000000000..d4224cd439
--- /dev/null
+++ b/spec/support/pedant/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem 'chef-pedant', :github => 'opscode/chef-pedant', :ref => "server-cli-option"
diff --git a/spec/support/pedant/pedant_config.rb b/spec/support/pedant/pedant_config.rb
index 6818d29d74..f7d14d8f17 100644
--- a/spec/support/pedant/pedant_config.rb
+++ b/spec/support/pedant/pedant_config.rb
@@ -72,6 +72,13 @@ superuser_name 'admin'
superuser_key key
webui_key key
+# When we updated Chef to RSpec 3 there were gem conflicts with chef-pedant.
+# We removed chef as a chef-pedant gem dependency in pedant.gemfile, but this
+# caused chef-pedant to fail because it could not query for the chef version
+# on the box pedant is running on. X-Chef-Version isn't needed in server
+# requests for these tests, so we've disabled it.
+ingore_x_chef_version true
+
# Set the platform_class
platform_class Pedant::OpenSourcePlatform
diff --git a/spec/support/pedant/run_pedant.rb b/spec/support/pedant/run_pedant.rb
index abee67103c..aac2c2df1a 100644
--- a/spec/support/pedant/run_pedant.rb
+++ b/spec/support/pedant/run_pedant.rb
@@ -8,6 +8,7 @@ require 'chef/chef_fs/config'
require 'tmpdir'
require 'fileutils'
require 'chef/version'
+require 'chef/mixin/shell_out'
def start_server(chef_repo_path)
Dir.mkdir(chef_repo_path) if !File.exists?(chef_repo_path)
@@ -37,28 +38,26 @@ begin
# Capture setup data into master_chef_repo_path
server = start_server(chef_repo_path)
+ so = nil
- require 'pedant'
- require 'pedant/opensource'
+ include Chef::Mixin::ShellOut
- #Pedant::Config.rerun = true
+ Bundler.with_clean_env do
- Pedant.config.suite = 'api'
- Pedant.config[:config_file] = 'spec/support/pedant/pedant_config.rb'
- Pedant.config.chef_server = server.url
- Pedant.setup([
- '--skip-knife',
- '--skip-validation',
- '--skip-authentication',
- '--skip-authorization',
- '--skip-omnibus'
- ])
+ shell_out("bundle install --gemfile spec/support/pedant/Gemfile", :live_stream => STDOUT)
- result = RSpec::Core::Runner.run(Pedant.config.rspec_args)
+ pedant_cmd = "chef-pedant " +
+ " --config spec/support/pedant/pedant_config.rb" +
+ " --server '#{server.url}'" +
+ " --skip-knife --skip-validation --skip-authentication" +
+ " --skip-authorization --skip-omnibus"
+ so = shell_out("bundle exec #{pedant_cmd}", :live_stream => STDOUT, :env => {'BUNDLE_GEMFILE' => 'spec/support/pedant/Gemfile'})
+
+ end
- server.stop if server.running?
ensure
+ server.stop if server && server.running?
FileUtils.remove_entry_secure(tmpdir) if tmpdir
end
-exit(result)
+exit(so.exitstatus)
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index f8cad6de7f..8d17af3993 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -165,3 +165,7 @@ end
def openssl_lt_101?
!openssl_gte_101?
end
+
+def aes_256_gcm?
+ OpenSSL::Cipher.ciphers.include?("aes-256-gcm")
+end
diff --git a/spec/support/shared/functional/directory_resource.rb b/spec/support/shared/functional/directory_resource.rb
index ee9085424e..39bdc313e5 100644
--- a/spec/support/shared/functional/directory_resource.rb
+++ b/spec/support/shared/functional/directory_resource.rb
@@ -25,7 +25,7 @@ shared_examples_for "a directory resource" do
context "when the target directory does not exist" do
before do
# assert pre-condition
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
describe "when running action :create" do
@@ -35,17 +35,17 @@ shared_examples_for "a directory resource" do
end
it "creates the directory when the :create action is run" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "is marked updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
context "and the recursive option is set" do
before do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
resource.recursive(true)
@recursive_path = File.join(path, 'red-headed-stepchild')
@@ -54,12 +54,12 @@ shared_examples_for "a directory resource" do
end
it "recursively creates required directories" do
- File.should exist(path)
- File.should exist(@recursive_path)
+ expect(File).to exist(path)
+ expect(File).to exist(@recursive_path)
end
it "is marked updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
end
@@ -97,7 +97,7 @@ shared_examples_for "a directory resource" do
# so we run the resource twice--otherwise the updated_by_last_action test
# will fail.
resource.dup.run_action(:create)
- File.should exist(path)
+ expect(File).to exist(path)
resource.run_action(:create)
end
@@ -108,11 +108,11 @@ shared_examples_for "a directory resource" do
end
it "does not re-create the directory" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "is not marked updated by last action" do
- resource.should_not be_updated_by_last_action
+ expect(resource).not_to be_updated_by_last_action
end
end
@@ -123,11 +123,11 @@ shared_examples_for "a directory resource" do
end
it "deletes the directory" do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
@@ -139,7 +139,7 @@ shared_examples_for "a directory resource" do
end
it "recursively deletes directories" do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
end
end
diff --git a/spec/support/shared/functional/file_resource.rb b/spec/support/shared/functional/file_resource.rb
index 72b72912bd..bcc2a7da25 100644
--- a/spec/support/shared/functional/file_resource.rb
+++ b/spec/support/shared/functional/file_resource.rb
@@ -48,10 +48,10 @@ end
shared_examples_for "a file with the wrong content" do
before do
# Assert starting state is as expected
- File.should exist(path)
+ expect(File).to exist(path)
# Kinda weird, in this case @expected_checksum is the cksum of the file
# with incorrect content.
- sha256_checksum(path).should == @expected_checksum
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
end
describe "when diff is disabled" do
@@ -65,20 +65,20 @@ shared_examples_for "a file with the wrong content" do
end
it "overwrites the file with the updated content when the :create action is run" do
- File.stat(path).mtime.should > @expected_mtime
- sha256_checksum(path).should_not == @expected_checksum
+ expect(File.stat(path).mtime).to be > @expected_mtime
+ expect(sha256_checksum(path)).not_to eq(@expected_checksum)
end
it "backs up the existing file" do
- Dir.glob(backup_glob).size.should equal(1)
+ expect(Dir.glob(backup_glob).size).to equal(1)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
it "should restore the security contexts on selinux", :selinux_only do
- selinux_security_context_restored?(path).should be_true
+ expect(selinux_security_context_restored?(path)).to be_truthy
end
end
@@ -89,11 +89,11 @@ shared_examples_for "a file with the wrong content" do
end
it "should not attempt to backup the existing file if :backup == 0" do
- Dir.glob(backup_glob).size.should equal(0)
+ expect(Dir.glob(backup_glob).size).to equal(0)
end
it "should restore the security contexts on selinux", :selinux_only do
- selinux_security_context_restored?(path).should be_true
+ expect(selinux_security_context_restored?(path)).to be_truthy
end
end
@@ -114,16 +114,16 @@ shared_examples_for "a file with the wrong content" do
end
it "doesn't overwrite the file when the :create_if_missing action is run" do
- File.stat(path).mtime.should == @expected_mtime
- sha256_checksum(path).should == @expected_checksum
+ expect(File.stat(path).mtime).to eq(@expected_mtime)
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
end
it "is not marked as updated" do
- resource.should_not be_updated_by_last_action
+ expect(resource).not_to be_updated_by_last_action
end
it "should restore the security contexts on selinux", :selinux_only do
- selinux_security_context_restored?(path).should be_true
+ expect(selinux_security_context_restored?(path)).to be_truthy
end
end
@@ -133,11 +133,11 @@ shared_examples_for "a file with the wrong content" do
end
it "deletes the file" do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
@@ -146,14 +146,14 @@ shared_examples_for "a file with the wrong content" do
context "when diff is enabled" do
describe 'sensitive attribute' do
context "should be insensitive by default" do
- it { expect(resource.sensitive).to(be_false) }
+ it { expect(resource.sensitive).to(be_falsey) }
end
context "when set" do
before { resource.sensitive(true) }
it "should be set on the resource" do
- expect(resource.sensitive).to(be_true)
+ expect(resource.sensitive).to(be_truthy)
end
context "when running :create action" do
@@ -181,8 +181,8 @@ end
shared_examples_for "a file with the correct content" do
before do
# Assert starting state is as expected
- File.should exist(path)
- sha256_checksum(path).should == @expected_checksum
+ expect(File).to exist(path)
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
end
include_context "diff disabled"
@@ -192,19 +192,19 @@ shared_examples_for "a file with the correct content" do
resource.run_action(:create)
end
it "does not overwrite the original when the :create action is run" do
- sha256_checksum(path).should == @expected_checksum
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
end
it "does not update the mtime of the file when the :create action is run" do
- File.stat(path).mtime.should == @expected_mtime
+ expect(File.stat(path).mtime).to eq(@expected_mtime)
end
it "is not marked as updated by last action" do
- resource.should_not be_updated_by_last_action
+ expect(resource).not_to be_updated_by_last_action
end
it "should restore the security contexts on selinux", :selinux_only do
- selinux_security_context_restored?(path).should be_true
+ expect(selinux_security_context_restored?(path)).to be_truthy
end
end
@@ -214,15 +214,15 @@ shared_examples_for "a file with the correct content" do
end
it "doesn't overwrite the file when the :create_if_missing action is run" do
- sha256_checksum(path).should == @expected_checksum
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
end
it "is not marked as updated by last action" do
- resource.should_not be_updated_by_last_action
+ expect(resource).not_to be_updated_by_last_action
end
it "should restore the security contexts on selinux", :selinux_only do
- selinux_security_context_restored?(path).should be_true
+ expect(selinux_security_context_restored?(path)).to be_truthy
end
end
@@ -232,11 +232,11 @@ shared_examples_for "a file with the correct content" do
end
it "deletes the file when the :delete action is run" do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
end
@@ -300,7 +300,7 @@ shared_examples_for "a file resource" do
it "successfully doesn't create the file" do
resource.run_action(:create) # should not raise
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
end
@@ -308,14 +308,14 @@ shared_examples_for "a file resource" do
describe "when setting atomic_update" do
it "booleans should work" do
- lambda {resource.atomic_update(true)}.should_not raise_error
- lambda {resource.atomic_update(false)}.should_not raise_error
+ expect {resource.atomic_update(true)}.not_to raise_error
+ expect {resource.atomic_update(false)}.not_to raise_error
end
it "anything else should raise an error" do
- lambda {resource.atomic_update(:copy)}.should raise_error(ArgumentError)
- lambda {resource.atomic_update(:move)}.should raise_error(ArgumentError)
- lambda {resource.atomic_update(958)}.should raise_error(ArgumentError)
+ expect {resource.atomic_update(:copy)}.to raise_error(ArgumentError)
+ expect {resource.atomic_update(:move)}.to raise_error(ArgumentError)
+ expect {resource.atomic_update(958)}.to raise_error(ArgumentError)
end
end
@@ -340,24 +340,24 @@ shared_examples_for "file resource not pointing to a real file" do
describe "when force_unlink is set to true" do
it ":create unlinks the target" do
- real_file?(path).should be_false
+ expect(real_file?(path)).to be_falsey
resource.force_unlink(true)
resource.run_action(:create)
- real_file?(path).should be_true
- binread(path).should == expected_content
- resource.should be_updated_by_last_action
+ expect(real_file?(path)).to be_truthy
+ expect(binread(path)).to eq(expected_content)
+ expect(resource).to be_updated_by_last_action
end
end
describe "when force_unlink is set to false" do
it ":create raises an error" do
- lambda {resource.run_action(:create) }.should raise_error(Chef::Exceptions::FileTypeMismatch)
+ expect {resource.run_action(:create) }.to raise_error(Chef::Exceptions::FileTypeMismatch)
end
end
describe "when force_unlink is not set (default)" do
it ":create raises an error" do
- lambda {resource.run_action(:create) }.should raise_error(Chef::Exceptions::FileTypeMismatch)
+ expect {resource.run_action(:create) }.to raise_error(Chef::Exceptions::FileTypeMismatch)
end
end
end
@@ -441,7 +441,7 @@ shared_examples_for "a configured file resource" do
after(:each) do
# symlink should never be followed
- binread(symlink_target).should == "This is so wrong!!!"
+ expect(binread(symlink_target)).to eq("This is so wrong!!!")
end
it_behaves_like "file resource not pointing to a real file"
@@ -477,7 +477,7 @@ shared_examples_for "a configured file resource" do
end
it "raises an InvalidSymlink error" do
- lambda { resource.run_action(:create) }.should raise_error(Chef::Exceptions::InvalidSymlink)
+ expect { resource.run_action(:create) }.to raise_error(Chef::Exceptions::InvalidSymlink)
end
it "issues a warning/assumption in whyrun mode" do
@@ -505,7 +505,7 @@ shared_examples_for "a configured file resource" do
FileUtils.rm_rf(link_path)
end
it "raises an InvalidSymlink error" do
- lambda { resource.run_action(:create) }.should raise_error(Chef::Exceptions::InvalidSymlink)
+ expect { resource.run_action(:create) }.to raise_error(Chef::Exceptions::InvalidSymlink)
end
it "issues a warning/assumption in whyrun mode" do
@@ -536,7 +536,7 @@ shared_examples_for "a configured file resource" do
end
it "raises an InvalidSymlink error" do
- lambda { resource.run_action(:create) }.should raise_error(Chef::Exceptions::FileTypeMismatch)
+ expect { resource.run_action(:create) }.to raise_error(Chef::Exceptions::FileTypeMismatch)
end
it "issues a warning/assumption in whyrun mode" do
@@ -564,7 +564,7 @@ shared_examples_for "a configured file resource" do
after(:each) do
# shared examples should not change our test setup of a file resource
# pointing at a symlink:
- resource.path.should == link_path
+ expect(resource.path).to eq(link_path)
FileUtils.rm_rf(link_path)
end
@@ -581,7 +581,7 @@ shared_examples_for "a configured file resource" do
it "does not replace the symlink with a real file" do
resource.run_action(:create)
- File.should be_symlink(link_path)
+ expect(File).to be_symlink(link_path)
end
end
@@ -593,17 +593,17 @@ shared_examples_for "a configured file resource" do
end
it "updates the source file content" do
- pending
+ skip
end
it "marks the resource as updated" do
resource.run_action(:create)
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
it "does not replace the symlink with a real file" do
resource.run_action(:create)
- File.should be_symlink(link_path)
+ expect(File).to be_symlink(link_path)
end
end
@@ -646,15 +646,15 @@ shared_examples_for "a configured file resource" do
after(:each) do
# shared examples should not change our test setup of a file resource
# pointing at a symlink:
- resource.path.should == link_to_link_path
+ expect(resource.path).to eq(link_to_link_path)
FileUtils.rm_rf(link_to_file_path)
FileUtils.rm_rf(link_to_link_path)
end
it "does not replace the symlink with a real file" do
resource.run_action(:create)
- File.should be_symlink(link_to_link_path)
- File.should be_symlink(link_to_file_path)
+ expect(File).to be_symlink(link_to_link_path)
+ expect(File).to be_symlink(link_to_file_path)
end
end
@@ -686,9 +686,9 @@ shared_examples_for "a configured file resource" do
it ":create updates the target" do
resource.force_unlink(true)
resource.run_action(:create)
- real_file?(path).should be_true
- binread(path).should == expected_content
- resource.should be_updated_by_last_action
+ expect(real_file?(path)).to be_truthy
+ expect(binread(path)).to eq(expected_content)
+ expect(resource).to be_updated_by_last_action
end
end
@@ -696,9 +696,9 @@ shared_examples_for "a configured file resource" do
it ":create updates the target" do
resource.force_unlink(true)
resource.run_action(:create)
- real_file?(path).should be_true
- binread(path).should == expected_content
- resource.should be_updated_by_last_action
+ expect(real_file?(path)).to be_truthy
+ expect(binread(path)).to eq(expected_content)
+ expect(resource).to be_updated_by_last_action
end
end
@@ -706,9 +706,9 @@ shared_examples_for "a configured file resource" do
it ":create updates the target" do
resource.force_unlink(true)
resource.run_action(:create)
- real_file?(path).should be_true
- binread(path).should == expected_content
- resource.should be_updated_by_last_action
+ expect(real_file?(path)).to be_truthy
+ expect(binread(path)).to eq(expected_content)
+ expect(resource).to be_updated_by_last_action
end
end
end
@@ -800,7 +800,7 @@ shared_examples_for "a configured file resource" do
end
before(:each) do
- path.bytesize.should <= 104
+ expect(path.bytesize).to be <= 104
UNIXServer.new(path)
end
@@ -821,8 +821,8 @@ shared_examples_for "a configured file resource" do
end
it "should notify the other resources correctly" do
- resource.should be_updated_by_last_action
- resource.run_context.immediate_notifications(resource).length.should == 1
+ expect(resource).to be_updated_by_last_action
+ expect(resource.run_context.immediate_notifications(resource).length).to eq(1)
end
end
@@ -838,8 +838,8 @@ shared_examples_for "a configured file resource" do
end
it "should notify the other resources correctly" do
- resource.should be_updated_by_last_action
- resource.run_context.immediate_notifications(resource).length.should == 1
+ expect(resource).to be_updated_by_last_action
+ expect(resource.run_context.immediate_notifications(resource).length).to eq(1)
end
end
end
@@ -847,7 +847,7 @@ shared_examples_for "a configured file resource" do
context "when the target file does not exist" do
before do
# Assert starting state is expected
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
describe "when running action :create" do
@@ -856,19 +856,19 @@ shared_examples_for "a configured file resource" do
end
it "creates the file when the :create action is run" do
- File.should exist(path)
+ expect(File).to exist(path)
end
it "creates the file with the correct content when the :create action is run" do
- binread(path).should == expected_content
+ expect(binread(path)).to eq(expected_content)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
it "should restore the security contexts on selinux", :selinux_only do
- selinux_security_context_restored?(path).should be_true
+ expect(selinux_security_context_restored?(path)).to be_truthy
end
end
@@ -878,15 +878,15 @@ shared_examples_for "a configured file resource" do
end
it "creates the file with the correct content" do
- binread(path).should == expected_content
+ expect(binread(path)).to eq(expected_content)
end
it "is marked as updated by last action" do
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
it "should restore the security contexts on selinux", :selinux_only do
- selinux_security_context_restored?(path).should be_true
+ expect(selinux_security_context_restored?(path)).to be_truthy
end
end
@@ -896,11 +896,11 @@ shared_examples_for "a configured file resource" do
end
it "deletes the file when the :delete action is run" do
- File.should_not exist(path)
+ expect(File).not_to exist(path)
end
it "is not marked updated by last action" do
- resource.should_not be_updated_by_last_action
+ expect(resource).not_to be_updated_by_last_action
end
end
end
@@ -1001,21 +1001,21 @@ shared_examples_for "a configured file resource" do
describe ":create action should run without any updates" do
before do
# Assert starting state is as expected
- File.should exist(path)
- sha256_checksum(path).should == @expected_checksum
+ expect(File).to exist(path)
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
resource.run_action(:create)
end
it "does not overwrite the original when the :create action is run" do
- sha256_checksum(path).should == @expected_checksum
+ expect(sha256_checksum(path)).to eq(@expected_checksum)
end
it "does not update the mtime of the file when the :create action is run" do
- File.stat(path).mtime.should == @expected_mtime
+ expect(File.stat(path).mtime).to eq(@expected_mtime)
end
it "is not marked as updated by last action" do
- resource.should_not be_updated_by_last_action
+ expect(resource).not_to be_updated_by_last_action
end
end
end
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb
index 9999146dee..e016bb685d 100644
--- a/spec/support/shared/functional/securable_resource.rb
+++ b/spec/support/shared/functional/securable_resource.rb
@@ -163,8 +163,8 @@ shared_examples_for "a securable resource with existing target" do
let(:desired_gid) { 1337 }
let(:expected_gid) { 1337 }
- pending "should set an owner (Rerun specs under root)", :requires_unprivileged_user => true
- pending "should set a group (Rerun specs under root)", :requires_unprivileged_user => true
+ skip "should set an owner (Rerun specs under root)", :requires_unprivileged_user => true
+ skip "should set a group (Rerun specs under root)", :requires_unprivileged_user => true
describe "when setting the owner", :requires_root do
before do
@@ -173,11 +173,11 @@ shared_examples_for "a securable resource with existing target" do
end
it "should set an owner" do
- File.lstat(path).uid.should == expected_uid
+ expect(File.lstat(path).uid).to eq(expected_uid)
end
it "is marked as updated only if changes are made" do
- resource.updated_by_last_action?.should == expect_updated?
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
end
end
@@ -189,11 +189,11 @@ shared_examples_for "a securable resource with existing target" do
end
it "should set a group" do
- File.lstat(path).gid.should == expected_gid
+ expect(File.lstat(path).gid).to eq(expected_gid)
end
it "is marked as updated only if changes are made" do
- resource.updated_by_last_action?.should == expect_updated?
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
end
end
@@ -206,13 +206,12 @@ shared_examples_for "a securable resource with existing target" do
end
it "should set permissions as specified" do
- pending('Linux does not support lchmod', :if => resource.instance_of?(Chef::Resource::Link) && !os_x? && !freebsd?) do
- (File.lstat(path).mode & 007777).should == (@mode_string.oct & 007777)
- end
+ pending("Linux does not support lchmod")
+ expect{ File.lstat(path).mode & 007777 }.to eq(@mode_string.oct & 007777)
end
it "is marked as updated only if changes are made" do
- resource.updated_by_last_action?.should == expect_updated?
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
end
end
@@ -224,13 +223,12 @@ shared_examples_for "a securable resource with existing target" do
end
it "should set permissions in numeric form as a ruby-interpreted octal" do
- pending('Linux does not support lchmod', :if => resource.instance_of?(Chef::Resource::Link) && !os_x? && !freebsd?) do
- (File.lstat(path).mode & 007777).should == (@mode_integer & 007777)
- end
+ pending('Linux does not support lchmod')
+ expect{ File.lstat(path).mode & 007777 }.to eq(@mode_integer & 007777)
end
it "is marked as updated only if changes are made" do
- resource.updated_by_last_action?.should == expect_updated?
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
end
end
end
@@ -245,11 +243,11 @@ shared_examples_for "a securable resource with existing target" do
end
it "should set the owner" do
- descriptor.owner.should == SID.Administrator
+ expect(descriptor.owner).to eq(SID.Administrator)
end
it "is marked as updated only if changes are made" do
- resource.updated_by_last_action?.should == expect_updated?
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
end
end
@@ -260,11 +258,11 @@ shared_examples_for "a securable resource with existing target" do
end
it "should set the group" do
- descriptor.group.should == SID.Administrators
+ expect(descriptor.group).to eq(SID.Administrators)
end
it "is marked as updated only if changes are made" do
- resource.updated_by_last_action?.should == expect_updated?
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
end
end
@@ -276,11 +274,11 @@ shared_examples_for "a securable resource with existing target" do
end
it "should set the rights and deny_rights" do
- explicit_aces.should == denied_acl(SID.Guest, expected_modify_perms) + allowed_acl(SID.Guest, expected_read_perms)
+ expect(explicit_aces).to eq(denied_acl(SID.Guest, expected_modify_perms) + allowed_acl(SID.Guest, expected_read_perms))
end
it "is marked as updated only if changes are made" do
- resource.updated_by_last_action?.should == expect_updated?
+ expect(resource.updated_by_last_action?).to eq(expect_updated?)
end
end
end
@@ -291,81 +289,80 @@ shared_examples_for "a securable resource without existing target" do
include_context "diff disabled"
context "on Unix", :unix_only do
- pending "if we need any securable resource tests on Unix without existing target resource."
+ skip "if we need any securable resource tests on Unix without existing target resource."
end
context "on Windows", :windows_only do
include_context "use Windows permissions"
it "sets owner to Administrators on create if owner is not specified" do
- File.exist?(path).should == false
+ expect(File.exist?(path)).to eq(false)
resource.run_action(:create)
- descriptor.owner.should == SID.Administrators
+ expect(descriptor.owner).to eq(SID.Administrators)
end
it "sets owner when owner is specified" do
resource.owner 'Guest'
resource.run_action(:create)
- descriptor.owner.should == SID.Guest
+ expect(descriptor.owner).to eq(SID.Guest)
end
it "fails to set owner when owner has invalid characters" do
- lambda { resource.owner 'Lance "The Nose" Glindenberry III' }.should raise_error#(Chef::Exceptions::ValidationFailed)
+ expect { resource.owner 'Lance "The Nose" Glindenberry III' }.to raise_error#(Chef::Exceptions::ValidationFailed)
end
it "sets owner when owner is specified with a \\" do
resource.owner "#{ENV['USERDOMAIN']}\\Guest"
resource.run_action(:create)
- descriptor.owner.should == SID.Guest
+ expect(descriptor.owner).to eq(SID.Guest)
end
it "leaves owner alone if owner is not specified and resource already exists" do
# Set owner to Guest so it's not the same as the current user (which is the default on create)
resource.owner 'Guest'
resource.run_action(:create)
- descriptor.owner.should == SID.Guest
+ expect(descriptor.owner).to eq(SID.Guest)
new_resource = create_resource
- new_resource.owner.should == nil
+ expect(new_resource.owner).to eq(nil)
new_resource.run_action(:create)
- descriptor.owner.should == SID.Guest
+ expect(descriptor.owner).to eq(SID.Guest)
end
it "sets group to None on create if group is not specified" do
- resource.group.should == nil
- File.exist?(path).should == false
+ expect(resource.group).to eq(nil)
+ expect(File.exist?(path)).to eq(false)
resource.run_action(:create)
- descriptor.group.should == SID.None
+ expect(descriptor.group).to eq(SID.None)
end
it "sets group when group is specified" do
resource.group 'Everyone'
resource.run_action(:create)
- descriptor.group.should == SID.Everyone
+ expect(descriptor.group).to eq(SID.Everyone)
end
it "fails to set group when group has invalid characters" do
- lambda { resource.group 'Lance "The Nose" Glindenberry III' }.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { resource.group 'Lance "The Nose" Glindenberry III' }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "sets group when group is specified with a \\" do
- pending "Need to find a group containing a backslash that is on most peoples' machines" do
- resource.group "#{ENV['COMPUTERNAME']}\\Administrators"
- resource.run_action(:create)
- descriptor.group.should == SID.Everyone
- end
+ pending("Need to find a group containing a backslash that is on most peoples' machines")
+ resource.group "#{ENV['COMPUTERNAME']}\\Administrators"
+ resource.run_action(:create)
+ expect{ descriptor.group }.to eq(SID.Everyone)
end
it "leaves group alone if group is not specified and resource already exists" do
# Set group to Everyone so it's not the default (None)
resource.group 'Everyone'
resource.run_action(:create)
- descriptor.group.should == SID.Everyone
+ expect(descriptor.group).to eq(SID.Everyone)
new_resource = create_resource
- new_resource.group.should == nil
+ expect(new_resource.group).to eq(nil)
new_resource.run_action(:create)
- descriptor.group.should == SID.Everyone
+ expect(descriptor.group).to eq(SID.Everyone)
end
describe "with rights and deny_rights attributes" do
@@ -373,38 +370,38 @@ shared_examples_for "a securable resource without existing target" do
it "correctly sets :read rights" do
resource.rights(:read, 'Guest')
resource.run_action(:create)
- explicit_aces.should == allowed_acl(SID.Guest, expected_read_perms)
+ expect(explicit_aces).to eq(allowed_acl(SID.Guest, expected_read_perms))
end
it "correctly sets :read_execute rights" do
resource.rights(:read_execute, 'Guest')
resource.run_action(:create)
- explicit_aces.should == allowed_acl(SID.Guest, expected_read_execute_perms)
+ expect(explicit_aces).to eq(allowed_acl(SID.Guest, expected_read_execute_perms))
end
it "correctly sets :write rights" do
resource.rights(:write, 'Guest')
resource.run_action(:create)
- explicit_aces.should == allowed_acl(SID.Guest, expected_write_perms)
+ expect(explicit_aces).to eq(allowed_acl(SID.Guest, expected_write_perms))
end
it "correctly sets :modify rights" do
resource.rights(:modify, 'Guest')
resource.run_action(:create)
- explicit_aces.should == allowed_acl(SID.Guest, expected_modify_perms)
+ expect(explicit_aces).to eq(allowed_acl(SID.Guest, expected_modify_perms))
end
it "correctly sets :full_control rights" do
resource.rights(:full_control, 'Guest')
resource.run_action(:create)
- explicit_aces.should == allowed_acl(SID.Guest, expected_full_control_perms)
+ expect(explicit_aces).to eq(allowed_acl(SID.Guest, expected_full_control_perms))
end
it "correctly sets deny_rights" do
# deny is an ACE with full rights, but is a deny type ace, not an allow type
resource.deny_rights(:full_control, 'Guest')
resource.run_action(:create)
- explicit_aces.should == denied_acl(SID.Guest, expected_full_control_perms)
+ expect(explicit_aces).to eq(denied_acl(SID.Guest, expected_full_control_perms))
end
it "Sets multiple rights" do
@@ -412,9 +409,10 @@ shared_examples_for "a securable resource without existing target" do
resource.rights(:modify, 'Guest')
resource.run_action(:create)
- explicit_aces.should ==
+ expect(explicit_aces).to eq(
allowed_acl(SID.Everyone, expected_read_perms) +
allowed_acl(SID.Guest, expected_modify_perms)
+ )
end
it "Sets deny_rights ahead of rights" do
@@ -422,9 +420,10 @@ shared_examples_for "a securable resource without existing target" do
resource.deny_rights(:modify, 'Guest')
resource.run_action(:create)
- explicit_aces.should ==
+ expect(explicit_aces).to eq(
denied_acl(SID.Guest, expected_modify_perms) +
allowed_acl(SID.Everyone, expected_read_perms)
+ )
end
it "Sets deny_rights ahead of rights when specified in reverse order" do
@@ -432,9 +431,10 @@ shared_examples_for "a securable resource without existing target" do
resource.rights(:read, 'Everyone')
resource.run_action(:create)
- explicit_aces.should ==
+ expect(explicit_aces).to eq(
denied_acl(SID.Guest, expected_modify_perms) +
allowed_acl(SID.Everyone, expected_read_perms)
+ )
end
end
@@ -452,7 +452,7 @@ shared_examples_for "a securable resource without existing target" do
resource.group 'Everyone'
resource.run_action(:create)
- explicit_aces.should == [ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ) ]
+ expect(explicit_aces).to eq([ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ) ])
end
it "respects mode in numeric form as a ruby-interpreted octal" do
@@ -460,7 +460,7 @@ shared_examples_for "a securable resource without existing target" do
resource.owner 'Guest'
resource.run_action(:create)
- explicit_aces.should == [ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_WRITE | Security::FILE_GENERIC_EXECUTE | Security::DELETE) ]
+ expect(explicit_aces).to eq([ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_WRITE | Security::FILE_GENERIC_EXECUTE | Security::DELETE) ])
end
it "respects the owner, group and everyone bits of mode" do
@@ -469,11 +469,11 @@ shared_examples_for "a securable resource without existing target" do
resource.group 'Administrators'
resource.run_action(:create)
- explicit_aces.should == [
+ expect(explicit_aces).to eq([
ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_WRITE | Security::FILE_GENERIC_EXECUTE | Security::DELETE),
ACE.access_allowed(SID.Administrators, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_EXECUTE),
ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_READ)
- ]
+ ])
end
it "respects the individual read, write and execute bits of mode" do
@@ -482,31 +482,31 @@ shared_examples_for "a securable resource without existing target" do
resource.group 'Administrators'
resource.run_action(:create)
- explicit_aces.should == [
+ expect(explicit_aces).to eq([
ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ),
ACE.access_allowed(SID.Administrators, Security::FILE_GENERIC_WRITE | Security::DELETE),
ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_EXECUTE)
- ]
+ ])
end
it 'warns when mode tries to set owner bits but owner is not specified' do
@warn = []
- Chef::Log.stub(:warn) { |msg| @warn << msg }
+ allow(Chef::Log).to receive(:warn) { |msg| @warn << msg }
resource.mode 0400
resource.run_action(:create)
- @warn.include?("Mode 400 includes bits for the owner, but owner is not specified").should be_true
+ expect(@warn.include?("Mode 400 includes bits for the owner, but owner is not specified")).to be_truthy
end
it 'warns when mode tries to set group bits but group is not specified' do
@warn = []
- Chef::Log.stub(:warn) { |msg| @warn << msg }
+ allow(Chef::Log).to receive(:warn) { |msg| @warn << msg }
resource.mode 0040
resource.run_action(:create)
- @warn.include?("Mode 040 includes bits for the group, but group is not specified").should be_true
+ expect(@warn.include?("Mode 040 includes bits for the group, but group is not specified")).to be_truthy
end
end
@@ -518,12 +518,12 @@ shared_examples_for "a securable resource without existing target" do
resource.run_action(:create)
descriptor.dacl.each do | ace |
- ace.inherited?.should == false
+ expect(ace.inherited?).to eq(false)
end
end
it "has the inheritable acls of parent directory if no acl is specified" do
- File.exist?(path).should == false
+ expect(File.exist?(path)).to eq(false)
# Collect the inheritable acls form the parent by creating a file without
# any specific ACLs
@@ -542,7 +542,7 @@ shared_examples_for "a securable resource without existing target" do
ace.inherited?
end
- resource_inherited_acls.should == parent_inherited_acls
+ expect(resource_inherited_acls).to eq(parent_inherited_acls)
end
end
diff --git a/spec/support/shared/functional/securable_resource_with_reporting.rb b/spec/support/shared/functional/securable_resource_with_reporting.rb
index b02137a06c..8a2ceed837 100644
--- a/spec/support/shared/functional/securable_resource_with_reporting.rb
+++ b/spec/support/shared/functional/securable_resource_with_reporting.rb
@@ -56,18 +56,18 @@ shared_examples_for "a securable resource with reporting" do
end
it "has empty values for file metadata in 'current_resource'" do
- current_resource.owner.should be_nil
- current_resource.group.should be_nil
- current_resource.mode.should be_nil
+ expect(current_resource.owner).to be_nil
+ expect(current_resource.group).to be_nil
+ expect(current_resource.mode).to be_nil
end
context "and no security metadata is specified in new_resource" do
it "sets the metadata values on the new_resource as strings after creating" do
resource.run_action(:create)
# TODO: most stable way to specify?
- resource.owner.should == Etc.getpwuid(Process.uid).name
- resource.group.should == @expected_group_name
- resource.mode.should == "0#{default_mode}"
+ expect(resource.owner).to eq(Etc.getpwuid(Process.uid).name)
+ expect(resource.group).to eq(@expected_group_name)
+ expect(resource.mode).to eq("0#{default_mode}")
end
end
@@ -87,7 +87,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the owner on new_resource to the username (String) of the desired owner" do
- resource.owner.should == expected_user_name
+ expect(resource.owner).to eq(expected_user_name)
end
end
@@ -110,7 +110,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the owner on new_resource to the uid (Integer) of the desired owner" do
- resource.owner.should == expected_uid
+ expect(resource.owner).to eq(expected_uid)
end
end
@@ -124,7 +124,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the group on new_resource to the group name (String) of the group" do
- resource.group.should == expected_group_name
+ expect(resource.group).to eq(expected_group_name)
end
end
@@ -138,7 +138,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the group on new_resource to the gid (Integer)" do
- resource.group.should == expected_gid
+ expect(resource.group).to eq(expected_gid)
end
end
@@ -155,7 +155,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets mode on the new_resource as a String" do
- resource.mode.should == expected_mode
+ expect(resource.mode).to eq(expected_mode)
end
end
@@ -169,7 +169,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets mode on the new resource as a String" do
- resource.mode.should == expected_mode
+ expect(resource.mode).to eq(expected_mode)
end
end
end
@@ -183,9 +183,9 @@ shared_examples_for "a securable resource with reporting" do
context "and no security metadata is specified in new_resource" do
it "sets the current values on current resource as strings" do
# TODO: most stable way to specify?
- current_resource.owner.should == Etc.getpwuid(Process.uid).name
- current_resource.group.should == @expected_group_name
- current_resource.mode.should == "0#{((0100666 - File.umask) & 07777).to_s(8)}"
+ expect(current_resource.owner).to eq(Etc.getpwuid(Process.uid).name)
+ expect(current_resource.group).to eq(@expected_group_name)
+ expect(current_resource.mode).to eq("0#{((0100666 - File.umask) & 07777).to_s(8)}")
end
end
@@ -198,7 +198,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the owner on new_resource to the username (String) of the desired owner" do
- current_resource.owner.should == expected_user_name
+ expect(current_resource.owner).to eq(expected_user_name)
end
end
@@ -212,7 +212,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the owner on new_resource to the uid (Integer) of the desired owner" do
- current_resource.owner.should == expected_uid
+ expect(current_resource.owner).to eq(expected_uid)
end
end
@@ -222,7 +222,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the group on new_resource to the group name (String) of the group" do
- current_resource.group.should == @expected_group_name
+ expect(current_resource.group).to eq(@expected_group_name)
end
end
@@ -233,7 +233,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the group on new_resource to the gid (Integer)" do
- current_resource.group.should == @expected_gid
+ expect(current_resource.group).to eq(@expected_gid)
end
end
@@ -247,7 +247,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets mode on the new_resource as a String" do
- current_resource.mode.should == expected_mode
+ expect(current_resource.mode).to eq(expected_mode)
end
end
@@ -260,7 +260,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets mode on the new resource as a String" do
- current_resource.mode.should == expected_mode
+ expect(current_resource.mode).to eq(expected_mode)
end
end
end
@@ -268,11 +268,6 @@ shared_examples_for "a securable resource with reporting" do
describe "reading file security metadata for reporting on windows", :windows_only do
- before do
- pending "windows reporting not yet fully supported"
- end
-
-
context "when the target file doesn't exist" do
# Windows reporting data should look like this (+/- ish):
@@ -284,23 +279,28 @@ shared_examples_for "a securable resource with reporting" do
end
it "has empty values for file metadata in 'current_resource'" do
- current_resource.owner.should be_nil
- current_resource.expanded_rights.should be_nil
+ pending "windows reporting not yet fully supported"
+ expect(current_resource.owner).to be_nil
+ expect(current_resource.expanded_rights).to be_nil
end
context "and no security metadata is specified in new_resource" do
+ before do
+ pending "windows reporting not yet fully supported"
+ end
+
it "sets the metadata values on the new_resource as strings after creating" do
resource.run_action(:create)
# TODO: most stable way to specify?
- resource.owner.should == etc.getpwuid(process.uid).name
- resource.state[:expanded_rights].should == { "CURRENTUSER" => { "permissions" => ALL_EXPANDED_PERMISSIONS, "flags" => [] }}
- resource.state[:expanded_deny_rights].should == {}
- resource.state[:inherits].should be_true
+ expect(resource.owner).to eq(etc.getpwuid(process.uid).name)
+ expect(resource.state[:expanded_rights]).to eq({ "CURRENTUSER" => { "permissions" => ALL_EXPANDED_PERMISSIONS, "flags" => [] }})
+ expect(resource.state[:expanded_deny_rights]).to eq({})
+ expect(resource.state[:inherits]).to be_truthy
end
end
- context "and owner is specified with a string (username) in new_resource" do
+ context "and owner is specified with a string (username) in new_resource" do
# TODO/bug: duplicated from the "securable resource" tests
let(:expected_user_name) { 'Guest' }
@@ -311,7 +311,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the owner on new_resource to the username (string) of the desired owner" do
- resource.owner.should == expected_user_name
+ expect(resource.owner).to eq(expected_user_name)
end
end
@@ -322,12 +322,13 @@ shared_examples_for "a securable resource with reporting" do
let(:expected_user_name) { 'domain\user' }
before do
+ pending "windows reporting not yet fully supported"
resource.owner(expected_user_name)
resource.run_action(:create)
end
it "sets the owner on new_resource to the fully qualified name of the desired owner" do
- resource.owner.should == expected_user_name
+ expect(resource.owner).to eq(expected_user_name)
end
end
@@ -335,6 +336,7 @@ shared_examples_for "a securable resource with reporting" do
context "when the target file exists" do
before do
+ pending "windows reporting not yet fully supported"
FileUtils.touch(resource.path)
resource.action(:create)
end
@@ -342,8 +344,8 @@ shared_examples_for "a securable resource with reporting" do
context "and no security metadata is specified in new_resource" do
it "sets the current values on current resource as strings" do
# TODO: most stable way to specify?
- current_resource.owner.should == etc.getpwuid(process.uid).name
- current_resource.expanded_rights.should == { "CURRENTUSER" => ALL_EXPANDED_PERMISSIONS }
+ expect(current_resource.owner).to eq(etc.getpwuid(process.uid).name)
+ expect(current_resource.expanded_rights).to eq({ "CURRENTUSER" => ALL_EXPANDED_PERMISSIONS })
end
end
@@ -356,7 +358,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the owner on current_resource to the username (string) of the desired owner" do
- current_resource.owner.should == expected_user_name
+ expect(current_resource.owner).to eq(expected_user_name)
end
end
@@ -370,7 +372,7 @@ shared_examples_for "a securable resource with reporting" do
end
it "sets the owner on current_resource to the fully qualified name of the desired owner" do
- current_resource.owner.should == expected_uid
+ expect(current_resource.owner).to eq(expected_uid)
end
end
@@ -378,7 +380,7 @@ shared_examples_for "a securable resource with reporting" do
# TODO: before do blah
it "sets the expanded_rights on the current resource" do
- pending
+ skip
end
end
@@ -386,7 +388,7 @@ shared_examples_for "a securable resource with reporting" do
# TODO: before do blah
it "sets the expanded rights on the current resource" do
- pending
+ skip
end
end
diff --git a/spec/support/shared/functional/windows_script.rb b/spec/support/shared/functional/windows_script.rb
index fc06fb55d0..35b86dc4e8 100644
--- a/spec/support/shared/functional/windows_script.rb
+++ b/spec/support/shared/functional/windows_script.rb
@@ -44,4 +44,122 @@ shared_context Chef::Resource::WindowsScript do
after(:each) do
File.delete(script_output_path) if File.exists?(script_output_path)
end
+
+ let!(:resource) do
+ Chef::Resource::WindowsScript::Batch.new("Batch resource functional test", @run_context)
+ end
+
+ shared_examples_for "a script resource with architecture attribute" do
+ context "with the given architecture attribute value" do
+ let(:resource_architecture) { architecture }
+ let(:expected_architecture) do
+ if architecture
+ expected_architecture = architecture
+ else
+ expected_architecture = :i386
+ end
+ end
+ let(:expected_architecture_output) do
+ expected_architecture == :i386 ? 'X86' : 'AMD64'
+ end
+ let(:guard_script_suffix) do
+ "guard"
+ end
+ let(:guard_script_output_path) do
+ "#{script_output_path}#{guard_script_suffix}"
+ end
+ let(:resource_command) do
+ "#{architecture_command} #{output_command} #{script_output_path}"
+ end
+ let(:resource_guard_command) do
+ "#{architecture_command} #{output_command} #{guard_script_output_path}"
+ end
+
+ before(:each) do
+ resource.code resource_command
+ (resource.architecture architecture) if architecture
+ resource.returns(0)
+ end
+
+ it "should create a process with the expected architecture" do
+ resource.run_action(:run)
+ expect(get_process_architecture).to eq(expected_architecture_output.downcase)
+ end
+
+ it "should execute guards with the same architecture as the resource" do
+ resource.only_if resource_guard_command
+ resource.run_action(:run)
+ expect(get_process_architecture).to eq(expected_architecture_output.downcase)
+ expect(get_guard_process_architecture).to eq(expected_architecture_output.downcase)
+ expect(get_guard_process_architecture).to eq(get_process_architecture)
+ end
+
+ let (:architecture) { :x86_64 }
+ it "should execute a 64-bit guard if the guard's architecture is specified as 64-bit", :windows64_only do
+ resource.only_if resource_guard_command, :architecture => :x86_64
+ resource.run_action(:run)
+ expect(get_guard_process_architecture).to eq('amd64')
+ end
+
+ let (:architecture) { :i386 }
+ it "should execute a 32-bit guard if the guard's architecture is specified as 32-bit" do
+ resource.only_if resource_guard_command, :architecture => :i386
+ resource.run_action(:run)
+ expect(get_guard_process_architecture).to eq('x86')
+ end
+ end
+ end
+
+ shared_examples_for "a Windows script running on Windows" do
+
+ describe "when the run action is invoked on Windows" do
+ it "executes the script code" do
+ resource.code("@whoami > #{script_output_path}")
+ resource.returns(0)
+ resource.run_action(:run)
+ end
+ end
+
+ context "when evaluating guards" do
+ it "has a guard_interpreter attribute set to the short name of the resource" do
+ expect(resource.guard_interpreter).to eq(resource.resource_name)
+ resource.not_if "findstr.exe /thiscommandhasnonzeroexitstatus"
+ expect(Chef::Resource).to receive(:resource_for_node).and_call_original
+ expect(resource.class).to receive(:new).and_call_original
+ expect(resource.should_skip?(:run)).to be_falsey
+ end
+ end
+
+ context "when the architecture attribute is not set" do
+ let(:architecture) { nil }
+ it_behaves_like "a script resource with architecture attribute"
+ end
+
+ context "when the architecture attribute is :i386" do
+ let(:architecture) { :i386 }
+ it_behaves_like "a script resource with architecture attribute"
+ end
+
+ context "when the architecture attribute is :x86_64" do
+ let(:architecture) { :x86_64 }
+ it_behaves_like "a script resource with architecture attribute"
+ end
+ end
+
+ def get_windows_script_output(suffix = '')
+ File.read("#{script_output_path}#{suffix}")
+ end
+
+ def source_contains_case_insensitive_content?( source, content )
+ source.downcase.include?(content.downcase)
+ end
+
+ def get_guard_process_architecture
+ get_process_architecture(guard_script_suffix)
+ end
+
+ def get_process_architecture(suffix = '')
+ get_windows_script_output(suffix).strip.downcase
+ end
+
end
diff --git a/spec/support/shared/integration/knife_support.rb b/spec/support/shared/integration/knife_support.rb
index fd12998152..30293be6cf 100644
--- a/spec/support/shared/integration/knife_support.rb
+++ b/spec/support/shared/integration/knife_support.rb
@@ -103,6 +103,9 @@ module KnifeSupport
private
class KnifeResult
+
+ include ::RSpec::Matchers
+
def initialize(stdout, stderr, exit_code)
@stdout = stdout
@stderr = stderr
@@ -150,20 +153,20 @@ module KnifeSupport
stderr_actual = @stderr.sub(/^WARNING: No knife configuration file found\n/, '')
if expected[:stderr].is_a?(Regexp)
- stderr_actual.should =~ expected[:stderr]
+ expect(stderr_actual).to match(expected[:stderr])
else
- stderr_actual.should == expected[:stderr]
+ expect(stderr_actual).to eq(expected[:stderr])
end
stdout_actual = @stdout
if Chef::Platform.windows?
stderr_actual = stderr_actual.gsub("\r\n", "\n")
stdout_actual = stdout_actual.gsub("\r\n", "\n")
end
- @exit_code.should == expected[:exit_code]
+ expect(@exit_code).to eq(expected[:exit_code])
if expected[:stdout].is_a?(Regexp)
- stdout_actual.should =~ expected[:stdout]
+ expect(stdout_actual).to match(expected[:stdout])
else
- stdout_actual.should == expected[:stdout]
+ expect(stdout_actual).to eq(expected[:stdout])
end
end
end
diff --git a/spec/support/shared/matchers/exit_with_code.rb b/spec/support/shared/matchers/exit_with_code.rb
index 957586c85d..32ebf8db15 100644
--- a/spec/support/shared/matchers/exit_with_code.rb
+++ b/spec/support/shared/matchers/exit_with_code.rb
@@ -12,12 +12,12 @@ RSpec::Matchers.define :exit_with_code do |exp_code|
actual and actual == exp_code
end
- failure_message_for_should do |block|
+ failure_message do |block|
"expected block to call exit(#{exp_code}) but exit" +
(actual.nil? ? " not called" : "(#{actual}) was called")
end
- failure_message_for_should_not do |block|
+ failure_message_when_negated do |block|
"expected block not to call exit(#{exp_code})"
end
@@ -25,4 +25,8 @@ RSpec::Matchers.define :exit_with_code do |exp_code|
"expect block to call exit(#{exp_code})"
end
+ def supports_block_expectations?
+ true
+ end
+
end
diff --git a/spec/support/shared/unit/api_error_inspector.rb b/spec/support/shared/unit/api_error_inspector.rb
index 7577cb6c12..e85fa971e9 100644
--- a/spec/support/shared/unit/api_error_inspector.rb
+++ b/spec/support/shared/unit/api_error_inspector.rb
@@ -72,7 +72,7 @@ shared_examples_for "an api error inspector" do
before do
@response_body = "synchronize the clock on your host"
@response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) unauthorized", @response)
@inspector = described_class.new(@node_name, @exception, @config)
@inspector.add_explanation(@description)
@@ -88,7 +88,7 @@ shared_examples_for "an api error inspector" do
before do
@response_body = "check your key and node name"
@response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) unauthorized", @response)
@inspector = described_class.new(@node_name, @exception, @config)
@inspector.add_explanation(@description)
@@ -104,7 +104,7 @@ shared_examples_for "an api error inspector" do
before do
@response_body = "forbidden"
@response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) forbidden", @response)
@inspector = described_class.new(@node_name, @exception, @config)
@inspector.add_explanation(@description)
@@ -120,7 +120,7 @@ shared_examples_for "an api error inspector" do
before do
@response_body = "didn't like your data"
@response = Net::HTTPBadRequest.new("1.1", "400", "(response) bad request")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) bad request", @response)
@inspector = described_class.new(@node_name, @exception, @config)
@inspector.add_explanation(@description)
@@ -136,7 +136,7 @@ shared_examples_for "an api error inspector" do
before do
@response_body = "probably caused by a redirect to a get"
@response = Net::HTTPNotFound.new("1.1", "404", "(response) not found")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) not found", @response)
@inspector = described_class.new(@node_name, @exception, @config)
@inspector.add_explanation(@description)
@@ -151,7 +151,7 @@ shared_examples_for "an api error inspector" do
before do
@response_body = "sad trombone"
@response = Net::HTTPInternalServerError.new("1.1", "500", "(response) internal server error")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPFatalError.new("(exception) internal server error", @response)
@inspector = described_class.new(@node_name, @exception, @config)
@inspector.add_explanation(@description)
@@ -166,7 +166,7 @@ shared_examples_for "an api error inspector" do
before do
@response_body = "sad trombone orchestra"
@response = Net::HTTPBadGateway.new("1.1", "502", "(response) bad gateway")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPFatalError.new("(exception) bad gateway", @response)
@inspector = described_class.new(@node_name, @exception, @config)
@inspector.add_explanation(@description)
diff --git a/spec/support/shared/unit/execute_resource.rb b/spec/support/shared/unit/execute_resource.rb
index 609e77ad63..d6fb88db5c 100644
--- a/spec/support/shared/unit/execute_resource.rb
+++ b/spec/support/shared/unit/execute_resource.rb
@@ -26,84 +26,79 @@ shared_examples_for "an execute resource" do
end
it "should create a new Chef::Resource::Execute" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Execute)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Execute)
end
it "should set the command to the first argument to new" do
- @resource.command.should eql(resource_instance_name)
+ expect(@resource.command).to eql(resource_instance_name)
end
it "should accept an array on instantiation, too" do
resource = Chef::Resource::Execute.new(%w{something else})
- resource.should be_a_kind_of(Chef::Resource)
- resource.should be_a_kind_of(Chef::Resource::Execute)
- resource.command.should eql(%w{something else})
+ expect(resource).to be_a_kind_of(Chef::Resource)
+ expect(resource).to be_a_kind_of(Chef::Resource::Execute)
+ expect(resource.command).to eql(%w{something else})
end
it "should accept a string for the command to run" do
@resource.command "something"
- @resource.command.should eql("something")
+ expect(@resource.command).to eql("something")
end
it "should accept an array for the command to run" do
@resource.command %w{something else}
- @resource.command.should eql(%w{something else})
+ expect(@resource.command).to eql(%w{something else})
end
it "should accept a string for the cwd" do
@resource.cwd "something"
- @resource.cwd.should eql("something")
+ expect(@resource.cwd).to eql("something")
end
it "should accept a hash for the environment" do
test_hash = { :one => :two }
@resource.environment(test_hash)
- @resource.environment.should eql(test_hash)
+ expect(@resource.environment).to eql(test_hash)
end
it "allows the environment to be specified with #env" do
- @resource.should respond_to(:env)
+ expect(@resource).to respond_to(:env)
end
it "should accept a string for the group" do
@resource.group "something"
- @resource.group.should eql("something")
+ expect(@resource.group).to eql("something")
end
it "should accept an integer for the group" do
@resource.group 1
- @resource.group.should eql(1)
- end
-
- it "should accept an array for the execution path" do
- @resource.path ["woot"]
- @resource.path.should eql(["woot"])
+ expect(@resource.group).to eql(1)
end
it "should accept an integer for the return code" do
@resource.returns 1
- @resource.returns.should eql(1)
+ expect(@resource.returns).to eql(1)
end
it "should accept an integer for the timeout" do
@resource.timeout 1
- @resource.timeout.should eql(1)
+ expect(@resource.timeout).to eql(1)
end
it "should accept a string for the user" do
@resource.user "something"
- @resource.user.should eql("something")
+ expect(@resource.user).to eql("something")
end
it "should accept an integer for the user" do
@resource.user 1
- @resource.user.should eql(1)
+ expect(@resource.user).to eql(1)
end
it "should accept a string for creates" do
@resource.creates "something"
- @resource.creates.should eql("something")
+ expect(@resource.creates).to eql("something")
end
describe "when it has cwd, environment, group, path, return value, and a user" do
@@ -112,14 +107,12 @@ shared_examples_for "an execute resource" do
@resource.cwd("/tmp/")
@resource.environment({ :one => :two })
@resource.group("legos")
- @resource.path(["/var/local/"])
@resource.returns(1)
@resource.user("root")
end
it "returns the command as its identity" do
- @resource.identity.should == "grep"
+ expect(@resource.identity).to eq("grep")
end
end
end
-
diff --git a/spec/support/shared/unit/file_system_support.rb b/spec/support/shared/unit/file_system_support.rb
index 3e771dd187..358f0c405c 100644
--- a/spec/support/shared/unit/file_system_support.rb
+++ b/spec/support/shared/unit/file_system_support.rb
@@ -56,7 +56,7 @@ module FileSystemSupport
def no_blocking_calls_allowed
[ Chef::ChefFS::FileSystem::MemoryFile, Chef::ChefFS::FileSystem::MemoryDir ].each do |c|
[ :children, :exists?, :read ].each do |m|
- c.any_instance.stub(m).and_raise("#{m.to_s} should not be called")
+ allow_any_instance_of(c).to receive(m).and_raise("#{m.to_s} should not be called")
end
end
end
@@ -64,7 +64,7 @@ module FileSystemSupport
def list_should_yield_paths(fs, pattern_str, *expected_paths)
result_paths = []
Chef::ChefFS::FileSystem.list(fs, pattern(pattern_str)).each { |result| result_paths << result.path }
- result_paths.should =~ expected_paths
+ expect(result_paths).to match_array(expected_paths)
end
end
diff --git a/spec/support/shared/unit/platform_introspector.rb b/spec/support/shared/unit/platform_introspector.rb
index f76ddbdf9e..9f42c985f8 100644
--- a/spec/support/shared/unit/platform_introspector.rb
+++ b/spec/support/shared/unit/platform_introspector.rb
@@ -44,49 +44,49 @@ shared_examples_for "a platform introspector" do
it "returns a default value when there is no known platform" do
node = Hash.new
- platform_introspector.value_for_platform(@platform_hash).should == "default"
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq("default")
end
it "returns a default value when there is no known platform family" do
- platform_introspector.value_for_platform_family(@platform_family_hash).should == "default value"
+ expect(platform_introspector.value_for_platform_family(@platform_family_hash)).to eq("default value")
end
it "returns a default value when the current platform doesn't match" do
node.automatic_attrs[:platform] = "not-a-known-platform"
- platform_introspector.value_for_platform(@platform_hash).should == "default"
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq("default")
end
it "returns a default value when current platform_family doesn't match" do
node.automatic_attrs[:platform_family] = "ultra-derived-linux"
- platform_introspector.value_for_platform_family(@platform_family_hash).should == "default value"
+ expect(platform_introspector.value_for_platform_family(@platform_family_hash)).to eq("default value")
end
it "returns a value based on the current platform" do
node.automatic_attrs[:platform] = "openbsd"
- platform_introspector.value_for_platform(@platform_hash).should == "openbsd"
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq("openbsd")
end
it "returns a value based on the current platform family" do
node.automatic_attrs[:platform_family] = "debian"
- platform_introspector.value_for_platform_family(@platform_family_hash).should == "debian value"
+ expect(platform_introspector.value_for_platform_family(@platform_family_hash)).to eq("debian value")
end
it "returns a version-specific value based on the current platform" do
node.automatic_attrs[:platform] = "openbsd"
node.automatic_attrs[:platform_version] = "1.2.3"
- platform_introspector.value_for_platform(@platform_hash).should == "openbsd-1.2.3"
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq("openbsd-1.2.3")
end
it "returns a value based on the current platform if version not found" do
node.automatic_attrs[:platform] = "openbsd"
node.automatic_attrs[:platform_version] = "0.0.0"
- platform_introspector.value_for_platform(@platform_hash).should == "openbsd"
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq("openbsd")
end
it 'returns the exact match' do
node.automatic_attrs[:platform] = 'exact_match'
node.automatic_attrs[:platform_version] = '1.2.3'
- platform_introspector.value_for_platform(@platform_hash).should == 'exact'
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq('exact')
end
it 'raises RuntimeError' do
@@ -98,20 +98,20 @@ shared_examples_for "a platform introspector" do
it 'should return the value for that match' do
node.automatic_attrs[:platform] = 'successful_matches'
node.automatic_attrs[:platform_version] = '2.9'
- platform_introspector.value_for_platform(@platform_hash).should == 'matched < 3.0'
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq('matched < 3.0')
end
describe "when platform versions is an array" do
it "returns a version-specific value based on the current platform" do
node.automatic_attrs[:platform] = "debian"
node.automatic_attrs[:platform_version] = "6"
- platform_introspector.value_for_platform(@platform_hash).should == "debian-5/6"
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq("debian-5/6")
end
it "returns a value based on the current platform if version not found" do
node.automatic_attrs[:platform] = "debian"
node.automatic_attrs[:platform_version] = "0.0.0"
- platform_introspector.value_for_platform(@platform_hash).should == "debian"
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq("debian")
end
end
@@ -119,17 +119,17 @@ shared_examples_for "a platform introspector" do
it "returns true if the node is a provided platform and platforms are provided as symbols" do
node.automatic_attrs[:platform] = 'ubuntu'
- platform_introspector.platform?([:redhat, :ubuntu]).should == true
+ expect(platform_introspector.platform?([:redhat, :ubuntu])).to eq(true)
end
it "returns true if the node is a provided platform and platforms are provided as strings" do
node.automatic_attrs[:platform] = 'ubuntu'
- platform_introspector.platform?(["redhat", "ubuntu"]).should == true
+ expect(platform_introspector.platform?(["redhat", "ubuntu"])).to eq(true)
end
it "returns false if the node is not of the provided platforms" do
node.automatic_attrs[:platform] = 'ubuntu'
- platform_introspector.platform?(:splatlinux).should == false
+ expect(platform_introspector.platform?(:splatlinux)).to eq(false)
end
end
@@ -137,21 +137,21 @@ shared_examples_for "a platform introspector" do
it "returns true if the node is in a provided platform family and families are provided as symbols" do
node.automatic_attrs[:platform_family] = 'debian'
- platform_introspector.platform_family?([:rhel, :debian]).should == true
+ expect(platform_introspector.platform_family?([:rhel, :debian])).to eq(true)
end
it "returns true if the node is a provided platform and platforms are provided as strings" do
node.automatic_attrs[:platform_family] = 'rhel'
- platform_introspector.platform_family?(["rhel", "debian"]).should == true
+ expect(platform_introspector.platform_family?(["rhel", "debian"])).to eq(true)
end
it "returns false if the node is not of the provided platforms" do
node.automatic_attrs[:platform_family] = 'suse'
- platform_introspector.platform_family?(:splatlinux).should == false
+ expect(platform_introspector.platform_family?(:splatlinux)).to eq(false)
end
it "returns false if the node is not of the provided platforms and platform_family is not set" do
- platform_introspector.platform_family?(:splatlinux).should == false
+ expect(platform_introspector.platform_family?(:splatlinux)).to eq(false)
end
end
@@ -170,13 +170,13 @@ shared_examples_for "a platform introspector" do
it "returns the correct default for a given platform" do
node.automatic_attrs[:platform] = "debian"
node.automatic_attrs[:platform_version] = '9000'
- platform_introspector.value_for_platform(@platform_hash).should == [ :restart, :reload, :status ]
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq([ :restart, :reload, :status ])
end
it "returns the correct platform+version specific value " do
node.automatic_attrs[:platform] = "debian"
node.automatic_attrs[:platform_version] = '4.0'
- platform_introspector.value_for_platform(@platform_hash).should == [:restart, :reload]
+ expect(platform_introspector.value_for_platform(@platform_hash)).to eq([:restart, :reload])
end
end
diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb
index 85c8e2fb34..25c2b52b1b 100644
--- a/spec/support/shared/unit/provider/file.rb
+++ b/spec/support/shared/unit/provider/file.rb
@@ -43,67 +43,67 @@ end
# this is all getting a bit stupid, CHEF-4802 cut to remove all this
def setup_normal_file
[ resource_path, normalized_path, windows_path].each do |path|
- File.stub(:file?).with(path).and_return(true)
- File.stub(:exists?).with(path).and_return(true)
- File.stub(:exist?).with(path).and_return(true)
- File.stub(:directory?).with(path).and_return(false)
- File.stub(:writable?).with(path).and_return(true)
- file_symlink_class.stub(:symlink?).with(path).and_return(false)
- File.stub(:realpath?).with(path).and_return(normalized_path)
+ allow(File).to receive(:file?).with(path).and_return(true)
+ allow(File).to receive(:exists?).with(path).and_return(true)
+ allow(File).to receive(:exist?).with(path).and_return(true)
+ allow(File).to receive(:directory?).with(path).and_return(false)
+ allow(File).to receive(:writable?).with(path).and_return(true)
+ allow(file_symlink_class).to receive(:symlink?).with(path).and_return(false)
+ allow(File).to receive(:realpath?).with(path).and_return(normalized_path)
end
- File.stub(:directory?).with(enclosing_directory).and_return(true)
+ allow(File).to receive(:directory?).with(enclosing_directory).and_return(true)
end
def setup_missing_file
[ resource_path, normalized_path, windows_path].each do |path|
- File.stub(:file?).with(path).and_return(false)
- File.stub(:realpath?).with(path).and_return(resource_path)
- File.stub(:exists?).with(path).and_return(false)
- File.stub(:exist?).with(path).and_return(false)
- File.stub(:directory?).with(path).and_return(false)
- File.stub(:writable?).with(path).and_return(false)
- file_symlink_class.stub(:symlink?).with(path).and_return(false)
+ allow(File).to receive(:file?).with(path).and_return(false)
+ allow(File).to receive(:realpath?).with(path).and_return(resource_path)
+ allow(File).to receive(:exists?).with(path).and_return(false)
+ allow(File).to receive(:exist?).with(path).and_return(false)
+ allow(File).to receive(:directory?).with(path).and_return(false)
+ allow(File).to receive(:writable?).with(path).and_return(false)
+ allow(file_symlink_class).to receive(:symlink?).with(path).and_return(false)
end
- File.stub(:directory?).with(enclosing_directory).and_return(true)
+ allow(File).to receive(:directory?).with(enclosing_directory).and_return(true)
end
def setup_symlink
[ resource_path, normalized_path, windows_path].each do |path|
- File.stub(:file?).with(path).and_return(true)
- File.stub(:realpath?).with(path).and_return(normalized_path)
- File.stub(:exists?).with(path).and_return(true)
- File.stub(:exist?).with(path).and_return(true)
- File.stub(:directory?).with(path).and_return(false)
- File.stub(:writable?).with(path).and_return(true)
- file_symlink_class.stub(:symlink?).with(path).and_return(true)
+ allow(File).to receive(:file?).with(path).and_return(true)
+ allow(File).to receive(:realpath?).with(path).and_return(normalized_path)
+ allow(File).to receive(:exists?).with(path).and_return(true)
+ allow(File).to receive(:exist?).with(path).and_return(true)
+ allow(File).to receive(:directory?).with(path).and_return(false)
+ allow(File).to receive(:writable?).with(path).and_return(true)
+ allow(file_symlink_class).to receive(:symlink?).with(path).and_return(true)
end
- File.stub(:directory?).with(enclosing_directory).and_return(true)
+ allow(File).to receive(:directory?).with(enclosing_directory).and_return(true)
end
def setup_unwritable_file
[ resource_path, normalized_path, windows_path].each do |path|
- File.stub(:file?).with(path).and_return(false)
- File.stub(:realpath?).with(path).and_raise(Errno::ENOENT)
- File.stub(:exists?).with(path).and_return(true)
- File.stub(:exist?).with(path).and_return(true)
- File.stub(:directory?).with(path).and_return(false)
- File.stub(:writable?).with(path).and_return(false)
- file_symlink_class.stub(:symlink?).with(path).and_return(false)
+ allow(File).to receive(:file?).with(path).and_return(false)
+ allow(File).to receive(:realpath?).with(path).and_raise(Errno::ENOENT)
+ allow(File).to receive(:exists?).with(path).and_return(true)
+ allow(File).to receive(:exist?).with(path).and_return(true)
+ allow(File).to receive(:directory?).with(path).and_return(false)
+ allow(File).to receive(:writable?).with(path).and_return(false)
+ allow(file_symlink_class).to receive(:symlink?).with(path).and_return(false)
end
- File.stub(:directory?).with(enclosing_directory).and_return(true)
+ allow(File).to receive(:directory?).with(enclosing_directory).and_return(true)
end
def setup_missing_enclosing_directory
[ resource_path, normalized_path, windows_path].each do |path|
- File.stub(:file?).with(path).and_return(false)
- File.stub(:realpath?).with(path).and_raise(Errno::ENOENT)
- File.stub(:exists?).with(path).and_return(false)
- File.stub(:exist?).with(path).and_return(false)
- File.stub(:directory?).with(path).and_return(false)
- File.stub(:writable?).with(path).and_return(false)
- file_symlink_class.stub(:symlink?).with(path).and_return(false)
+ allow(File).to receive(:file?).with(path).and_return(false)
+ allow(File).to receive(:realpath?).with(path).and_raise(Errno::ENOENT)
+ allow(File).to receive(:exists?).with(path).and_return(false)
+ allow(File).to receive(:exist?).with(path).and_return(false)
+ allow(File).to receive(:directory?).with(path).and_return(false)
+ allow(File).to receive(:writable?).with(path).and_return(false)
+ allow(file_symlink_class).to receive(:symlink?).with(path).and_return(false)
end
- File.stub(:directory?).with(enclosing_directory).and_return(false)
+ allow(File).to receive(:directory?).with(enclosing_directory).and_return(false)
end
# A File subclass that we use as a replacement for Tempfile. Some versions of
@@ -136,9 +136,9 @@ shared_examples_for Chef::Provider::File do
end
before(:each) do
- content.stub(:tempfile).and_return(tempfile)
- File.stub(:exist?).with(tempfile.path).and_call_original
- File.stub(:exists?).with(tempfile.path).and_call_original
+ allow(content).to receive(:tempfile).and_return(tempfile)
+ allow(File).to receive(:exist?).with(tempfile.path).and_call_original
+ allow(File).to receive(:exists?).with(tempfile.path).and_call_original
end
after do
@@ -147,15 +147,15 @@ shared_examples_for Chef::Provider::File do
end
it "should return a #{described_class}" do
- provider.should be_a_kind_of(described_class)
+ expect(provider).to be_a_kind_of(described_class)
end
it "should store the resource passed to new as new_resource" do
- provider.new_resource.should eql(resource)
+ expect(provider.new_resource).to eql(resource)
end
it "should store the node passed to new as node" do
- provider.node.should eql(node)
+ expect(provider.node).to eql(node)
end
context "when loading the current resource" do
@@ -167,15 +167,15 @@ shared_examples_for Chef::Provider::File do
#
it "should not try to load the content when the file is present" do
setup_normal_file
- provider.should_not_receive(:tempfile)
- provider.should_not_receive(:content)
+ expect(provider).not_to receive(:tempfile)
+ expect(provider).not_to receive(:content)
provider.load_current_resource
end
it "should not try to load the content when the file is missing" do
setup_missing_file
- provider.should_not_receive(:tempfile)
- provider.should_not_receive(:content)
+ expect(provider).not_to receive(:tempfile)
+ expect(provider).not_to receive(:content)
provider.load_current_resource
end
end
@@ -189,33 +189,33 @@ shared_examples_for Chef::Provider::File do
it "should load a current resource based on the one specified at construction" do
provider.load_current_resource
- provider.current_resource.should be_a_kind_of(Chef::Resource::File)
+ expect(provider.current_resource).to be_a_kind_of(Chef::Resource::File)
end
it "the loaded current_resource name should be the same as the resource name" do
provider.load_current_resource
- provider.current_resource.name.should eql(resource.name)
+ expect(provider.current_resource.name).to eql(resource.name)
end
it "the loaded current_resource path should be the same as the resoure path" do
provider.load_current_resource
- provider.current_resource.path.should eql(resource.path)
+ expect(provider.current_resource.path).to eql(resource.path)
end
it "the loaded current_resource content should be nil" do
provider.load_current_resource
- provider.current_resource.content.should eql(nil)
+ expect(provider.current_resource.content).to eql(nil)
end
it "it should call checksum if we are managing content" do
- provider.should_receive(:managing_content?).at_least(:once).and_return(true)
- provider.should_receive(:checksum).with(resource.path).and_return(tempfile_sha256)
+ expect(provider).to receive(:managing_content?).at_least(:once).and_return(true)
+ expect(provider).to receive(:checksum).with(resource.path).and_return(tempfile_sha256)
provider.load_current_resource
end
it "it should not call checksum if we are not managing content" do
- provider.should_receive(:managing_content?).at_least(:once).and_return(false)
- provider.should_not_receive(:checksum)
+ expect(provider).to receive(:managing_content?).at_least(:once).and_return(false)
+ expect(provider).not_to receive(:checksum)
provider.load_current_resource
end
end
@@ -227,27 +227,27 @@ shared_examples_for Chef::Provider::File do
it "the current_resource should be a Chef::Resource::File" do
provider.load_current_resource
- provider.current_resource.should be_a_kind_of(Chef::Resource::File)
+ expect(provider.current_resource).to be_a_kind_of(Chef::Resource::File)
end
it "the current_resource name should be the same as the resource name" do
provider.load_current_resource
- provider.current_resource.name.should eql(resource.name)
+ expect(provider.current_resource.name).to eql(resource.name)
end
it "the current_resource path should be the same as the resource path" do
provider.load_current_resource
- provider.current_resource.path.should eql(resource.path)
+ expect(provider.current_resource.path).to eql(resource.path)
end
it "the loaded current_resource content should be nil" do
provider.load_current_resource
- provider.current_resource.content.should eql(nil)
+ expect(provider.current_resource.content).to eql(nil)
end
it "it should not call checksum if we are not managing content" do
- provider.should_not_receive(:managing_content?)
- provider.should_not_receive(:checksum)
+ expect(provider).not_to receive(:managing_content?)
+ expect(provider).not_to receive(:checksum)
provider.load_current_resource
end
end
@@ -255,14 +255,14 @@ shared_examples_for Chef::Provider::File do
context "examining file security metadata on Unix with a file that exists" do
before do
# fake that we're on unix even if we're on windows
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
# mock up the filesystem to behave like unix
setup_normal_file
stat_struct = double("::File.stat", :mode => 0600, :uid => 0, :gid => 0, :mtime => 10000)
resource_real_path = File.realpath(resource.path)
- File.should_receive(:stat).with(resource_real_path).at_least(:once).and_return(stat_struct)
- Etc.stub(:getgrgid).with(0).and_return(double("Group Ent", :name => "wheel"))
- Etc.stub(:getpwuid).with(0).and_return(double("User Ent", :name => "root"))
+ expect(File).to receive(:stat).with(resource_real_path).at_least(:once).and_return(stat_struct)
+ allow(Etc).to receive(:getgrgid).with(0).and_return(double("Group Ent", :name => "wheel"))
+ allow(Etc).to receive(:getpwuid).with(0).and_return(double("User Ent", :name => "root"))
end
context "when the new_resource does not specify any state" do
@@ -271,15 +271,15 @@ shared_examples_for Chef::Provider::File do
end
it "should load the permissions into the current_resource" do
- provider.current_resource.mode.should == "0600"
- provider.current_resource.owner.should == "root"
- provider.current_resource.group.should == "wheel"
+ expect(provider.current_resource.mode).to eq("0600")
+ expect(provider.current_resource.owner).to eq("root")
+ expect(provider.current_resource.group).to eq("wheel")
end
it "should not set the new_resource permissions" do
- provider.new_resource.group.should be_nil
- provider.new_resource.owner.should be_nil
- provider.new_resource.mode.should be_nil
+ expect(provider.new_resource.group).to be_nil
+ expect(provider.new_resource.owner).to be_nil
+ expect(provider.new_resource.mode).to be_nil
end
end
@@ -293,15 +293,15 @@ shared_examples_for Chef::Provider::File do
it "should load the permissions into the current_resource as numbers" do
# Mode is always loaded as string for reporting purposes.
- provider.current_resource.mode.should == "0600"
- provider.current_resource.owner.should == 0
- provider.current_resource.group.should == 0
+ expect(provider.current_resource.mode).to eq("0600")
+ expect(provider.current_resource.owner).to eq(0)
+ expect(provider.current_resource.group).to eq(0)
end
it "should not set the new_resource permissions" do
- provider.new_resource.group.should == 1
- provider.new_resource.owner.should == 1
- provider.new_resource.mode.should == 0644
+ expect(provider.new_resource.group).to eq(1)
+ expect(provider.new_resource.owner).to eq(1)
+ expect(provider.new_resource.mode).to eq(0644)
end
end
@@ -314,15 +314,15 @@ shared_examples_for Chef::Provider::File do
end
it "should load the permissions into the current_resource as symbols" do
- provider.current_resource.mode.should == "0600"
- provider.current_resource.owner.should == "root"
- provider.current_resource.group.should == "wheel"
+ expect(provider.current_resource.mode).to eq("0600")
+ expect(provider.current_resource.owner).to eq("root")
+ expect(provider.current_resource.group).to eq("wheel")
end
it "should not set the new_resource permissions" do
- provider.new_resource.group.should == "seattlehiphop"
- provider.new_resource.owner.should == "macklemore"
- provider.new_resource.mode.should == "0321"
+ expect(provider.new_resource.group).to eq("seattlehiphop")
+ expect(provider.new_resource.owner).to eq("macklemore")
+ expect(provider.new_resource.mode).to eq("0321")
end
end
@@ -331,7 +331,7 @@ shared_examples_for Chef::Provider::File do
context "examining file security metadata on Unix with a file that does not exist" do
before do
# fake that we're on unix even if we're on windows
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
setup_missing_file
end
@@ -341,15 +341,15 @@ shared_examples_for Chef::Provider::File do
end
it "the current_resource permissions should be nil" do
- provider.current_resource.mode.should be_nil
- provider.current_resource.owner.should be_nil
- provider.current_resource.group.should be_nil
+ expect(provider.current_resource.mode).to be_nil
+ expect(provider.current_resource.owner).to be_nil
+ expect(provider.current_resource.group).to be_nil
end
it "should not set the new_resource permissions" do
- provider.new_resource.group.should be_nil
- provider.new_resource.owner.should be_nil
- provider.new_resource.mode.should be_nil
+ expect(provider.new_resource.group).to be_nil
+ expect(provider.new_resource.owner).to be_nil
+ expect(provider.new_resource.mode).to be_nil
end
end
@@ -362,15 +362,15 @@ shared_examples_for Chef::Provider::File do
end
it "the current_resource permissions should be nil" do
- provider.current_resource.mode.should be_nil
- provider.current_resource.owner.should be_nil
- provider.current_resource.group.should be_nil
+ expect(provider.current_resource.mode).to be_nil
+ expect(provider.current_resource.owner).to be_nil
+ expect(provider.current_resource.group).to be_nil
end
it "should not set the new_resource permissions" do
- provider.new_resource.group.should == 51948
- provider.new_resource.owner.should == 63945
- provider.new_resource.mode.should == 0123
+ expect(provider.new_resource.group).to eq(51948)
+ expect(provider.new_resource.owner).to eq(63945)
+ expect(provider.new_resource.mode).to eq(0123)
end
end
end
@@ -380,35 +380,35 @@ shared_examples_for Chef::Provider::File do
before do
# fake that we're on unix even if we're on windows
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
# mock up the filesystem to behave like unix
setup_normal_file
stat_struct = double("::File.stat", :mode => 0600, :uid => 0, :gid => 0, :mtime => 10000)
resource_real_path = File.realpath(resource.path)
- File.stub(:stat).with(resource_real_path).and_return(stat_struct)
- Etc.stub(:getgrgid).with(0).and_return(double("Group Ent", :name => "wheel"))
- Etc.stub(:getpwuid).with(0).and_return(double("User Ent", :name => "root"))
+ allow(File).to receive(:stat).with(resource_real_path).and_return(stat_struct)
+ allow(Etc).to receive(:getgrgid).with(0).and_return(double("Group Ent", :name => "wheel"))
+ allow(Etc).to receive(:getpwuid).with(0).and_return(double("User Ent", :name => "root"))
provider.send(:load_resource_attributes_from_file, resource)
end
it "new_resource should record the new permission information" do
- provider.new_resource.group.should == "wheel"
- provider.new_resource.owner.should == "root"
- provider.new_resource.mode.should == "0600"
+ expect(provider.new_resource.group).to eq("wheel")
+ expect(provider.new_resource.owner).to eq("root")
+ expect(provider.new_resource.mode).to eq("0600")
end
end
context "when reporting security metadata on windows" do
it "records the file owner" do
- pending
+ skip
end
it "records rights for each user in the ACL" do
- pending
+ skip
end
it "records deny_rights for each user in the ACL" do
- pending
+ skip
end
end
@@ -419,12 +419,12 @@ shared_examples_for Chef::Provider::File do
[:create, :create_if_missing, :touch].each do |action|
context "action #{action}" do
it "raises EnclosingDirectoryDoesNotExist" do
- lambda {provider.run_action(action)}.should raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist)
+ expect {provider.run_action(action)}.to raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist)
end
it "does not raise an exception in why-run mode" do
Chef::Config[:why_run] = true
- lambda {provider.run_action(action)}.should_not raise_error
+ expect {provider.run_action(action)}.not_to raise_error
Chef::Config[:why_run] = false
end
end
@@ -435,12 +435,12 @@ shared_examples_for Chef::Provider::File do
before { setup_unwritable_file }
it "action delete raises InsufficientPermissions" do
- lambda {provider.run_action(:delete)}.should raise_error(Chef::Exceptions::InsufficientPermissions)
+ expect {provider.run_action(:delete)}.to raise_error(Chef::Exceptions::InsufficientPermissions)
end
it "action delete also raises InsufficientPermissions in why-run mode" do
Chef::Config[:why_run] = true
- lambda {provider.run_action(:delete)}.should raise_error(Chef::Exceptions::InsufficientPermissions)
+ expect {provider.run_action(:delete)}.to raise_error(Chef::Exceptions::InsufficientPermissions)
Chef::Config[:why_run] = false
end
end
@@ -449,10 +449,10 @@ shared_examples_for Chef::Provider::File do
context "action create" do
it "should create the file, update its contents and then set the acls on the file" do
setup_missing_file
- provider.should_receive(:do_create_file)
- provider.should_receive(:do_contents_changes)
- provider.should_receive(:do_acl_changes)
- provider.should_receive(:load_resource_attributes_from_file)
+ expect(provider).to receive(:do_create_file)
+ expect(provider).to receive(:do_contents_changes)
+ expect(provider).to receive(:do_acl_changes)
+ expect(provider).to receive(:load_resource_attributes_from_file)
provider.run_action(:create)
end
@@ -461,18 +461,18 @@ shared_examples_for Chef::Provider::File do
before { setup_normal_file }
it "should not create the file" do
provider.load_current_resource
- provider.deployment_strategy.should_not_receive(:create).with(resource_path)
+ expect(provider.deployment_strategy).not_to receive(:create).with(resource_path)
provider.send(:do_create_file)
- provider.send(:needs_creating?).should == false
+ expect(provider.send(:needs_creating?)).to eq(false)
end
end
context "when the file does not exist" do
before { setup_missing_file }
it "should create the file" do
provider.load_current_resource
- provider.deployment_strategy.should_receive(:create).with(resource_path)
+ expect(provider.deployment_strategy).to receive(:create).with(resource_path)
provider.send(:do_create_file)
- provider.send(:needs_creating?).should == true
+ expect(provider.send(:needs_creating?)).to eq(true)
end
end
end
@@ -483,10 +483,10 @@ shared_examples_for Chef::Provider::File do
setup_normal_file
provider.load_current_resource
tempfile = double('Tempfile', :path => "/tmp/foo-bar-baz")
- content.stub(:tempfile).and_return(tempfile)
- File.should_receive(:exists?).with("/tmp/foo-bar-baz").and_return(true)
- tempfile.should_receive(:close).once
- tempfile.should_receive(:unlink).once
+ allow(content).to receive(:tempfile).and_return(tempfile)
+ expect(File).to receive(:exists?).with("/tmp/foo-bar-baz").and_return(true)
+ expect(tempfile).to receive(:close).once
+ expect(tempfile).to receive(:unlink).once
end
context "when the contents have changed" do
@@ -494,64 +494,64 @@ shared_examples_for Chef::Provider::File do
let(:tempfile_sha256) { "42971f0ddce0cb20cf7660a123ffa1a1543beb2f1e7cd9d65858764a27f3201d" }
let(:diff_for_reporting) { "+++\n---\n+foo\n-bar\n" }
before do
- provider.stub(:contents_changed?).and_return(true)
+ allow(provider).to receive(:contents_changed?).and_return(true)
diff = double('Diff', :for_output => ['+++','---','+foo','-bar'],
:for_reporting => diff_for_reporting )
- diff.stub(:diff).with(resource_path, tempfile_path).and_return(true)
- provider.should_receive(:diff).at_least(:once).and_return(diff)
- provider.should_receive(:managing_content?).at_least(:once).and_return(true)
- provider.should_receive(:checksum).with(tempfile_path).and_return(tempfile_sha256)
- provider.should_receive(:checksum).with(resource_path).and_return(tempfile_sha256)
- provider.deployment_strategy.should_receive(:deploy).with(tempfile_path, normalized_path)
+ allow(diff).to receive(:diff).with(resource_path, tempfile_path).and_return(true)
+ expect(provider).to receive(:diff).at_least(:once).and_return(diff)
+ expect(provider).to receive(:managing_content?).at_least(:once).and_return(true)
+ expect(provider).to receive(:checksum).with(tempfile_path).and_return(tempfile_sha256)
+ expect(provider).to receive(:checksum).with(resource_path).and_return(tempfile_sha256)
+ expect(provider.deployment_strategy).to receive(:deploy).with(tempfile_path, normalized_path)
end
context "when the file was created" do
- before { provider.should_receive(:needs_creating?).at_least(:once).and_return(true) }
+ before { expect(provider).to receive(:needs_creating?).at_least(:once).and_return(true) }
it "does not backup the file and does not produce a diff for reporting" do
- provider.should_not_receive(:do_backup)
+ expect(provider).not_to receive(:do_backup)
provider.send(:do_contents_changes)
- resource.diff.should be_nil
+ expect(resource.diff).to be_nil
end
end
context "when the file was not created" do
- before { provider.should_receive(:needs_creating?).at_least(:once).and_return(false) }
+ before { expect(provider).to receive(:needs_creating?).at_least(:once).and_return(false) }
it "backs up the file and produces a diff for reporting" do
- provider.should_receive(:do_backup)
+ expect(provider).to receive(:do_backup)
provider.send(:do_contents_changes)
- resource.diff.should == diff_for_reporting
+ expect(resource.diff).to eq(diff_for_reporting)
end
end
end
it "does nothing when the contents have not changed" do
- provider.stub(:contents_changed?).and_return(false)
- provider.should_not_receive(:diff)
+ allow(provider).to receive(:contents_changed?).and_return(false)
+ expect(provider).not_to receive(:diff)
provider.send(:do_contents_changes)
end
end
it "does nothing when there is no content to deploy (tempfile returned from contents is nil)" do
- provider.send(:content).should_receive(:tempfile).at_least(:once).and_return(nil)
- provider.should_not_receive(:diff)
- lambda{ provider.send(:do_contents_changes) }.should_not raise_error
+ expect(provider.send(:content)).to receive(:tempfile).at_least(:once).and_return(nil)
+ expect(provider).not_to receive(:diff)
+ expect{ provider.send(:do_contents_changes) }.not_to raise_error
end
it "raises an exception when the content object returns a tempfile with a nil path" do
tempfile = double('Tempfile', :path => nil)
- provider.send(:content).should_receive(:tempfile).at_least(:once).and_return(tempfile)
- lambda{ provider.send(:do_contents_changes) }.should raise_error
+ expect(provider.send(:content)).to receive(:tempfile).at_least(:once).and_return(tempfile)
+ expect{ provider.send(:do_contents_changes) }.to raise_error
end
it "raises an exception when the content object returns a tempfile that does not exist" do
tempfile = double('Tempfile', :path => "/tmp/foo-bar-baz")
- provider.send(:content).should_receive(:tempfile).at_least(:once).and_return(tempfile)
- File.should_receive(:exists?).with("/tmp/foo-bar-baz").and_return(false)
- lambda{ provider.send(:do_contents_changes) }.should raise_error
+ expect(provider.send(:content)).to receive(:tempfile).at_least(:once).and_return(tempfile)
+ expect(File).to receive(:exists?).with("/tmp/foo-bar-baz").and_return(false)
+ expect{ provider.send(:do_contents_changes) }.to raise_error
end
end
context "do_acl_changes" do
it "needs tests" do
- pending
+ skip
end
end
@@ -560,11 +560,11 @@ shared_examples_for Chef::Provider::File do
before do
setup_normal_file
provider.load_current_resource
- provider.stub(:resource_updated?).and_return(true)
+ allow(provider).to receive(:resource_updated?).and_return(true)
end
it "should check for selinux_enabled? by default" do
- provider.should_receive(:selinux_enabled?)
+ expect(provider).to receive(:selinux_enabled?)
provider.send(:do_selinux)
end
@@ -580,27 +580,27 @@ shared_examples_for Chef::Provider::File do
context "when selinux is enabled on the system" do
before do
- provider.should_receive(:selinux_enabled?).and_return(true)
+ expect(provider).to receive(:selinux_enabled?).and_return(true)
end
it "restores security context on the file" do
- provider.should_receive(:restore_security_context).with(normalized_path, false)
+ expect(provider).to receive(:restore_security_context).with(normalized_path, false)
provider.send(:do_selinux)
end
it "restores security context recursively when told so" do
- provider.should_receive(:restore_security_context).with(normalized_path, true)
+ expect(provider).to receive(:restore_security_context).with(normalized_path, true)
provider.send(:do_selinux, true)
end
end
context "when selinux is disabled on the system" do
before do
- provider.should_receive(:selinux_enabled?).and_return(false)
+ expect(provider).to receive(:selinux_enabled?).and_return(false)
end
it "should not restore security context" do
- provider.should_not_receive(:restore_security_context)
+ expect(provider).not_to receive(:restore_security_context)
provider.send(:do_selinux)
end
end
@@ -617,7 +617,7 @@ shared_examples_for Chef::Provider::File do
end
it "should not check for selinux_enabled?" do
- provider.should_not_receive(:selinux_enabled?)
+ expect(provider).not_to receive(:selinux_enabled?)
provider.send(:do_selinux)
end
end
@@ -625,11 +625,11 @@ shared_examples_for Chef::Provider::File do
context "when resource is not updated" do
before do
- provider.stub(:resource_updated?).and_return(false)
+ allow(provider).to receive(:resource_updated?).and_return(false)
end
it "should not check for selinux_enabled?" do
- provider.should_not_receive(:selinux_enabled?)
+ expect(provider).not_to receive(:selinux_enabled?)
provider.send(:do_selinux)
end
end
@@ -643,29 +643,29 @@ shared_examples_for Chef::Provider::File do
context "when the file is not a symlink" do
before { setup_normal_file }
it "should backup and delete the file and be updated by the last action" do
- provider.should_receive(:do_backup).at_least(:once).and_return(true)
- File.should_receive(:delete).with(resource_path).and_return(true)
+ expect(provider).to receive(:do_backup).at_least(:once).and_return(true)
+ expect(File).to receive(:delete).with(resource_path).and_return(true)
provider.run_action(:delete)
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
context "when the file is a symlink" do
before { setup_symlink }
it "should not backup the symlink" do
- provider.should_not_receive(:do_backup)
- File.should_receive(:delete).with(resource_path).and_return(true)
+ expect(provider).not_to receive(:do_backup)
+ expect(File).to receive(:delete).with(resource_path).and_return(true)
provider.run_action(:delete)
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
end
context "when the file is not writable" do
before { setup_unwritable_file }
it "should not try to backup or delete the file, and should not be updated by last action" do
- provider.should_not_receive(:do_backup)
- File.should_not_receive(:delete)
- lambda { provider.run_action(:delete) }.should raise_error()
- resource.should_not be_updated_by_last_action
+ expect(provider).not_to receive(:do_backup)
+ expect(File).not_to receive(:delete)
+ expect { provider.run_action(:delete) }.to raise_error()
+ expect(resource).not_to be_updated_by_last_action
end
end
end
@@ -674,10 +674,10 @@ shared_examples_for Chef::Provider::File do
before { setup_missing_file }
it "should not try to backup or delete the file, and should not be updated by last action" do
- provider.should_not_receive(:do_backup)
- File.should_not_receive(:delete)
- lambda { provider.run_action(:delete) }.should_not raise_error
- resource.should_not be_updated_by_last_action
+ expect(provider).not_to receive(:do_backup)
+ expect(File).not_to receive(:delete)
+ expect { provider.run_action(:delete) }.not_to raise_error
+ expect(resource).not_to be_updated_by_last_action
end
end
end
@@ -686,19 +686,19 @@ shared_examples_for Chef::Provider::File do
context "when the file does not exist" do
before { setup_missing_file }
it "should update the atime/mtime on action_touch" do
- File.should_receive(:utime).once
- provider.should_receive(:action_create)
+ expect(File).to receive(:utime).once
+ expect(provider).to receive(:action_create)
provider.run_action(:touch)
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
context "when the file exists" do
before { setup_normal_file }
it "should update the atime/mtime on action_touch" do
- File.should_receive(:utime).once
- provider.should_receive(:action_create)
+ expect(File).to receive(:utime).once
+ expect(provider).to receive(:action_create)
provider.run_action(:touch)
- resource.should be_updated_by_last_action
+ expect(resource).to be_updated_by_last_action
end
end
end
@@ -707,7 +707,7 @@ shared_examples_for Chef::Provider::File do
context "when the file does not exist" do
before { setup_missing_file }
it "should call action_create" do
- provider.should_receive(:action_create)
+ expect(provider).to receive(:action_create)
provider.run_action(:create_if_missing)
end
end
@@ -715,7 +715,7 @@ shared_examples_for Chef::Provider::File do
context "when the file exists" do
before { setup_normal_file }
it "should not call action_create" do
- provider.should_not_receive(:action_create)
+ expect(provider).not_to receive(:action_create)
provider.run_action(:create_if_missing)
end
end
@@ -728,27 +728,27 @@ shared_examples_for "a file provider with content field" do
context "when testing managing_content?" do
it "should be false when creating a file without content" do
provider.action = :create
- resource.stub(:content).and_return(nil)
- resource.stub(:checksum).and_return(nil)
- expect(provider.send(:managing_content?)).to be_false
+ allow(resource).to receive(:content).and_return(nil)
+ allow(resource).to receive(:checksum).and_return(nil)
+ expect(provider.send(:managing_content?)).to be_falsey
end
it "should be true when creating a file with content" do
provider.action = :create
- resource.stub(:content).and_return("flurbleblobbleblooble")
- resource.stub(:checksum).and_return(nil)
- expect(provider.send(:managing_content?)).to be_true
+ allow(resource).to receive(:content).and_return("flurbleblobbleblooble")
+ allow(resource).to receive(:checksum).and_return(nil)
+ expect(provider.send(:managing_content?)).to be_truthy
end
it "should be true when checksum is set on the content (no matter how crazy)" do
provider.action = :create_if_missing
- resource.stub(:checksum).and_return("1234123234234234")
- resource.stub(:content).and_return(nil)
- expect(provider.send(:managing_content?)).to be_true
+ allow(resource).to receive(:checksum).and_return("1234123234234234")
+ allow(resource).to receive(:content).and_return(nil)
+ expect(provider.send(:managing_content?)).to be_truthy
end
it "should be false when action is create_if_missing" do
provider.action = :create_if_missing
- resource.stub(:content).and_return("flurbleblobbleblooble")
- resource.stub(:checksum).and_return(nil)
- expect(provider.send(:managing_content?)).to be_false
+ allow(resource).to receive(:content).and_return("flurbleblobbleblooble")
+ allow(resource).to receive(:checksum).and_return(nil)
+ expect(provider.send(:managing_content?)).to be_falsey
end
end
end
@@ -757,32 +757,31 @@ shared_examples_for "a file provider with source field" do
context "when testing managing_content?" do
it "should be false when creating a file without content" do
provider.action = :create
- resource.stub(:content).and_return(nil)
- resource.stub(:source).and_return(nil)
- resource.stub(:checksum).and_return(nil)
- expect(provider.send(:managing_content?)).to be_false
+ allow(resource).to receive(:content).and_return(nil)
+ allow(resource).to receive(:source).and_return(nil)
+ allow(resource).to receive(:checksum).and_return(nil)
+ expect(provider.send(:managing_content?)).to be_falsey
end
it "should be true when creating a file with content" do
provider.action = :create
- resource.stub(:content).and_return(nil)
- resource.stub(:source).and_return("http://somewhere.com/something.php")
- resource.stub(:checksum).and_return(nil)
- expect(provider.send(:managing_content?)).to be_true
+ allow(resource).to receive(:content).and_return(nil)
+ allow(resource).to receive(:source).and_return("http://somewhere.com/something.php")
+ allow(resource).to receive(:checksum).and_return(nil)
+ expect(provider.send(:managing_content?)).to be_truthy
end
it "should be true when checksum is set on the content (no matter how crazy)" do
provider.action = :create_if_missing
- resource.stub(:content).and_return(nil)
- resource.stub(:source).and_return(nil)
- resource.stub(:checksum).and_return("1234123234234234")
- expect(provider.send(:managing_content?)).to be_true
+ allow(resource).to receive(:content).and_return(nil)
+ allow(resource).to receive(:source).and_return(nil)
+ allow(resource).to receive(:checksum).and_return("1234123234234234")
+ expect(provider.send(:managing_content?)).to be_truthy
end
it "should be false when action is create_if_missing" do
provider.action = :create_if_missing
- resource.stub(:content).and_return(nil)
- resource.stub(:source).and_return("http://somewhere.com/something.php")
- resource.stub(:checksum).and_return(nil)
- expect(provider.send(:managing_content?)).to be_false
+ allow(resource).to receive(:content).and_return(nil)
+ allow(resource).to receive(:source).and_return("http://somewhere.com/something.php")
+ allow(resource).to receive(:checksum).and_return(nil)
+ expect(provider.send(:managing_content?)).to be_falsey
end
end
end
-
diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb
index 42f948d494..fc7c79ef7d 100644
--- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb
+++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb
@@ -53,39 +53,39 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
supported_useradd_options.each do |attribute, option|
it "should check for differences in #{attribute} between the new and current resources" do
- @current_resource.should_receive(attribute)
- @new_resource.should_receive(attribute)
+ expect(@current_resource).to receive(attribute)
+ expect(@new_resource).to receive(attribute)
provider.universal_options
end
it "should set the option for #{attribute} if the new resources #{attribute} is not nil" do
- @new_resource.stub(attribute).and_return("hola")
- provider.universal_options.should eql([option, 'hola'])
+ allow(@new_resource).to receive(attribute).and_return("hola")
+ expect(provider.universal_options).to eql([option, 'hola'])
end
it "should set the option for #{attribute} if the new resources #{attribute} is not nil, without homedir management" do
- @new_resource.stub(:supports).and_return({:manage_home => false,
+ allow(@new_resource).to receive(:supports).and_return({:manage_home => false,
:non_unique => false})
- @new_resource.stub(attribute).and_return("hola")
- provider.universal_options.should eql([option, 'hola'])
+ allow(@new_resource).to receive(attribute).and_return("hola")
+ expect(provider.universal_options).to eql([option, 'hola'])
end
it "should set the option for #{attribute} if the new resources #{attribute} is not nil, without homedir management (using real attributes)" do
- @new_resource.stub(:manage_home).and_return(false)
- @new_resource.stub(:non_unique).and_return(false)
- @new_resource.stub(:non_unique).and_return(false)
- @new_resource.stub(attribute).and_return("hola")
- provider.universal_options.should eql([option, 'hola'])
+ allow(@new_resource).to receive(:manage_home).and_return(false)
+ allow(@new_resource).to receive(:non_unique).and_return(false)
+ allow(@new_resource).to receive(:non_unique).and_return(false)
+ allow(@new_resource).to receive(attribute).and_return("hola")
+ expect(provider.universal_options).to eql([option, 'hola'])
end
end
it "should combine all the possible options" do
combined_opts = []
supported_useradd_options.sort{ |a,b| a[0] <=> b[0] }.each do |attribute, option|
- @new_resource.stub(attribute).and_return("hola")
+ allow(@new_resource).to receive(attribute).and_return("hola")
combined_opts << option << 'hola'
end
- provider.universal_options.should eql(combined_opts)
+ expect(provider.universal_options).to eql(combined_opts)
end
describe "when we want to create a system user" do
@@ -96,55 +96,55 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
it "should set useradd -r" do
@new_resource.system(true)
- provider.useradd_options.should == [ "-r" ]
+ expect(provider.useradd_options).to eq([ "-r" ])
end
end
describe "when the resource has a different home directory and supports home directory management" do
before do
- @new_resource.stub(:home).and_return("/wowaweea")
- @new_resource.stub(:supports).and_return({:manage_home => true,
+ allow(@new_resource).to receive(:home).and_return("/wowaweea")
+ allow(@new_resource).to receive(:supports).and_return({:manage_home => true,
:non_unique => false})
end
it "should set -m -d /homedir" do
- provider.universal_options.should == %w[-d /wowaweea -m]
- provider.useradd_options.should == []
+ expect(provider.universal_options).to eq(%w[-d /wowaweea -m])
+ expect(provider.useradd_options).to eq([])
end
end
describe "when the resource has a different home directory and supports home directory management (using real attributes)" do
before do
- @new_resource.stub(:home).and_return("/wowaweea")
- @new_resource.stub(:manage_home).and_return(true)
- @new_resource.stub(:non_unique).and_return(false)
+ allow(@new_resource).to receive(:home).and_return("/wowaweea")
+ allow(@new_resource).to receive(:manage_home).and_return(true)
+ allow(@new_resource).to receive(:non_unique).and_return(false)
end
it "should set -m -d /homedir" do
- provider.universal_options.should eql(%w[-d /wowaweea -m])
- provider.useradd_options.should == []
+ expect(provider.universal_options).to eql(%w[-d /wowaweea -m])
+ expect(provider.useradd_options).to eq([])
end
end
describe "when the resource supports non_unique ids" do
before do
- @new_resource.stub(:supports).and_return({:manage_home => false,
+ allow(@new_resource).to receive(:supports).and_return({:manage_home => false,
:non_unique => true})
end
it "should set -m -o" do
- provider.universal_options.should eql([ "-o" ])
+ expect(provider.universal_options).to eql([ "-o" ])
end
end
describe "when the resource supports non_unique ids (using real attributes)" do
before do
- @new_resource.stub(:manage_home).and_return(false)
- @new_resource.stub(:non_unique).and_return(true)
+ allow(@new_resource).to receive(:manage_home).and_return(false)
+ allow(@new_resource).to receive(:non_unique).and_return(true)
end
it "should set -m -o" do
- provider.universal_options.should eql([ "-o" ])
+ expect(provider.universal_options).to eql([ "-o" ])
end
end
end
@@ -169,7 +169,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
"-d", '/Users/mud',
"-m",
"adam" ])
- provider.should_receive(:shell_out!).with(*command).and_return(true)
+ expect(provider).to receive(:shell_out!).with(*command).and_return(true)
provider.create_user
end
@@ -190,7 +190,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
"-u", '1000',
"-r",
"adam" ])
- provider.should_receive(:shell_out!).with(*command).and_return(true)
+ expect(provider).to receive(:shell_out!).with(*command).and_return(true)
provider.create_user
end
@@ -213,7 +213,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
"-d", '/Users/mud',
"-m",
"adam" ]
- provider.should_receive(:shell_out!).with(*command).and_return(true)
+ expect(provider).to receive(:shell_out!).with(*command).and_return(true)
provider.manage_user
end
@@ -224,16 +224,16 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
"-d", '/Users/mud',
"-m",
"adam" ]
- provider.should_receive(:shell_out!).with(*command).and_return(true)
+ expect(provider).to receive(:shell_out!).with(*command).and_return(true)
provider.manage_user
end
it "CHEF-3429: does not set -m if we aren't changing the home directory" do
- provider.should_receive(:updating_home?).and_return(false)
+ expect(provider).to receive(:updating_home?).and_return(false)
command = ["usermod",
"-g", '23',
"adam" ]
- provider.should_receive(:shell_out!).with(*command).and_return(true)
+ expect(provider).to receive(:shell_out!).with(*command).and_return(true)
provider.manage_user
end
end
@@ -241,27 +241,27 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
describe "when removing a user" do
it "should run userdel with the new resources user name" do
- provider.should_receive(:shell_out!).with("userdel", @new_resource.username).and_return(true)
+ expect(provider).to receive(:shell_out!).with("userdel", @new_resource.username).and_return(true)
provider.remove_user
end
it "should run userdel with the new resources user name and -r if manage_home is true" do
@new_resource.supports({ :manage_home => true,
:non_unique => false})
- provider.should_receive(:shell_out!).with("userdel", "-r", @new_resource.username).and_return(true)
+ expect(provider).to receive(:shell_out!).with("userdel", "-r", @new_resource.username).and_return(true)
provider.remove_user
end
it "should run userdel with the new resources user name if non_unique is true" do
@new_resource.supports({ :manage_home => false,
:non_unique => true})
- provider.should_receive(:shell_out!).with("userdel", @new_resource.username).and_return(true)
+ expect(provider).to receive(:shell_out!).with("userdel", @new_resource.username).and_return(true)
provider.remove_user
end
it "should run userdel with the new resources user name and -f if force is true" do
@new_resource.force(true)
- provider.should_receive(:shell_out!).with("userdel", "-f", @new_resource.username).and_return(true)
+ expect(provider).to receive(:shell_out!).with("userdel", "-f", @new_resource.username).and_return(true)
provider.remove_user
end
end
@@ -284,96 +284,96 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
end
it "should return false if status begins with P" do
- provider.should_receive(:shell_out!).
+ expect(provider).to receive(:shell_out!).
with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}).
and_return(passwd_s_status)
- provider.check_lock.should eql(false)
+ expect(provider.check_lock).to eql(false)
end
it "should return false if status begins with N" do
@stdout = "root N"
- provider.should_receive(:shell_out!).
+ expect(provider).to receive(:shell_out!).
with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}).
and_return(passwd_s_status)
- provider.check_lock.should eql(false)
+ expect(provider.check_lock).to eql(false)
end
it "should return true if status begins with L" do
@stdout = "root L"
- provider.should_receive(:shell_out!).
+ expect(provider).to receive(:shell_out!).
with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}).
and_return(passwd_s_status)
- provider.check_lock.should eql(true)
+ expect(provider.check_lock).to eql(true)
end
it "should raise a Chef::Exceptions::User if passwd -S fails on anything other than redhat/centos" do
@node.automatic_attrs[:platform] = 'ubuntu'
- provider.should_receive(:shell_out!).
+ expect(provider).to receive(:shell_out!).
with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}).
and_return(passwd_s_status)
- passwd_s_status.should_receive(:exitstatus).and_return(1)
- lambda { provider.check_lock }.should raise_error(Chef::Exceptions::User)
+ expect(passwd_s_status).to receive(:exitstatus).and_return(1)
+ expect { provider.check_lock }.to raise_error(Chef::Exceptions::User)
end
['redhat', 'centos'].each do |os|
it "should not raise a Chef::Exceptions::User if passwd -S exits with 1 on #{os} and the passwd package is version 0.73-1" do
@node.automatic_attrs[:platform] = os
- passwd_s_status.should_receive(:exitstatus).and_return(1)
- provider.should_receive(:shell_out!).
+ expect(passwd_s_status).to receive(:exitstatus).and_return(1)
+ expect(provider).to receive(:shell_out!).
with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}).
and_return(passwd_s_status)
rpm_status = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "passwd-0.73-1\n", :stderr => "")
- provider.should_receive(:shell_out!).with("rpm -q passwd").and_return(rpm_status)
- lambda { provider.check_lock }.should_not raise_error
+ expect(provider).to receive(:shell_out!).with("rpm -q passwd").and_return(rpm_status)
+ expect { provider.check_lock }.not_to raise_error
end
it "should raise a Chef::Exceptions::User if passwd -S exits with 1 on #{os} and the passwd package is not version 0.73-1" do
@node.automatic_attrs[:platform] = os
- passwd_s_status.should_receive(:exitstatus).and_return(1)
- provider.should_receive(:shell_out!).
+ expect(passwd_s_status).to receive(:exitstatus).and_return(1)
+ expect(provider).to receive(:shell_out!).
with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}).
and_return(passwd_s_status)
rpm_status = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "passwd-0.73-2\n", :stderr => "")
- provider.should_receive(:shell_out!).with("rpm -q passwd").and_return(rpm_status)
- lambda { provider.check_lock }.should raise_error(Chef::Exceptions::User)
+ expect(provider).to receive(:shell_out!).with("rpm -q passwd").and_return(rpm_status)
+ expect { provider.check_lock }.to raise_error(Chef::Exceptions::User)
end
it "should raise a ShellCommandFailed exception if passwd -S exits with something other than 0 or 1 on #{os}" do
@node.automatic_attrs[:platform] = os
- provider.should_receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
- lambda { provider.check_lock }.should raise_error(Mixlib::ShellOut::ShellCommandFailed)
+ expect(provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ expect { provider.check_lock }.to raise_error(Mixlib::ShellOut::ShellCommandFailed)
end
end
context "when in why run mode" do
before do
passwd_status = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => "", :stderr => "passwd: user 'chef-test' does not exist\n")
- provider.should_receive(:shell_out!).
+ expect(provider).to receive(:shell_out!).
with("passwd", "-S", @new_resource.username, {:returns=>[0, 1]}).
and_return(passwd_status)
Chef::Config[:why_run] = true
end
it "should return false if the user does not exist" do
- provider.check_lock.should eql(false)
+ expect(provider.check_lock).to eql(false)
end
it "should not raise an error if the user does not exist" do
- lambda { provider.check_lock }.should_not raise_error
+ expect { provider.check_lock }.not_to raise_error
end
end
end
describe "when locking the user" do
it "should run usermod -L with the new resources username" do
- provider.should_receive(:shell_out!).with("usermod", "-L", @new_resource.username)
+ expect(provider).to receive(:shell_out!).with("usermod", "-L", @new_resource.username)
provider.lock_user
end
end
describe "when unlocking the user" do
it "should run usermod -L with the new resources username" do
- provider.should_receive(:shell_out!).with("usermod", "-U", @new_resource.username)
+ expect(provider).to receive(:shell_out!).with("usermod", "-U", @new_resource.username)
provider.unlock_user
end
end
@@ -411,12 +411,12 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
provider.new_resource.home home_check["new_resource_home"].first
@new_home_mock = double("Pathname")
- Pathname.should_receive(:new).with(@current_resource.home).and_return(@current_home_mock)
- @current_home_mock.should_receive(:cleanpath).and_return(home_check["current_resource_home"].last)
- Pathname.should_receive(:new).with(@new_resource.home).and_return(@new_home_mock)
- @new_home_mock.should_receive(:cleanpath).and_return(home_check["new_resource_home"].last)
+ expect(Pathname).to receive(:new).with(@current_resource.home).and_return(@current_home_mock)
+ expect(@current_home_mock).to receive(:cleanpath).and_return(home_check["current_resource_home"].last)
+ expect(Pathname).to receive(:new).with(@new_resource.home).and_return(@new_home_mock)
+ expect(@new_home_mock).to receive(:cleanpath).and_return(home_check["new_resource_home"].last)
- provider.updating_home?.should == home_check["expected_result"]
+ expect(provider.updating_home?).to eq(home_check["expected_result"])
end
end
it "should return true if the current home does not exist but a home is specified by the new resource" do
@@ -427,7 +427,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
@current_resource.home nil
@new_resource.home "/home/kitten"
- provider.updating_home?.should == true
+ expect(provider.updating_home?).to eq(true)
end
end
end
diff --git a/spec/support/shared/unit/resource/static_provider_resolution.rb b/spec/support/shared/unit/resource/static_provider_resolution.rb
new file mode 100644
index 0000000000..2bc4c70d95
--- /dev/null
+++ b/spec/support/shared/unit/resource/static_provider_resolution.rb
@@ -0,0 +1,66 @@
+#
+# Author:: Lamont Granquist (<lamont@chef.io>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+
+#
+# This is for typical "static" provider resolution which maps resources onto
+# providers based only on the node data. Its not really 'static' because it
+# all goes through the Chef::ProviderResolver, but the effective result is
+# a static mapping for the node (unlike the service resource which is
+# complicated).
+#
+def static_provider_resolution(opts={})
+ action = opts[:action]
+ provider_class = opts[:provider]
+ resource_class = opts[:resource]
+ name = opts[:name]
+ os = opts[:os]
+ platform_family = opts[:platform_family]
+ platform_version = opts[:platform_version]
+
+ describe resource_class, "static provider initialization" do
+ let(:node) {
+ node = Chef::Node.new
+ node.automatic_attrs[:os] = os
+ node.automatic_attrs[:platform_family] = platform_family
+ node.automatic_attrs[:platform_version] = platform_version
+ node
+ }
+ let(:events) { Chef::EventDispatch::Dispatcher.new }
+ let(:run_context) { Chef::RunContext.new(node, {}, events) }
+ let(:resource) { resource_class.new("foo", run_context) }
+
+ it "should return a #{resource_class}" do
+ expect(resource).to be_a_kind_of(resource_class)
+ end
+
+ it "should set the resource_name to #{name}" do
+ expect(resource.resource_name).to eql(name)
+ end
+
+ it "should leave the provider nil" do
+ expect(resource.provider).to eql(nil)
+ end
+
+ it "should resolve to a #{provider_class}" do
+ expect(resource.provider_for_action(action)).to be_a(provider_class)
+ end
+ end
+end
+
diff --git a/spec/support/shared/unit/script_resource.rb b/spec/support/shared/unit/script_resource.rb
index 1137958420..58f7f98f19 100644
--- a/spec/support/shared/unit/script_resource.rb
+++ b/spec/support/shared/unit/script_resource.rb
@@ -26,26 +26,26 @@ shared_examples_for "a script resource" do
end
it "should create a new Chef::Resource::Script" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Script)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Script)
end
it "should have a resource name of :script" do
- @resource.resource_name.should eql(resource_name)
+ expect(@resource.resource_name).to eql(resource_name)
end
it "should set command to the argument provided to new" do
- @resource.command.should eql(resource_instance_name)
+ expect(@resource.command).to eql(resource_instance_name)
end
it "should accept a string for the code" do
@resource.code "hey jude"
- @resource.code.should eql("hey jude")
+ expect(@resource.code).to eql("hey jude")
end
it "should accept a string for the flags" do
@resource.flags "-f"
- @resource.flags.should eql("-f")
+ expect(@resource.flags).to eql("-f")
end
describe "when executing guards" do
@@ -67,23 +67,23 @@ shared_examples_for "a script resource" do
inherited_difference = Chef::Resource::Script.guard_inherited_attributes -
[:cwd, :environment, :group, :path, :user, :umask ]
- inherited_difference.should == []
+ expect(inherited_difference).to eq([])
end
it "when guard_interpreter is set to the default value, the guard command string should be evaluated by command execution and not through a resource" do
- Chef::Resource::Conditional.any_instance.should_not_receive(:evaluate_block)
- Chef::Resource::Conditional.any_instance.should_receive(:evaluate_command).and_return(true)
- Chef::GuardInterpreter::ResourceGuardInterpreter.any_instance.should_not_receive(:evaluate_action)
+ expect_any_instance_of(Chef::Resource::Conditional).not_to receive(:evaluate_block)
+ expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).not_to receive(:evaluate_action)
+ expect_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).to receive(:evaluate).and_return(true)
resource.only_if 'echo hi'
- resource.should_skip?(:run).should == nil
+ expect(resource.should_skip?(:run)).to eq(nil)
end
it "when a valid guard_interpreter resource is specified, a block should be used to evaluate the guard" do
- Chef::GuardInterpreter::DefaultGuardInterpreter.any_instance.should_not_receive(:evaluate)
- Chef::GuardInterpreter::ResourceGuardInterpreter.any_instance.should_receive(:evaluate_action).and_return(true)
+ expect_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).not_to receive(:evaluate)
+ expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(true)
resource.guard_interpreter :script
resource.only_if 'echo hi'
- resource.should_skip?(:run).should == nil
+ expect(resource.should_skip?(:run)).to eq(nil)
end
end
end
diff --git a/spec/support/shared/unit/windows_script_resource.rb b/spec/support/shared/unit/windows_script_resource.rb
index 23dbfbe722..a2fc884ff2 100644
--- a/spec/support/shared/unit/windows_script_resource.rb
+++ b/spec/support/shared/unit/windows_script_resource.rb
@@ -35,12 +35,45 @@ shared_examples_for "a Windows script resource" do
end
it "should be a kind of Chef::Resource::WindowsScript" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::WindowsScript)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::WindowsScript)
end
- context "script" do
- let(:script_resource) { resource_instance }
+ context "when evaluating guards" do
+ it "should have a default_guard_interpreter attribute that is the same as the resource" do
+ expect(@resource.default_guard_interpreter).to eq(@resource.resource_name)
+ end
+
+ it "should default to using guard_interpreter attribute that is the same as the resource" do
+ expect(@resource.guard_interpreter).to eq(@resource.resource_name)
+ end
+
+ it "should use a resource to evaluate the guard when guard_interpreter is not specified" do
+ expect_any_instance_of(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:evaluate_action).and_return(true)
+ expect_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).not_to receive(:evaluate)
+ @resource.only_if 'echo hi'
+ expect(@resource.should_skip?(:run)).to eq(nil)
+ end
+
+ describe "when the guard is given a ruby block" do
+ it "should evaluate the guard if the guard_interpreter is set to its default value" do
+ @resource.only_if { true }
+ expect(@resource.should_skip?(:run)).to eq(nil)
+ end
+
+ it "should raise an exception if the guard_interpreter is overridden from its default value" do
+ @resource.guard_interpreter :bash
+ @resource.only_if { true }
+ expect { @resource.should_skip?(:run) }.to raise_error
+ end
+ end
+ end
+
+ context "script with a default guard interpreter" do
+ let(:script_resource) do
+ resource_instance.guard_interpreter :default
+ resource_instance
+ end
it_should_behave_like "a script resource"
end
diff --git a/spec/unit/api_client/registration_spec.rb b/spec/unit/api_client/registration_spec.rb
index d752429676..d6230afb6a 100644
--- a/spec/unit/api_client/registration_spec.rb
+++ b/spec/unit/api_client/registration_spec.rb
@@ -85,7 +85,7 @@ describe Chef::ApiClient::Registration do
before do
Chef::Config[:validation_client_name] = "test-validator"
Chef::Config[:validation_key] = File.expand_path('ssl/private_key.pem', CHEF_SPEC_DATA)
- OpenSSL::PKey::RSA.stub(:generate).with(2048).and_return(generated_private_key)
+ allow(OpenSSL::PKey::RSA).to receive(:generate).with(2048).and_return(generated_private_key)
end
after do
@@ -93,51 +93,51 @@ describe Chef::ApiClient::Registration do
end
it "has an HTTP client configured with validator credentials" do
- registration.http_api.should be_a_kind_of(Chef::REST)
- registration.http_api.client_name.should == "test-validator"
- registration.http_api.signing_key.should == private_key_data
+ expect(registration.http_api).to be_a_kind_of(Chef::REST)
+ expect(registration.http_api.client_name).to eq("test-validator")
+ expect(registration.http_api.signing_key).to eq(private_key_data)
end
describe "when creating/updating the client on the server" do
before do
- registration.stub(:http_api).and_return(http_mock)
+ allow(registration).to receive(:http_api).and_return(http_mock)
end
it "posts a locally generated public key to the server to create a client" do
- http_mock.should_receive(:post).
+ expect(http_mock).to receive(:post).
with("clients", expected_post_data).
and_return(create_with_pkey_response)
- registration.create_or_update.should == create_with_pkey_response
- registration.private_key.should == generated_private_key_pem
+ expect(registration.create_or_update).to eq(create_with_pkey_response)
+ expect(registration.private_key).to eq(generated_private_key_pem)
end
it "puts a locally generated public key to the server to update a client" do
- http_mock.should_receive(:post).
+ expect(http_mock).to receive(:post).
with("clients", expected_post_data).
and_raise(exception_409)
- http_mock.should_receive(:put).
+ expect(http_mock).to receive(:put).
with("clients/#{client_name}", expected_put_data).
and_return(update_with_pkey_response)
- registration.create_or_update.should == update_with_pkey_response
- registration.private_key.should == generated_private_key_pem
+ expect(registration.create_or_update).to eq(update_with_pkey_response)
+ expect(registration.private_key).to eq(generated_private_key_pem)
end
it "writes the generated private key to disk" do
- http_mock.should_receive(:post).
+ expect(http_mock).to receive(:post).
with("clients", expected_post_data).
and_return(create_with_pkey_response)
registration.run
- IO.read(key_location).should == generated_private_key_pem
+ expect(IO.read(key_location)).to eq(generated_private_key_pem)
end
context "and the client already exists on a Chef 11 server" do
it "requests a new key from the server and saves it" do
- http_mock.should_receive(:post).and_raise(exception_409)
- http_mock.should_receive(:put).
+ expect(http_mock).to receive(:post).and_raise(exception_409)
+ expect(http_mock).to receive(:put).
with("clients/#{client_name}", expected_put_data).
and_return(update_with_pkey_response)
- registration.create_or_update.should == update_with_pkey_response
- registration.private_key.should == generated_private_key_pem
+ expect(registration.create_or_update).to eq(update_with_pkey_response)
+ expect(registration.private_key).to eq(generated_private_key_pem)
end
end
@@ -153,37 +153,37 @@ describe Chef::ApiClient::Registration do
before do
Chef::Config[:local_key_generation] = false
- OpenSSL::PKey::RSA.should_not_receive(:generate)
+ expect(OpenSSL::PKey::RSA).not_to receive(:generate)
end
it "creates a new ApiClient on the server using the validator identity" do
- http_mock.should_receive(:post).
+ expect(http_mock).to receive(:post).
with("clients", expected_post_data).
and_return(server_v10_response)
- registration.create_or_update.should == server_v10_response
- registration.private_key.should == "--begin rsa key etc--"
+ expect(registration.create_or_update).to eq(server_v10_response)
+ expect(registration.private_key).to eq("--begin rsa key etc--")
end
context "and the client already exists on a Chef 11 server" do
it "requests a new key from the server and saves it" do
- http_mock.should_receive(:post).and_raise(exception_409)
- http_mock.should_receive(:put).
+ expect(http_mock).to receive(:post).and_raise(exception_409)
+ expect(http_mock).to receive(:put).
with("clients/#{client_name}", expected_put_data).
and_return(server_v11_response)
- registration.create_or_update.should == server_v11_response
- registration.private_key.should == "--begin rsa key etc--"
+ expect(registration.create_or_update).to eq(server_v11_response)
+ expect(registration.private_key).to eq("--begin rsa key etc--")
end
end
context "and the client already exists on a Chef 10 server" do
it "requests a new key from the server and saves it" do
- http_mock.should_receive(:post).with("clients", expected_post_data).
+ expect(http_mock).to receive(:post).with("clients", expected_post_data).
and_raise(exception_409)
- http_mock.should_receive(:put).
+ expect(http_mock).to receive(:put).
with("clients/#{client_name}", expected_put_data).
and_return(server_v10_response)
- registration.create_or_update.should == server_v10_response
- registration.private_key.should == "--begin rsa key etc--"
+ expect(registration.create_or_update).to eq(server_v10_response)
+ expect(registration.private_key).to eq("--begin rsa key etc--")
end
end
end
@@ -191,60 +191,82 @@ describe Chef::ApiClient::Registration do
describe "when writing the private key to disk" do
before do
- registration.stub(:private_key).and_return('--begin rsa key etc--')
+ allow(registration).to receive(:private_key).and_return('--begin rsa key etc--')
end
# Permission read via File.stat is busted on windows, though creating the
# file with 0600 has the desired effect of giving access rights to the
# owner only. A platform-specific functional test would be helpful.
it "creates the file with 0600 permissions", :unix_only do
- File.should_not exist(key_location)
+ expect(File).not_to exist(key_location)
registration.write_key
- File.should exist(key_location)
+ expect(File).to exist(key_location)
stat = File.stat(key_location)
- (stat.mode & 07777).should == 0600
+ expect(stat.mode & 07777).to eq(0600)
end
it "writes the private key content to the file" do
registration.write_key
- IO.read(key_location).should == "--begin rsa key etc--"
+ expect(IO.read(key_location)).to eq("--begin rsa key etc--")
+ end
+
+ context 'when the client key location is a symlink' do
+ it 'does not follow the symlink', :unix_only do
+ expected_flags = (File::CREAT|File::TRUNC|File::RDWR)
+
+ if defined?(File::NOFOLLOW)
+ expected_flags |= File::NOFOLLOW
+ end
+
+ expect(registration.file_flags).to eq(expected_flags)
+ end
+
+ context 'with follow_client_key_symlink set to true' do
+ before do
+ Chef::Config[:follow_client_key_symlink] = true
+ end
+
+ it 'follows the symlink', :unix_only do
+ expect(registration.file_flags).to eq(File::CREAT|File::TRUNC|File::RDWR)
+ end
+ end
end
end
describe "when registering a client" do
before do
- registration.stub(:http_api).and_return(http_mock)
+ allow(registration).to receive(:http_api).and_return(http_mock)
end
it "creates the client on the server and writes the key" do
- http_mock.should_receive(:post).ordered.and_return(server_v10_response)
+ expect(http_mock).to receive(:post).ordered.and_return(server_v10_response)
registration.run
- IO.read(key_location).should == generated_private_key_pem
+ expect(IO.read(key_location)).to eq(generated_private_key_pem)
end
it "retries up to 5 times" do
response_500 = Net::HTTPInternalServerError.new("1.1", "500", "Internal Server Error")
exception_500 = Net::HTTPFatalError.new("500 Internal Server Error", response_500)
- http_mock.should_receive(:post).ordered.and_raise(exception_500) # 1
- http_mock.should_receive(:post).ordered.and_raise(exception_500) # 2
- http_mock.should_receive(:post).ordered.and_raise(exception_500) # 3
- http_mock.should_receive(:post).ordered.and_raise(exception_500) # 4
- http_mock.should_receive(:post).ordered.and_raise(exception_500) # 5
+ expect(http_mock).to receive(:post).ordered.and_raise(exception_500) # 1
+ expect(http_mock).to receive(:post).ordered.and_raise(exception_500) # 2
+ expect(http_mock).to receive(:post).ordered.and_raise(exception_500) # 3
+ expect(http_mock).to receive(:post).ordered.and_raise(exception_500) # 4
+ expect(http_mock).to receive(:post).ordered.and_raise(exception_500) # 5
- http_mock.should_receive(:post).ordered.and_return(server_v10_response)
+ expect(http_mock).to receive(:post).ordered.and_return(server_v10_response)
registration.run
- IO.read(key_location).should == generated_private_key_pem
+ expect(IO.read(key_location)).to eq(generated_private_key_pem)
end
it "gives up retrying after the max attempts" do
response_500 = Net::HTTPInternalServerError.new("1.1", "500", "Internal Server Error")
exception_500 = Net::HTTPFatalError.new("500 Internal Server Error", response_500)
- http_mock.should_receive(:post).exactly(6).times.and_raise(exception_500)
+ expect(http_mock).to receive(:post).exactly(6).times.and_raise(exception_500)
- lambda {registration.run}.should raise_error(Net::HTTPFatalError)
+ expect {registration.run}.to raise_error(Net::HTTPFatalError)
end
end
diff --git a/spec/unit/api_client_spec.rb b/spec/unit/api_client_spec.rb
index bd6c5ef7fd..7f8687e2b9 100644
--- a/spec/unit/api_client_spec.rb
+++ b/spec/unit/api_client_spec.rb
@@ -28,64 +28,64 @@ describe Chef::ApiClient do
it "has a name attribute" do
@client.name("ops_master")
- @client.name.should == "ops_master"
+ expect(@client.name).to eq("ops_master")
end
it "does not allow spaces in the name" do
- lambda { @client.name "ops master" }.should raise_error(ArgumentError)
+ expect { @client.name "ops master" }.to raise_error(ArgumentError)
end
it "only allows string values for the name" do
- lambda { @client.name Hash.new }.should raise_error(ArgumentError)
+ expect { @client.name Hash.new }.to raise_error(ArgumentError)
end
it "has an admin flag attribute" do
@client.admin(true)
- @client.admin.should be_true
+ expect(@client.admin).to be_truthy
end
it "defaults to non-admin" do
- @client.admin.should be_false
+ expect(@client.admin).to be_falsey
end
it "allows only boolean values for the admin flag" do
- lambda { @client.admin(false) }.should_not raise_error
- lambda { @client.admin(Hash.new) }.should raise_error(ArgumentError)
+ expect { @client.admin(false) }.not_to raise_error
+ expect { @client.admin(Hash.new) }.to raise_error(ArgumentError)
end
it "has a 'validator' flag attribute" do
@client.validator(true)
- @client.validator.should be_true
+ expect(@client.validator).to be_truthy
end
it "defaults to non-validator" do
- @client.validator.should be_false
+ expect(@client.validator).to be_falsey
end
it "allows only boolean values for the 'validator' flag" do
- lambda { @client.validator(false) }.should_not raise_error
- lambda { @client.validator(Hash.new) }.should raise_error(ArgumentError)
+ expect { @client.validator(false) }.not_to raise_error
+ expect { @client.validator(Hash.new) }.to raise_error(ArgumentError)
end
it "has a public key attribute" do
@client.public_key("super public")
- @client.public_key.should == "super public"
+ expect(@client.public_key).to eq("super public")
end
it "accepts only String values for the public key" do
- lambda { @client.public_key "" }.should_not raise_error
- lambda { @client.public_key Hash.new }.should raise_error(ArgumentError)
+ expect { @client.public_key "" }.not_to raise_error
+ expect { @client.public_key Hash.new }.to raise_error(ArgumentError)
end
it "has a private key attribute" do
@client.private_key("super private")
- @client.private_key.should == "super private"
+ expect(@client.private_key).to eq("super private")
end
it "accepts only String values for the private key" do
- lambda { @client.private_key "" }.should_not raise_error
- lambda { @client.private_key Hash.new }.should raise_error(ArgumentError)
+ expect { @client.private_key "" }.not_to raise_error
+ expect { @client.private_key Hash.new }.to raise_error(ArgumentError)
end
describe "when serializing to JSON" do
@@ -96,32 +96,32 @@ describe Chef::ApiClient do
end
it "serializes as a JSON object" do
- @json.should match(/^\{.+\}$/)
+ expect(@json).to match(/^\{.+\}$/)
end
it "includes the name value" do
- @json.should include(%q{"name":"black"})
+ expect(@json).to include(%q{"name":"black"})
end
it "includes the public key value" do
- @json.should include(%{"public_key":"crowes"})
+ expect(@json).to include(%{"public_key":"crowes"})
end
it "includes the 'admin' flag" do
- @json.should include(%q{"admin":false})
+ expect(@json).to include(%q{"admin":false})
end
it "includes the 'validator' flag" do
- @json.should include(%q{"validator":false})
+ expect(@json).to include(%q{"validator":false})
end
it "includes the private key when present" do
@client.private_key("monkeypants")
- @client.to_json.should include(%q{"private_key":"monkeypants"})
+ expect(@client.to_json).to include(%q{"private_key":"monkeypants"})
end
it "does not include the private key if not present" do
- @json.should_not include("private_key")
+ expect(@json).not_to include("private_key")
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
@@ -143,27 +143,27 @@ describe Chef::ApiClient do
end
it "should deserialize to a Chef::ApiClient object" do
- @client.should be_a_kind_of(Chef::ApiClient)
+ expect(@client).to be_a_kind_of(Chef::ApiClient)
end
it "preserves the name" do
- @client.name.should == "black"
+ expect(@client.name).to eq("black")
end
it "preserves the public key" do
- @client.public_key.should == "crowes"
+ expect(@client.public_key).to eq("crowes")
end
it "preserves the admin status" do
- @client.admin.should be_true
+ expect(@client.admin).to be_truthy
end
it "preserves the 'validator' status" do
- @client.validator.should be_true
+ expect(@client.validator).to be_truthy
end
it "includes the private key if present" do
- @client.private_key.should == "monkeypants"
+ expect(@client.private_key).to eq("monkeypants")
end
end
@@ -183,33 +183,33 @@ describe Chef::ApiClient do
"json_class" => "Chef::ApiClient"
}
@http_client = double("Chef::REST mock")
- Chef::REST.stub(:new).and_return(@http_client)
- @http_client.should_receive(:get).with("clients/black").and_return(client)
+ allow(Chef::REST).to receive(:new).and_return(@http_client)
+ expect(@http_client).to receive(:get).with("clients/black").and_return(client)
@client = Chef::ApiClient.load(client['name'])
end
it "should deserialize to a Chef::ApiClient object" do
- @client.should be_a_kind_of(Chef::ApiClient)
+ expect(@client).to be_a_kind_of(Chef::ApiClient)
end
it "preserves the name" do
- @client.name.should == "black"
+ expect(@client.name).to eq("black")
end
it "preserves the public key" do
- @client.public_key.should == "crowes"
+ expect(@client.public_key).to eq("crowes")
end
it "preserves the admin status" do
- @client.admin.should be_a_kind_of(TrueClass)
+ expect(@client.admin).to be_a_kind_of(TrueClass)
end
it "preserves the 'validator' status" do
- @client.validator.should be_a_kind_of(TrueClass)
+ expect(@client.validator).to be_a_kind_of(TrueClass)
end
it "includes the private key if present" do
- @client.private_key.should == "monkeypants"
+ expect(@client.private_key).to eq("monkeypants")
end
end
@@ -230,9 +230,9 @@ describe Chef::ApiClient do
end
it "has an HTTP client configured with default credentials" do
- @client.http_api.should be_a_kind_of(Chef::REST)
- @client.http_api.client_name.should == "silent-bob"
- @client.http_api.signing_key.to_s.should == private_key_data
+ expect(@client.http_api).to be_a_kind_of(Chef::REST)
+ expect(@client.http_api.client_name).to eq("silent-bob")
+ expect(@client.http_api.signing_key.to_s).to eq(private_key_data)
end
end
@@ -240,7 +240,7 @@ describe Chef::ApiClient do
describe "when requesting a new key" do
before do
@http_client = double("Chef::REST mock")
- Chef::REST.stub(:new).and_return(@http_client)
+ allow(Chef::REST).to receive(:new).and_return(@http_client)
end
context "and the client does not exist on the server" do
@@ -248,11 +248,11 @@ describe Chef::ApiClient do
@a_404_response = Net::HTTPNotFound.new("404 not found and such", nil, nil)
@a_404_exception = Net::HTTPServerException.new("404 not found exception", @a_404_response)
- @http_client.should_receive(:get).with("clients/lost-my-key").and_raise(@a_404_exception)
+ expect(@http_client).to receive(:get).with("clients/lost-my-key").and_raise(@a_404_exception)
end
it "raises a 404 error" do
- lambda { Chef::ApiClient.reregister("lost-my-key") }.should raise_error(Net::HTTPServerException)
+ expect { Chef::ApiClient.reregister("lost-my-key") }.to raise_error(Net::HTTPServerException)
end
end
@@ -260,7 +260,7 @@ describe Chef::ApiClient do
before do
@api_client_without_key = Chef::ApiClient.new
@api_client_without_key.name("lost-my-key")
- @http_client.should_receive(:get).with("clients/lost-my-key").and_return(@api_client_without_key)
+ expect(@http_client).to receive(:get).with("clients/lost-my-key").and_return(@api_client_without_key)
end
@@ -269,7 +269,7 @@ describe Chef::ApiClient do
@api_client_with_key = Chef::ApiClient.new
@api_client_with_key.name("lost-my-key")
@api_client_with_key.private_key("the new private key")
- @http_client.should_receive(:put).
+ expect(@http_client).to receive(:put).
with("clients/lost-my-key", :name => "lost-my-key", :admin => false, :validator => false, :private_key => true).
and_return(@api_client_with_key)
end
@@ -277,17 +277,17 @@ describe Chef::ApiClient do
it "returns an ApiClient with a private key" do
response = Chef::ApiClient.reregister("lost-my-key")
# no sane == method for ApiClient :'(
- response.should == @api_client_without_key
- response.private_key.should == "the new private key"
- response.name.should == "lost-my-key"
- response.admin.should be_false
+ expect(response).to eq(@api_client_without_key)
+ expect(response.private_key).to eq("the new private key")
+ expect(response.name).to eq("lost-my-key")
+ expect(response.admin).to be_falsey
end
end
context "and the client exists on a Chef 10-like server" do
before do
@api_client_with_key = {"name" => "lost-my-key", "private_key" => "the new private key"}
- @http_client.should_receive(:put).
+ expect(@http_client).to receive(:put).
with("clients/lost-my-key", :name => "lost-my-key", :admin => false, :validator => false, :private_key => true).
and_return(@api_client_with_key)
end
@@ -295,11 +295,11 @@ describe Chef::ApiClient do
it "returns an ApiClient with a private key" do
response = Chef::ApiClient.reregister("lost-my-key")
# no sane == method for ApiClient :'(
- response.should == @api_client_without_key
- response.private_key.should == "the new private key"
- response.name.should == "lost-my-key"
- response.admin.should be_false
- response.validator.should be_false
+ expect(response).to eq(@api_client_without_key)
+ expect(response.private_key).to eq("the new private key")
+ expect(response.name).to eq("lost-my-key")
+ expect(response.admin).to be_falsey
+ expect(response.validator).to be_falsey
end
end
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb
index e29c038340..5a6366281f 100644
--- a/spec/unit/application/apply_spec.rb
+++ b/spec/unit/application/apply_spec.rb
@@ -21,7 +21,7 @@ describe Chef::Application::Apply do
before do
@app = Chef::Application::Apply.new
- @app.stub(:configure_logging).and_return(true)
+ allow(@app).to receive(:configure_logging).and_return(true)
@recipe_text = "package 'nyancat'"
Chef::Config[:solo] = true
end
@@ -29,7 +29,7 @@ describe Chef::Application::Apply do
describe "configuring the application" do
it "should set solo mode to true" do
@app.reconfigure
- Chef::Config[:solo].should be_true
+ expect(Chef::Config[:solo]).to be_truthy
end
end
describe "read_recipe_file" do
@@ -37,30 +37,30 @@ describe Chef::Application::Apply do
@recipe_file_name = "foo.rb"
@recipe_path = File.expand_path(@recipe_file_name)
@recipe_file = double("Tempfile (mock)", :read => @recipe_text)
- @app.stub(:open).with(@recipe_path).and_return(@recipe_file)
- File.stub(:exist?).with(@recipe_path).and_return(true)
- Chef::Application.stub(:fatal!).and_return(true)
+ allow(@app).to receive(:open).with(@recipe_path).and_return(@recipe_file)
+ allow(File).to receive(:exist?).with(@recipe_path).and_return(true)
+ allow(Chef::Application).to receive(:fatal!).and_return(true)
end
it "should read text properly" do
- @app.read_recipe_file(@recipe_file_name)[0].should == @recipe_text
+ expect(@app.read_recipe_file(@recipe_file_name)[0]).to eq(@recipe_text)
end
it "should return a file_handle" do
- @app.read_recipe_file(@recipe_file_name)[1].should be_instance_of(RSpec::Mocks::Mock)
+ expect(@app.read_recipe_file(@recipe_file_name)[1]).to be_instance_of(RSpec::Mocks::Double)
end
describe "when recipe is nil" do
it "should raise a fatal with the missing filename message" do
- Chef::Application.should_receive(:fatal!).with("No recipe file was provided", 1)
+ expect(Chef::Application).to receive(:fatal!).with("No recipe file was provided", 1)
@app.read_recipe_file(nil)
end
end
describe "when recipe doesn't exist" do
before do
- File.stub(:exist?).with(@recipe_path).and_return(false)
+ allow(File).to receive(:exist?).with(@recipe_path).and_return(false)
end
it "should raise a fatal with the file doesn't exist message" do
- Chef::Application.should_receive(:fatal!).with(/^No file exists at/, 1)
+ expect(Chef::Application).to receive(:fatal!).with(/^No file exists at/, 1)
@app.read_recipe_file(@recipe_file_name)
end
end
@@ -72,13 +72,13 @@ describe Chef::Application::Apply do
@recipe_fh = @app.instance_variable_get(:@recipe_fh)
end
it "should open a tempfile" do
- @recipe_fh.path.should match(/.*recipe-temporary-file.*/)
+ expect(@recipe_fh.path).to match(/.*recipe-temporary-file.*/)
end
it "should write recipe text to the tempfile" do
- @recipe_fh.read.should == @recipe_text
+ expect(@recipe_fh.read).to eq(@recipe_text)
end
it "should save the filename for later use" do
- @recipe_fh.path.should == @app.instance_variable_get(:@recipe_filename)
+ expect(@recipe_fh.path).to eq(@app.instance_variable_get(:@recipe_filename))
end
end
describe "recipe_file_arg" do
@@ -86,8 +86,8 @@ describe Chef::Application::Apply do
ARGV.clear
end
it "should exit and log message" do
- Chef::Log.should_receive(:debug).with(/^No recipe file provided/)
- lambda { @app.run }.should raise_error(SystemExit) { |e| e.status.should == 1 }
+ expect(Chef::Log).to receive(:debug).with(/^No recipe file provided/)
+ expect { @app.run }.to raise_error(SystemExit) { |e| expect(e.status).to eq(1) }
end
end
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb
index ee91e67256..38e051e269 100644
--- a/spec/unit/application/client_spec.rb
+++ b/spec/unit/application/client_spec.rb
@@ -19,16 +19,16 @@ require 'spec_helper'
describe Chef::Application::Client, "reconfigure" do
before do
- Kernel.stub(:trap).and_return(:ok)
+ allow(Kernel).to receive(:trap).and_return(:ok)
@original_argv = ARGV.dup
ARGV.clear
@app = Chef::Application::Client.new
- @app.stub(:trap)
- @app.stub(:configure_opt_parser).and_return(true)
- @app.stub(:configure_chef).and_return(true)
- @app.stub(:configure_logging).and_return(true)
+ allow(@app).to receive(:trap)
+ allow(@app).to receive(:configure_opt_parser).and_return(true)
+ allow(@app).to receive(:configure_chef).and_return(true)
+ allow(@app).to receive(:configure_logging).and_return(true)
@app.cli_arguments = []
Chef::Config[:interval] = 10
@@ -53,7 +53,7 @@ describe Chef::Application::Client, "reconfigure" do
end
it "should terminate with message" do
- Chef::Application.should_receive(:fatal!).with(
+ expect(Chef::Application).to receive(:fatal!).with(
"Unforked chef-client interval runs are disabled in Chef 12.
Configuration settings:
interval = 600 seconds
@@ -71,7 +71,7 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
it "should reconfigure chef-client" do
@app.reconfigure
- Chef::Config[:interval].should be_nil
+ expect(Chef::Config[:interval]).to be_nil
end
end
end
@@ -84,7 +84,7 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
it "should set the interval to 1800" do
@app.reconfigure
- Chef::Config.interval.should == 1800
+ expect(Chef::Config.interval).to eq(1800)
end
end
@@ -98,12 +98,12 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
it "ignores the splay" do
@app.reconfigure
- Chef::Config.splay.should be_nil
+ expect(Chef::Config.splay).to be_nil
end
it "forces the interval to nil" do
@app.reconfigure
- Chef::Config.interval.should be_nil
+ expect(Chef::Config.interval).to be_nil
end
end
@@ -116,13 +116,13 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
before do
Chef::Config[:json_attribs] = json_source
- Chef::ConfigFetcher.should_receive(:new).with(json_source).
+ expect(Chef::ConfigFetcher).to receive(:new).with(json_source).
and_return(config_fetcher)
end
it "reads the JSON attributes from the specified source" do
@app.reconfigure
- @app.chef_client_json.should == json_attribs
+ expect(@app.chef_client_json).to eq(json_attribs)
end
end
end
@@ -131,13 +131,13 @@ describe Chef::Application::Client, "setup_application" do
before do
@app = Chef::Application::Client.new
# this is all stuff the reconfigure method needs
- @app.stub(:configure_opt_parser).and_return(true)
- @app.stub(:configure_chef).and_return(true)
- @app.stub(:configure_logging).and_return(true)
+ allow(@app).to receive(:configure_opt_parser).and_return(true)
+ allow(@app).to receive(:configure_chef).and_return(true)
+ allow(@app).to receive(:configure_logging).and_return(true)
end
it "should change privileges" do
- Chef::Daemon.should_receive(:change_privilege).and_return(true)
+ expect(Chef::Daemon).to receive(:change_privilege).and_return(true)
@app.setup_application
end
after do
@@ -159,9 +159,9 @@ describe Chef::Application::Client, "configure_chef" do
it "should set the colored output to false by default on windows and true otherwise" do
if windows?
- Chef::Config[:color].should be_false
+ expect(Chef::Config[:color]).to be_falsey
else
- Chef::Config[:color].should be_true
+ expect(Chef::Config[:color]).to be_truthy
end
end
end
@@ -177,8 +177,8 @@ describe Chef::Application::Client, "run_application", :unix_only do
@pipe = IO.pipe
@client = Chef::Client.new
- Chef::Client.stub(:new).and_return(@client)
- @client.stub(:run) do
+ allow(Chef::Client).to receive(:new).and_return(@client)
+ allow(@client).to receive(:run) do
@pipe[1].puts 'started'
sleep 1
@pipe[1].puts 'finished'
@@ -189,7 +189,7 @@ describe Chef::Application::Client, "run_application", :unix_only do
context "when converging in forked process" do
before do
Chef::Config[:daemonize] = true
- Chef::Daemon.stub(:daemonize).and_return(true)
+ allow(Chef::Daemon).to receive(:daemonize).and_return(true)
end
it "should exit hard with exitstatus 3" do
@@ -198,19 +198,19 @@ describe Chef::Application::Client, "run_application", :unix_only do
end
Process.kill("TERM", pid)
_pid, result = Process.waitpid2(pid)
- result.exitstatus.should == 3
+ expect(result.exitstatus).to eq(3)
end
it "should allow child to finish converging" do
pid = fork do
@app.run_application
end
- @pipe[0].gets.should == "started\n"
+ expect(@pipe[0].gets).to eq("started\n")
Process.kill("TERM", pid)
Process.wait
sleep 1 # Make sure we give the converging child process enough time to finish
- IO.select([@pipe[0]], nil, nil, 0).should_not be_nil
- @pipe[0].gets.should == "finished\n"
+ expect(IO.select([@pipe[0]], nil, nil, 0)).not_to be_nil
+ expect(@pipe[0].gets).to eq("finished\n")
end
end
@@ -224,12 +224,12 @@ describe Chef::Application::Client, "run_application", :unix_only do
pid = fork do
@app.run_application
end
- @pipe[0].gets.should == "started\n"
+ expect(@pipe[0].gets).to eq("started\n")
Process.kill("TERM", pid)
_pid, result = Process.waitpid2(pid)
- result.exitstatus.should == 0
- IO.select([@pipe[0]], nil, nil, 0).should_not be_nil
- @pipe[0].gets.should == "finished\n"
+ expect(result.exitstatus).to eq(0)
+ expect(IO.select([@pipe[0]], nil, nil, 0)).not_to be_nil
+ expect(@pipe[0].gets).to eq("finished\n")
end
it "should exit hard when sent before converge" do
@@ -239,7 +239,7 @@ describe Chef::Application::Client, "run_application", :unix_only do
end
Process.kill("TERM", pid)
_pid, result = Process.waitpid2(pid)
- result.exitstatus.should == 3
+ expect(result.exitstatus).to eq(3)
end
end
end
@@ -255,7 +255,7 @@ describe Chef::Application::Client, "run_application", :unix_only do
# Chef::Log.init($stderr)
# Chef::Log.level = :debug
- @app.stub(:run_chef_client) do
+ allow(@app).to receive(:run_chef_client) do
run_count += 1
if run_count > 3
@@ -277,7 +277,7 @@ describe Chef::Application::Client, "run_application", :unix_only do
# We have to do it this way because the main loop of
# Chef::Application::Client swallows most exceptions, and we need to be
# able to expose our expectation failures to the parent process in the test.
- @app.stub(:interval_sleep) do |arg|
+ allow(@app).to receive(:interval_sleep) do |arg|
number_of_sleep_calls += 1
if number_of_sleep_calls > 1
exit 127
@@ -286,12 +286,12 @@ describe Chef::Application::Client, "run_application", :unix_only do
end
it "shouldn't sleep when sent USR1" do
- @app.stub(:interval_sleep).with(0).and_call_original
+ allow(@app).to receive(:interval_sleep).with(0).and_call_original
pid = fork do
@app.run_application
end
_pid, result = Process.waitpid2(pid)
- result.exitstatus.should == 0
+ expect(result.exitstatus).to eq(0)
end
end
end
diff --git a/spec/unit/application/knife_spec.rb b/spec/unit/application/knife_spec.rb
index 0933d7e178..806a596a61 100644
--- a/spec/unit/application/knife_spec.rb
+++ b/spec/unit/application/knife_spec.rb
@@ -35,66 +35,66 @@ describe Chef::Application::Knife do
before(:each) do
# Prevent code from getting loaded on every test invocation.
- Chef::Knife.stub(:load_commands)
+ allow(Chef::Knife).to receive(:load_commands)
@knife = Chef::Application::Knife.new
- @knife.stub(:puts)
- @knife.stub(:trap)
- Chef::Knife.stub(:list_commands)
+ allow(@knife).to receive(:puts)
+ allow(@knife).to receive(:trap)
+ allow(Chef::Knife).to receive(:list_commands)
end
it "should exit 1 and print the options if no arguments are given at all" do
with_argv([]) do
- lambda { @knife.run }.should raise_error(SystemExit) { |e| e.status.should == 1 }
+ expect { @knife.run }.to raise_error(SystemExit) { |e| expect(e.status).to eq(1) }
end
end
it "should exit 2 if run without a sub command" do
with_argv("--user", "adam") do
- Chef::Log.should_receive(:error).with(/you need to pass a sub\-command/i)
- lambda { @knife.run }.should raise_error(SystemExit) { |e| e.status.should == 2 }
+ expect(Chef::Log).to receive(:error).with(/you need to pass a sub\-command/i)
+ expect { @knife.run }.to raise_error(SystemExit) { |e| expect(e.status).to eq(2) }
end
end
it "should run a sub command with the applications command line option prototype" do
with_argv(*%w{noop knife command with some args}) do
knife = double(Chef::Knife)
- Chef::Knife.should_receive(:run).with(ARGV, @knife.options).and_return(knife)
- @knife.should_receive(:exit).with(0)
+ expect(Chef::Knife).to receive(:run).with(ARGV, @knife.options).and_return(knife)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
end
it "should set the colored output to false by default on windows and true otherwise" do
with_argv(*%w{noop knife command}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
if windows?
- Chef::Config[:color].should be_false
+ expect(Chef::Config[:color]).to be_falsey
else
- Chef::Config[:color].should be_true
+ expect(Chef::Config[:color]).to be_truthy
end
end
describe "when given a path to the client key" do
it "expands a relative path relative to the CWD" do
relative_path = '.chef/client.pem'
- Dir.stub(:pwd).and_return(CHEF_SPEC_DATA)
+ allow(Dir).to receive(:pwd).and_return(CHEF_SPEC_DATA)
with_argv(*%W{noop knife command -k #{relative_path}}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:client_key].should == File.join(CHEF_SPEC_DATA, relative_path)
+ expect(Chef::Config[:client_key]).to eq(File.join(CHEF_SPEC_DATA, relative_path))
end
it "expands a ~/home/path to the correct full path" do
home_path = '~/.chef/client.pem'
with_argv(*%W{noop knife command -k #{home_path}}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:client_key].should == File.join(ENV['HOME'], '.chef/client.pem').gsub((File::ALT_SEPARATOR || '\\'), File::SEPARATOR)
+ expect(Chef::Config[:client_key]).to eq(File.join(ENV['HOME'], '.chef/client.pem').gsub((File::ALT_SEPARATOR || '\\'), File::SEPARATOR))
end
it "does not expand a full path" do
@@ -104,10 +104,10 @@ describe Chef::Application::Knife do
'/etc/chef/client.pem'
end
with_argv(*%W{noop knife command -k #{full_path}}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:client_key].should == full_path
+ expect(Chef::Config[:client_key]).to eq(full_path)
end
end
@@ -119,52 +119,52 @@ describe Chef::Application::Knife do
it "should default to no environment" do
with_argv(*%w{noop knife command}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:environment].should == nil
+ expect(Chef::Config[:environment]).to eq(nil)
end
it "should load the environment from the config file" do
config_file = File.join(CHEF_SPEC_DATA,"environment-config.rb")
with_argv(*%W{noop knife command -c #{config_file}}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:environment].should == 'production'
+ expect(Chef::Config[:environment]).to eq('production')
end
it "should load the environment from the CLI options" do
with_argv(*%W{noop knife command -E development}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:environment].should == 'development'
+ expect(Chef::Config[:environment]).to eq('development')
end
it "should override the config file environment with the CLI environment" do
config_file = File.join(CHEF_SPEC_DATA,"environment-config.rb")
with_argv(*%W{noop knife command -c #{config_file} -E override}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:environment].should == 'override'
+ expect(Chef::Config[:environment]).to eq('override')
end
it "should override the config file environment with the CLI environment regardless of order" do
config_file = File.join(CHEF_SPEC_DATA,"environment-config.rb")
with_argv(*%W{noop knife command -E override -c #{config_file}}) do
- @knife.should_receive(:exit).with(0)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
- Chef::Config[:environment].should == 'override'
+ expect(Chef::Config[:environment]).to eq('override')
end
it "should run a sub command with the applications command line option prototype" do
with_argv(*%w{noop knife command with some args}) do
knife = double(Chef::Knife)
- Chef::Knife.should_receive(:run).with(ARGV, @knife.options).and_return(knife)
- @knife.should_receive(:exit).with(0)
+ expect(Chef::Knife).to receive(:run).with(ARGV, @knife.options).and_return(knife)
+ expect(@knife).to receive(:exit).with(0)
@knife.run
end
end
diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb
index e29fcc9367..80f0bead8b 100644
--- a/spec/unit/application/solo_spec.rb
+++ b/spec/unit/application/solo_spec.rb
@@ -19,12 +19,12 @@ require 'spec_helper'
describe Chef::Application::Solo do
before do
- Kernel.stub(:trap).and_return(:ok)
+ allow(Kernel).to receive(:trap).and_return(:ok)
@app = Chef::Application::Solo.new
- @app.stub(:configure_opt_parser).and_return(true)
- @app.stub(:configure_chef).and_return(true)
- @app.stub(:configure_logging).and_return(true)
- @app.stub(:trap)
+ allow(@app).to receive(:configure_opt_parser).and_return(true)
+ allow(@app).to receive(:configure_chef).and_return(true)
+ allow(@app).to receive(:configure_logging).and_return(true)
+ allow(@app).to receive(:trap)
Chef::Config[:recipe_url] = false
Chef::Config[:json_attribs] = false
Chef::Config[:solo] = true
@@ -33,7 +33,7 @@ describe Chef::Application::Solo do
describe "configuring the application" do
it "should set solo mode to true" do
@app.reconfigure
- Chef::Config[:solo].should be_true
+ expect(Chef::Config[:solo]).to be_truthy
end
describe "when configured to not fork the client process" do
@@ -50,7 +50,7 @@ describe Chef::Application::Solo do
end
it "should terminate with message" do
- Chef::Application.should_receive(:fatal!).with(
+ expect(Chef::Application).to receive(:fatal!).with(
"Unforked chef-client interval runs are disabled in Chef 12.
Configuration settings:
interval = 600 seconds
@@ -69,7 +69,7 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
it "should set the interval to 1800" do
Chef::Config[:interval] = nil
@app.reconfigure
- Chef::Config[:interval].should == 1800
+ expect(Chef::Config[:interval]).to eq(1800)
end
end
@@ -80,13 +80,13 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
before do
Chef::Config[:json_attribs] = json_source
- Chef::ConfigFetcher.should_receive(:new).with(json_source).
+ expect(Chef::ConfigFetcher).to receive(:new).with(json_source).
and_return(config_fetcher)
end
it "reads the JSON attributes from the specified source" do
@app.reconfigure
- @app.chef_client_json.should == json_attribs
+ expect(@app.chef_client_json).to eq(json_attribs)
end
end
@@ -94,33 +94,34 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
before do
Chef::Config[:cookbook_path] = "#{Dir.tmpdir}/chef-solo/cookbooks"
Chef::Config[:recipe_url] = "http://junglist.gen.nz/recipes.tgz"
- FileUtils.stub(:mkdir_p).and_return(true)
+ allow(FileUtils).to receive(:rm_rf).and_return(true)
+ allow(FileUtils).to receive(:mkdir_p).and_return(true)
@tarfile = StringIO.new("remote_tarball_content")
- @app.stub(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile)
+ allow(@app).to receive(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile)
@target_file = StringIO.new
- File.stub(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(@target_file)
+ allow(File).to receive(:open).with("#{Dir.tmpdir}/chef-solo/recipes.tgz", "wb").and_yield(@target_file)
- Chef::Mixin::Command.stub(:run_command).and_return(true)
+ allow(Chef::Mixin::Command).to receive(:run_command).and_return(true)
end
it "should create the recipes path based on the parent of the cookbook path" do
- FileUtils.should_receive(:mkdir_p).with("#{Dir.tmpdir}/chef-solo").and_return(true)
+ expect(FileUtils).to receive(:mkdir_p).with("#{Dir.tmpdir}/chef-solo").and_return(true)
@app.reconfigure
end
it "should download the recipes" do
- @app.should_receive(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile)
+ expect(@app).to receive(:open).with("http://junglist.gen.nz/recipes.tgz").and_yield(@tarfile)
@app.reconfigure
end
it "should write the recipes to the target path" do
@app.reconfigure
- @target_file.string.should == "remote_tarball_content"
+ expect(@target_file.string).to eq("remote_tarball_content")
end
it "should untar the target file to the parent of the cookbook path" do
- Chef::Mixin::Command.should_receive(:run_command).with({:command => "tar zxvf #{Dir.tmpdir}/chef-solo/recipes.tgz -C #{Dir.tmpdir}/chef-solo"}).and_return(true)
+ expect(Chef::Mixin::Command).to receive(:run_command).with({:command => "tar zxvf #{Dir.tmpdir}/chef-solo/recipes.tgz -C #{Dir.tmpdir}/chef-solo"}).and_return(true)
@app.reconfigure
end
end
@@ -135,13 +136,14 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
Chef::Config[:json_attribs] = json_source
Chef::Config[:recipe_url] = "http://icanhas.cheezburger.com/lolcats"
Chef::Config[:cookbook_path] = "#{Dir.tmpdir}/chef-solo/cookbooks"
- FileUtils.stub(:mkdir_p).and_return(true)
- Chef::Mixin::Command.stub(:run_command).and_return(true)
+ allow(FileUtils).to receive(:rm_rf).and_return(true)
+ allow(FileUtils).to receive(:mkdir_p).and_return(true)
+ allow(Chef::Mixin::Command).to receive(:run_command).and_return(true)
end
it "should fetch the recipe_url first" do
- @app.should_receive(:fetch_recipe_tarball).ordered
- Chef::ConfigFetcher.should_receive(:new).ordered.and_return(config_fetcher)
+ expect(@app).to receive(:fetch_recipe_tarball).ordered
+ expect(Chef::ConfigFetcher).to receive(:new).ordered.and_return(config_fetcher)
@app.reconfigure
end
end
@@ -150,18 +152,18 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config
before do
Chef::Config[:solo] = true
- Chef::Daemon.stub(:change_privilege)
+ allow(Chef::Daemon).to receive(:change_privilege)
@chef_client = double("Chef::Client")
- Chef::Client.stub(:new).and_return(@chef_client)
+ allow(Chef::Client).to receive(:new).and_return(@chef_client)
@app = Chef::Application::Solo.new
# this is all stuff the reconfigure method needs
- @app.stub(:configure_opt_parser).and_return(true)
- @app.stub(:configure_chef).and_return(true)
- @app.stub(:configure_logging).and_return(true)
+ allow(@app).to receive(:configure_opt_parser).and_return(true)
+ allow(@app).to receive(:configure_chef).and_return(true)
+ allow(@app).to receive(:configure_logging).and_return(true)
end
it "should change privileges" do
- Chef::Daemon.should_receive(:change_privilege).and_return(true)
+ expect(Chef::Daemon).to receive(:change_privilege).and_return(true)
@app.setup_application
end
end
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index b7b69c6993..210f875fbe 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -24,9 +24,9 @@ describe Chef::Application do
ARGV.clear
Chef::Log.logger = Logger.new(StringIO.new)
@app = Chef::Application.new
- @app.stub(:trap)
- Dir.stub(:chdir).and_return(0)
- @app.stub(:reconfigure)
+ allow(@app).to receive(:trap)
+ allow(Dir).to receive(:chdir).and_return(0)
+ allow(@app).to receive(:reconfigure)
Chef::Log.init(STDERR)
end
@@ -37,23 +37,23 @@ describe Chef::Application do
describe "reconfigure" do
before do
@app = Chef::Application.new
- @app.stub(:configure_chef).and_return(true)
- @app.stub(:configure_logging).and_return(true)
- @app.stub(:configure_proxy_environment_variables).and_return(true)
+ allow(@app).to receive(:configure_chef).and_return(true)
+ allow(@app).to receive(:configure_logging).and_return(true)
+ allow(@app).to receive(:configure_proxy_environment_variables).and_return(true)
end
it "should configure chef" do
- @app.should_receive(:configure_chef).and_return(true)
+ expect(@app).to receive(:configure_chef).and_return(true)
@app.reconfigure
end
it "should configure logging" do
- @app.should_receive(:configure_logging).and_return(true)
+ expect(@app).to receive(:configure_logging).and_return(true)
@app.reconfigure
end
it "should configure environment variables" do
- @app.should_receive(:configure_proxy_environment_variables).and_return(true)
+ expect(@app).to receive(:configure_proxy_environment_variables).and_return(true)
@app.reconfigure
end
end
@@ -65,24 +65,24 @@ describe Chef::Application do
describe "run" do
before do
- @app.stub(:setup_application).and_return(true)
- @app.stub(:run_application).and_return(true)
- @app.stub(:configure_chef).and_return(true)
- @app.stub(:configure_logging).and_return(true)
+ allow(@app).to receive(:setup_application).and_return(true)
+ allow(@app).to receive(:run_application).and_return(true)
+ allow(@app).to receive(:configure_chef).and_return(true)
+ allow(@app).to receive(:configure_logging).and_return(true)
end
it "should reconfigure the application before running" do
- @app.should_receive(:reconfigure).and_return(true)
+ expect(@app).to receive(:reconfigure).and_return(true)
@app.run
end
it "should setup the application before running it" do
- @app.should_receive(:setup_application).and_return(true)
+ expect(@app).to receive(:setup_application).and_return(true)
@app.run
end
it "should run the actual application" do
- @app.should_receive(:run_application).and_return(true)
+ expect(@app).to receive(:run_application).and_return(true)
@app.run
end
end
@@ -91,15 +91,15 @@ describe Chef::Application do
describe "configure_chef" do
before do
# Silence warnings when no config file exists
- Chef::Log.stub(:warn)
+ allow(Chef::Log).to receive(:warn)
@app = Chef::Application.new
#Chef::Config.stub(:merge!).and_return(true)
- @app.stub(:parse_options).and_return(true)
+ allow(@app).to receive(:parse_options).and_return(true)
end
it "should parse the commandline options" do
- @app.should_receive(:parse_options).and_return(true)
+ expect(@app).to receive(:parse_options).and_return(true)
@app.config[:config_file] = "/etc/chef/default.rb" #have a config file set, to prevent triggering error block
@app.configure_chef
end
@@ -110,7 +110,7 @@ describe Chef::Application do
let(:config_location_pathname) do
p = Pathname.new(config_location)
- p.stub(:realpath).and_return(config_location)
+ allow(p).to receive(:realpath).and_return(config_location)
p
end
@@ -119,21 +119,21 @@ describe Chef::Application do
# force let binding to get evaluated or else we stub Pathname.new before we try to use it.
config_location_pathname
- Pathname.stub(:new).with(config_location).and_return(config_location_pathname)
- File.should_receive(:read).
+ allow(Pathname).to receive(:new).with(config_location).and_return(config_location_pathname)
+ expect(File).to receive(:read).
with(config_location).
and_return(config_content)
end
it "should configure chef::config from a file" do
- Chef::Config.should_receive(:from_string).with(config_content, config_location)
+ expect(Chef::Config).to receive(:from_string).with(config_content, config_location)
@app.configure_chef
end
it "should merge the local config hash into chef::config" do
#File.should_receive(:open).with("/etc/chef/default.rb").and_yield(@config_file)
@app.configure_chef
- Chef::Config.rspec_ran.should == "true"
+ expect(Chef::Config.rspec_ran).to eq("true")
end
end
@@ -144,8 +144,8 @@ describe Chef::Application do
end
it "should emit a warning" do
- Chef::Config.should_not_receive(:from_file).with("/etc/chef/default.rb")
- Chef::Log.should_receive(:warn).with("No config file found or specified on command line, using command line options.")
+ expect(Chef::Config).not_to receive(:from_file).with("/etc/chef/default.rb")
+ expect(Chef::Log).to receive(:warn).with("No config file found or specified on command line, using command line options.")
@app.configure_chef
end
end
@@ -155,7 +155,7 @@ describe Chef::Application do
@app.config[:config_file] = "/etc/chef/notfound"
end
it "should use the passed in command line options and defaults" do
- Chef::Config.should_receive(:merge!)
+ expect(Chef::Config).to receive(:merge!)
@app.configure_chef
end
end
@@ -164,33 +164,33 @@ describe Chef::Application do
describe "when configuring the logger" do
before do
@app = Chef::Application.new
- Chef::Log.stub(:init)
+ allow(Chef::Log).to receive(:init)
end
it "should initialise the chef logger" do
- Chef::Log.stub(:level=)
+ allow(Chef::Log).to receive(:level=)
@monologger = double("Monologger")
- MonoLogger.should_receive(:new).with(Chef::Config[:log_location]).and_return(@monologger)
- Chef::Log.should_receive(:init).with(@monologger)
+ expect(MonoLogger).to receive(:new).with(Chef::Config[:log_location]).and_return(@monologger)
+ expect(Chef::Log).to receive(:init).with(@monologger)
@app.configure_logging
end
it "should raise fatals if log location is invalid" do
Chef::Config[:log_location] = "/tmp/non-existing-dir/logfile"
- Chef::Log.should_receive(:fatal).at_least(:once)
- Process.should_receive(:exit)
+ expect(Chef::Log).to receive(:fatal).at_least(:once)
+ expect(Process).to receive(:exit)
@app.configure_logging
end
shared_examples_for "log_level_is_auto" do
context "when STDOUT is to a tty" do
before do
- STDOUT.stub(:tty?).and_return(true)
+ allow(STDOUT).to receive(:tty?).and_return(true)
end
it "configures the log level to :warn" do
@app.configure_logging
- Chef::Log.level.should == :warn
+ expect(Chef::Log.level).to eq(:warn)
end
context "when force_logger is configured" do
@@ -200,19 +200,19 @@ describe Chef::Application do
it "configures the log level to info" do
@app.configure_logging
- Chef::Log.level.should == :info
+ expect(Chef::Log.level).to eq(:info)
end
end
end
context "when STDOUT is not to a tty" do
before do
- STDOUT.stub(:tty?).and_return(false)
+ allow(STDOUT).to receive(:tty?).and_return(false)
end
it "configures the log level to :info" do
@app.configure_logging
- Chef::Log.level.should == :info
+ expect(Chef::Log.level).to eq(:info)
end
context "when force_formatter is configured" do
@@ -221,7 +221,7 @@ describe Chef::Application do
end
it "sets the log level to :warn" do
@app.configure_logging
- Chef::Log.level.should == :warn
+ expect(Chef::Log.level).to eq(:warn)
end
end
end
@@ -242,10 +242,10 @@ describe Chef::Application do
describe "when configuring environment variables" do
def configure_proxy_environment_variables_stubs
- @app.stub(:configure_http_proxy).and_return(true)
- @app.stub(:configure_https_proxy).and_return(true)
- @app.stub(:configure_ftp_proxy).and_return(true)
- @app.stub(:configure_no_proxy).and_return(true)
+ allow(@app).to receive(:configure_http_proxy).and_return(true)
+ allow(@app).to receive(:configure_https_proxy).and_return(true)
+ allow(@app).to receive(:configure_ftp_proxy).and_return(true)
+ allow(@app).to receive(:configure_no_proxy).and_return(true)
end
shared_examples_for "setting ENV['http_proxy']" do
@@ -255,12 +255,12 @@ describe Chef::Application do
it "should set ENV['http_proxy']" do
@app.configure_proxy_environment_variables
- @env['http_proxy'].should == "#{scheme}://#{address}:#{port}"
+ expect(@env['http_proxy']).to eq("#{scheme}://#{address}:#{port}")
end
it "should set ENV['HTTP_PROXY']" do
@app.configure_proxy_environment_variables
- @env['HTTP_PROXY'].should == "#{scheme}://#{address}:#{port}"
+ expect(@env['HTTP_PROXY']).to eq("#{scheme}://#{address}:#{port}")
end
describe "when Chef::Config[:http_proxy_user] is set" do
@@ -270,8 +270,8 @@ describe Chef::Application do
it "should set ENV['http_proxy'] with the username" do
@app.configure_proxy_environment_variables
- @env['http_proxy'].should == "#{scheme}://username@#{address}:#{port}"
- @env['HTTP_PROXY'].should == "#{scheme}://username@#{address}:#{port}"
+ expect(@env['http_proxy']).to eq("#{scheme}://username@#{address}:#{port}")
+ expect(@env['HTTP_PROXY']).to eq("#{scheme}://username@#{address}:#{port}")
end
context "when :http_proxy_user contains '@' and/or ':'" do
@@ -281,8 +281,8 @@ describe Chef::Application do
it "should set ENV['http_proxy'] with the escaped username" do
@app.configure_proxy_environment_variables
- @env['http_proxy'].should == "#{scheme}://my%3Ausern%40me@#{address}:#{port}"
- @env['HTTP_PROXY'].should == "#{scheme}://my%3Ausern%40me@#{address}:#{port}"
+ expect(@env['http_proxy']).to eq("#{scheme}://my%3Ausern%40me@#{address}:#{port}")
+ expect(@env['HTTP_PROXY']).to eq("#{scheme}://my%3Ausern%40me@#{address}:#{port}")
end
end
@@ -293,8 +293,8 @@ describe Chef::Application do
it "should set ENV['http_proxy'] with the password" do
@app.configure_proxy_environment_variables
- @env['http_proxy'].should == "#{scheme}://username:password@#{address}:#{port}"
- @env['HTTP_PROXY'].should == "#{scheme}://username:password@#{address}:#{port}"
+ expect(@env['http_proxy']).to eq("#{scheme}://username:password@#{address}:#{port}")
+ expect(@env['HTTP_PROXY']).to eq("#{scheme}://username:password@#{address}:#{port}")
end
context "when :http_proxy_pass contains '@' and/or ':'" do
@@ -304,8 +304,8 @@ describe Chef::Application do
it "should set ENV['http_proxy'] with the escaped password" do
@app.configure_proxy_environment_variables
- @env['http_proxy'].should == "#{scheme}://username:%3AP%40ssword101@#{address}:#{port}"
- @env['HTTP_PROXY'].should == "#{scheme}://username:%3AP%40ssword101@#{address}:#{port}"
+ expect(@env['http_proxy']).to eq("#{scheme}://username:%3AP%40ssword101@#{address}:#{port}")
+ expect(@env['HTTP_PROXY']).to eq("#{scheme}://username:%3AP%40ssword101@#{address}:#{port}")
end
end
end
@@ -319,8 +319,8 @@ describe Chef::Application do
it "should set ENV['http_proxy']" do
@app.configure_proxy_environment_variables
- @env['http_proxy'].should == "#{scheme}://#{address}:#{port}"
- @env['HTTP_PROXY'].should == "#{scheme}://#{address}:#{port}"
+ expect(@env['http_proxy']).to eq("#{scheme}://#{address}:#{port}")
+ expect(@env['HTTP_PROXY']).to eq("#{scheme}://#{address}:#{port}")
end
end
end
@@ -328,11 +328,11 @@ describe Chef::Application do
describe "when configuring ENV['http_proxy']" do
before do
@env = {}
- @app.stub(:env).and_return(@env)
+ allow(@app).to receive(:env).and_return(@env)
- @app.stub(:configure_https_proxy).and_return(true)
- @app.stub(:configure_ftp_proxy).and_return(true)
- @app.stub(:configure_no_proxy).and_return(true)
+ allow(@app).to receive(:configure_https_proxy).and_return(true)
+ allow(@app).to receive(:configure_ftp_proxy).and_return(true)
+ allow(@app).to receive(:configure_no_proxy).and_return(true)
end
describe "when Chef::Config[:http_proxy] is not set" do
@@ -342,7 +342,7 @@ describe Chef::Application do
it "should not set ENV['http_proxy']" do
@app.configure_proxy_environment_variables
- @env.should == {}
+ expect(@env).to eq({})
end
end
@@ -401,7 +401,7 @@ describe Chef::Application do
it "should set ENV['http_proxy']" do
@app.configure_proxy_environment_variables
- @env['http_proxy'].should == Chef::Config[:http_proxy]
+ expect(@env['http_proxy']).to eq(Chef::Config[:http_proxy])
end
end
@@ -417,26 +417,26 @@ describe Chef::Application do
describe "class method: fatal!" do
before do
- STDERR.stub(:puts).with("FATAL: blah").and_return(true)
- Chef::Log.stub(:fatal).and_return(true)
- Process.stub(:exit).and_return(true)
+ allow(STDERR).to receive(:puts).with("FATAL: blah").and_return(true)
+ allow(Chef::Log).to receive(:fatal).and_return(true)
+ allow(Process).to receive(:exit).and_return(true)
end
it "should log an error message to the logger" do
- Chef::Log.should_receive(:fatal).with("blah").and_return(true)
+ expect(Chef::Log).to receive(:fatal).with("blah").and_return(true)
Chef::Application.fatal! "blah"
end
describe "when an exit code is supplied" do
it "should exit with the given exit code" do
- Process.should_receive(:exit).with(-100).and_return(true)
+ expect(Process).to receive(:exit).with(-100).and_return(true)
Chef::Application.fatal! "blah", -100
end
end
describe "when an exit code is not supplied" do
it "should exit with the default exit code" do
- Process.should_receive(:exit).with(-1).and_return(true)
+ expect(Process).to receive(:exit).with(-1).and_return(true)
Chef::Application.fatal! "blah"
end
end
@@ -449,7 +449,7 @@ describe Chef::Application do
end
it "should raise an error" do
- lambda { @app.setup_application }.should raise_error(Chef::Exceptions::Application)
+ expect { @app.setup_application }.to raise_error(Chef::Exceptions::Application)
end
end
@@ -459,7 +459,7 @@ describe Chef::Application do
end
it "should raise an error" do
- lambda { @app.run_application }.should raise_error(Chef::Exceptions::Application)
+ expect { @app.run_application }.to raise_error(Chef::Exceptions::Application)
end
end
@@ -467,22 +467,22 @@ describe Chef::Application do
it "should warn for bad config file path" do
@app.config[:config_file] = "/tmp/non-existing-dir/file"
config_file_regexp = Regexp.new @app.config[:config_file]
- Chef::Log.should_receive(:warn).at_least(:once).with(config_file_regexp).and_return(true)
- Chef::Log.stub(:warn).and_return(true)
+ expect(Chef::Log).to receive(:warn).at_least(:once).with(config_file_regexp).and_return(true)
+ allow(Chef::Log).to receive(:warn).and_return(true)
@app.configure_chef
end
end
describe "configuration errors" do
before do
- Process.should_receive(:exit)
+ expect(Process).to receive(:exit)
end
def raises_informative_fatals_on_configure_chef
config_file_regexp = Regexp.new @app.config[:config_file]
- Chef::Log.should_receive(:fatal).
+ expect(Chef::Log).to receive(:fatal).
with(/Configuration error/)
- Chef::Log.should_receive(:fatal).
+ expect(Chef::Log).to receive(:fatal).
with(config_file_regexp).
at_least(1).times
@app.configure_chef
diff --git a/spec/unit/chef_fs/data_handler/group_handler_spec.rb b/spec/unit/chef_fs/data_handler/group_handler_spec.rb
new file mode 100644
index 0000000000..5f14646602
--- /dev/null
+++ b/spec/unit/chef_fs/data_handler/group_handler_spec.rb
@@ -0,0 +1,63 @@
+#
+# Author:: Ryan Cragun (<ryan@getchef.com>)
+# Copyright:: Copyright (c) 2014 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'lib/chef/chef_fs/data_handler/group_data_handler'
+
+class TestEntry < Mash
+ attr_accessor :name, :org
+
+ def initialize(name, org)
+ @name = name
+ @org = org
+ end
+end
+
+describe Chef::ChefFS::DataHandler::GroupDataHandler do
+ describe '#normalize_for_post' do
+ let(:entry) do
+ TestEntry.new('workers.json', 'hive')
+ end
+
+ let(:group) do
+ { 'name' => 'worker_bees',
+ 'clients' => %w(honey sting),
+ 'users' => %w(fizz buzz),
+ 'actors' => %w(honey)
+ }
+ end
+
+ let(:normalized) do
+ { 'actors' =>
+ { 'users' => %w(fizz buzz),
+ 'clients'=> %w(honey sting),
+ 'groups'=> []
+ },
+ 'groupname' => 'workers',
+ 'name' => 'worker_bees',
+ 'orgname' => 'hive'
+ }
+ end
+
+ let(:handler) { described_class.new }
+
+ it 'normalizes the users, clients and groups into actors' do
+ expect(handler.normalize_for_post(group, entry)).to eq(normalized)
+ end
+ end
+end
diff --git a/spec/unit/chef_fs/diff_spec.rb b/spec/unit/chef_fs/diff_spec.rb
index 2133d05139..71605393f3 100644
--- a/spec/unit/chef_fs/diff_spec.rb
+++ b/spec/unit/chef_fs/diff_spec.rb
@@ -91,7 +91,7 @@ describe 'diff', :uses_diff => true do
Chef::ChefFS::CommandLine.diff_print(pattern('/'), a, b, nil, nil) do |diff|
results << remove_os_differences(diff)
end
- results.should =~ [
+ expect(results).to match_array([
'diff --knife a/both_dirs/sub_both_files_different b/both_dirs/sub_both_files_different
--- a/both_dirs/sub_both_files_different DATE
+++ b/both_dirs/sub_both_files_different DATE
@@ -160,14 +160,14 @@ new file
+++ b/b_only_file DATE
CONTEXT_LINE_NUMBERS
+b_only_file
-' ]
+' ])
end
it 'Chef::ChefFS::CommandLine.diff_print(/both_dirs)' do
results = []
Chef::ChefFS::CommandLine.diff_print(pattern('/both_dirs'), a, b, nil, nil) do |diff|
results << remove_os_differences(diff)
end
- results.should =~ [
+ expect(results).to match_array([
'diff --knife a/both_dirs/sub_both_files_different b/both_dirs/sub_both_files_different
--- a/both_dirs/sub_both_files_different DATE
+++ b/both_dirs/sub_both_files_different DATE
@@ -202,14 +202,14 @@ new file
+++ b/both_dirs/sub_b_only_file DATE
CONTEXT_LINE_NUMBERS
+sub_b_only_file
-' ]
+' ])
end
it 'Chef::ChefFS::CommandLine.diff_print(/) with depth 1' do
results = []
Chef::ChefFS::CommandLine.diff_print(pattern('/'), a, b, 1, nil) do |diff|
results << remove_os_differences(diff)
end
- results.should =~ [
+ expect(results).to match_array([
'Common subdirectories: b/both_dirs
','diff --knife a/both_files_different b/both_files_different
--- a/both_files_different DATE
@@ -236,14 +236,14 @@ new file
+++ b/b_only_file DATE
CONTEXT_LINE_NUMBERS
+b_only_file
-' ]
+' ])
end
it 'Chef::ChefFS::CommandLine.diff_print(/*_*) with depth 0' do
results = []
Chef::ChefFS::CommandLine.diff_print(pattern('/*_*'), a, b, 0, nil) do |diff|
results << remove_os_differences(diff)
end
- results.should =~ [
+ expect(results).to match_array([
'Common subdirectories: b/both_dirs
','diff --knife a/both_files_different b/both_files_different
--- a/both_files_different DATE
@@ -270,14 +270,14 @@ new file
+++ b/b_only_file DATE
CONTEXT_LINE_NUMBERS
+b_only_file
-' ]
+' ])
end
it 'Chef::ChefFS::CommandLine.diff_print(/) in name-only mode' do
results = []
Chef::ChefFS::CommandLine.diff_print(pattern('/'), a, b, nil, :name_only) do |diff|
results << remove_os_differences(diff)
end
- results.should =~ [
+ expect(results).to match_array([
"b/both_dirs/sub_both_files_different\n",
"b/both_dirs/sub_dirs_empty_in_b_filled_in_a/subsub\n",
"b/both_dirs/sub_dirs_empty_in_a_filled_in_b/subsub\n",
@@ -296,14 +296,14 @@ CONTEXT_LINE_NUMBERS
"b/b_only_file\n",
"b/dir_in_a_file_in_b\n",
"b/file_in_a_dir_in_b\n"
- ]
+ ])
end
it 'Chef::ChefFS::CommandLine.diff_print(/) in name-status mode' do
results = []
Chef::ChefFS::CommandLine.diff_print(pattern('/'), a, b, nil, :name_status) do |diff|
results << remove_os_differences(diff)
end
- results.should =~ [
+ expect(results).to match_array([
"M\tb/both_dirs/sub_both_files_different\n",
"D\tb/both_dirs/sub_dirs_empty_in_b_filled_in_a/subsub\n",
"A\tb/both_dirs/sub_dirs_empty_in_a_filled_in_b/subsub\n",
@@ -322,7 +322,7 @@ CONTEXT_LINE_NUMBERS
"A\tb/b_only_file\n",
"T\tb/dir_in_a_file_in_b\n",
"T\tb/file_in_a_dir_in_b\n"
- ]
+ ])
end
end
end
diff --git a/spec/unit/chef_fs/file_pattern_spec.rb b/spec/unit/chef_fs/file_pattern_spec.rb
index bac393a054..cdf506225a 100644
--- a/spec/unit/chef_fs/file_pattern_spec.rb
+++ b/spec/unit/chef_fs/file_pattern_spec.rb
@@ -28,466 +28,465 @@ describe Chef::ChefFS::FilePattern do
context 'with empty pattern ""' do
let(:pattern) { Chef::ChefFS::FilePattern.new('') }
it 'match?' do
- pattern.match?('').should be_true
- pattern.match?('/').should be_false
- pattern.match?('a').should be_false
- pattern.match?('a/b').should be_false
+ expect(pattern.match?('')).to be_truthy
+ expect(pattern.match?('/')).to be_falsey
+ expect(pattern.match?('a')).to be_falsey
+ expect(pattern.match?('a/b')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should == ''
+ expect(pattern.exact_path).to eq('')
end
it 'could_match_children?' do
- pattern.could_match_children?('').should be_false
- pattern.could_match_children?('a/b').should be_false
+ expect(pattern.could_match_children?('')).to be_falsey
+ expect(pattern.could_match_children?('a/b')).to be_falsey
end
end
context 'with root pattern "/"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/') }
it 'match?' do
- pattern.match?('/').should be_true
- pattern.match?('').should be_false
- pattern.match?('a').should be_false
- pattern.match?('/a').should be_false
+ expect(pattern.match?('/')).to be_truthy
+ expect(pattern.match?('')).to be_falsey
+ expect(pattern.match?('a')).to be_falsey
+ expect(pattern.match?('/a')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should == '/'
+ expect(pattern.exact_path).to eq('/')
end
it 'could_match_children?' do
- pattern.could_match_children?('').should be_false
- pattern.could_match_children?('/').should be_false
- pattern.could_match_children?('a').should be_false
- pattern.could_match_children?('a/b').should be_false
- pattern.could_match_children?('/a').should be_false
+ expect(pattern.could_match_children?('')).to be_falsey
+ expect(pattern.could_match_children?('/')).to be_falsey
+ expect(pattern.could_match_children?('a')).to be_falsey
+ expect(pattern.could_match_children?('a/b')).to be_falsey
+ expect(pattern.could_match_children?('/a')).to be_falsey
end
end
context 'with simple pattern "abc"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('abc') }
it 'match?' do
- pattern.match?('abc').should be_true
- pattern.match?('a').should be_false
- pattern.match?('abcd').should be_false
- pattern.match?('/abc').should be_false
- pattern.match?('').should be_false
- pattern.match?('/').should be_false
+ expect(pattern.match?('abc')).to be_truthy
+ expect(pattern.match?('a')).to be_falsey
+ expect(pattern.match?('abcd')).to be_falsey
+ expect(pattern.match?('/abc')).to be_falsey
+ expect(pattern.match?('')).to be_falsey
+ expect(pattern.match?('/')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should == 'abc'
+ expect(pattern.exact_path).to eq('abc')
end
it 'could_match_children?' do
- pattern.could_match_children?('').should be_false
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/abc').should be_false
+ expect(pattern.could_match_children?('')).to be_falsey
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/abc')).to be_falsey
end
end
context 'with simple pattern "/abc"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc') }
it 'match?' do
- pattern.match?('/abc').should be_true
- pattern.match?('abc').should be_false
- pattern.match?('a').should be_false
- pattern.match?('abcd').should be_false
- pattern.match?('').should be_false
- pattern.match?('/').should be_false
+ expect(pattern.match?('/abc')).to be_truthy
+ expect(pattern.match?('abc')).to be_falsey
+ expect(pattern.match?('a')).to be_falsey
+ expect(pattern.match?('abcd')).to be_falsey
+ expect(pattern.match?('')).to be_falsey
+ expect(pattern.match?('/')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should == '/abc'
+ expect(pattern.exact_path).to eq('/abc')
end
it 'could_match_children?' do
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/abc').should be_false
- pattern.could_match_children?('/').should be_true
- pattern.could_match_children?('').should be_false
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/abc')).to be_falsey
+ expect(pattern.could_match_children?('/')).to be_truthy
+ expect(pattern.could_match_children?('')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
end
end
context 'with simple pattern "abc/def/ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('abc/def/ghi') }
it 'match?' do
- pattern.match?('abc/def/ghi').should be_true
- pattern.match?('/abc/def/ghi').should be_false
- pattern.match?('abc').should be_false
- pattern.match?('abc/def').should be_false
+ expect(pattern.match?('abc/def/ghi')).to be_truthy
+ expect(pattern.match?('/abc/def/ghi')).to be_falsey
+ expect(pattern.match?('abc')).to be_falsey
+ expect(pattern.match?('abc/def')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should == 'abc/def/ghi'
+ expect(pattern.exact_path).to eq('abc/def/ghi')
end
it 'could_match_children?' do
- pattern.could_match_children?('abc').should be_true
- pattern.could_match_children?('xyz').should be_false
- pattern.could_match_children?('/abc').should be_false
- pattern.could_match_children?('abc/def').should be_true
- pattern.could_match_children?('abc/xyz').should be_false
- pattern.could_match_children?('abc/def/ghi').should be_false
+ expect(pattern.could_match_children?('abc')).to be_truthy
+ expect(pattern.could_match_children?('xyz')).to be_falsey
+ expect(pattern.could_match_children?('/abc')).to be_falsey
+ expect(pattern.could_match_children?('abc/def')).to be_truthy
+ expect(pattern.could_match_children?('abc/xyz')).to be_falsey
+ expect(pattern.could_match_children?('abc/def/ghi')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('abc').should == 'def'
- pattern.exact_child_name_under('abc/def').should == 'ghi'
+ expect(pattern.exact_child_name_under('abc')).to eq('def')
+ expect(pattern.exact_child_name_under('abc/def')).to eq('ghi')
end
end
context 'with simple pattern "/abc/def/ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc/def/ghi') }
it 'match?' do
- pattern.match?('/abc/def/ghi').should be_true
- pattern.match?('abc/def/ghi').should be_false
- pattern.match?('/abc').should be_false
- pattern.match?('/abc/def').should be_false
+ expect(pattern.match?('/abc/def/ghi')).to be_truthy
+ expect(pattern.match?('abc/def/ghi')).to be_falsey
+ expect(pattern.match?('/abc')).to be_falsey
+ expect(pattern.match?('/abc/def')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should == '/abc/def/ghi'
+ expect(pattern.exact_path).to eq('/abc/def/ghi')
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/xyz').should be_false
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/abc/def').should be_true
- pattern.could_match_children?('/abc/xyz').should be_false
- pattern.could_match_children?('/abc/def/ghi').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/xyz')).to be_falsey
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/abc/def')).to be_truthy
+ expect(pattern.could_match_children?('/abc/xyz')).to be_falsey
+ expect(pattern.could_match_children?('/abc/def/ghi')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
- pattern.exact_child_name_under('/abc').should == 'def'
- pattern.exact_child_name_under('/abc/def').should == 'ghi'
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
+ expect(pattern.exact_child_name_under('/abc')).to eq('def')
+ expect(pattern.exact_child_name_under('/abc/def')).to eq('ghi')
end
end
context 'with simple pattern "a\*\b"', :pending => (Chef::Platform.windows?) do
let(:pattern) { Chef::ChefFS::FilePattern.new('a\*\b') }
it 'match?' do
- pattern.match?('a*b').should be_true
- pattern.match?('ab').should be_false
- pattern.match?('acb').should be_false
- pattern.match?('ab').should be_false
+ expect(pattern.match?('a*b')).to be_truthy
+ expect(pattern.match?('ab')).to be_falsey
+ expect(pattern.match?('acb')).to be_falsey
+ expect(pattern.match?('ab')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should == 'a*b'
+ expect(pattern.exact_path).to eq('a*b')
end
it 'could_match_children?' do
- pattern.could_match_children?('a/*b').should be_false
+ expect(pattern.could_match_children?('a/*b')).to be_falsey
end
end
context 'with star pattern "/abc/*/ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc/*/ghi') }
it 'match?' do
- pattern.match?('/abc/def/ghi').should be_true
- pattern.match?('/abc/ghi').should be_false
+ expect(pattern.match?('/abc/def/ghi')).to be_truthy
+ expect(pattern.match?('/abc/ghi')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/xyz').should be_false
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/abc/def').should be_true
- pattern.could_match_children?('/abc/xyz').should be_true
- pattern.could_match_children?('/abc/def/ghi').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/xyz')).to be_falsey
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/abc/def')).to be_truthy
+ expect(pattern.could_match_children?('/abc/xyz')).to be_truthy
+ expect(pattern.could_match_children?('/abc/def/ghi')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
- pattern.exact_child_name_under('/abc').should == nil
- pattern.exact_child_name_under('/abc/def').should == 'ghi'
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
+ expect(pattern.exact_child_name_under('/abc')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc/def')).to eq('ghi')
end
end
context 'with star pattern "/abc/d*f/ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc/d*f/ghi') }
it 'match?' do
- pattern.match?('/abc/def/ghi').should be_true
- pattern.match?('/abc/dxf/ghi').should be_true
- pattern.match?('/abc/df/ghi').should be_true
- pattern.match?('/abc/dxyzf/ghi').should be_true
- pattern.match?('/abc/d/ghi').should be_false
- pattern.match?('/abc/f/ghi').should be_false
- pattern.match?('/abc/ghi').should be_false
- pattern.match?('/abc/xyz/ghi').should be_false
+ expect(pattern.match?('/abc/def/ghi')).to be_truthy
+ expect(pattern.match?('/abc/dxf/ghi')).to be_truthy
+ expect(pattern.match?('/abc/df/ghi')).to be_truthy
+ expect(pattern.match?('/abc/dxyzf/ghi')).to be_truthy
+ expect(pattern.match?('/abc/d/ghi')).to be_falsey
+ expect(pattern.match?('/abc/f/ghi')).to be_falsey
+ expect(pattern.match?('/abc/ghi')).to be_falsey
+ expect(pattern.match?('/abc/xyz/ghi')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/xyz').should be_false
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/abc/def').should be_true
- pattern.could_match_children?('/abc/xyz').should be_false
- pattern.could_match_children?('/abc/dxyzf').should be_true
- pattern.could_match_children?('/abc/df').should be_true
- pattern.could_match_children?('/abc/d').should be_false
- pattern.could_match_children?('/abc/f').should be_false
- pattern.could_match_children?('/abc/def/ghi').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/xyz')).to be_falsey
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/abc/def')).to be_truthy
+ expect(pattern.could_match_children?('/abc/xyz')).to be_falsey
+ expect(pattern.could_match_children?('/abc/dxyzf')).to be_truthy
+ expect(pattern.could_match_children?('/abc/df')).to be_truthy
+ expect(pattern.could_match_children?('/abc/d')).to be_falsey
+ expect(pattern.could_match_children?('/abc/f')).to be_falsey
+ expect(pattern.could_match_children?('/abc/def/ghi')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
- pattern.exact_child_name_under('/abc').should == nil
- pattern.exact_child_name_under('/abc/def').should == 'ghi'
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
+ expect(pattern.exact_child_name_under('/abc')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc/def')).to eq('ghi')
end
end
context 'with star pattern "/abc/d??f/ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc/d??f/ghi') }
it 'match?' do
- pattern.match?('/abc/deef/ghi').should be_true
- pattern.match?('/abc/deeef/ghi').should be_false
- pattern.match?('/abc/def/ghi').should be_false
- pattern.match?('/abc/df/ghi').should be_false
- pattern.match?('/abc/d/ghi').should be_false
- pattern.match?('/abc/f/ghi').should be_false
- pattern.match?('/abc/ghi').should be_false
+ expect(pattern.match?('/abc/deef/ghi')).to be_truthy
+ expect(pattern.match?('/abc/deeef/ghi')).to be_falsey
+ expect(pattern.match?('/abc/def/ghi')).to be_falsey
+ expect(pattern.match?('/abc/df/ghi')).to be_falsey
+ expect(pattern.match?('/abc/d/ghi')).to be_falsey
+ expect(pattern.match?('/abc/f/ghi')).to be_falsey
+ expect(pattern.match?('/abc/ghi')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/xyz').should be_false
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/abc/deef').should be_true
- pattern.could_match_children?('/abc/deeef').should be_false
- pattern.could_match_children?('/abc/def').should be_false
- pattern.could_match_children?('/abc/df').should be_false
- pattern.could_match_children?('/abc/d').should be_false
- pattern.could_match_children?('/abc/f').should be_false
- pattern.could_match_children?('/abc/deef/ghi').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/xyz')).to be_falsey
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/abc/deef')).to be_truthy
+ expect(pattern.could_match_children?('/abc/deeef')).to be_falsey
+ expect(pattern.could_match_children?('/abc/def')).to be_falsey
+ expect(pattern.could_match_children?('/abc/df')).to be_falsey
+ expect(pattern.could_match_children?('/abc/d')).to be_falsey
+ expect(pattern.could_match_children?('/abc/f')).to be_falsey
+ expect(pattern.could_match_children?('/abc/deef/ghi')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
- pattern.exact_child_name_under('/abc').should == nil
- pattern.exact_child_name_under('/abc/deef').should == 'ghi'
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
+ expect(pattern.exact_child_name_under('/abc')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc/deef')).to eq('ghi')
end
end
context 'with star pattern "/abc/d[a-z][0-9]f/ghi"', :pending => (Chef::Platform.windows?) do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc/d[a-z][0-9]f/ghi') }
it 'match?' do
- pattern.match?('/abc/de1f/ghi').should be_true
- pattern.match?('/abc/deef/ghi').should be_false
- pattern.match?('/abc/d11f/ghi').should be_false
- pattern.match?('/abc/de11f/ghi').should be_false
- pattern.match?('/abc/dee1f/ghi').should be_false
- pattern.match?('/abc/df/ghi').should be_false
- pattern.match?('/abc/d/ghi').should be_false
- pattern.match?('/abc/f/ghi').should be_false
- pattern.match?('/abc/ghi').should be_false
+ expect(pattern.match?('/abc/de1f/ghi')).to be_truthy
+ expect(pattern.match?('/abc/deef/ghi')).to be_falsey
+ expect(pattern.match?('/abc/d11f/ghi')).to be_falsey
+ expect(pattern.match?('/abc/de11f/ghi')).to be_falsey
+ expect(pattern.match?('/abc/dee1f/ghi')).to be_falsey
+ expect(pattern.match?('/abc/df/ghi')).to be_falsey
+ expect(pattern.match?('/abc/d/ghi')).to be_falsey
+ expect(pattern.match?('/abc/f/ghi')).to be_falsey
+ expect(pattern.match?('/abc/ghi')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/xyz').should be_false
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/abc/de1f').should be_true
- pattern.could_match_children?('/abc/deef').should be_false
- pattern.could_match_children?('/abc/d11f').should be_false
- pattern.could_match_children?('/abc/de11f').should be_false
- pattern.could_match_children?('/abc/dee1f').should be_false
- pattern.could_match_children?('/abc/def').should be_false
- pattern.could_match_children?('/abc/df').should be_false
- pattern.could_match_children?('/abc/d').should be_false
- pattern.could_match_children?('/abc/f').should be_false
- pattern.could_match_children?('/abc/de1f/ghi').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/xyz')).to be_falsey
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/abc/de1f')).to be_truthy
+ expect(pattern.could_match_children?('/abc/deef')).to be_falsey
+ expect(pattern.could_match_children?('/abc/d11f')).to be_falsey
+ expect(pattern.could_match_children?('/abc/de11f')).to be_falsey
+ expect(pattern.could_match_children?('/abc/dee1f')).to be_falsey
+ expect(pattern.could_match_children?('/abc/def')).to be_falsey
+ expect(pattern.could_match_children?('/abc/df')).to be_falsey
+ expect(pattern.could_match_children?('/abc/d')).to be_falsey
+ expect(pattern.could_match_children?('/abc/f')).to be_falsey
+ expect(pattern.could_match_children?('/abc/de1f/ghi')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
- pattern.exact_child_name_under('/abc').should == nil
- pattern.exact_child_name_under('/abc/de1f').should == 'ghi'
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
+ expect(pattern.exact_child_name_under('/abc')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc/de1f')).to eq('ghi')
end
end
context 'with star pattern "/abc/**/ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc/**/ghi') }
it 'match?' do
- pattern.match?('/abc/def/ghi').should be_true
- pattern.match?('/abc/d/e/f/ghi').should be_true
- pattern.match?('/abc/ghi').should be_false
- pattern.match?('/abcdef/d/ghi').should be_false
- pattern.match?('/abc/d/defghi').should be_false
- pattern.match?('/xyz').should be_false
+ expect(pattern.match?('/abc/def/ghi')).to be_truthy
+ expect(pattern.match?('/abc/d/e/f/ghi')).to be_truthy
+ expect(pattern.match?('/abc/ghi')).to be_falsey
+ expect(pattern.match?('/abcdef/d/ghi')).to be_falsey
+ expect(pattern.match?('/abc/d/defghi')).to be_falsey
+ expect(pattern.match?('/xyz')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/abc/d').should be_true
- pattern.could_match_children?('/abc/d/e').should be_true
- pattern.could_match_children?('/abc/d/e/f').should be_true
- pattern.could_match_children?('/abc/def/ghi').should be_true
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/xyz').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/abc/d')).to be_truthy
+ expect(pattern.could_match_children?('/abc/d/e')).to be_truthy
+ expect(pattern.could_match_children?('/abc/d/e/f')).to be_truthy
+ expect(pattern.could_match_children?('/abc/def/ghi')).to be_truthy
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/xyz')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
- pattern.exact_child_name_under('/abc').should == nil
- pattern.exact_child_name_under('/abc/def').should == nil
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
+ expect(pattern.exact_child_name_under('/abc')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc/def')).to eq(nil)
end
end
context 'with star pattern "/abc**/ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc**/ghi') }
it 'match?' do
- pattern.match?('/abc/def/ghi').should be_true
- pattern.match?('/abc/d/e/f/ghi').should be_true
- pattern.match?('/abc/ghi').should be_true
- pattern.match?('/abcdef/ghi').should be_true
- pattern.match?('/abc/defghi').should be_false
- pattern.match?('/xyz').should be_false
+ expect(pattern.match?('/abc/def/ghi')).to be_truthy
+ expect(pattern.match?('/abc/d/e/f/ghi')).to be_truthy
+ expect(pattern.match?('/abc/ghi')).to be_truthy
+ expect(pattern.match?('/abcdef/ghi')).to be_truthy
+ expect(pattern.match?('/abc/defghi')).to be_falsey
+ expect(pattern.match?('/xyz')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/abcdef').should be_true
- pattern.could_match_children?('/abc/d/e').should be_true
- pattern.could_match_children?('/abc/d/e/f').should be_true
- pattern.could_match_children?('/abc/def/ghi').should be_true
- pattern.could_match_children?('abc').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/abcdef')).to be_truthy
+ expect(pattern.could_match_children?('/abc/d/e')).to be_truthy
+ expect(pattern.could_match_children?('/abc/d/e/f')).to be_truthy
+ expect(pattern.could_match_children?('/abc/def/ghi')).to be_truthy
+ expect(pattern.could_match_children?('abc')).to be_falsey
end
it 'could_match_children? /abc** returns false for /xyz' do
- pending 'Make could_match_children? more rigorous' do
- # At the moment, we return false for this, but in the end it would be nice to return true:
- pattern.could_match_children?('/xyz').should be_false
- end
+ pending 'Make could_match_children? more rigorous'
+ # At the moment, we return false for this, but in the end it would be nice to return true:
+ pattern.could_match_children?('/xyz').should be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == nil
- pattern.exact_child_name_under('/abc').should == nil
- pattern.exact_child_name_under('/abc/def').should == nil
+ expect(pattern.exact_child_name_under('/')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc/def')).to eq(nil)
end
end
context 'with star pattern "/abc/**ghi"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('/abc/**ghi') }
it 'match?' do
- pattern.match?('/abc/def/ghi').should be_true
- pattern.match?('/abc/def/ghi/ghi').should be_true
- pattern.match?('/abc/def/ghi/jkl').should be_false
- pattern.match?('/abc/d/e/f/ghi').should be_true
- pattern.match?('/abc/ghi').should be_true
- pattern.match?('/abcdef/ghi').should be_false
- pattern.match?('/abc/defghi').should be_true
- pattern.match?('/xyz').should be_false
+ expect(pattern.match?('/abc/def/ghi')).to be_truthy
+ expect(pattern.match?('/abc/def/ghi/ghi')).to be_truthy
+ expect(pattern.match?('/abc/def/ghi/jkl')).to be_falsey
+ expect(pattern.match?('/abc/d/e/f/ghi')).to be_truthy
+ expect(pattern.match?('/abc/ghi')).to be_truthy
+ expect(pattern.match?('/abcdef/ghi')).to be_falsey
+ expect(pattern.match?('/abc/defghi')).to be_truthy
+ expect(pattern.match?('/xyz')).to be_falsey
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
it 'could_match_children?' do
- pattern.could_match_children?('/abc').should be_true
- pattern.could_match_children?('/abcdef').should be_false
- pattern.could_match_children?('/abc/d/e').should be_true
- pattern.could_match_children?('/abc/d/e/f').should be_true
- pattern.could_match_children?('/abc/def/ghi').should be_true
- pattern.could_match_children?('abc').should be_false
- pattern.could_match_children?('/xyz').should be_false
+ expect(pattern.could_match_children?('/abc')).to be_truthy
+ expect(pattern.could_match_children?('/abcdef')).to be_falsey
+ expect(pattern.could_match_children?('/abc/d/e')).to be_truthy
+ expect(pattern.could_match_children?('/abc/d/e/f')).to be_truthy
+ expect(pattern.could_match_children?('/abc/def/ghi')).to be_truthy
+ expect(pattern.could_match_children?('abc')).to be_falsey
+ expect(pattern.could_match_children?('/xyz')).to be_falsey
end
it 'exact_child_name_under' do
- pattern.exact_child_name_under('/').should == 'abc'
- pattern.exact_child_name_under('/abc').should == nil
- pattern.exact_child_name_under('/abc/def').should == nil
+ expect(pattern.exact_child_name_under('/')).to eq('abc')
+ expect(pattern.exact_child_name_under('/abc')).to eq(nil)
+ expect(pattern.exact_child_name_under('/abc/def')).to eq(nil)
end
end
context 'with star pattern "a**b**c"' do
let(:pattern) { Chef::ChefFS::FilePattern.new('a**b**c') }
it 'match?' do
- pattern.match?('axybzwc').should be_true
- pattern.match?('abc').should be_true
- pattern.match?('axyzwc').should be_false
- pattern.match?('ac').should be_false
- pattern.match?('a/x/y/b/z/w/c').should be_true
+ expect(pattern.match?('axybzwc')).to be_truthy
+ expect(pattern.match?('abc')).to be_truthy
+ expect(pattern.match?('axyzwc')).to be_falsey
+ expect(pattern.match?('ac')).to be_falsey
+ expect(pattern.match?('a/x/y/b/z/w/c')).to be_truthy
end
it 'exact_path' do
- pattern.exact_path.should be_nil
+ expect(pattern.exact_path).to be_nil
end
end
context 'normalization tests' do
it 'handles trailing slashes' do
- p('abc/').normalized_pattern.should == 'abc'
- p('abc/').exact_path.should == 'abc'
- p('abc/').match?('abc').should be_true
- p('//').normalized_pattern.should == '/'
- p('//').exact_path.should == '/'
- p('//').match?('/').should be_true
- p('/./').normalized_pattern.should == '/'
- p('/./').exact_path.should == '/'
- p('/./').match?('/').should be_true
+ expect(p('abc/').normalized_pattern).to eq('abc')
+ expect(p('abc/').exact_path).to eq('abc')
+ expect(p('abc/').match?('abc')).to be_truthy
+ expect(p('//').normalized_pattern).to eq('/')
+ expect(p('//').exact_path).to eq('/')
+ expect(p('//').match?('/')).to be_truthy
+ expect(p('/./').normalized_pattern).to eq('/')
+ expect(p('/./').exact_path).to eq('/')
+ expect(p('/./').match?('/')).to be_truthy
end
it 'handles multiple slashes' do
- p('abc//def').normalized_pattern.should == 'abc/def'
- p('abc//def').exact_path.should == 'abc/def'
- p('abc//def').match?('abc/def').should be_true
- p('abc//').normalized_pattern.should == 'abc'
- p('abc//').exact_path.should == 'abc'
- p('abc//').match?('abc').should be_true
+ expect(p('abc//def').normalized_pattern).to eq('abc/def')
+ expect(p('abc//def').exact_path).to eq('abc/def')
+ expect(p('abc//def').match?('abc/def')).to be_truthy
+ expect(p('abc//').normalized_pattern).to eq('abc')
+ expect(p('abc//').exact_path).to eq('abc')
+ expect(p('abc//').match?('abc')).to be_truthy
end
it 'handles dot' do
- p('abc/./def').normalized_pattern.should == 'abc/def'
- p('abc/./def').exact_path.should == 'abc/def'
- p('abc/./def').match?('abc/def').should be_true
- p('./abc/def').normalized_pattern.should == 'abc/def'
- p('./abc/def').exact_path.should == 'abc/def'
- p('./abc/def').match?('abc/def').should be_true
- p('/.').normalized_pattern.should == '/'
- p('/.').exact_path.should == '/'
- p('/.').match?('/').should be_true
+ expect(p('abc/./def').normalized_pattern).to eq('abc/def')
+ expect(p('abc/./def').exact_path).to eq('abc/def')
+ expect(p('abc/./def').match?('abc/def')).to be_truthy
+ expect(p('./abc/def').normalized_pattern).to eq('abc/def')
+ expect(p('./abc/def').exact_path).to eq('abc/def')
+ expect(p('./abc/def').match?('abc/def')).to be_truthy
+ expect(p('/.').normalized_pattern).to eq('/')
+ expect(p('/.').exact_path).to eq('/')
+ expect(p('/.').match?('/')).to be_truthy
end
it 'handles dot by itself', :pending => "decide what to do with dot by itself" do
- p('.').normalized_pattern.should == '.'
- p('.').exact_path.should == '.'
- p('.').match?('.').should be_true
- p('./').normalized_pattern.should == '.'
- p('./').exact_path.should == '.'
- p('./').match?('.').should be_true
+ expect(p('.').normalized_pattern).to eq('.')
+ expect(p('.').exact_path).to eq('.')
+ expect(p('.').match?('.')).to be_truthy
+ expect(p('./').normalized_pattern).to eq('.')
+ expect(p('./').exact_path).to eq('.')
+ expect(p('./').match?('.')).to be_truthy
end
it 'handles dotdot' do
- p('abc/../def').normalized_pattern.should == 'def'
- p('abc/../def').exact_path.should == 'def'
- p('abc/../def').match?('def').should be_true
- p('abc/def/../..').normalized_pattern.should == ''
- p('abc/def/../..').exact_path.should == ''
- p('abc/def/../..').match?('').should be_true
- p('/*/../def').normalized_pattern.should == '/def'
- p('/*/../def').exact_path.should == '/def'
- p('/*/../def').match?('/def').should be_true
- p('/*/*/../def').normalized_pattern.should == '/*/def'
- p('/*/*/../def').exact_path.should be_nil
- p('/*/*/../def').match?('/abc/def').should be_true
- p('/abc/def/../..').normalized_pattern.should == '/'
- p('/abc/def/../..').exact_path.should == '/'
- p('/abc/def/../..').match?('/').should be_true
- p('abc/../../def').normalized_pattern.should == '../def'
- p('abc/../../def').exact_path.should == '../def'
- p('abc/../../def').match?('../def').should be_true
+ expect(p('abc/../def').normalized_pattern).to eq('def')
+ expect(p('abc/../def').exact_path).to eq('def')
+ expect(p('abc/../def').match?('def')).to be_truthy
+ expect(p('abc/def/../..').normalized_pattern).to eq('')
+ expect(p('abc/def/../..').exact_path).to eq('')
+ expect(p('abc/def/../..').match?('')).to be_truthy
+ expect(p('/*/../def').normalized_pattern).to eq('/def')
+ expect(p('/*/../def').exact_path).to eq('/def')
+ expect(p('/*/../def').match?('/def')).to be_truthy
+ expect(p('/*/*/../def').normalized_pattern).to eq('/*/def')
+ expect(p('/*/*/../def').exact_path).to be_nil
+ expect(p('/*/*/../def').match?('/abc/def')).to be_truthy
+ expect(p('/abc/def/../..').normalized_pattern).to eq('/')
+ expect(p('/abc/def/../..').exact_path).to eq('/')
+ expect(p('/abc/def/../..').match?('/')).to be_truthy
+ expect(p('abc/../../def').normalized_pattern).to eq('../def')
+ expect(p('abc/../../def').exact_path).to eq('../def')
+ expect(p('abc/../../def').match?('../def')).to be_truthy
end
it 'handles dotdot with double star' do
- p('abc**/def/../ghi').exact_path.should be_nil
- p('abc**/def/../ghi').match?('abc/ghi').should be_true
- p('abc**/def/../ghi').match?('abc/x/y/z/ghi').should be_true
- p('abc**/def/../ghi').match?('ghi').should be_false
+ expect(p('abc**/def/../ghi').exact_path).to be_nil
+ expect(p('abc**/def/../ghi').match?('abc/ghi')).to be_truthy
+ expect(p('abc**/def/../ghi').match?('abc/x/y/z/ghi')).to be_truthy
+ expect(p('abc**/def/../ghi').match?('ghi')).to be_falsey
end
it 'raises error on dotdot with overlapping double star' do
- lambda { Chef::ChefFS::FilePattern.new('abc/**/../def').exact_path }.should raise_error(ArgumentError)
- lambda { Chef::ChefFS::FilePattern.new('abc/**/abc/../../def').exact_path }.should raise_error(ArgumentError)
+ expect { Chef::ChefFS::FilePattern.new('abc/**/../def').exact_path }.to raise_error(ArgumentError)
+ expect { Chef::ChefFS::FilePattern.new('abc/**/abc/../../def').exact_path }.to raise_error(ArgumentError)
end
it 'handles leading dotdot' do
- p('../abc/def').exact_path.should == '../abc/def'
- p('../abc/def').match?('../abc/def').should be_true
- p('/../abc/def').exact_path.should == '/abc/def'
- p('/../abc/def').match?('/abc/def').should be_true
- p('..').exact_path.should == '..'
- p('..').match?('..').should be_true
- p('/..').exact_path.should == '/'
- p('/..').match?('/').should be_true
+ expect(p('../abc/def').exact_path).to eq('../abc/def')
+ expect(p('../abc/def').match?('../abc/def')).to be_truthy
+ expect(p('/../abc/def').exact_path).to eq('/abc/def')
+ expect(p('/../abc/def').match?('/abc/def')).to be_truthy
+ expect(p('..').exact_path).to eq('..')
+ expect(p('..').match?('..')).to be_truthy
+ expect(p('/..').exact_path).to eq('/')
+ expect(p('/..').match?('/')).to be_truthy
end
end
diff --git a/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb b/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb
index 570246c41f..142755a4f1 100644
--- a/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb
+++ b/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb
@@ -27,20 +27,20 @@ describe Chef::ChefFS::FileSystem::OperationFailedError do
it 'include error cause' do
allow_message_expectations_on_nil
response_body = '{"error":["Invalid key test in request body"]}'
- @response.stub(:code).and_return("400")
- @response.stub(:body).and_return(response_body)
+ allow(@response).to receive(:code).and_return("400")
+ allow(@response).to receive(:body).and_return(response_body)
exception = Net::HTTPServerException.new("(exception) unauthorized", @response)
- proc {
+ expect {
raise Chef::ChefFS::FileSystem::OperationFailedError.new(:write, self, exception), error_message
- }.should raise_error(Chef::ChefFS::FileSystem::OperationFailedError, "#{error_message} cause: #{response_body}")
+ }.to raise_error(Chef::ChefFS::FileSystem::OperationFailedError, "#{error_message} cause: #{response_body}")
end
end
context 'does not have a cause attribute' do
it 'does not include error cause' do
- proc {
+ expect {
raise Chef::ChefFS::FileSystem::OperationFailedError.new(:write, self), error_message
- }.should raise_error(Chef::ChefFS::FileSystem::OperationFailedError, error_message)
+ }.to raise_error(Chef::ChefFS::FileSystem::OperationFailedError, error_message)
end
end
end
diff --git a/spec/unit/chef_fs/file_system_spec.rb b/spec/unit/chef_fs/file_system_spec.rb
index 383a2c81ab..75ca4d4be9 100644
--- a/spec/unit/chef_fs/file_system_spec.rb
+++ b/spec/unit/chef_fs/file_system_spec.rb
@@ -43,13 +43,13 @@ describe Chef::ChefFS::FileSystem do
context 'resolve_path' do
it '/' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/').path.should == '/'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/').path).to eq('/')
end
it 'nonexistent /a' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/a').path.should == '/a'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/a').path).to eq('/a')
end
it 'nonexistent /a/b' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/a/b').path.should == '/a/b'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/a/b').path).to eq('/a/b')
end
end
end
@@ -66,18 +66,19 @@ describe Chef::ChefFS::FileSystem do
:c => '',
}
},
- :x => ''
+ :x => '',
+ :y => {}
})
}
context 'list' do
it '/**' do
- list_should_yield_paths(fs, '/**', '/', '/a', '/x', '/a/aa', '/a/aa/c', '/a/aa/zz', '/a/ab', '/a/ab/c')
+ list_should_yield_paths(fs, '/**', '/', '/a', '/x', '/y', '/a/aa', '/a/aa/c', '/a/aa/zz', '/a/ab', '/a/ab/c')
end
it '/' do
list_should_yield_paths(fs, '/', '/')
end
it '/*' do
- list_should_yield_paths(fs, '/*', '/', '/a', '/x')
+ list_should_yield_paths(fs, '/*', '/', '/a', '/x', '/y')
end
it '/*/*' do
list_should_yield_paths(fs, '/*/*', '/a/aa', '/a/ab')
@@ -113,22 +114,34 @@ describe Chef::ChefFS::FileSystem do
no_blocking_calls_allowed
end
it 'resolves /' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/').path.should == '/'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/').path).to eq('/')
end
it 'resolves /x' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/x').path.should == '/x'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/x').path).to eq('/x')
end
it 'resolves /a' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/a').path.should == '/a'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/a').path).to eq('/a')
end
it 'resolves /a/aa' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/a/aa').path.should == '/a/aa'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/a/aa').path).to eq('/a/aa')
end
it 'resolves /a/aa/zz' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/a/aa/zz').path.should == '/a/aa/zz'
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/a/aa/zz').path).to eq('/a/aa/zz')
end
- it 'resolves nonexistent /y/x/w' do
- Chef::ChefFS::FileSystem.resolve_path(fs, '/y/x/w').path.should == '/y/x/w'
+ it 'resolves nonexistent /q/x/w' do
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/q/x/w').path).to eq('/q/x/w')
+ end
+ end
+
+ context 'empty?' do
+ it 'is not empty /' do
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/').empty?).to be false
+ end
+ it 'is empty /y' do
+ expect(Chef::ChefFS::FileSystem.resolve_path(fs, '/y').empty?).to be true
+ end
+ it 'is not a directory and can\'t be tested /x' do
+ expect { Chef::ChefFS::FileSystem.resolve_path(fs, '/x').empty? }.to raise_error(NoMethodError)
end
end
end
diff --git a/spec/unit/chef_fs/parallelizer.rb b/spec/unit/chef_fs/parallelizer.rb
index a871b60e98..9cb97963ed 100644
--- a/spec/unit/chef_fs/parallelizer.rb
+++ b/spec/unit/chef_fs/parallelizer.rb
@@ -29,8 +29,8 @@ describe Chef::ChefFS::Parallelizer do
sleep val
outputs << val
end
- elapsed_time.should < 0.6
- outputs.should == [ 0.1, 0.3, 0.5 ]
+ expect(elapsed_time).to be < 0.6
+ expect(outputs).to eq([ 0.1, 0.3, 0.5 ])
end
context "With :ordered => false (unordered output)" do
@@ -38,15 +38,15 @@ describe Chef::ChefFS::Parallelizer do
parallelize([], :ordered => false) do
sleep 10
end.to_a == []
- elapsed_time.should < 0.1
+ expect(elapsed_time).to be < 0.1
end
it "10 sleep(0.2)s complete within 0.5 seconds" do
- parallelize(1.upto(10), :ordered => false) do |i|
+ expect(parallelize(1.upto(10), :ordered => false) do |i|
sleep 0.2
'x'
- end.to_a.should == %w(x x x x x x x x x x)
- elapsed_time.should < 0.5
+ end.to_a).to eq(%w(x x x x x x x x x x))
+ expect(elapsed_time).to be < 0.5
end
it "The output comes as soon as it is available" do
@@ -54,10 +54,10 @@ describe Chef::ChefFS::Parallelizer do
sleep val
val
end
- enum.map do |value|
- elapsed_time.should < value+0.1
+ expect(enum.map do |value|
+ expect(elapsed_time).to be < value+0.1
value
- end.should == [ 0.1, 0.3, 0.5 ]
+ end).to eq([ 0.1, 0.3, 0.5 ])
end
it "An exception in input is passed through but does NOT stop processing" do
@@ -67,8 +67,8 @@ describe Chef::ChefFS::Parallelizer do
enum = parallelize(input, :ordered => false) { |x| sleep(x); x }
results = []
expect { enum.each { |value| results << value } }.to raise_error 'hi'
- results.should == [ 0.1, 0.3, 0.5 ]
- elapsed_time.should < 0.6
+ expect(results).to eq([ 0.1, 0.3, 0.5 ])
+ expect(elapsed_time).to be < 0.6
end
it "Exceptions in output are raised after all processing is done" do
@@ -84,9 +84,9 @@ describe Chef::ChefFS::Parallelizer do
end
results = []
expect { enum.each { |value| results << value } }.to raise_error 'hi'
- results.sort.should == [ 1, 2, 3 ]
- elapsed_time.should < 0.3
- processed.should == 3
+ expect(results.sort).to eq([ 1, 2, 3 ])
+ expect(elapsed_time).to be < 0.3
+ expect(processed).to eq(3)
end
it "Exceptions with :stop_on_exception are raised after all processing is done" do
@@ -101,7 +101,7 @@ describe Chef::ChefFS::Parallelizer do
x
end
expect { parallelized.to_a }.to raise_error 'hi'
- processed.should == 4
+ expect(processed).to eq(4)
end
end
@@ -110,15 +110,15 @@ describe Chef::ChefFS::Parallelizer do
parallelize([]) do
sleep 10
end.to_a == []
- elapsed_time.should < 0.1
+ expect(elapsed_time).to be < 0.1
end
it "10 sleep(0.2)s complete within 0.5 seconds" do
- parallelize(1.upto(10), :ordered => true) do |i|
+ expect(parallelize(1.upto(10), :ordered => true) do |i|
sleep 0.2
'x'
- end.to_a.should == %w(x x x x x x x x x x)
- elapsed_time.should < 0.5
+ end.to_a).to eq(%w(x x x x x x x x x x))
+ expect(elapsed_time).to be < 0.5
end
it "Output comes in the order of the input" do
@@ -126,10 +126,10 @@ describe Chef::ChefFS::Parallelizer do
sleep val
val
end.enum_for(:each_with_index)
- enum.next.should == [ 0.5, 0 ]
- enum.next.should == [ 0.3, 1 ]
- enum.next.should == [ 0.1, 2 ]
- elapsed_time.should < 0.6
+ expect(enum.next).to eq([ 0.5, 0 ])
+ expect(enum.next).to eq([ 0.3, 1 ])
+ expect(enum.next).to eq([ 0.1, 2 ])
+ expect(elapsed_time).to be < 0.6
end
it "Exceptions in input are raised in the correct sequence but do NOT stop processing" do
@@ -139,8 +139,8 @@ describe Chef::ChefFS::Parallelizer do
results = []
enum = parallelize(input) { |x| sleep(x); x }
expect { enum.each { |value| results << value } }.to raise_error 'hi'
- elapsed_time.should < 0.6
- results.should == [ 0.5, 0.3, 0.1 ]
+ expect(elapsed_time).to be < 0.6
+ expect(results).to eq([ 0.5, 0.3, 0.1 ])
end
it "Exceptions in output are raised in the correct sequence and running processes do NOT stop processing" do
@@ -156,9 +156,9 @@ describe Chef::ChefFS::Parallelizer do
end
results = []
expect { enum.each { |value| results << value } }.to raise_error 'hi'
- results.should == [ 1, 2 ]
- elapsed_time.should < 0.3
- processed.should == 3
+ expect(results).to eq([ 1, 2 ])
+ expect(elapsed_time).to be < 0.3
+ expect(processed).to eq(3)
end
it "Exceptions with :stop_on_exception are raised after all processing is done" do
@@ -173,7 +173,7 @@ describe Chef::ChefFS::Parallelizer do
x
end
expect { parallelized.to_a }.to raise_error 'hi'
- processed.should == 4
+ expect(processed).to eq(4)
end
end
@@ -187,10 +187,10 @@ describe Chef::ChefFS::Parallelizer do
sleep 0.1
end
enum = parallelize(input) { |x| x }
- enum.map do |value|
- elapsed_time.should < (value+1)*0.1
+ expect(enum.map do |value|
+ expect(elapsed_time).to be < (value+1)*0.1
value
- end.should == [ 1, 2, 3 ]
+ end).to eq([ 1, 2, 3 ])
end
end
@@ -226,44 +226,44 @@ describe Chef::ChefFS::Parallelizer do
end
it "parallelize with :main_thread_processing = true does not block" do
- parallelizer.parallelize([1]) do |x|
+ expect(parallelizer.parallelize([1]) do |x|
sleep(0.1)
x
- end.to_a.should == [ 1 ]
- elapsed_time.should < 0.2
+ end.to_a).to eq([ 1 ])
+ expect(elapsed_time).to be < 0.2
end
it "parallelize with :main_thread_processing = false waits for the job to finish" do
- parallelizer.parallelize([1], :main_thread_processing => false) do |x|
+ expect(parallelizer.parallelize([1], :main_thread_processing => false) do |x|
sleep(0.1)
x+1
- end.to_a.should == [ 2 ]
- elapsed_time.should > 0.3
+ end.to_a).to eq([ 2 ])
+ expect(elapsed_time).to be > 0.3
end
it "resizing the Parallelizer to 0 waits for the job to stop" do
- elapsed_time.should < 0.2
+ expect(elapsed_time).to be < 0.2
parallelizer.resize(0)
- parallelizer.num_threads.should == 0
- elapsed_time.should > 0.25
- @occupying_job_finished.should == [ true ]
+ expect(parallelizer.num_threads).to eq(0)
+ expect(elapsed_time).to be > 0.25
+ expect(@occupying_job_finished).to eq([ true ])
end
it "stopping the Parallelizer waits for the job to finish" do
- elapsed_time.should < 0.2
+ expect(elapsed_time).to be < 0.2
parallelizer.stop
- parallelizer.num_threads.should == 0
- elapsed_time.should > 0.25
- @occupying_job_finished.should == [ true ]
+ expect(parallelizer.num_threads).to eq(0)
+ expect(elapsed_time).to be > 0.25
+ expect(@occupying_job_finished).to eq([ true ])
end
it "resizing the Parallelizer to 2 does not stop the job" do
- elapsed_time.should < 0.2
+ expect(elapsed_time).to be < 0.2
parallelizer.resize(2)
- parallelizer.num_threads.should == 2
- elapsed_time.should < 0.2
+ expect(parallelizer.num_threads).to eq(2)
+ expect(elapsed_time).to be < 0.2
sleep(0.3)
- @occupying_job_finished.should == [ true ]
+ expect(@occupying_job_finished).to eq([ true ])
end
end
@@ -276,9 +276,9 @@ describe Chef::ChefFS::Parallelizer do
sleep(0.05) # Just enough to yield and get other inputs in the queue
x
end
- enum.count.should == 6
- outputs_processed.should == 0
- input_mapper.num_processed.should == 6
+ expect(enum.count).to eq(6)
+ expect(outputs_processed).to eq(0)
+ expect(input_mapper.num_processed).to eq(6)
end
it ".count with arguments works normally" do
@@ -288,10 +288,10 @@ describe Chef::ChefFS::Parallelizer do
outputs_processed += 1
x
end
- enum.count { |x| x > 1 }.should == 6
- enum.count(2).should == 3
- outputs_processed.should == 20
- input_mapper.num_processed.should == 20
+ expect(enum.count { |x| x > 1 }).to eq(6)
+ expect(enum.count(2)).to eq(3)
+ expect(outputs_processed).to eq(20)
+ expect(input_mapper.num_processed).to eq(20)
end
it ".first does not enumerate anything other than the first result(s)" do
@@ -302,10 +302,10 @@ describe Chef::ChefFS::Parallelizer do
sleep(0.05) # Just enough to yield and get other inputs in the queue
x
end
- enum.first.should == 1
- enum.first(2).should == [1,2]
- outputs_processed.should == 3
- input_mapper.num_processed.should == 3
+ expect(enum.first).to eq(1)
+ expect(enum.first(2)).to eq([1,2])
+ expect(outputs_processed).to eq(3)
+ expect(input_mapper.num_processed).to eq(3)
end
it ".take does not enumerate anything other than the first result(s)" do
@@ -316,9 +316,9 @@ describe Chef::ChefFS::Parallelizer do
sleep(0.05) # Just enough to yield and get other inputs in the queue
x
end
- enum.take(2).should == [1,2]
- outputs_processed.should == 2
- input_mapper.num_processed.should == 2
+ expect(enum.take(2)).to eq([1,2])
+ expect(outputs_processed).to eq(2)
+ expect(input_mapper.num_processed).to eq(2)
end
it ".drop does not process anything other than the last result(s)" do
@@ -329,9 +329,9 @@ describe Chef::ChefFS::Parallelizer do
sleep(0.05) # Just enough to yield and get other inputs in the queue
x
end
- enum.drop(2).should == [3,4,5,6]
- outputs_processed.should == 4
- input_mapper.num_processed.should == 6
+ expect(enum.drop(2)).to eq([3,4,5,6])
+ expect(outputs_processed).to eq(4)
+ expect(input_mapper.num_processed).to eq(6)
end
if Enumerable.method_defined?(:lazy)
@@ -343,9 +343,9 @@ describe Chef::ChefFS::Parallelizer do
sleep(0.05) # Just enough to yield and get other inputs in the queue
x
end
- enum.lazy.take(2).to_a.should == [1,2]
- outputs_processed.should == 2
- input_mapper.num_processed.should == 2
+ expect(enum.lazy.take(2).to_a).to eq([1,2])
+ expect(outputs_processed).to eq(2)
+ expect(input_mapper.num_processed).to eq(2)
end
it ".drop does not process anything other than the last result(s)" do
@@ -356,9 +356,9 @@ describe Chef::ChefFS::Parallelizer do
sleep(0.05) # Just enough to yield and get other inputs in the queue
x
end
- enum.lazy.drop(2).to_a.should == [3,4,5,6]
- outputs_processed.should == 4
- input_mapper.num_processed.should == 6
+ expect(enum.lazy.drop(2).to_a).to eq([3,4,5,6])
+ expect(outputs_processed).to eq(4)
+ expect(input_mapper.num_processed).to eq(6)
end
it "lazy enumerable is actually lazy" do
@@ -372,8 +372,8 @@ describe Chef::ChefFS::Parallelizer do
enum.lazy.take(2)
enum.lazy.drop(2)
sleep(0.1)
- outputs_processed.should == 0
- input_mapper.num_processed.should == 0
+ expect(outputs_processed).to eq(0)
+ expect(input_mapper.num_processed).to eq(0)
end
end
end
@@ -386,10 +386,10 @@ describe Chef::ChefFS::Parallelizer do
outputs_processed += 1
x
end
- enum.map { |x| x }.should == [1,2,3]
- enum.map { |x| x }.should == [1,2,3]
- outputs_processed.should == 6
- input_mapper.num_processed.should == 6
+ expect(enum.map { |x| x }).to eq([1,2,3])
+ expect(enum.map { |x| x }).to eq([1,2,3])
+ expect(outputs_processed).to eq(6)
+ expect(input_mapper.num_processed).to eq(6)
end
it ".first and then .map on the same parallel enumerable returns the correct results and re-processes the input" do
@@ -399,10 +399,10 @@ describe Chef::ChefFS::Parallelizer do
outputs_processed += 1
x
end
- enum.first.should == 1
- enum.map { |x| x }.should == [1,2,3]
- outputs_processed.should >= 4
- input_mapper.num_processed.should >= 4
+ expect(enum.first).to eq(1)
+ expect(enum.map { |x| x }).to eq([1,2,3])
+ expect(outputs_processed).to be >= 4
+ expect(input_mapper.num_processed).to be >= 4
end
it "two simultaneous enumerations throws an exception" do
@@ -424,7 +424,7 @@ describe Chef::ChefFS::Parallelizer do
context "And main_thread_processing on" do
it "succeeds in running" do
- parallelizer.parallelize([0.5]) { |x| x*2 }.to_a.should == [1]
+ expect(parallelizer.parallelize([0.5]) { |x| x*2 }.to_a).to eq([1])
end
end
end
@@ -435,11 +435,11 @@ describe Chef::ChefFS::Parallelizer do
end
it "does not have contention issues with large numbers of inputs" do
- parallelizer.parallelize(1.upto(500)) { |x| x+1 }.to_a.should == 2.upto(501).to_a
+ expect(parallelizer.parallelize(1.upto(500)) { |x| x+1 }.to_a).to eq(2.upto(501).to_a)
end
it "does not have contention issues with large numbers of inputs with ordering off" do
- parallelizer.parallelize(1.upto(500), :ordered => false) { |x| x+1 }.to_a.sort.should == 2.upto(501).to_a
+ expect(parallelizer.parallelize(1.upto(500), :ordered => false) { |x| x+1 }.to_a.sort).to eq(2.upto(501).to_a)
end
it "does not have contention issues with large numbers of jobs and inputs with ordering off" do
@@ -451,7 +451,7 @@ describe Chef::ChefFS::Parallelizer do
Thread.new { outputs[i] = parallelizers[i].to_a }
end
threads.each { |thread| thread.join }
- outputs.each { |output| output.sort.should == 2.upto(501).to_a }
+ outputs.each { |output| expect(output.sort).to eq(2.upto(501).to_a) }
end
end
diff --git a/spec/unit/chef_spec.rb b/spec/unit/chef_spec.rb
index b0f0359806..8a8d6c6c68 100644
--- a/spec/unit/chef_spec.rb
+++ b/spec/unit/chef_spec.rb
@@ -20,6 +20,6 @@ require 'spec_helper'
describe Chef do
it "should have a version defined" do
- Chef::VERSION.should match(/(\d+)\.(\d+)\.(\d+)/)
+ expect(Chef::VERSION).to match(/(\d+)\.(\d+)\.(\d+)/)
end
end
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index e05245c413..10958d628c 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Client do
ohai_system = double( "Ohai::System",
:all_plugins => true,
:data => ohai_data)
- ohai_system.stub(:[]) do |key|
+ allow(ohai_system).to receive(:[]) do |key|
ohai_data[key]
end
ohai_system
@@ -61,6 +61,7 @@ describe Chef::Client do
let(:client_opts) { {} }
let(:client) do
+ Chef::Config[:event_loggers] = []
Chef::Client.new(json_attribs, client_opts).tap do |c|
c.node = node
end
@@ -71,7 +72,7 @@ describe Chef::Client do
# Node/Ohai data
#Chef::Config[:node_name] = fqdn
- Ohai::System.stub(:new).and_return(ohai_system)
+ allow(Ohai::System).to receive(:new).and_return(ohai_system)
end
describe "authentication protocol selection" do
@@ -84,7 +85,7 @@ describe Chef::Client do
Chef::Config[:node_name] = ("f" * 90)
# ugly that this happens as a side effect of a getter :(
client.node_name
- Chef::Config[:authentication_protocol_version].should == "1.0"
+ expect(Chef::Config[:authentication_protocol_version]).to eq("1.0")
end
end
@@ -93,7 +94,7 @@ describe Chef::Client do
Chef::Config[:node_name] = ("f" * 91)
# ugly that this happens as a side effect of a getter :(
client.node_name
- Chef::Config[:authentication_protocol_version].should == "1.1"
+ expect(Chef::Config[:authentication_protocol_version]).to eq("1.1")
end
end
end
@@ -103,11 +104,11 @@ describe Chef::Client do
context "and STDOUT is a TTY" do
before do
- STDOUT.stub(:tty?).and_return(true)
+ allow(STDOUT).to receive(:tty?).and_return(true)
end
it "configures the :doc formatter" do
- client.formatters_for_run.should == [[:doc]]
+ expect(client.formatters_for_run).to eq([[:doc]])
end
context "and force_logger is set" do
@@ -116,8 +117,8 @@ describe Chef::Client do
end
it "configures the :null formatter" do
- Chef::Config[:force_logger].should be_true
- client.formatters_for_run.should == [[:null]]
+ expect(Chef::Config[:force_logger]).to be_truthy
+ expect(client.formatters_for_run).to eq([[:null]])
end
end
@@ -126,11 +127,11 @@ describe Chef::Client do
context "and STDOUT is not a TTY" do
before do
- STDOUT.stub(:tty?).and_return(false)
+ allow(STDOUT).to receive(:tty?).and_return(false)
end
it "configures the :null formatter" do
- client.formatters_for_run.should == [[:null]]
+ expect(client.formatters_for_run).to eq([[:null]])
end
context "and force_formatter is set" do
@@ -138,7 +139,7 @@ describe Chef::Client do
Chef::Config[:force_formatter] = true
end
it "it configures the :doc formatter" do
- client.formatters_for_run.should == [[:doc]]
+ expect(client.formatters_for_run).to eq([[:doc]])
end
end
end
@@ -152,14 +153,14 @@ describe Chef::Client do
end
it "does not configure a default formatter" do
- client.formatters_for_run.should == [[:min, nil]]
+ expect(client.formatters_for_run).to eq([[:min, nil]])
end
it "configures the formatter for STDOUT/STDERR" do
configured_formatters = client.configure_formatters
min_formatter = configured_formatters[0]
- min_formatter.output.out.should == STDOUT
- min_formatter.output.err.should == STDERR
+ expect(min_formatter.output.out).to eq(STDOUT)
+ expect(min_formatter.output.err).to eq(STDERR)
end
end
@@ -177,8 +178,8 @@ describe Chef::Client do
it "configures the formatter for the file path" do
configured_formatters = client.configure_formatters
min_formatter = configured_formatters[0]
- min_formatter.output.out.path.should == @tmpout.path
- min_formatter.output.err.path.should == @tmpout.path
+ expect(min_formatter.output.out.path).to eq(@tmpout.path)
+ expect(min_formatter.output.err.path).to eq(@tmpout.path)
end
end
@@ -203,11 +204,11 @@ describe Chef::Client do
# --Client.register
# Make sure Client#register thinks the client key doesn't
# exist, so it tries to register and create one.
- File.should_receive(:exists?).with(Chef::Config[:client_key]).exactly(1).times.and_return(api_client_exists?)
+ expect(File).to receive(:exists?).with(Chef::Config[:client_key]).exactly(1).times.and_return(api_client_exists?)
unless api_client_exists?
# Client.register will register with the validation client name.
- Chef::ApiClient::Registration.any_instance.should_receive(:run)
+ expect_any_instance_of(Chef::ApiClient::Registration).to receive(:run)
end
end
@@ -215,59 +216,59 @@ describe Chef::Client do
# Client.register will then turn around create another
# Chef::REST object, this time with the client key it got from the
# previous step.
- Chef::REST.should_receive(:new).
+ expect(Chef::REST).to receive(:new).
with(Chef::Config[:chef_server_url], fqdn, Chef::Config[:client_key]).
exactly(1).
and_return(http_node_load)
# --Client#build_node
# looks up the node, which we will return, then later saves it.
- Chef::Node.should_receive(:find_or_create).with(fqdn).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(fqdn).and_return(node)
# --ResourceReporter#node_load_completed
# gets a run id from the server for storing resource history
# (has its own tests, so stubbing it here.)
- Chef::ResourceReporter.any_instance.should_receive(:node_load_completed)
+ expect_any_instance_of(Chef::ResourceReporter).to receive(:node_load_completed)
end
def stub_for_sync_cookbooks
# --Client#setup_run_context
# ---Client#sync_cookbooks -- downloads the list of cookbooks to sync
#
- Chef::CookbookSynchronizer.any_instance.should_receive(:sync_cookbooks)
- Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync)
- http_cookbook_sync.should_receive(:post).
+ expect_any_instance_of(Chef::CookbookSynchronizer).to receive(:sync_cookbooks)
+ expect(Chef::REST).to receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync)
+ expect(http_cookbook_sync).to receive(:post).
with("environments/_default/cookbook_versions", {:run_list => []}).
and_return({})
end
def stub_for_converge
# --Client#converge
- Chef::Runner.should_receive(:new).and_return(runner)
- runner.should_receive(:converge).and_return(true)
+ expect(Chef::Runner).to receive(:new).and_return(runner)
+ expect(runner).to receive(:converge).and_return(true)
# --ResourceReporter#run_completed
# updates the server with the resource history
# (has its own tests, so stubbing it here.)
- Chef::ResourceReporter.any_instance.should_receive(:run_completed)
+ expect_any_instance_of(Chef::ResourceReporter).to receive(:run_completed)
end
def stub_for_node_save
- node.stub(:data_for_save).and_return(node.for_json)
+ allow(node).to receive(:data_for_save).and_return(node.for_json)
# --Client#save_updated_node
- Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_node_save)
- http_node_save.should_receive(:put_rest).with("nodes/#{fqdn}", node.for_json).and_return(true)
+ expect(Chef::REST).to receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_node_save)
+ expect(http_node_save).to receive(:put_rest).with("nodes/#{fqdn}", node.for_json).and_return(true)
end
def stub_for_run
- Chef::RunLock.any_instance.should_receive(:acquire)
- Chef::RunLock.any_instance.should_receive(:save_pid)
- Chef::RunLock.any_instance.should_receive(:release)
+ expect_any_instance_of(Chef::RunLock).to receive(:acquire)
+ expect_any_instance_of(Chef::RunLock).to receive(:save_pid)
+ expect_any_instance_of(Chef::RunLock).to receive(:release)
# Post conditions: check that node has been filled in correctly
- client.should_receive(:run_started)
- client.should_receive(:run_completed_successfully)
+ expect(client).to receive(:run_started)
+ expect(client).to receive(:run_completed_successfully)
end
before do
@@ -290,8 +291,8 @@ describe Chef::Client do
client.run
# fork is stubbed, so we can see the outcome of the run
- node.automatic_attrs[:platform].should == "example-platform"
- node.automatic_attrs[:platform_version].should == "example-platform-1.0"
+ expect(node.automatic_attrs[:platform]).to eq("example-platform")
+ expect(node.automatic_attrs[:platform_version]).to eq("example-platform-1.0")
end
end
@@ -320,23 +321,23 @@ describe Chef::Client do
before do
# Client will try to compile and run override_recipe
- Chef::RunContext::CookbookCompiler.any_instance.should_receive(:compile)
+ expect_any_instance_of(Chef::RunContext::CookbookCompiler).to receive(:compile)
end
def stub_for_sync_cookbooks
# --Client#setup_run_context
# ---Client#sync_cookbooks -- downloads the list of cookbooks to sync
#
- Chef::CookbookSynchronizer.any_instance.should_receive(:sync_cookbooks)
- Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync)
- http_cookbook_sync.should_receive(:post).
+ expect_any_instance_of(Chef::CookbookSynchronizer).to receive(:sync_cookbooks)
+ expect(Chef::REST).to receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync)
+ expect(http_cookbook_sync).to receive(:post).
with("environments/_default/cookbook_versions", {:run_list => ["override_recipe"]}).
and_return({})
end
def stub_for_node_save
# Expect NO node save
- node.should_not_receive(:save)
+ expect(node).not_to receive(:save)
end
end
end
@@ -353,9 +354,9 @@ describe Chef::Client do
# --Client#setup_run_context
# ---Client#sync_cookbooks -- downloads the list of cookbooks to sync
#
- Chef::CookbookSynchronizer.any_instance.should_receive(:sync_cookbooks)
- Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync)
- http_cookbook_sync.should_receive(:post).
+ expect_any_instance_of(Chef::CookbookSynchronizer).to receive(:sync_cookbooks)
+ expect(Chef::REST).to receive(:new).with(Chef::Config[:chef_server_url]).and_return(http_cookbook_sync)
+ expect(http_cookbook_sync).to receive(:post).
with("environments/_default/cookbook_versions", {:run_list => ["new_run_list_recipe"]}).
and_return({})
end
@@ -363,12 +364,12 @@ describe Chef::Client do
before do
# Client will try to compile and run the new_run_list_recipe, but we
# do not create a fixture for this.
- Chef::RunContext::CookbookCompiler.any_instance.should_receive(:compile)
+ expect_any_instance_of(Chef::RunContext::CookbookCompiler).to receive(:compile)
end
it "sets the new run list on the node" do
client.run
- node.run_list.should == Chef::RunList.new(new_runlist)
+ expect(node.run_list).to eq(Chef::RunList.new(new_runlist))
end
end
end
@@ -380,24 +381,23 @@ describe Chef::Client do
it "should remove the run_lock on failure of #load_node" do
@run_lock = double("Chef::RunLock", :acquire => true)
- Chef::RunLock.stub(:new).and_return(@run_lock)
+ allow(Chef::RunLock).to receive(:new).and_return(@run_lock)
@events = double("Chef::EventDispatch::Dispatcher").as_null_object
- Chef::EventDispatch::Dispatcher.stub(:new).and_return(@events)
-
+ allow(Chef::EventDispatch::Dispatcher).to receive(:new).and_return(@events)
# @events is created on Chef::Client.new, so we need to recreate it after mocking
client = Chef::Client.new
- client.stub(:load_node).and_raise(Exception)
- @run_lock.should_receive(:release)
- lambda { client.run }.should raise_error(Exception)
+ allow(client).to receive(:load_node).and_raise(Exception)
+ expect(@run_lock).to receive(:release)
+ expect { client.run }.to raise_error(Exception)
end
end
describe "when notifying other objects of the status of the chef run" do
before do
Chef::Client.clear_notifications
- Chef::Node.stub(:find_or_create).and_return(node)
- node.stub(:save)
+ allow(Chef::Node).to receive(:find_or_create).and_return(node)
+ allow(node).to receive(:save)
client.load_node
client.build_node
end
@@ -405,34 +405,34 @@ describe Chef::Client do
it "notifies observers that the run has started" do
notified = false
Chef::Client.when_run_starts do |run_status|
- run_status.node.should == node
+ expect(run_status.node).to eq(node)
notified = true
end
client.run_started
- notified.should be_true
+ expect(notified).to be_truthy
end
it "notifies observers that the run has completed successfully" do
notified = false
Chef::Client.when_run_completes_successfully do |run_status|
- run_status.node.should == node
+ expect(run_status.node).to eq(node)
notified = true
end
client.run_completed_successfully
- notified.should be_true
+ expect(notified).to be_truthy
end
it "notifies observers that the run failed" do
notified = false
Chef::Client.when_run_fails do |run_status|
- run_status.node.should == node
+ expect(run_status.node).to eq(node)
notified = true
end
client.run_failed
- notified.should be_true
+ expect(notified).to be_truthy
end
end
@@ -446,73 +446,73 @@ describe Chef::Client do
# build_node will call Node#expand! with server, which will
# eventually hit the server to expand the included role.
mock_chef_rest = double("Chef::REST")
- mock_chef_rest.should_receive(:get_rest).with("roles/role_containing_cookbook1").and_return(role_containing_cookbook1)
- Chef::REST.should_receive(:new).and_return(mock_chef_rest)
+ expect(mock_chef_rest).to receive(:get_rest).with("roles/role_containing_cookbook1").and_return(role_containing_cookbook1)
+ expect(Chef::REST).to receive(:new).and_return(mock_chef_rest)
# check pre-conditions.
- node[:roles].should be_nil
- node[:recipes].should be_nil
+ expect(node[:roles]).to be_nil
+ expect(node[:recipes]).to be_nil
- client.policy_builder.stub(:node).and_return(node)
+ allow(client.policy_builder).to receive(:node).and_return(node)
# chefspec and possibly others use the return value of this method
- client.build_node.should == node
+ expect(client.build_node).to eq(node)
# check post-conditions.
- node[:roles].should_not be_nil
- node[:roles].length.should == 1
- node[:roles].should include("role_containing_cookbook1")
- node[:recipes].should_not be_nil
- node[:recipes].length.should == 1
- node[:recipes].should include("cookbook1")
+ expect(node[:roles]).not_to be_nil
+ expect(node[:roles].length).to eq(1)
+ expect(node[:roles]).to include("role_containing_cookbook1")
+ expect(node[:recipes]).not_to be_nil
+ expect(node[:recipes].length).to eq(1)
+ expect(node[:recipes]).to include("cookbook1")
end
it "should set the environment from the specified configuration value" do
- node.chef_environment.should == "_default"
+ expect(node.chef_environment).to eq("_default")
Chef::Config[:environment] = "A"
test_env = Chef::Environment.new
test_env.name("A")
mock_chef_rest = double("Chef::REST")
- mock_chef_rest.should_receive(:get_rest).with("environments/A").and_return(test_env)
- Chef::REST.should_receive(:new).and_return(mock_chef_rest)
- client.policy_builder.stub(:node).and_return(node)
- client.build_node.should == node
+ expect(mock_chef_rest).to receive(:get_rest).with("environments/A").and_return(test_env)
+ expect(Chef::REST).to receive(:new).and_return(mock_chef_rest)
+ allow(client.policy_builder).to receive(:node).and_return(node)
+ expect(client.build_node).to eq(node)
- node.chef_environment.should == "A"
+ expect(node.chef_environment).to eq("A")
end
end
describe "windows_admin_check" do
context "platform is not windows" do
before do
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
end
it "shouldn't be called" do
- client.should_not_receive(:has_admin_privileges?)
+ expect(client).not_to receive(:has_admin_privileges?)
client.do_windows_admin_check
end
end
context "platform is windows" do
before do
- Chef::Platform.stub(:windows?).and_return(true)
+ allow(Chef::Platform).to receive(:windows?).and_return(true)
end
it "should be called" do
- client.should_receive(:has_admin_privileges?)
+ expect(client).to receive(:has_admin_privileges?)
client.do_windows_admin_check
end
context "admin privileges exist" do
before do
- client.should_receive(:has_admin_privileges?).and_return(true)
+ expect(client).to receive(:has_admin_privileges?).and_return(true)
end
it "should not log a warning message" do
- Chef::Log.should_not_receive(:warn)
+ expect(Chef::Log).not_to receive(:warn)
client.do_windows_admin_check
end
@@ -525,11 +525,11 @@ describe Chef::Client do
context "admin privileges doesn't exist" do
before do
- client.should_receive(:has_admin_privileges?).and_return(false)
+ expect(client).to receive(:has_admin_privileges?).and_return(false)
end
it "should log a warning message" do
- Chef::Log.should_receive(:warn)
+ expect(Chef::Log).to receive(:warn)
client.do_windows_admin_check
end
diff --git a/spec/unit/config_fetcher_spec.rb b/spec/unit/config_fetcher_spec.rb
index 31787a0909..1b4a4903a8 100644
--- a/spec/unit/config_fetcher_spec.rb
+++ b/spec/unit/config_fetcher_spec.rb
@@ -16,10 +16,10 @@ describe Chef::ConfigFetcher do
let(:config_content) { "# The client.rb content" }
it "reads the file from disk" do
- ::File.should_receive(:read).
+ expect(::File).to receive(:read).
with(config_location).
and_return(config_content)
- fetcher.read_config.should == config_content
+ expect(fetcher.read_config).to eq(config_content)
end
context "and consuming JSON" do
@@ -28,11 +28,11 @@ describe Chef::ConfigFetcher do
it "returns the parsed JSON" do
- ::File.should_receive(:read).
+ expect(::File).to receive(:read).
with(config_location).
and_return(valid_json)
- fetcher.fetch_json.should == {"a" => "b"}
+ expect(fetcher.fetch_json).to eq({"a" => "b"})
end
context "and the JSON is invalid" do
@@ -40,11 +40,11 @@ describe Chef::ConfigFetcher do
it "reports the JSON error" do
- ::File.should_receive(:read).
+ expect(::File).to receive(:read).
with(config_location).
and_return(invalid_json)
- Chef::Application.should_receive(:fatal!).
+ expect(Chef::Application).to receive(:fatal!).
with(invalid_json_error_regex, 2)
fetcher.fetch_json
end
@@ -59,32 +59,32 @@ describe Chef::ConfigFetcher do
let(:config_content) { "# The client.rb content" }
before do
- Chef::HTTP::Simple.should_receive(:new).
+ expect(Chef::HTTP::Simple).to receive(:new).
with(config_location).
and_return(http)
end
it "reads the file over HTTP" do
- http.should_receive(:get).
+ expect(http).to receive(:get).
with("").and_return(config_content)
- fetcher.read_config.should == config_content
+ expect(fetcher.read_config).to eq(config_content)
end
context "and consuming JSON" do
let(:config_location) { "https://example.com/foo.json" }
it "fetches the file and parses it" do
- http.should_receive(:get).
+ expect(http).to receive(:get).
with("").and_return(valid_json)
- fetcher.fetch_json.should == {"a" => "b"}
+ expect(fetcher.fetch_json).to eq({"a" => "b"})
end
context "and the JSON is invalid" do
it "reports the JSON error" do
- http.should_receive(:get).
+ expect(http).to receive(:get).
with("").and_return(invalid_json)
- Chef::Application.should_receive(:fatal!).
+ expect(Chef::Application).to receive(:fatal!).
with(invalid_json_error_regex, 2)
fetcher.fetch_json
end
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 41411669e6..58fb229c96 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -28,7 +28,7 @@ describe Chef::Config do
end
it "sets the server url" do
- Chef::Config.chef_server_url.should == "https://junglist.gen.nz"
+ expect(Chef::Config.chef_server_url).to eq("https://junglist.gen.nz")
end
context "when the url has a leading space" do
@@ -37,7 +37,7 @@ describe Chef::Config do
end
it "strips the space from the url when setting" do
- Chef::Config.chef_server_url.should == "https://junglist.gen.nz"
+ expect(Chef::Config.chef_server_url).to eq("https://junglist.gen.nz")
end
end
@@ -48,7 +48,7 @@ describe Chef::Config do
end
it "strips the space from the url when setting without raising an error" do
- Chef::Config.chef_server_url.should == "https://junglist.gen.nz"
+ expect(Chef::Config.chef_server_url).to eq("https://junglist.gen.nz")
end
end
@@ -79,39 +79,39 @@ describe Chef::Config do
# end
#
it "has an empty list of formatters by default" do
- Chef::Config.formatters.should == []
+ expect(Chef::Config.formatters).to eq([])
end
it "configures a formatter with a short name" do
Chef::Config.add_formatter(:doc)
- Chef::Config.formatters.should == [[:doc, nil]]
+ expect(Chef::Config.formatters).to eq([[:doc, nil]])
end
it "configures a formatter with a file output" do
Chef::Config.add_formatter(:doc, "/var/log/formatter.log")
- Chef::Config.formatters.should == [[:doc, "/var/log/formatter.log"]]
+ expect(Chef::Config.formatters).to eq([[:doc, "/var/log/formatter.log"]])
end
end
describe "class method: manage_secret_key" do
before do
- Chef::FileCache.stub(:load).and_return(true)
- Chef::FileCache.stub(:has_key?).with("chef_server_cookie_id").and_return(false)
+ allow(Chef::FileCache).to receive(:load).and_return(true)
+ allow(Chef::FileCache).to receive(:has_key?).with("chef_server_cookie_id").and_return(false)
end
it "should generate and store a chef server cookie id" do
- Chef::FileCache.should_receive(:store).with("chef_server_cookie_id", /\w{40}/).and_return(true)
+ expect(Chef::FileCache).to receive(:store).with("chef_server_cookie_id", /\w{40}/).and_return(true)
Chef::Config.manage_secret_key
end
describe "when the filecache has a chef server cookie id key" do
before do
- Chef::FileCache.stub(:has_key?).with("chef_server_cookie_id").and_return(true)
+ allow(Chef::FileCache).to receive(:has_key?).with("chef_server_cookie_id").and_return(true)
end
it "should not generate and store a chef server cookie id" do
- Chef::FileCache.should_not_receive(:store).with("chef_server_cookie_id", /\w{40}/)
+ expect(Chef::FileCache).not_to receive(:store).with("chef_server_cookie_id", /\w{40}/)
Chef::Config.manage_secret_key
end
end
@@ -126,23 +126,23 @@ describe Chef::Config do
end
before :each do
- Chef::Platform.stub(:windows?).and_return(is_windows)
+ allow(Chef::Platform).to receive(:windows?).and_return(is_windows)
end
describe "class method: platform_specific_path" do
if is_windows
it "should return a windows path on windows systems" do
path = "/etc/chef/cookbooks"
- Chef::Config.stub(:env).and_return({ 'SYSTEMDRIVE' => 'C:' })
+ allow(Chef::Config).to receive(:env).and_return({ 'SYSTEMDRIVE' => 'C:' })
# match on a regex that looks for the base path with an optional
# system drive at the beginning (c:)
# system drive is not hardcoded b/c it can change and b/c it is not present on linux systems
- Chef::Config.platform_specific_path(path).should == "C:\\chef\\cookbooks"
+ expect(Chef::Config.platform_specific_path(path)).to eq("C:\\chef\\cookbooks")
end
else
it "should return given path on non-windows systems" do
path = "/etc/chef/cookbooks"
- Chef::Config.platform_specific_path(path).should == "/etc/chef/cookbooks"
+ expect(Chef::Config.platform_specific_path(path)).to eq("/etc/chef/cookbooks")
end
end
end
@@ -166,46 +166,46 @@ describe Chef::Config do
before do
if is_windows
- Chef::Config.stub(:env).and_return({ 'SYSTEMDRIVE' => 'C:' })
+ allow(Chef::Config).to receive(:env).and_return({ 'SYSTEMDRIVE' => 'C:' })
Chef::Config[:user_home] = 'C:\Users\charlie'
else
Chef::Config[:user_home] = '/Users/charlie'
end
- Chef::Config.stub(:path_accessible?).and_return(false)
+ allow(Chef::Config).to receive(:path_accessible?).and_return(false)
end
describe "Chef::Config[:cache_path]" do
context "when /var/chef exists and is accessible" do
it "defaults to /var/chef" do
- Chef::Config.stub(:path_accessible?).with(to_platform("/var/chef")).and_return(true)
- Chef::Config[:cache_path].should == primary_cache_path
+ allow(Chef::Config).to receive(:path_accessible?).with(to_platform("/var/chef")).and_return(true)
+ expect(Chef::Config[:cache_path]).to eq(primary_cache_path)
end
end
context "when /var/chef does not exist and /var is accessible" do
it "defaults to /var/chef" do
- File.stub(:exists?).with(to_platform("/var/chef")).and_return(false)
- Chef::Config.stub(:path_accessible?).with(to_platform("/var")).and_return(true)
- Chef::Config[:cache_path].should == primary_cache_path
+ allow(File).to receive(:exists?).with(to_platform("/var/chef")).and_return(false)
+ allow(Chef::Config).to receive(:path_accessible?).with(to_platform("/var")).and_return(true)
+ expect(Chef::Config[:cache_path]).to eq(primary_cache_path)
end
end
context "when /var/chef does not exist and /var is not accessible" do
it "defaults to $HOME/.chef" do
- File.stub(:exists?).with(to_platform("/var/chef")).and_return(false)
- Chef::Config.stub(:path_accessible?).with(to_platform("/var")).and_return(false)
- Chef::Config[:cache_path].should == secondary_cache_path
+ allow(File).to receive(:exists?).with(to_platform("/var/chef")).and_return(false)
+ allow(Chef::Config).to receive(:path_accessible?).with(to_platform("/var")).and_return(false)
+ expect(Chef::Config[:cache_path]).to eq(secondary_cache_path)
end
end
context "when /var/chef exists and is not accessible" do
it "defaults to $HOME/.chef" do
- File.stub(:exists?).with(to_platform("/var/chef")).and_return(true)
- File.stub(:readable?).with(to_platform("/var/chef")).and_return(true)
- File.stub(:writable?).with(to_platform("/var/chef")).and_return(false)
+ allow(File).to receive(:exists?).with(to_platform("/var/chef")).and_return(true)
+ allow(File).to receive(:readable?).with(to_platform("/var/chef")).and_return(true)
+ allow(File).to receive(:writable?).with(to_platform("/var/chef")).and_return(false)
- Chef::Config[:cache_path].should == secondary_cache_path
+ expect(Chef::Config[:cache_path]).to eq(secondary_cache_path)
end
end
@@ -220,7 +220,7 @@ describe Chef::Config do
end
it "cache_path is /a/b/c/local-mode-cache" do
- Chef::Config.cache_path.should == to_platform('/a/b/c/local-mode-cache')
+ expect(Chef::Config.cache_path).to eq(to_platform('/a/b/c/local-mode-cache'))
end
end
@@ -230,43 +230,43 @@ describe Chef::Config do
end
it "cache_path is /a/b/c/local-mode-cache" do
- Chef::Config.cache_path.should == to_platform('/a/b/c/local-mode-cache')
+ expect(Chef::Config.cache_path).to eq(to_platform('/a/b/c/local-mode-cache'))
end
end
end
end
it "Chef::Config[:file_backup_path] defaults to /var/chef/backup" do
- Chef::Config.stub(:cache_path).and_return(primary_cache_path)
+ allow(Chef::Config).to receive(:cache_path).and_return(primary_cache_path)
backup_path = is_windows ? "#{primary_cache_path}\\backup" : "#{primary_cache_path}/backup"
- Chef::Config[:file_backup_path].should == backup_path
+ expect(Chef::Config[:file_backup_path]).to eq(backup_path)
end
it "Chef::Config[:ssl_verify_mode] defaults to :verify_peer" do
- Chef::Config[:ssl_verify_mode].should == :verify_peer
+ expect(Chef::Config[:ssl_verify_mode]).to eq(:verify_peer)
end
it "Chef::Config[:ssl_ca_path] defaults to nil" do
- Chef::Config[:ssl_ca_path].should be_nil
+ expect(Chef::Config[:ssl_ca_path]).to be_nil
end
# TODO can this be removed?
if !is_windows
it "Chef::Config[:ssl_ca_file] defaults to nil" do
- Chef::Config[:ssl_ca_file].should be_nil
+ expect(Chef::Config[:ssl_ca_file]).to be_nil
end
end
it "Chef::Config[:data_bag_path] defaults to /var/chef/data_bags" do
- Chef::Config.stub(:cache_path).and_return(primary_cache_path)
+ allow(Chef::Config).to receive(:cache_path).and_return(primary_cache_path)
data_bag_path = is_windows ? "#{primary_cache_path}\\data_bags" : "#{primary_cache_path}/data_bags"
- Chef::Config[:data_bag_path].should == data_bag_path
+ expect(Chef::Config[:data_bag_path]).to eq(data_bag_path)
end
it "Chef::Config[:environment_path] defaults to /var/chef/environments" do
- Chef::Config.stub(:cache_path).and_return(primary_cache_path)
+ allow(Chef::Config).to receive(:cache_path).and_return(primary_cache_path)
environment_path = is_windows ? "#{primary_cache_path}\\environments" : "#{primary_cache_path}/environments"
- Chef::Config[:environment_path].should == environment_path
+ expect(Chef::Config[:environment_path]).to eq(environment_path)
end
describe "setting the config dir" do
@@ -278,7 +278,7 @@ describe Chef::Config do
end
it "config_dir is /etc/chef" do
- Chef::Config.config_dir.should == to_platform("/etc/chef")
+ expect(Chef::Config.config_dir).to eq(to_platform("/etc/chef"))
end
context "and chef is running in local mode" do
@@ -287,7 +287,7 @@ describe Chef::Config do
end
it "config_dir is /etc/chef" do
- Chef::Config.config_dir.should == to_platform("/etc/chef")
+ expect(Chef::Config.config_dir).to eq(to_platform("/etc/chef"))
end
end
@@ -297,7 +297,7 @@ describe Chef::Config do
end
it "yields the explicit value" do
- Chef::Config.config_dir.should == to_platform("/other/config/dir/")
+ expect(Chef::Config.config_dir).to eq(to_platform("/other/config/dir/"))
end
end
@@ -309,7 +309,7 @@ describe Chef::Config do
end
it "config_dir is /home/charlie/.chef/" do
- Chef::Config.config_dir.should == Chef::Util::PathHelper.join(to_platform("/home/charlie/.chef"), '')
+ expect(Chef::Config.config_dir).to eq(Chef::Util::PathHelper.join(to_platform("/home/charlie/.chef"), ''))
end
context "and chef is running in local mode" do
@@ -318,7 +318,7 @@ describe Chef::Config do
end
it "config_dir is /home/charlie/.chef/" do
- Chef::Config.config_dir.should == Chef::Util::PathHelper.join(to_platform("/home/charlie/.chef"), '')
+ expect(Chef::Config.config_dir).to eq(Chef::Util::PathHelper.join(to_platform("/home/charlie/.chef"), ''))
end
end
end
@@ -334,24 +334,24 @@ describe Chef::Config do
let(:default_ca_file) { "c:/opscode/chef/embedded/ssl/certs/cacert.pem" }
it "finds the embedded dir in the default location" do
- Chef::Config.stub(:_this_file).and_return(default_config_location)
- Chef::Config.embedded_dir.should == "c:/opscode/chef/embedded"
+ allow(Chef::Config).to receive(:_this_file).and_return(default_config_location)
+ expect(Chef::Config.embedded_dir).to eq("c:/opscode/chef/embedded")
end
it "finds the embedded dir in a custom install location" do
- Chef::Config.stub(:_this_file).and_return(alternate_install_location)
- Chef::Config.embedded_dir.should == "c:/my/alternate/install/place/chef/embedded"
+ allow(Chef::Config).to receive(:_this_file).and_return(alternate_install_location)
+ expect(Chef::Config.embedded_dir).to eq("c:/my/alternate/install/place/chef/embedded")
end
it "doesn't error when not in an omnibus install" do
- Chef::Config.stub(:_this_file).and_return(non_omnibus_location)
- Chef::Config.embedded_dir.should be_nil
+ allow(Chef::Config).to receive(:_this_file).and_return(non_omnibus_location)
+ expect(Chef::Config.embedded_dir).to be_nil
end
it "sets the ssl_ca_cert path if the cert file is available" do
- Chef::Config.stub(:_this_file).and_return(default_config_location)
- File.stub(:exist?).with(default_ca_file).and_return(true)
- Chef::Config.ssl_ca_file.should == default_ca_file
+ allow(Chef::Config).to receive(:_this_file).and_return(default_config_location)
+ allow(File).to receive(:exist?).with(default_ca_file).and_return(true)
+ expect(Chef::Config.ssl_ca_file).to eq(default_ca_file)
end
end
end
@@ -360,19 +360,19 @@ describe Chef::Config do
describe "Chef::Config[:user_home]" do
it "should set when HOME is provided" do
expected = to_platform("/home/kitten")
- Chef::Config.stub(:env).and_return({ 'HOME' => expected })
- Chef::Config[:user_home].should == expected
+ allow(Chef::Config).to receive(:env).and_return({ 'HOME' => expected })
+ expect(Chef::Config[:user_home]).to eq(expected)
end
it "should be set when only USERPROFILE is provided" do
expected = to_platform("/users/kitten")
- Chef::Config.stub(:env).and_return({ 'USERPROFILE' => expected })
- Chef::Config[:user_home].should == expected
+ allow(Chef::Config).to receive(:env).and_return({ 'USERPROFILE' => expected })
+ expect(Chef::Config[:user_home]).to eq(expected)
end
it "falls back to the current working directory when HOME and USERPROFILE is not set" do
- Chef::Config.stub(:env).and_return({})
- Chef::Config[:user_home].should == Dir.pwd
+ allow(Chef::Config).to receive(:env).and_return({})
+ expect(Chef::Config[:user_home]).to eq(Dir.pwd)
end
end
@@ -380,32 +380,32 @@ describe Chef::Config do
let(:db_secret_default_path){ to_platform("/etc/chef/encrypted_data_bag_secret") }
before do
- File.stub(:exist?).with(db_secret_default_path).and_return(secret_exists)
+ allow(File).to receive(:exist?).with(db_secret_default_path).and_return(secret_exists)
end
context "/etc/chef/encrypted_data_bag_secret exists" do
let(:secret_exists) { true }
it "sets the value to /etc/chef/encrypted_data_bag_secret" do
- Chef::Config[:encrypted_data_bag_secret].should eq db_secret_default_path
+ expect(Chef::Config[:encrypted_data_bag_secret]).to eq db_secret_default_path
end
end
context "/etc/chef/encrypted_data_bag_secret does not exist" do
let(:secret_exists) { false }
it "sets the value to nil" do
- Chef::Config[:encrypted_data_bag_secret].should be_nil
+ expect(Chef::Config[:encrypted_data_bag_secret]).to be_nil
end
end
end
describe "Chef::Config[:event_handlers]" do
it "sets a event_handlers to an empty array by default" do
- Chef::Config[:event_handlers].should eq([])
+ expect(Chef::Config[:event_handlers]).to eq([])
end
it "should be able to add custom handlers" do
o = Object.new
Chef::Config[:event_handlers] << o
- Chef::Config[:event_handlers].should be_include(o)
+ expect(Chef::Config[:event_handlers]).to be_include(o)
end
end
@@ -413,7 +413,96 @@ describe Chef::Config do
context "on a platform that is not Windows" do
it "allows one letter usernames" do
any_match = Chef::Config[:user_valid_regex].any? { |regex| regex.match('a') }
- expect(any_match).to be_true
+ expect(any_match).to be_truthy
+ end
+ end
+ end
+
+ describe "Chef::Config[:internal_locale]" do
+ let(:shell_out) do
+ double("Chef::Mixin::ShellOut double", :exitstatus => 0, :stdout => locales)
+ end
+
+ let(:locales) { locale_array.join("\n") }
+
+ before do
+ allow(Chef::Config).to receive(:shell_out_with_systems_locale).with("locale -a").and_return(shell_out)
+ end
+
+ shared_examples_for "a suitable locale" do
+ it "returns an English UTF-8 locale" do
+ expect(Chef::Log).to_not receive(:warn).with(/Please install an English UTF-8 locale for Chef to use/)
+ expect(Chef::Log).to_not receive(:debug).with(/Defaulting to locale en_US.UTF-8 on Windows/)
+ expect(Chef::Log).to_not receive(:debug).with(/No usable locale -a command found/)
+ expect(Chef::Config.guess_internal_locale).to eq expected_locale
+ end
+ end
+
+ context "when the result includes 'C.UTF-8'" do
+ include_examples "a suitable locale" do
+ let(:locale_array) { [expected_locale, "en_US.UTF-8"] }
+ let(:expected_locale) { "C.UTF-8" }
+ end
+ end
+
+ context "when the result includes 'en_US.UTF-8'" do
+ include_examples "a suitable locale" do
+ let(:locale_array) { ["en_CA.UTF-8", expected_locale, "en_NZ.UTF-8"] }
+ let(:expected_locale) { "en_US.UTF-8" }
+ end
+ end
+
+ context "when the result includes 'en_US.utf8'" do
+ include_examples "a suitable locale" do
+ let(:locale_array) { ["en_CA.utf8", "en_US.utf8", "en_NZ.utf8"] }
+ let(:expected_locale) { "en_US.UTF-8" }
+ end
+ end
+
+ context "when the result includes 'en.UTF-8'" do
+ include_examples "a suitable locale" do
+ let(:locale_array) { ["en.ISO8859-1", expected_locale] }
+ let(:expected_locale) { "en.UTF-8" }
+ end
+ end
+
+ context "when the result includes 'en_*.UTF-8'" do
+ include_examples "a suitable locale" do
+ let(:locale_array) { [expected_locale, "en_CA.UTF-8", "en_GB.UTF-8"] }
+ let(:expected_locale) { "en_AU.UTF-8" }
+ end
+ end
+
+ context "when the result includes 'en_*.utf8'" do
+ include_examples "a suitable locale" do
+ let(:locale_array) { ["en_AU.utf8", "en_CA.utf8", "en_GB.utf8"] }
+ let(:expected_locale) { "en_AU.UTF-8" }
+ end
+ end
+
+ context "when the result does not include 'en_*.UTF-8'" do
+ let(:locale_array) { ["af_ZA", "af_ZA.ISO8859-1", "af_ZA.ISO8859-15", "af_ZA.UTF-8"] }
+
+ it "should fall back to C locale" do
+ expect(Chef::Log).to receive(:warn).with("Please install an English UTF-8 locale for Chef to use, falling back to C locale and disabling UTF-8 support.")
+ expect(Chef::Config.guess_internal_locale).to eq 'C'
+ end
+ end
+
+ context "on error" do
+ let(:locale_array) { [] }
+
+ before do
+ allow(Chef::Config).to receive(:shell_out_with_systems_locale).and_raise("THIS IS AN ERROR")
+ end
+
+ it "should default to 'en_US.UTF-8'" do
+ if is_windows
+ expect(Chef::Log).to receive(:debug).with("Defaulting to locale en_US.UTF-8 on Windows, until it matters that we do something else.")
+ else
+ expect(Chef::Log).to receive(:debug).with("No usable locale -a command found, assuming you have en_US.UTF-8 installed.")
+ end
+ expect(Chef::Config.guess_internal_locale).to eq "en_US.UTF-8"
end
end
end
diff --git a/spec/unit/cookbook/chefignore_spec.rb b/spec/unit/cookbook/chefignore_spec.rb
index e529a6d05a..9f5546de28 100644
--- a/spec/unit/cookbook/chefignore_spec.rb
+++ b/spec/unit/cookbook/chefignore_spec.rb
@@ -23,18 +23,18 @@ describe Chef::Cookbook::Chefignore do
end
it "loads the globs in the chefignore file" do
- @chefignore.ignores.should =~ %w[recipes/ignoreme.rb ignored]
+ expect(@chefignore.ignores).to match_array(%w[recipes/ignoreme.rb ignored])
end
it "removes items from an array that match the ignores" do
file_list = %w[ recipes/ignoreme.rb recipes/dontignoreme.rb ]
- @chefignore.remove_ignores_from(file_list).should == %w[recipes/dontignoreme.rb]
+ expect(@chefignore.remove_ignores_from(file_list)).to eq(%w[recipes/dontignoreme.rb])
end
it "determines if a file is ignored" do
- @chefignore.ignored?('ignored').should be_true
- @chefignore.ignored?('recipes/ignoreme.rb').should be_true
- @chefignore.ignored?('recipes/dontignoreme.rb').should be_false
+ expect(@chefignore.ignored?('ignored')).to be_truthy
+ expect(@chefignore.ignored?('recipes/ignoreme.rb')).to be_truthy
+ expect(@chefignore.ignored?('recipes/dontignoreme.rb')).to be_falsey
end
context "when using the single cookbook pattern" do
@@ -43,7 +43,7 @@ describe Chef::Cookbook::Chefignore do
end
it "loads the globs in the chefignore file" do
- @chefignore.ignores.should =~ %w[recipes/ignoreme.rb ignored vendor/bundle/*]
+ expect(@chefignore.ignores).to match_array(%w[recipes/ignoreme.rb ignored vendor/bundle/*])
end
end
end
diff --git a/spec/unit/cookbook/cookbook_version_loader_spec.rb b/spec/unit/cookbook/cookbook_version_loader_spec.rb
index 4ba4e1de57..2c4ad11787 100644
--- a/spec/unit/cookbook/cookbook_version_loader_spec.rb
+++ b/spec/unit/cookbook/cookbook_version_loader_spec.rb
@@ -20,7 +20,7 @@ require 'spec_helper'
describe Chef::Cookbook::CookbookVersionLoader do
before do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
end
describe "loading a cookbook" do
@@ -74,8 +74,8 @@ describe Chef::Cookbook::CookbookVersionLoader do
end
it "should load the metadata for the cookbook" do
- loaded_cookbook.metadata.name.to_s.should == "openldap"
- loaded_cookbook.metadata.should be_a_kind_of(Chef::Cookbook::Metadata)
+ expect(loaded_cookbook.metadata.name.to_s).to eq("openldap")
+ expect(loaded_cookbook.metadata).to be_a_kind_of(Chef::Cookbook::Metadata)
end
context "when a cookbook has ignored files" do
diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb
index 51814320d4..a1903a1948 100644
--- a/spec/unit/cookbook/metadata_spec.rb
+++ b/spec/unit/cookbook/metadata_spec.rb
@@ -34,7 +34,7 @@ describe Chef::Cookbook::Metadata do
end
it "does not depend on object identity for equality" do
- metadata.should == metadata.dup
+ expect(metadata).to eq(metadata.dup)
end
it "is not equal to another object if it isn't have all of the metadata fields" do
@@ -46,7 +46,7 @@ describe Chef::Cookbook::Metadata do
setter = "#{field}="
metadata_value = metadata.send(field)
almost_duck_type.send(setter, metadata_value) if almost_duck_type.respond_to?(setter)
- @mets.should_not == almost_duck_type
+ expect(@mets).not_to eq(almost_duck_type)
end
end
end
@@ -58,7 +58,7 @@ describe Chef::Cookbook::Metadata do
metadata_value = metadata.send(field)
duck_type.send(setter, metadata_value)
end
- metadata.should == duck_type
+ expect(metadata).to eq(duck_type)
end
it "is not equal if any values are different" do
@@ -73,7 +73,7 @@ describe Chef::Cookbook::Metadata do
end
duck_type.send("#{field_to_change}=".to_sym, :epic_fail)
- metadata.should_not == duck_type
+ expect(metadata).not_to eq(duck_type)
end
end
@@ -82,71 +82,71 @@ describe Chef::Cookbook::Metadata do
describe "when first created" do
it "has no name" do
- metadata.name.should eq(nil)
+ expect(metadata.name).to eq(nil)
end
it "has an empty description" do
- metadata.description.should eq("")
+ expect(metadata.description).to eq("")
end
it "has an empty long description" do
- metadata.long_description.should eq("")
+ expect(metadata.long_description).to eq("")
end
it "defaults to 'all rights reserved' license" do
- metadata.license.should eq("All rights reserved")
+ expect(metadata.license).to eq("All rights reserved")
end
it "has an empty maintainer field" do
- metadata.maintainer.should eq(nil)
+ expect(metadata.maintainer).to eq(nil)
end
it "has an empty maintainer_email field" do
- metadata.maintainer.should eq(nil)
+ expect(metadata.maintainer).to eq(nil)
end
it "has an empty platforms list" do
- metadata.platforms.should eq(Mash.new)
+ expect(metadata.platforms).to eq(Mash.new)
end
it "has an empty dependencies list" do
- metadata.dependencies.should eq(Mash.new)
+ expect(metadata.dependencies).to eq(Mash.new)
end
it "has an empty recommends list" do
- metadata.recommendations.should eq(Mash.new)
+ expect(metadata.recommendations).to eq(Mash.new)
end
it "has an empty suggestions list" do
- metadata.suggestions.should eq(Mash.new)
+ expect(metadata.suggestions).to eq(Mash.new)
end
it "has an empty conflicts list" do
- metadata.conflicting.should eq(Mash.new)
+ expect(metadata.conflicting).to eq(Mash.new)
end
it "has an empty replaces list" do
- metadata.replacing.should eq(Mash.new)
+ expect(metadata.replacing).to eq(Mash.new)
end
it "has an empty attributes list" do
- metadata.attributes.should eq(Mash.new)
+ expect(metadata.attributes).to eq(Mash.new)
end
it "has an empty groupings list" do
- metadata.groupings.should eq(Mash.new)
+ expect(metadata.groupings).to eq(Mash.new)
end
it "has an empty recipes list" do
- metadata.recipes.should eq(Mash.new)
+ expect(metadata.recipes).to eq(Mash.new)
end
it "has an empty source_url string" do
- metadata.source_url.should eq('')
+ expect(metadata.source_url).to eq('')
end
it "has an empty issues_url string" do
- metadata.issues_url.should eq('')
+ expect(metadata.issues_url).to eq('')
end
end
@@ -155,12 +155,12 @@ describe Chef::Cookbook::Metadata do
context "when no required fields are set" do
it "is not valid" do
- metadata.should_not be_valid
+ expect(metadata).not_to be_valid
end
it "has a list of validation errors" do
expected_errors = ["The `name' attribute is required in cookbook metadata"]
- metadata.errors.should eq(expected_errors)
+ expect(metadata.errors).to eq(expected_errors)
end
end
@@ -171,11 +171,11 @@ describe Chef::Cookbook::Metadata do
end
it "is valid" do
- metadata.should be_valid
+ expect(metadata).to be_valid
end
it "has no validation errors" do
- metadata.errors.should be_empty
+ expect(metadata.errors).to be_empty
end
end
@@ -185,7 +185,7 @@ describe Chef::Cookbook::Metadata do
describe "adding a supported platform" do
it "should support adding a supported platform with a single expression" do
metadata.supports("ubuntu", ">= 8.04")
- metadata.platforms["ubuntu"].should == '>= 8.04'
+ expect(metadata.platforms["ubuntu"]).to eq('>= 8.04')
end
end
@@ -203,23 +203,23 @@ describe Chef::Cookbook::Metadata do
params.sort { |a,b| a.to_s <=> b.to_s }.each do |field, field_value|
describe field do
it "should be set-able via #{field}" do
- metadata.send(field, field_value).should eql(field_value)
+ expect(metadata.send(field, field_value)).to eql(field_value)
end
it "should be get-able via #{field}" do
metadata.send(field, field_value)
- metadata.send(field).should eql(field_value)
+ expect(metadata.send(field)).to eql(field_value)
end
end
end
describe "version transformation" do
it "should transform an '0.6' version to '0.6.0'" do
- metadata.send(:version, "0.6").should eql("0.6.0")
+ expect(metadata.send(:version, "0.6")).to eql("0.6.0")
end
it "should spit out '0.6.0' after transforming '0.6'" do
metadata.send(:version, "0.6")
- metadata.send(:version).should eql("0.6.0")
+ expect(metadata.send(:version)).to eql("0.6.0")
end
end
end
@@ -238,11 +238,11 @@ describe Chef::Cookbook::Metadata do
check_with = dep_args.shift
describe dep do
it "should be set-able via #{dep}" do
- metadata.send(dep, *dep_args).should == dep_args[1]
+ expect(metadata.send(dep, *dep_args)).to eq(dep_args[1])
end
it "should be get-able via #{check_with}" do
metadata.send(dep, *dep_args)
- metadata.send(check_with).should == { dep_args[0] => dep_args[1] }
+ expect(metadata.send(check_with)).to eq({ dep_args[0] => dep_args[1] })
end
end
end
@@ -260,11 +260,11 @@ describe Chef::Cookbook::Metadata do
normalized_version = dep_args.pop
describe dep do
it "should be set-able and normalized via #{dep}" do
- metadata.send(dep, *dep_args).should == normalized_version
+ expect(metadata.send(dep, *dep_args)).to eq(normalized_version)
end
it "should be get-able and normalized via #{check_with}" do
metadata.send(dep, *dep_args)
- metadata.send(check_with).should == { dep_args[0] => normalized_version }
+ expect(metadata.send(check_with)).to eq({ dep_args[0] => normalized_version })
end
end
end
@@ -282,7 +282,7 @@ describe Chef::Cookbook::Metadata do
dep_types.each do |dep, dep_args|
it "for #{dep} raises an informative error instead of vomiting on your shoes" do
- lambda {metadata.send(dep, *dep_args)}.should raise_error(Chef::Exceptions::ObsoleteDependencySyntax)
+ expect {metadata.send(dep, *dep_args)}.to raise_error(Chef::Exceptions::ObsoleteDependencySyntax)
end
end
end
@@ -300,7 +300,7 @@ describe Chef::Cookbook::Metadata do
dep_types.each do |dep, dep_args|
it "for #{dep} raises an informative error instead of vomiting on your shoes" do
- lambda {metadata.send(dep, *dep_args)}.should raise_error(Chef::Exceptions::InvalidVersionConstraint)
+ expect {metadata.send(dep, *dep_args)}.to raise_error(Chef::Exceptions::InvalidVersionConstraint)
end
end
end
@@ -312,24 +312,24 @@ describe Chef::Cookbook::Metadata do
"title" => "MySQL Tuning",
"description" => "Setting from the my.cnf file that allow you to tune your mysql server"
}
- metadata.grouping("/db/mysql/databases/tuning", group).should == group
+ expect(metadata.grouping("/db/mysql/databases/tuning", group)).to eq(group)
end
it "should not accept anything but a string for display_name" do
- lambda {
+ expect {
metadata.grouping("db/mysql/databases", :title => "foo")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.grouping("db/mysql/databases", :title => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should not accept anything but a string for the description" do
- lambda {
+ expect {
metadata.grouping("db/mysql/databases", :description => "foo")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.grouping("db/mysql/databases", :description => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
end
@@ -347,170 +347,170 @@ describe Chef::Cookbook::Metadata do
"source_url" => "http://example.com",
"issues_url" => "http://example.com/issues"
}
- metadata.attribute("/db/mysql/databases", attrs).should == attrs
+ expect(metadata.attribute("/db/mysql/databases", attrs)).to eq(attrs)
end
it "should not accept anything but a string for display_name" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :display_name => "foo")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :display_name => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should not accept anything but a string for the description" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :description => "foo")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :description => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should not accept anything but a string for the source_url" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :source_url => "foo")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :source_url => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should not accept anything but a string for the issues_url" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :issues_url => "foo")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :issues_url => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should not accept anything but an array of strings for choice" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :choice => ['dedicated', 'shared'])
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :choice => [10, 'shared'])
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
metadata.attribute("db/mysql/databases", :choice => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should set choice to empty array by default" do
metadata.attribute("db/mysql/databases", {})
- metadata.attributes["db/mysql/databases"][:choice].should == []
+ expect(metadata.attributes["db/mysql/databases"][:choice]).to eq([])
end
it "should let calculated be true or false" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :calculated => true)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :calculated => false)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :calculated => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should set calculated to false by default" do
metadata.attribute("db/mysql/databases", {})
- metadata.attributes["db/mysql/databases"][:calculated].should == false
+ expect(metadata.attributes["db/mysql/databases"][:calculated]).to eq(false)
end
it "accepts String for the attribute type" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :type => "string")
- }.should_not raise_error
+ }.not_to raise_error
end
it "accepts Array for the attribute type" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :type => "array")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :type => Array.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "accepts symbol for the attribute type" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :type => "symbol")
- }.should_not raise_error
+ }.not_to raise_error
end
it "should let type be hash (backwards compatability only)" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :type => "hash")
- }.should_not raise_error
+ }.not_to raise_error
end
it "should let required be required, recommended or optional" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :required => 'required')
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :required => 'recommended')
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :required => 'optional')
- }.should_not raise_error
+ }.not_to raise_error
end
it "should convert required true to required" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :required => true)
- }.should_not raise_error
+ }.not_to raise_error
#attrib = metadata.attributes["db/mysql/databases"][:required].should == "required"
end
it "should convert required false to optional" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :required => false)
- }.should_not raise_error
+ }.not_to raise_error
#attrib = metadata.attributes["db/mysql/databases"][:required].should == "optional"
end
it "should set required to 'optional' by default" do
metadata.attribute("db/mysql/databases", {})
- metadata.attributes["db/mysql/databases"][:required].should == 'optional'
+ expect(metadata.attributes["db/mysql/databases"][:required]).to eq('optional')
end
it "should make sure recipes is an array" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :recipes => [])
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :required => Hash.new)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should set recipes to an empty array by default" do
metadata.attribute("db/mysql/databases", {})
- metadata.attributes["db/mysql/databases"][:recipes].should == []
+ expect(metadata.attributes["db/mysql/databases"][:recipes]).to eq([])
end
it "should allow the default value to be a string, array, hash, boolean or numeric" do
- lambda {
+ expect {
metadata.attribute("db/mysql/databases", :default => [])
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :default => {})
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :default => "alice in chains")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :default => 1337)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :default => true)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
metadata.attribute("db/mysql/databases", :required => :not_gonna_do_it)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should limit the types allowed in the choice array" do
@@ -519,87 +519,87 @@ describe Chef::Cookbook::Metadata do
:choice => [ "test1", "test2" ],
:default => "test1"
}
- lambda {
+ expect {
metadata.attribute("test_cookbook/test", options)
- }.should_not raise_error
+ }.not_to raise_error
options = {
:type => "boolean",
:choice => [ true, false ],
:default => true
}
- lambda {
+ expect {
metadata.attribute("test_cookbook/test", options)
- }.should_not raise_error
+ }.not_to raise_error
options = {
:type => "numeric",
:choice => [ 1337, 420 ],
:default => 1337
}
- lambda {
+ expect {
metadata.attribute("test_cookbook/test", options)
- }.should_not raise_error
+ }.not_to raise_error
options = {
:type => "numeric",
:choice => [ true, "false" ],
:default => false
}
- lambda {
+ expect {
metadata.attribute("test_cookbook/test", options)
- }.should raise_error
+ }.to raise_error
end
it "should error if default used with calculated" do
- lambda {
+ expect {
attrs = {
:calculated => true,
:default => [ "I thought you said calculated" ]
}
metadata.attribute("db/mysql/databases", attrs)
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
attrs = {
:calculated => true,
:default => "I thought you said calculated"
}
metadata.attribute("db/mysql/databases", attrs)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should allow a default that is a choice" do
- lambda {
+ expect {
attrs = {
:choice => [ "a", "b", "c"],
:default => "b"
}
metadata.attribute("db/mysql/databases", attrs)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
attrs = {
:choice => [ "a", "b", "c", "d", "e"],
:default => ["b", "d"]
}
metadata.attribute("db/mysql/databases", attrs)
- }.should_not raise_error
+ }.not_to raise_error
end
it "should error if default is not a choice" do
- lambda {
+ expect {
attrs = {
:choice => [ "a", "b", "c"],
:default => "d"
}
metadata.attribute("db/mysql/databases", attrs)
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
attrs = {
:choice => [ "a", "b", "c", "d", "e"],
:default => ["b", "z"]
}
metadata.attribute("db/mysql/databases", attrs)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
end
@@ -616,18 +616,18 @@ describe Chef::Cookbook::Metadata do
end
it "should have the names of the recipes" do
- metadata.recipes["test_cookbook"].should == ""
- metadata.recipes["test_cookbook::enlighten"].should == ""
+ expect(metadata.recipes["test_cookbook"]).to eq("")
+ expect(metadata.recipes["test_cookbook::enlighten"]).to eq("")
end
it "should let you set the description for a recipe" do
metadata.recipe "test_cookbook", "It, um... tests stuff?"
- metadata.recipes["test_cookbook"].should == "It, um... tests stuff?"
+ expect(metadata.recipes["test_cookbook"]).to eq("It, um... tests stuff?")
end
it "should automatically provide each recipe" do
- metadata.providing.has_key?("test_cookbook").should == true
- metadata.providing.has_key?("test_cookbook::enlighten").should == true
+ expect(metadata.providing.has_key?("test_cookbook")).to eq(true)
+ expect(metadata.providing.has_key?("test_cookbook::enlighten")).to eq(true)
end
end
@@ -662,7 +662,7 @@ describe Chef::Cookbook::Metadata do
let(:deserialized_metadata) { Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(metadata)) }
it "should serialize to a json hash" do
- deserialized_metadata.should be_a_kind_of(Hash)
+ expect(deserialized_metadata).to be_a_kind_of(Hash)
end
%w{
@@ -686,7 +686,7 @@ describe Chef::Cookbook::Metadata do
issues_url
}.each do |t|
it "should include '#{t}'" do
- deserialized_metadata[t].should == metadata.send(t.to_sym)
+ expect(deserialized_metadata[t]).to eq(metadata.send(t.to_sym))
end
end
end
@@ -697,7 +697,7 @@ describe Chef::Cookbook::Metadata do
it "should deserialize to a Chef::Cookbook::Metadata object" do
- deserialized_metadata.should be_a_kind_of(Chef::Cookbook::Metadata)
+ expect(deserialized_metadata).to be_a_kind_of(Chef::Cookbook::Metadata)
end
%w{
@@ -721,7 +721,7 @@ describe Chef::Cookbook::Metadata do
issues_url
}.each do |t|
it "should match '#{t}'" do
- deserialized_metadata.send(t.to_sym).should == metadata.send(t.to_sym)
+ expect(deserialized_metadata.send(t.to_sym)).to eq(metadata.send(t.to_sym))
end
end
end
@@ -739,31 +739,31 @@ describe Chef::Cookbook::Metadata do
it "should transform deprecated greater than syntax for :#{to_check.to_s}" do
@hash[to_check.to_s]["foo::bar"] = ">> 0.2"
deserial = Chef::Cookbook::Metadata.from_hash(@hash)
- deserial.send(to_check)["foo::bar"].should == '> 0.2'
+ expect(deserial.send(to_check)["foo::bar"]).to eq('> 0.2')
end
it "should transform deprecated less than syntax for :#{to_check.to_s}" do
@hash[to_check.to_s]["foo::bar"] = "<< 0.2"
deserial = Chef::Cookbook::Metadata.from_hash(@hash)
- deserial.send(to_check)["foo::bar"].should == '< 0.2'
+ expect(deserial.send(to_check)["foo::bar"]).to eq('< 0.2')
end
it "should ignore multiple dependency constraints for :#{to_check.to_s}" do
@hash[to_check.to_s]["foo::bar"] = [ ">= 1.0", "<= 5.2" ]
deserial = Chef::Cookbook::Metadata.from_hash(@hash)
- deserial.send(to_check)["foo::bar"].should == []
+ expect(deserial.send(to_check)["foo::bar"]).to eq([])
end
it "should accept an empty array of dependency constraints for :#{to_check.to_s}" do
@hash[to_check.to_s]["foo::bar"] = []
deserial = Chef::Cookbook::Metadata.from_hash(@hash)
- deserial.send(to_check)["foo::bar"].should == []
+ expect(deserial.send(to_check)["foo::bar"]).to eq([])
end
it "should accept single-element arrays of dependency constraints for :#{to_check.to_s}" do
@hash[to_check.to_s]["foo::bar"] = [ ">= 2.0" ]
deserial = Chef::Cookbook::Metadata.from_hash(@hash)
- deserial.send(to_check)["foo::bar"].should == ">= 2.0"
+ expect(deserial.send(to_check)["foo::bar"]).to eq(">= 2.0")
end
end
end
diff --git a/spec/unit/cookbook/syntax_check_spec.rb b/spec/unit/cookbook/syntax_check_spec.rb
index 4d22e0e920..67d31cdca5 100644
--- a/spec/unit/cookbook/syntax_check_spec.rb
+++ b/spec/unit/cookbook/syntax_check_spec.rb
@@ -21,7 +21,7 @@ require "chef/cookbook/syntax_check"
describe Chef::Cookbook::SyntaxCheck do
before do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
end
let(:cookbook_path) { File.join(CHEF_SPEC_DATA, 'cookbooks', 'openldap') }
@@ -64,14 +64,14 @@ describe Chef::Cookbook::SyntaxCheck do
it "creates a syntax checker given the cookbook name when Chef::Config.cookbook_path is set" do
Chef::Config[:cookbook_path] = File.dirname(cookbook_path)
syntax_check = Chef::Cookbook::SyntaxCheck.for_cookbook(:openldap)
- syntax_check.cookbook_path.should == cookbook_path
- syntax_check.ruby_files.sort.should == open_ldap_cookbook_files.sort
+ expect(syntax_check.cookbook_path).to eq(cookbook_path)
+ expect(syntax_check.ruby_files.sort).to eq(open_ldap_cookbook_files.sort)
end
it "creates a syntax checker given the cookbook name and cookbook_path" do
syntax_check = Chef::Cookbook::SyntaxCheck.for_cookbook(:openldap, File.join(CHEF_SPEC_DATA, 'cookbooks'))
- syntax_check.cookbook_path.should == cookbook_path
- syntax_check.ruby_files.sort.should == open_ldap_cookbook_files.sort
+ expect(syntax_check.cookbook_path).to eq(cookbook_path)
+ expect(syntax_check.ruby_files.sort).to eq(open_ldap_cookbook_files.sort)
end
context "when using a standalone cookbook" do
@@ -79,22 +79,22 @@ describe Chef::Cookbook::SyntaxCheck do
it "creates a syntax checker given the cookbook name and cookbook_path for a standalone cookbook" do
syntax_check = Chef::Cookbook::SyntaxCheck.for_cookbook(:standalone_cookbook, CHEF_SPEC_DATA)
- syntax_check.cookbook_path.should == cookbook_path
- syntax_check.ruby_files.should == [File.join(cookbook_path, 'recipes/default.rb')]
+ expect(syntax_check.cookbook_path).to eq(cookbook_path)
+ expect(syntax_check.ruby_files).to eq([File.join(cookbook_path, 'recipes/default.rb')])
end
end
describe "when first created" do
it "has the path to the cookbook to syntax check" do
- syntax_check.cookbook_path.should == cookbook_path
+ expect(syntax_check.cookbook_path).to eq(cookbook_path)
end
it "lists the ruby files in the cookbook" do
- syntax_check.ruby_files.sort.should == @ruby_files.sort
+ expect(syntax_check.ruby_files.sort).to eq(@ruby_files.sort)
end
it "lists the erb templates in the cookbook" do
- syntax_check.template_files.sort.should == @template_files.sort
+ expect(syntax_check.template_files.sort).to eq(@template_files.sort)
end
end
@@ -112,33 +112,33 @@ describe Chef::Cookbook::SyntaxCheck do
describe "and the files have not been syntax checked previously" do
it "shows that all ruby files require a syntax check" do
- syntax_check.untested_ruby_files.sort.should == @ruby_files.sort
+ expect(syntax_check.untested_ruby_files.sort).to eq(@ruby_files.sort)
end
it "shows that all template files require a syntax check" do
- syntax_check.untested_template_files.sort.should == @template_files.sort
+ expect(syntax_check.untested_template_files.sort).to eq(@template_files.sort)
end
it "removes a ruby file from the list of untested files after it is marked as validated" do
recipe = File.join(cookbook_path, 'recipes', 'default.rb')
syntax_check.validated(recipe)
- syntax_check.untested_ruby_files.should_not include(recipe)
+ expect(syntax_check.untested_ruby_files).not_to include(recipe)
end
it "removes a template file from the list of untested files after it is marked as validated" do
template = File.join(cookbook_path, 'templates', 'default', 'test.erb')
syntax_check.validated(template)
- syntax_check.untested_template_files.should_not include(template)
+ expect(syntax_check.untested_template_files).not_to include(template)
end
it "validates all ruby files" do
- syntax_check.validate_ruby_files.should be_true
- syntax_check.untested_ruby_files.should be_empty
+ expect(syntax_check.validate_ruby_files).to be_truthy
+ expect(syntax_check.untested_ruby_files).to be_empty
end
it "validates all templates" do
- syntax_check.validate_templates.should be_true
- syntax_check.untested_template_files.should be_empty
+ expect(syntax_check.validate_templates).to be_truthy
+ expect(syntax_check.untested_template_files).to be_empty
end
describe "and a file has a syntax error" do
@@ -148,22 +148,22 @@ describe Chef::Cookbook::SyntaxCheck do
end
it "it indicates that a ruby file has a syntax error" do
- syntax_check.validate_ruby_files.should be_false
+ expect(syntax_check.validate_ruby_files).to be_falsey
end
it "does not remove the invalid file from the list of untested files" do
- syntax_check.untested_ruby_files.should include(File.join(cookbook_path, 'recipes', 'default.rb'))
+ expect(syntax_check.untested_ruby_files).to include(File.join(cookbook_path, 'recipes', 'default.rb'))
syntax_check.validate_ruby_files
- syntax_check.untested_ruby_files.should include(File.join(cookbook_path, 'recipes', 'default.rb'))
+ expect(syntax_check.untested_ruby_files).to include(File.join(cookbook_path, 'recipes', 'default.rb'))
end
it "indicates that a template file has a syntax error" do
- syntax_check.validate_templates.should be_false
+ expect(syntax_check.validate_templates).to be_falsey
end
it "does not remove the invalid template from the list of untested templates" do
- syntax_check.untested_template_files.should include(File.join(cookbook_path, 'templates', 'default', 'borken.erb'))
- lambda {syntax_check.validate_templates}.should_not change(syntax_check, :untested_template_files)
+ expect(syntax_check.untested_template_files).to include(File.join(cookbook_path, 'templates', 'default', 'borken.erb'))
+ expect {syntax_check.validate_templates}.not_to change(syntax_check, :untested_template_files)
end
end
@@ -177,12 +177,12 @@ describe Chef::Cookbook::SyntaxCheck do
end
it "shows that ignored ruby files do not require a syntax check" do
- syntax_check.untested_ruby_files.sort.should == @ruby_files.sort
+ expect(syntax_check.untested_ruby_files.sort).to eq(@ruby_files.sort)
end
it "does not indicate that a ruby file has a syntax error" do
- syntax_check.validate_ruby_files.should be_true
- syntax_check.untested_ruby_files.should be_empty
+ expect(syntax_check.validate_ruby_files).to be_truthy
+ expect(syntax_check.untested_ruby_files).to be_empty
end
end
@@ -196,13 +196,13 @@ describe Chef::Cookbook::SyntaxCheck do
end
it "does not syntax check ruby files" do
- syntax_check.should_not_receive(:shell_out)
- syntax_check.validate_ruby_files.should be_true
+ expect(syntax_check).not_to receive(:shell_out)
+ expect(syntax_check.validate_ruby_files).to be_truthy
end
it "does not syntax check templates" do
- syntax_check.should_not_receive(:shell_out)
- syntax_check.validate_templates.should be_true
+ expect(syntax_check).not_to receive(:shell_out)
+ expect(syntax_check.validate_templates).to be_truthy
end
end
end
diff --git a/spec/unit/cookbook_loader_spec.rb b/spec/unit/cookbook_loader_spec.rb
index deaf393d7a..51532778e4 100644
--- a/spec/unit/cookbook_loader_spec.rb
+++ b/spec/unit/cookbook_loader_spec.rb
@@ -20,7 +20,7 @@ require 'spec_helper'
describe Chef::CookbookLoader do
before do
- Chef::Platform.stub(:windows?) {false}
+ allow(Chef::Platform).to receive(:windows?) {false}
end
let(:repo_paths) do
[
@@ -40,7 +40,7 @@ describe Chef::CookbookLoader do
cookbook_paths.delete_if { |path| File.basename(path) == "chefignore" }
cookbook_paths.each do |cookbook_path|
- Chef::Cookbook::CookbookVersionLoader.should_receive(:new).
+ expect(Chef::Cookbook::CookbookVersionLoader).to receive(:new).
with(cookbook_path, anything).
once.
and_call_original
@@ -56,19 +56,19 @@ describe Chef::CookbookLoader do
describe "[]" do
it "should return cookbook objects with []" do
- cookbook_loader[:openldap].should be_a_kind_of(Chef::CookbookVersion)
+ expect(cookbook_loader[:openldap]).to be_a_kind_of(Chef::CookbookVersion)
end
it "should raise an exception if it cannot find a cookbook with []" do
- lambda { cookbook_loader[:monkeypoop] }.should raise_error(Chef::Exceptions::CookbookNotFoundInRepo)
+ expect { cookbook_loader[:monkeypoop] }.to raise_error(Chef::Exceptions::CookbookNotFoundInRepo)
end
it "should allow you to look up available cookbooks with [] and a symbol" do
- cookbook_loader[:openldap].name.should eql(:openldap)
+ expect(cookbook_loader[:openldap].name).to eql(:openldap)
end
it "should allow you to look up available cookbooks with [] and a string" do
- cookbook_loader["openldap"].name.should eql(:openldap)
+ expect(cookbook_loader["openldap"].name).to eql(:openldap)
end
end
@@ -78,8 +78,8 @@ describe Chef::CookbookLoader do
cookbook_loader.each do |cookbook_name, cookbook|
seen[cookbook_name] = true
end
- seen.should have_key("openldap")
- seen.should have_key("apache2")
+ expect(seen).to have_key("openldap")
+ expect(seen).to have_key("apache2")
end
it "should iterate in alphabetical order" do
@@ -87,86 +87,86 @@ describe Chef::CookbookLoader do
cookbook_loader.each do |cookbook_name, cookbook|
seen << cookbook_name
end
- seen[0].should == "angrybash"
- seen[1].should == "apache2"
- seen[2].should == "borken"
- seen[3].should == "ignorken"
- seen[4].should == "java"
- seen[5].should == "name-mismatch"
- seen[6].should == "openldap"
+ expect(seen[0]).to eq("angrybash")
+ expect(seen[1]).to eq("apache2")
+ expect(seen[2]).to eq("borken")
+ expect(seen[3]).to eq("ignorken")
+ expect(seen[4]).to eq("java")
+ expect(seen[5]).to eq("name-mismatch")
+ expect(seen[6]).to eq("openldap")
end
end
describe "referencing cookbook files" do
it "should find all the cookbooks in the cookbook path" do
cookbook_loader.load_cookbooks
- cookbook_loader.should have_key(:openldap)
- cookbook_loader.should have_key(:apache2)
+ expect(cookbook_loader).to have_key(:openldap)
+ expect(cookbook_loader).to have_key(:apache2)
end
it "should allow you to override an attribute file via cookbook_path" do
- cookbook_loader[:openldap].attribute_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].attribute_filenames.detect { |f|
f =~ /cookbooks\/openldap\/attributes\/default.rb/
- }.should_not eql(nil)
- cookbook_loader[:openldap].attribute_filenames.detect { |f|
+ }).not_to eql(nil)
+ expect(cookbook_loader[:openldap].attribute_filenames.detect { |f|
f =~ /kitchen\/openldap\/attributes\/default.rb/
- }.should eql(nil)
+ }).to eql(nil)
end
it "should load different attribute files from deeper paths" do
- cookbook_loader[:openldap].attribute_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].attribute_filenames.detect { |f|
f =~ /kitchen\/openldap\/attributes\/robinson.rb/
- }.should_not eql(nil)
+ }).not_to eql(nil)
end
it "should allow you to override a definition file via cookbook_path" do
- cookbook_loader[:openldap].definition_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].definition_filenames.detect { |f|
f =~ /cookbooks\/openldap\/definitions\/client.rb/
- }.should_not eql(nil)
- cookbook_loader[:openldap].definition_filenames.detect { |f|
+ }).not_to eql(nil)
+ expect(cookbook_loader[:openldap].definition_filenames.detect { |f|
f =~ /kitchen\/openldap\/definitions\/client.rb/
- }.should eql(nil)
+ }).to eql(nil)
end
it "should load definition files from deeper paths" do
- cookbook_loader[:openldap].definition_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].definition_filenames.detect { |f|
f =~ /kitchen\/openldap\/definitions\/drewbarrymore.rb/
- }.should_not eql(nil)
+ }).not_to eql(nil)
end
it "should allow you to override a recipe file via cookbook_path" do
- cookbook_loader[:openldap].recipe_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].recipe_filenames.detect { |f|
f =~ /cookbooks\/openldap\/recipes\/gigantor.rb/
- }.should_not eql(nil)
- cookbook_loader[:openldap].recipe_filenames.detect { |f|
+ }).not_to eql(nil)
+ expect(cookbook_loader[:openldap].recipe_filenames.detect { |f|
f =~ /kitchen\/openldap\/recipes\/gigantor.rb/
- }.should eql(nil)
+ }).to eql(nil)
end
it "should load recipe files from deeper paths" do
- cookbook_loader[:openldap].recipe_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].recipe_filenames.detect { |f|
f =~ /kitchen\/openldap\/recipes\/woot.rb/
- }.should_not eql(nil)
+ }).not_to eql(nil)
end
it "should allow you to have an 'ignore' file, which skips loading files in later cookbooks" do
- cookbook_loader[:openldap].recipe_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].recipe_filenames.detect { |f|
f =~ /kitchen\/openldap\/recipes\/ignoreme.rb/
- }.should eql(nil)
+ }).to eql(nil)
end
it "should find files that start with a ." do
- cookbook_loader[:openldap].file_filenames.detect { |f|
+ expect(cookbook_loader[:openldap].file_filenames.detect { |f|
f =~ /\.dotfile$/
- }.should =~ /\.dotfile$/
- cookbook_loader[:openldap].file_filenames.detect { |f|
+ }).to match(/\.dotfile$/)
+ expect(cookbook_loader[:openldap].file_filenames.detect { |f|
f =~ /\.ssh\/id_rsa$/
- }.should =~ /\.ssh\/id_rsa$/
+ }).to match(/\.ssh\/id_rsa$/)
end
it "should load the metadata for the cookbook" do
- cookbook_loader.metadata[:openldap].name.to_s.should == "openldap"
- cookbook_loader.metadata[:openldap].should be_a_kind_of(Chef::Cookbook::Metadata)
+ expect(cookbook_loader.metadata[:openldap].name.to_s).to eq("openldap")
+ expect(cookbook_loader.metadata[:openldap]).to be_a_kind_of(Chef::Cookbook::Metadata)
end
end # referencing cookbook files
@@ -199,27 +199,27 @@ describe Chef::CookbookLoader do
cookbook_loader.each do |cookbook_name, cookbook|
seen[cookbook_name] = true
end
- seen.should have_key("openldap")
+ expect(seen).to have_key("openldap")
end
it "should not duplicate keys when serialized to JSON" do
# Chef JSON serialization will generate duplicate keys if given
# a Hash containing matching string and symbol keys. See CHEF-4571.
aa = cookbook_loader["openldap"]
- aa.to_hash["metadata"].recipes.keys.should_not include(:openldap)
- aa.to_hash["metadata"].recipes.keys.should include("openldap")
+ expect(aa.to_hash["metadata"].recipes.keys).not_to include(:openldap)
+ expect(aa.to_hash["metadata"].recipes.keys).to include("openldap")
expected_desc = "Main Open LDAP configuration"
- aa.to_hash["metadata"].recipes["openldap"].should == expected_desc
+ expect(aa.to_hash["metadata"].recipes["openldap"]).to eq(expected_desc)
raw = Chef::JSONCompat.to_json(aa.to_hash["metadata"].recipes)
search_str = "\"openldap\":\""
key_idx = raw.index(search_str)
- key_idx.should be > 0
+ expect(key_idx).to be > 0
dup_idx = raw[(key_idx + 1)..-1].index(search_str)
- dup_idx.should be_nil
+ expect(dup_idx).to be_nil
end
it "should not load the cookbook again when accessed" do
- cookbook_loader.should_not_receive('load_cookbook')
+ expect(cookbook_loader).not_to receive('load_cookbook')
cookbook_loader["openldap"]
end
@@ -228,11 +228,11 @@ describe Chef::CookbookLoader do
cookbook_loader.each do |cookbook_name, cookbook|
seen[cookbook_name] = true
end
- seen.should_not have_key("apache2")
+ expect(seen).not_to have_key("apache2")
end
it "should load another cookbook lazily with []" do
- cookbook_loader["apache2"].should be_a_kind_of(Chef::CookbookVersion)
+ expect(cookbook_loader["apache2"]).to be_a_kind_of(Chef::CookbookVersion)
end
context "when an unrelated cookbook has invalid metadata" do
@@ -265,8 +265,8 @@ describe Chef::CookbookLoader do
cookbook_loader.each do |cookbook_name, cookbook|
seen[cookbook_name] = true
end
- seen.should have_key("openldap")
- seen.should have_key("apache2")
+ expect(seen).to have_key("openldap")
+ expect(seen).to have_key("apache2")
end
end
end # loading only one cookbook
@@ -279,8 +279,8 @@ describe Chef::CookbookLoader do
it "loads the correct cookbook" do
cookbook_version = cookbook_loader["name-mismatch"]
- cookbook_version.should be_a_kind_of(Chef::CookbookVersion)
- cookbook_version.name.should == :"name-mismatch"
+ expect(cookbook_version).to be_a_kind_of(Chef::CookbookVersion)
+ expect(cookbook_version.name).to eq(:"name-mismatch")
end
end
diff --git a/spec/unit/cookbook_manifest_spec.rb b/spec/unit/cookbook_manifest_spec.rb
index e87b8e1e9a..8b50b040c2 100644
--- a/spec/unit/cookbook_manifest_spec.rb
+++ b/spec/unit/cookbook_manifest_spec.rb
@@ -210,8 +210,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "examplehost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "afile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum-host"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum-host")
end
it "should return a manifest record based on priority preference: platform & full version" do
@@ -221,8 +221,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "afile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum-platver-full"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum-platver-full")
end
it "should return a manifest record based on priority preference: platform & partial version" do
@@ -232,8 +232,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "afile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum-platver-partial"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum-platver-partial")
end
it "should return a manifest record based on priority preference: platform only" do
@@ -243,8 +243,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "afile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum-plat"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum-plat")
end
it "should return a manifest record based on priority preference: default" do
@@ -254,8 +254,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "afile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum-default"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum-default")
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 1" do
@@ -265,8 +265,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "bfile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum2-platver-full"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum2-platver-full")
end
it "should return a manifest record based on priority preference: platform & partial version - platform_version variant 1" do
@@ -276,8 +276,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "bfile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum2-platver-partial"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum2-platver-partial")
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 2" do
@@ -287,8 +287,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "bfile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum3-platver-full"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum3-platver-full")
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 3" do
@@ -298,8 +298,8 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_record = @cookbook.preferred_manifest_record(node, :files, "bfile.rb")
- manifest_record.should_not be_nil
- manifest_record[:checksum].should == "csum4-platver-full"
+ expect(manifest_record).not_to be_nil
+ expect(manifest_record[:checksum]).to eq("csum4-platver-full")
end
describe "when fetching the contents of a directory by file specificity" do
@@ -311,11 +311,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "examplehost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum-host-1", "csum-host-2"]
+ expect(checksums.sort).to eq(["csum-host-1", "csum-host-2"])
end
it "should return a directory of manifest records based on priority preference: platform & full version" do
@@ -325,11 +325,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum-platver-full-1", "csum-platver-full-2"]
+ expect(checksums.sort).to eq(["csum-platver-full-1", "csum-platver-full-2"])
end
it "should return a directory of manifest records based on priority preference: platform & partial version" do
@@ -339,11 +339,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum-platver-partial-1", "csum-platver-partial-2"]
+ expect(checksums.sort).to eq(["csum-platver-partial-1", "csum-platver-partial-2"])
end
it "should return a directory of manifest records based on priority preference: platform only" do
@@ -353,11 +353,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum-plat-1", "csum-plat-2"]
+ expect(checksums.sort).to eq(["csum-plat-1", "csum-plat-2"])
end
it "should return a directory of manifest records based on priority preference: default" do
@@ -367,11 +367,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum-default-1", "csum-default-2"]
+ expect(checksums.sort).to eq(["csum-default-1", "csum-default-2"])
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 1" do
@@ -381,11 +381,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum2-platver-full-1", "csum2-platver-full-2"]
+ expect(checksums.sort).to eq(["csum2-platver-full-1", "csum2-platver-full-2"])
end
it "should return a manifest record based on priority preference: platform & partial version - platform_version variant 1" do
@@ -395,11 +395,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum2-platver-partial-1", "csum2-platver-partial-2"]
+ expect(checksums.sort).to eq(["csum2-platver-partial-1", "csum2-platver-partial-2"])
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 2" do
@@ -409,11 +409,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum3-platver-full-1", "csum3-platver-full-2"]
+ expect(checksums.sort).to eq(["csum3-platver-full-1", "csum3-platver-full-2"])
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 3" do
@@ -423,11 +423,11 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
manifest_records = @cookbook.preferred_manifest_records_for_directory(node, :files, "adirectory")
- manifest_records.should_not be_nil
- manifest_records.size.should == 2
+ expect(manifest_records).not_to be_nil
+ expect(manifest_records.size).to eq(2)
checksums = manifest_records.map{ |manifest_record| manifest_record[:checksum] }
- checksums.sort.should == ["csum4-platver-full-1", "csum4-platver-full-2"]
+ expect(checksums.sort).to eq(["csum4-platver-full-1", "csum4-platver-full-2"])
end
end
@@ -441,10 +441,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "examplehost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.host', 'anotherfile2.rb.host']
+ expect(filenames.sort).to eq(['anotherfile1.rb.host', 'anotherfile2.rb.host'])
end
it "should return a list of relative paths based on priority preference: platform & full version" do
@@ -454,10 +454,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version']
+ expect(filenames.sort).to eq(['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version'])
end
it "should return a list of relative paths based on priority preference: platform & partial version" do
@@ -467,10 +467,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.platform-partial-version', 'anotherfile2.rb.platform-partial-version']
+ expect(filenames.sort).to eq(['anotherfile1.rb.platform-partial-version', 'anotherfile2.rb.platform-partial-version'])
end
it "should return a list of relative paths based on priority preference: platform only" do
@@ -480,10 +480,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.platform', 'anotherfile2.rb.platform']
+ expect(filenames.sort).to eq(['anotherfile1.rb.platform', 'anotherfile2.rb.platform'])
end
it "should return a list of relative paths based on priority preference: default" do
@@ -493,10 +493,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.default', 'anotherfile2.rb.default']
+ expect(filenames.sort).to eq(['anotherfile1.rb.default', 'anotherfile2.rb.default'])
end
it "should return a list of relative paths based on priority preference: platform & full version - platform_version variant 1" do
@@ -506,10 +506,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version']
+ expect(filenames.sort).to eq(['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version'])
end
it "should return a list of relative paths based on priority preference: platform & partial version - platform_version variant 1" do
@@ -519,10 +519,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.platform-partial-version', 'anotherfile2.rb.platform-partial-version']
+ expect(filenames.sort).to eq(['anotherfile1.rb.platform-partial-version', 'anotherfile2.rb.platform-partial-version'])
end
it "should return a list of relative paths based on priority preference: platform & full version - platform_version variant 2" do
@@ -532,10 +532,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version']
+ expect(filenames.sort).to eq(['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version'])
end
it "should return a list of relative paths based on priority preference: platform & full version - platform_version variant 3" do
@@ -545,10 +545,10 @@ describe "Chef::CookbookVersion manifest" do
node.automatic_attrs[:fqdn] = "differenthost.example.org"
filenames = @cookbook.relative_filenames_in_preferred_directory(node, :files, "adirectory")
- filenames.should_not be_nil
- filenames.size.should == 2
+ expect(filenames).not_to be_nil
+ expect(filenames.size).to eq(2)
- filenames.sort.should == ['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version']
+ expect(filenames.sort).to eq(['anotherfile1.rb.platform-full-version', 'anotherfile2.rb.platform-full-version'])
end
end
end
diff --git a/spec/unit/cookbook_site_streaming_uploader_spec.rb b/spec/unit/cookbook_site_streaming_uploader_spec.rb
index 1d7009e31c..ef0f649163 100644
--- a/spec/unit/cookbook_site_streaming_uploader_spec.rb
+++ b/spec/unit/cookbook_site_streaming_uploader_spec.rb
@@ -42,16 +42,16 @@ describe Chef::CookbookSiteStreamingUploader do
@cookbook_repo = File.expand_path(File.join(CHEF_SPEC_DATA, 'cookbooks'))
@loader = Chef::CookbookLoader.new(@cookbook_repo)
@loader.load_cookbooks
- File.stub(:unlink).and_return()
+ allow(File).to receive(:unlink)
end
it "should create the cookbook tmp dir" do
cookbook = @loader[:openldap]
files_count = Dir.glob(File.join(@cookbook_repo, cookbook.name.to_s, '**', '*'), File::FNM_DOTMATCH).count { |file| File.file?(file) }
- Tempfile.should_receive(:new).with("chef-#{cookbook.name}-build").and_return(FakeTempfile.new("chef-#{cookbook.name}-build"))
- FileUtils.should_receive(:mkdir_p).exactly(files_count + 1).times
- FileUtils.should_receive(:cp).exactly(files_count).times
+ expect(Tempfile).to receive(:new).with("chef-#{cookbook.name}-build").and_return(FakeTempfile.new("chef-#{cookbook.name}-build"))
+ expect(FileUtils).to receive(:mkdir_p).exactly(files_count + 1).times
+ expect(FileUtils).to receive(:cp).exactly(files_count).times
Chef::CookbookSiteStreamingUploader.create_build_dir(cookbook)
end
@@ -64,39 +64,39 @@ describe Chef::CookbookSiteStreamingUploader do
@secret_filename = File.join(CHEF_SPEC_DATA, 'ssl/private_key.pem')
@rsa_key = File.read(@secret_filename)
response = Net::HTTPResponse.new('1.0', '200', 'OK')
- Net::HTTP.any_instance.stub(:request).and_return(response)
+ allow_any_instance_of(Net::HTTP).to receive(:request).and_return(response)
end
it "should send an http request" do
- Net::HTTP.any_instance.should_receive(:request)
+ expect_any_instance_of(Net::HTTP).to receive(:request)
Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
end
it "should read the private key file" do
- File.should_receive(:read).with(@secret_filename).and_return(@rsa_key)
+ expect(File).to receive(:read).with(@secret_filename).and_return(@rsa_key)
Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
end
it "should add the authentication signed header" do
- Mixlib::Authentication::SigningObject.any_instance.should_receive(:sign).and_return({})
+ expect_any_instance_of(Mixlib::Authentication::SigningObject).to receive(:sign).and_return({})
Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
end
it "should be able to send post requests" do
post = Net::HTTP::Post.new(@uri, {})
- Net::HTTP::Post.should_receive(:new).once.and_return(post)
- Net::HTTP::Put.should_not_receive(:new)
- Net::HTTP::Get.should_not_receive(:new)
+ expect(Net::HTTP::Post).to receive(:new).once.and_return(post)
+ expect(Net::HTTP::Put).not_to receive(:new)
+ expect(Net::HTTP::Get).not_to receive(:new)
Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
end
it "should be able to send put requests" do
put = Net::HTTP::Put.new(@uri, {})
- Net::HTTP::Post.should_not_receive(:new)
- Net::HTTP::Put.should_receive(:new).once.and_return(put)
- Net::HTTP::Get.should_not_receive(:new)
+ expect(Net::HTTP::Post).not_to receive(:new)
+ expect(Net::HTTP::Put).to receive(:new).once.and_return(put)
+ expect(Net::HTTP::Get).not_to receive(:new)
Chef::CookbookSiteStreamingUploader.make_request(:put, @uri, 'bill', @secret_filename)
end
@@ -126,19 +126,19 @@ describe Chef::CookbookSiteStreamingUploader do
@uri = "https://cookbooks.dummy.com/api/v1/cookbooks"
uri_info = URI.parse(@uri)
@http = Net::HTTP.new(uri_info.host, uri_info.port)
- Net::HTTP.should_receive(:new).with(uri_info.host, uri_info.port).and_return(@http)
+ expect(Net::HTTP).to receive(:new).with(uri_info.host, uri_info.port).and_return(@http)
end
it "should be VERIFY_NONE when ssl_verify_mode is :verify_none" do
Chef::Config[:ssl_verify_mode] = :verify_none
Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
- @http.verify_mode.should == OpenSSL::SSL::VERIFY_NONE
+ expect(@http.verify_mode).to eq(OpenSSL::SSL::VERIFY_NONE)
end
it "should be VERIFY_PEER when ssl_verify_mode is :verify_peer" do
Chef::Config[:ssl_verify_mode] = :verify_peer
Chef::CookbookSiteStreamingUploader.make_request(:post, @uri, 'bill', @secret_filename)
- @http.verify_mode.should == OpenSSL::SSL::VERIFY_PEER
+ expect(@http.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
end
end
@@ -151,17 +151,17 @@ describe Chef::CookbookSiteStreamingUploader do
end
it "should create a StreamPart" do
- @stream_part.should be_instance_of(Chef::CookbookSiteStreamingUploader::StreamPart)
+ expect(@stream_part).to be_instance_of(Chef::CookbookSiteStreamingUploader::StreamPart)
end
it "should expose its size" do
- @stream_part.size.should eql(File.size(@file))
+ expect(@stream_part.size).to eql(File.size(@file))
end
it "should read with offset and how_much" do
content = @file.read(4)
@file.rewind
- @stream_part.read(0, 4).should eql(content)
+ expect(@stream_part.read(0, 4)).to eql(content)
end
end # StreamPart
@@ -173,15 +173,15 @@ describe Chef::CookbookSiteStreamingUploader do
end
it "should create a StringPart" do
- @string_part.should be_instance_of(Chef::CookbookSiteStreamingUploader::StringPart)
+ expect(@string_part).to be_instance_of(Chef::CookbookSiteStreamingUploader::StringPart)
end
it "should expose its size" do
- @string_part.size.should eql(@str.size)
+ expect(@string_part.size).to eql(@str.size)
end
it "should read with offset and how_much" do
- @string_part.read(2, 4).should eql(@str[2, 4])
+ expect(@string_part.read(2, 4)).to eql(@str[2, 4])
end
end # StringPart
@@ -198,21 +198,21 @@ describe Chef::CookbookSiteStreamingUploader do
end
it "should create a MultipartStream" do
- @multipart_stream.should be_instance_of(Chef::CookbookSiteStreamingUploader::MultipartStream)
+ expect(@multipart_stream).to be_instance_of(Chef::CookbookSiteStreamingUploader::MultipartStream)
end
it "should expose its size" do
- @multipart_stream.size.should eql(@stream1.size + @stream2.size)
+ expect(@multipart_stream.size).to eql(@stream1.size + @stream2.size)
end
it "should read with how_much" do
- @multipart_stream.read(10).should eql("#{@string1}#{@string2}"[0, 10])
+ expect(@multipart_stream.read(10)).to eql("#{@string1}#{@string2}"[0, 10])
end
it "should read receiving destination buffer as second argument (CHEF-4456: Ruby 2 compat)" do
dst_buf = ''
@multipart_stream.read(10, dst_buf)
- dst_buf.should eql("#{@string1}#{@string2}"[0, 10])
+ expect(dst_buf).to eql("#{@string1}#{@string2}"[0, 10])
end
end # MultipartStream
diff --git a/spec/unit/cookbook_spec.rb b/spec/unit/cookbook_spec.rb
index 9bcea97d98..7b3cda2af1 100644
--- a/spec/unit/cookbook_spec.rb
+++ b/spec/unit/cookbook_spec.rb
@@ -33,43 +33,43 @@ describe Chef::CookbookVersion do
end
it "should have a name" do
- @cookbook.name.should == :openldap
+ expect(@cookbook.name).to eq(:openldap)
end
it "should allow you to set the list of attribute files and create the mapping from short names to paths" do
@cookbook.attribute_filenames = [ "attributes/one.rb", "attributes/two.rb" ]
- @cookbook.attribute_filenames.should == [ "attributes/one.rb", "attributes/two.rb" ]
- @cookbook.attribute_filenames_by_short_filename.keys.sort.should eql(["one", "two"])
- @cookbook.attribute_filenames_by_short_filename["one"].should == "attributes/one.rb"
- @cookbook.attribute_filenames_by_short_filename["two"].should == "attributes/two.rb"
+ expect(@cookbook.attribute_filenames).to eq([ "attributes/one.rb", "attributes/two.rb" ])
+ expect(@cookbook.attribute_filenames_by_short_filename.keys.sort).to eql(["one", "two"])
+ expect(@cookbook.attribute_filenames_by_short_filename["one"]).to eq("attributes/one.rb")
+ expect(@cookbook.attribute_filenames_by_short_filename["two"]).to eq("attributes/two.rb")
end
it "should allow you to set the list of recipe files and create the mapping of recipe short name to filename" do
@cookbook.recipe_filenames = [ "recipes/one.rb", "recipes/two.rb" ]
- @cookbook.recipe_filenames.should == [ "recipes/one.rb", "recipes/two.rb" ]
- @cookbook.recipe_filenames_by_name.keys.sort.should eql(["one", "two"])
- @cookbook.recipe_filenames_by_name["one"].should == "recipes/one.rb"
- @cookbook.recipe_filenames_by_name["two"].should == "recipes/two.rb"
+ expect(@cookbook.recipe_filenames).to eq([ "recipes/one.rb", "recipes/two.rb" ])
+ expect(@cookbook.recipe_filenames_by_name.keys.sort).to eql(["one", "two"])
+ expect(@cookbook.recipe_filenames_by_name["one"]).to eq("recipes/one.rb")
+ expect(@cookbook.recipe_filenames_by_name["two"]).to eq("recipes/two.rb")
end
it "should generate a list of recipes by fully-qualified name" do
@cookbook.recipe_filenames = [ "recipes/one.rb", "/recipes/two.rb", "three.rb" ]
- @cookbook.fully_qualified_recipe_names.include?("openldap::one").should == true
- @cookbook.fully_qualified_recipe_names.include?("openldap::two").should == true
- @cookbook.fully_qualified_recipe_names.include?("openldap::three").should == true
+ expect(@cookbook.fully_qualified_recipe_names.include?("openldap::one")).to eq(true)
+ expect(@cookbook.fully_qualified_recipe_names.include?("openldap::two")).to eq(true)
+ expect(@cookbook.fully_qualified_recipe_names.include?("openldap::three")).to eq(true)
end
it "should find a preferred file" do
- pending
+ skip
end
it "should not return an unchanged preferred file" do
pending
- @cookbook.preferred_filename(@node, :files, 'a-filename', 'the-checksum').should be_nil
+ expect(@cookbook.preferred_filename(@node, :files, 'a-filename', 'the-checksum')).to be_nil
end
it "should raise an ArgumentException if you try to load a bad recipe name" do
- lambda { @cookbook.load_recipe("doesnt_exist", @node) }.should raise_error(ArgumentError)
+ expect { @cookbook.load_recipe("doesnt_exist", @node) }.to raise_error(ArgumentError)
end
end
diff --git a/spec/unit/cookbook_version_spec.rb b/spec/unit/cookbook_version_spec.rb
index 8436e5c480..3d0348553b 100644
--- a/spec/unit/cookbook_version_spec.rb
+++ b/spec/unit/cookbook_version_spec.rb
@@ -24,58 +24,58 @@ describe Chef::CookbookVersion do
end
it "has a name" do
- @cookbook_version.name.should == 'tatft'
+ expect(@cookbook_version.name).to eq('tatft')
end
it "has no attribute files" do
- @cookbook_version.attribute_filenames.should be_empty
+ expect(@cookbook_version.attribute_filenames).to be_empty
end
it "has no resource definition files" do
- @cookbook_version.definition_filenames.should be_empty
+ expect(@cookbook_version.definition_filenames).to be_empty
end
it "has no cookbook files" do
- @cookbook_version.file_filenames.should be_empty
+ expect(@cookbook_version.file_filenames).to be_empty
end
it "has no recipe files" do
- @cookbook_version.recipe_filenames.should be_empty
+ expect(@cookbook_version.recipe_filenames).to be_empty
end
it "has no library files" do
- @cookbook_version.library_filenames.should be_empty
+ expect(@cookbook_version.library_filenames).to be_empty
end
it "has no LWRP resource files" do
- @cookbook_version.resource_filenames.should be_empty
+ expect(@cookbook_version.resource_filenames).to be_empty
end
it "has no LWRP provider files" do
- @cookbook_version.provider_filenames.should be_empty
+ expect(@cookbook_version.provider_filenames).to be_empty
end
it "has no metadata files" do
- @cookbook_version.metadata_filenames.should be_empty
+ expect(@cookbook_version.metadata_filenames).to be_empty
end
it "is not frozen" do
- @cookbook_version.should_not be_frozen_version
+ expect(@cookbook_version).not_to be_frozen_version
end
it "can be frozen" do
@cookbook_version.freeze_version
- @cookbook_version.should be_frozen_version
+ expect(@cookbook_version).to be_frozen_version
end
it "is \"ready\"" do
# WTF is this? what are the valid states? and why aren't they set with encapsulating methods?
# [Dan 15-Jul-2010]
- @cookbook_version.status.should == :ready
+ expect(@cookbook_version.status).to eq(:ready)
end
it "has empty metadata" do
- @cookbook_version.metadata.should == Chef::Cookbook::Metadata.new
+ expect(@cookbook_version.metadata).to eq(Chef::Cookbook::Metadata.new)
end
it "creates a manifest hash of its contents" do
@@ -92,7 +92,7 @@ describe Chef::CookbookVersion do
"metadata"=>Chef::Cookbook::Metadata.new,
"version"=>"0.0.0",
"name"=>"tatft-0.0.0"}
- @cookbook_version.manifest.should == expected
+ expect(@cookbook_version.manifest).to eq(expected)
end
end
@@ -144,90 +144,90 @@ describe Chef::CookbookVersion do
it "generates a manifest containing the cookbook's files" do
manifest = @cookbook_version.manifest
- manifest["metadata"].should == Chef::Cookbook::Metadata.new
- manifest["cookbook_name"].should == "tatft"
+ expect(manifest["metadata"]).to eq(Chef::Cookbook::Metadata.new)
+ expect(manifest["cookbook_name"]).to eq("tatft")
- manifest["recipes"].should have(1).recipe_file
+ expect(manifest["recipes"].size).to eq(1)
recipe = manifest["recipes"].first
- recipe["name"].should == "default.rb"
- recipe["path"].should == "recipes/default.rb"
- recipe["checksum"].should match(MD5)
- recipe["specificity"].should == "default"
+ expect(recipe["name"]).to eq("default.rb")
+ expect(recipe["path"]).to eq("recipes/default.rb")
+ expect(recipe["checksum"]).to match(MD5)
+ expect(recipe["specificity"]).to eq("default")
- manifest["definitions"].should have(1).definition_file
+ expect(manifest["definitions"].size).to eq(1)
definition = manifest["definitions"].first
- definition["name"].should == "runit_service.rb"
- definition["path"].should == "definitions/runit_service.rb"
- definition["checksum"].should match(MD5)
- definition["specificity"].should == "default"
+ expect(definition["name"]).to eq("runit_service.rb")
+ expect(definition["path"]).to eq("definitions/runit_service.rb")
+ expect(definition["checksum"]).to match(MD5)
+ expect(definition["specificity"]).to eq("default")
- manifest["libraries"].should have(1).library_file
+ expect(manifest["libraries"].size).to eq(1)
library = manifest["libraries"].first
- library["name"].should == "ownage.rb"
- library["path"].should == "libraries/ownage.rb"
- library["checksum"].should match(MD5)
- library["specificity"].should == "default"
+ expect(library["name"]).to eq("ownage.rb")
+ expect(library["path"]).to eq("libraries/ownage.rb")
+ expect(library["checksum"]).to match(MD5)
+ expect(library["specificity"]).to eq("default")
- manifest["attributes"].should have(1).attribute_file
+ expect(manifest["attributes"].size).to eq(1)
attribute_file = manifest["attributes"].first
- attribute_file["name"].should == "default.rb"
- attribute_file["path"].should == "attributes/default.rb"
- attribute_file["checksum"].should match(MD5)
- attribute_file["specificity"].should == "default"
+ expect(attribute_file["name"]).to eq("default.rb")
+ expect(attribute_file["path"]).to eq("attributes/default.rb")
+ expect(attribute_file["checksum"]).to match(MD5)
+ expect(attribute_file["specificity"]).to eq("default")
- manifest["files"].should have(1).cookbook_file
+ expect(manifest["files"].size).to eq(1)
cookbook_file = manifest["files"].first
- cookbook_file["name"].should == "giant_blob.tgz"
- cookbook_file["path"].should == "files/default/giant_blob.tgz"
- cookbook_file["checksum"].should match(MD5)
- cookbook_file["specificity"].should == "default"
+ expect(cookbook_file["name"]).to eq("giant_blob.tgz")
+ expect(cookbook_file["path"]).to eq("files/default/giant_blob.tgz")
+ expect(cookbook_file["checksum"]).to match(MD5)
+ expect(cookbook_file["specificity"]).to eq("default")
- manifest["templates"].should have(1).template
+ expect(manifest["templates"].size).to eq(1)
template = manifest["templates"].first
- template["name"].should == "configuration.erb"
- template["path"].should == "templates/default/configuration.erb"
- template["checksum"].should match(MD5)
- template["specificity"].should == "default"
+ expect(template["name"]).to eq("configuration.erb")
+ expect(template["path"]).to eq("templates/default/configuration.erb")
+ expect(template["checksum"]).to match(MD5)
+ expect(template["specificity"]).to eq("default")
- manifest["resources"].should have(1).lwr
+ expect(manifest["resources"].size).to eq(1)
lwr = manifest["resources"].first
- lwr["name"].should == "lwr.rb"
- lwr["path"].should == "resources/lwr.rb"
- lwr["checksum"].should match(MD5)
- lwr["specificity"].should == "default"
+ expect(lwr["name"]).to eq("lwr.rb")
+ expect(lwr["path"]).to eq("resources/lwr.rb")
+ expect(lwr["checksum"]).to match(MD5)
+ expect(lwr["specificity"]).to eq("default")
- manifest["providers"].should have(1).lwp
+ expect(manifest["providers"].size).to eq(1)
lwp = manifest["providers"].first
- lwp["name"].should == "lwp.rb"
- lwp["path"].should == "providers/lwp.rb"
- lwp["checksum"].should match(MD5)
- lwp["specificity"].should == "default"
+ expect(lwp["name"]).to eq("lwp.rb")
+ expect(lwp["path"]).to eq("providers/lwp.rb")
+ expect(lwp["checksum"]).to match(MD5)
+ expect(lwp["specificity"]).to eq("default")
- manifest["root_files"].should have(1).file_in_the_cookbook_root
+ expect(manifest["root_files"].size).to eq(1)
readme = manifest["root_files"].first
- readme["name"].should == "README.rdoc"
- readme["path"].should == "README.rdoc"
- readme["checksum"].should match(MD5)
- readme["specificity"].should == "default"
+ expect(readme["name"]).to eq("README.rdoc")
+ expect(readme["path"]).to eq("README.rdoc")
+ expect(readme["checksum"]).to match(MD5)
+ expect(readme["specificity"]).to eq("default")
end
it "determines whether a template is available for a given node" do
- @cookbook_version.should have_template_for_node(@node, "configuration.erb")
- @cookbook_version.should_not have_template_for_node(@node, "missing.erb")
+ expect(@cookbook_version).to have_template_for_node(@node, "configuration.erb")
+ expect(@cookbook_version).not_to have_template_for_node(@node, "missing.erb")
end
it "determines whether a cookbook_file is available for a given node" do
- @cookbook_version.should have_cookbook_file_for_node(@node, "giant_blob.tgz")
- @cookbook_version.should_not have_cookbook_file_for_node(@node, "missing.txt")
+ expect(@cookbook_version).to have_cookbook_file_for_node(@node, "giant_blob.tgz")
+ expect(@cookbook_version).not_to have_cookbook_file_for_node(@node, "missing.txt")
end
describe "raises an error when attempting to load a missing cookbook_file and" do
@@ -243,12 +243,12 @@ describe Chef::CookbookVersion do
it "describes the cookbook and version" do
useful_explanation = Regexp.new(Regexp.escape("Cookbook 'tatft' (0.0.0) does not contain"))
- @attempt_to_load_file.should raise_error(Chef::Exceptions::FileNotFound, useful_explanation)
+ expect(@attempt_to_load_file).to raise_error(Chef::Exceptions::FileNotFound, useful_explanation)
end
it "lists suggested places to look" do
useful_explanation = Regexp.new(Regexp.escape("files/default/no-such-thing.txt"))
- @attempt_to_load_file.should raise_error(Chef::Exceptions::FileNotFound, useful_explanation)
+ expect(@attempt_to_load_file).to raise_error(Chef::Exceptions::FileNotFound, useful_explanation)
end
end
end
@@ -273,80 +273,80 @@ describe Chef::CookbookVersion do
it "generates a manifest containing the cookbook's files" do
manifest = @cookbook_version.manifest
- manifest["metadata"].should == Chef::Cookbook::Metadata.new
- manifest["cookbook_name"].should == "blarghle"
+ expect(manifest["metadata"]).to eq(Chef::Cookbook::Metadata.new)
+ expect(manifest["cookbook_name"]).to eq("blarghle")
- manifest["recipes"].should have(1).recipe_file
+ expect(manifest["recipes"].size).to eq(1)
recipe = manifest["recipes"].first
- recipe["name"].should == "default.rb"
- recipe["path"].should == "recipes/default.rb"
- recipe["checksum"].should match(MD5)
- recipe["specificity"].should == "default"
+ expect(recipe["name"]).to eq("default.rb")
+ expect(recipe["path"]).to eq("recipes/default.rb")
+ expect(recipe["checksum"]).to match(MD5)
+ expect(recipe["specificity"]).to eq("default")
- manifest["definitions"].should have(1).definition_file
+ expect(manifest["definitions"].size).to eq(1)
definition = manifest["definitions"].first
- definition["name"].should == "runit_service.rb"
- definition["path"].should == "definitions/runit_service.rb"
- definition["checksum"].should match(MD5)
- definition["specificity"].should == "default"
+ expect(definition["name"]).to eq("runit_service.rb")
+ expect(definition["path"]).to eq("definitions/runit_service.rb")
+ expect(definition["checksum"]).to match(MD5)
+ expect(definition["specificity"]).to eq("default")
- manifest["libraries"].should have(1).library_file
+ expect(manifest["libraries"].size).to eq(1)
library = manifest["libraries"].first
- library["name"].should == "ownage.rb"
- library["path"].should == "libraries/ownage.rb"
- library["checksum"].should match(MD5)
- library["specificity"].should == "default"
+ expect(library["name"]).to eq("ownage.rb")
+ expect(library["path"]).to eq("libraries/ownage.rb")
+ expect(library["checksum"]).to match(MD5)
+ expect(library["specificity"]).to eq("default")
- manifest["attributes"].should have(1).attribute_file
+ expect(manifest["attributes"].size).to eq(1)
attribute_file = manifest["attributes"].first
- attribute_file["name"].should == "default.rb"
- attribute_file["path"].should == "attributes/default.rb"
- attribute_file["checksum"].should match(MD5)
- attribute_file["specificity"].should == "default"
+ expect(attribute_file["name"]).to eq("default.rb")
+ expect(attribute_file["path"]).to eq("attributes/default.rb")
+ expect(attribute_file["checksum"]).to match(MD5)
+ expect(attribute_file["specificity"]).to eq("default")
- manifest["files"].should have(1).cookbook_file
+ expect(manifest["files"].size).to eq(1)
cookbook_file = manifest["files"].first
- cookbook_file["name"].should == "giant_blob.tgz"
- cookbook_file["path"].should == "files/default/giant_blob.tgz"
- cookbook_file["checksum"].should match(MD5)
- cookbook_file["specificity"].should == "default"
+ expect(cookbook_file["name"]).to eq("giant_blob.tgz")
+ expect(cookbook_file["path"]).to eq("files/default/giant_blob.tgz")
+ expect(cookbook_file["checksum"]).to match(MD5)
+ expect(cookbook_file["specificity"]).to eq("default")
- manifest["templates"].should have(1).template
+ expect(manifest["templates"].size).to eq(1)
template = manifest["templates"].first
- template["name"].should == "configuration.erb"
- template["path"].should == "templates/default/configuration.erb"
- template["checksum"].should match(MD5)
- template["specificity"].should == "default"
+ expect(template["name"]).to eq("configuration.erb")
+ expect(template["path"]).to eq("templates/default/configuration.erb")
+ expect(template["checksum"]).to match(MD5)
+ expect(template["specificity"]).to eq("default")
- manifest["resources"].should have(1).lwr
+ expect(manifest["resources"].size).to eq(1)
lwr = manifest["resources"].first
- lwr["name"].should == "lwr.rb"
- lwr["path"].should == "resources/lwr.rb"
- lwr["checksum"].should match(MD5)
- lwr["specificity"].should == "default"
+ expect(lwr["name"]).to eq("lwr.rb")
+ expect(lwr["path"]).to eq("resources/lwr.rb")
+ expect(lwr["checksum"]).to match(MD5)
+ expect(lwr["specificity"]).to eq("default")
- manifest["providers"].should have(1).lwp
+ expect(manifest["providers"].size).to eq(1)
lwp = manifest["providers"].first
- lwp["name"].should == "lwp.rb"
- lwp["path"].should == "providers/lwp.rb"
- lwp["checksum"].should match(MD5)
- lwp["specificity"].should == "default"
+ expect(lwp["name"]).to eq("lwp.rb")
+ expect(lwp["path"]).to eq("providers/lwp.rb")
+ expect(lwp["checksum"]).to match(MD5)
+ expect(lwp["specificity"]).to eq("default")
- manifest["root_files"].should have(1).file_in_the_cookbook_root
+ expect(manifest["root_files"].size).to eq(1)
readme = manifest["root_files"].first
- readme["name"].should == "README.rdoc"
- readme["path"].should == "README.rdoc"
- readme["checksum"].should match(MD5)
- readme["specificity"].should == "default"
+ expect(readme["name"]).to eq("README.rdoc")
+ expect(readme["path"]).to eq("README.rdoc")
+ expect(readme["checksum"]).to match(MD5)
+ expect(readme["specificity"]).to eq("default")
end
end
end
@@ -389,43 +389,43 @@ describe Chef::CookbookVersion do
end
it "should see a template" do
- @cookbook_version.should have_template_for_node(@node, "test.erb")
+ expect(@cookbook_version).to have_template_for_node(@node, "test.erb")
end
it "should see a template using an array lookup" do
- @cookbook_version.should have_template_for_node(@node, ["test.erb"])
+ expect(@cookbook_version).to have_template_for_node(@node, ["test.erb"])
end
it "should see a template using an array lookup with non-existant elements" do
- @cookbook_version.should have_template_for_node(@node, ["missing.txt", "test.erb"])
+ expect(@cookbook_version).to have_template_for_node(@node, ["missing.txt", "test.erb"])
end
it "should see a file" do
- @cookbook_version.should have_cookbook_file_for_node(@node, "test.txt")
+ expect(@cookbook_version).to have_cookbook_file_for_node(@node, "test.txt")
end
it "should see a file using an array lookup" do
- @cookbook_version.should have_cookbook_file_for_node(@node, ["test.txt"])
+ expect(@cookbook_version).to have_cookbook_file_for_node(@node, ["test.txt"])
end
it "should see a file using an array lookup with non-existant elements" do
- @cookbook_version.should have_cookbook_file_for_node(@node, ["missing.txt", "test.txt"])
+ expect(@cookbook_version).to have_cookbook_file_for_node(@node, ["missing.txt", "test.txt"])
end
it "should not see a non-existant template" do
- @cookbook_version.should_not have_template_for_node(@node, "missing.erb")
+ expect(@cookbook_version).not_to have_template_for_node(@node, "missing.erb")
end
it "should not see a non-existant template using an array lookup" do
- @cookbook_version.should_not have_template_for_node(@node, ["missing.erb"])
+ expect(@cookbook_version).not_to have_template_for_node(@node, ["missing.erb"])
end
it "should not see a non-existant file" do
- @cookbook_version.should_not have_cookbook_file_for_node(@node, "missing.txt")
+ expect(@cookbook_version).not_to have_cookbook_file_for_node(@node, "missing.txt")
end
it "should not see a non-existant file using an array lookup" do
- @cookbook_version.should_not have_cookbook_file_for_node(@node, ["missing.txt"])
+ expect(@cookbook_version).not_to have_cookbook_file_for_node(@node, ["missing.txt"])
end
end
@@ -453,9 +453,9 @@ describe Chef::CookbookVersion do
lg = Chef::CookbookVersion.new("foo", '/tmp/blah')
sm.version = smaller
lg.version = larger
- sm.should be < lg
- lg.should be > sm
- sm.should_not == lg
+ expect(sm).to be < lg
+ expect(lg).to be > sm
+ expect(sm).not_to eq(lg)
end
end
@@ -464,7 +464,7 @@ describe Chef::CookbookVersion do
b = Chef::CookbookVersion.new("foo", '/tmp/blah')
a.version = "1.2"
b.version = "1.2.0"
- a.should == b
+ expect(a).to eq(b)
end
@@ -473,7 +473,7 @@ describe Chef::CookbookVersion do
apt.version = "1.0"
god = Chef::CookbookVersion.new "god", '/tmp/blah'
god.version = "2.0"
- lambda {apt <=> god}.should raise_error(Chef::Exceptions::CookbookVersionNameMismatch)
+ expect {apt <=> god}.to raise_error(Chef::Exceptions::CookbookVersionNameMismatch)
end
end
@@ -493,7 +493,7 @@ describe Chef::CookbookVersion do
"1 2 3", "1-2-3", "1_2_3", "1.2_3", "1.2-3"]
the_error = Chef::Exceptions::InvalidCookbookVersion
bad_versions.each do |v|
- lambda {@cbv.version = v}.should raise_error(the_error)
+ expect {@cbv.version = v}.to raise_error(the_error)
end
end
diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb
index 9132dae389..e020576a23 100644
--- a/spec/unit/daemon_spec.rb
+++ b/spec/unit/daemon_spec.rb
@@ -23,12 +23,12 @@ describe Chef::Daemon do
if windows?
mock_struct = #Struct::Passwd.new(nil, nil, 111, 111)
mock_struct = OpenStruct.new(:uid => 2342, :gid => 2342)
- Etc.stub(:getpwnam).and_return mock_struct
- Etc.stub(:getgrnam).and_return mock_struct
+ allow(Etc).to receive(:getpwnam).and_return mock_struct
+ allow(Etc).to receive(:getgrnam).and_return mock_struct
# mock unimplemented methods
- Process.stub(:initgroups).and_return nil
- Process::GID.stub(:change_privilege).and_return 11
- Process::UID.stub(:change_privilege).and_return 11
+ allow(Process).to receive(:initgroups).and_return nil
+ allow(Process::GID).to receive(:change_privilege).and_return 11
+ allow(Process::UID).to receive(:change_privilege).and_return 11
end
end
@@ -41,7 +41,7 @@ describe Chef::Daemon do
end
it "should return the supplied value" do
- Chef::Daemon.pid_file.should eql("/var/run/chef/chef-client.pid")
+ expect(Chef::Daemon.pid_file).to eql("/var/run/chef/chef-client.pid")
end
end
@@ -52,7 +52,7 @@ describe Chef::Daemon do
end
it "should return a valued based on @name" do
- Chef::Daemon.pid_file.should eql("/tmp/chef-client.pid")
+ expect(Chef::Daemon.pid_file).to eql("/tmp/chef-client.pid")
end
end
@@ -65,7 +65,7 @@ describe Chef::Daemon do
end
it "should suck the pid out of pid_file" do
- File.should_receive(:read).with("/var/run/chef/chef-client.pid").and_return("1337")
+ expect(File).to receive(:read).with("/var/run/chef/chef-client.pid").and_return("1337")
Chef::Daemon.pid_from_file
end
end
@@ -73,13 +73,13 @@ describe Chef::Daemon do
describe ".change_privilege" do
before do
- Chef::Application.stub(:fatal!).and_return(true)
+ allow(Chef::Application).to receive(:fatal!).and_return(true)
Chef::Config[:user] = 'aj'
- Dir.stub(:chdir)
+ allow(Dir).to receive(:chdir)
end
it "changes the working directory to root" do
- Dir.should_receive(:chdir).with("/").and_return(0)
+ expect(Dir).to receive(:chdir).with("/").and_return(0)
Chef::Daemon.change_privilege
end
@@ -90,24 +90,24 @@ describe Chef::Daemon do
end
it "should log an appropriate info message" do
- Chef::Log.should_receive(:info).with("About to change privilege to aj:staff")
+ expect(Chef::Log).to receive(:info).with("About to change privilege to aj:staff")
Chef::Daemon.change_privilege
end
it "should call _change_privilege with the user and group" do
- Chef::Daemon.should_receive(:_change_privilege).with("aj", "staff")
+ expect(Chef::Daemon).to receive(:_change_privilege).with("aj", "staff")
Chef::Daemon.change_privilege
end
end
describe "when just the user option is supplied" do
it "should log an appropriate info message" do
- Chef::Log.should_receive(:info).with("About to change privilege to aj")
+ expect(Chef::Log).to receive(:info).with("About to change privilege to aj")
Chef::Daemon.change_privilege
end
it "should call _change_privilege with just the user" do
- Chef::Daemon.should_receive(:_change_privilege).with("aj")
+ expect(Chef::Daemon).to receive(:_change_privilege).with("aj")
Chef::Daemon.change_privilege
end
end
@@ -116,56 +116,56 @@ describe Chef::Daemon do
describe "._change_privilege" do
before do
- Process.stub(:euid).and_return(0)
- Process.stub(:egid).and_return(0)
+ allow(Process).to receive(:euid).and_return(0)
+ allow(Process).to receive(:egid).and_return(0)
- Process::UID.stub(:change_privilege).and_return(nil)
- Process::GID.stub(:change_privilege).and_return(nil)
+ allow(Process::UID).to receive(:change_privilege).and_return(nil)
+ allow(Process::GID).to receive(:change_privilege).and_return(nil)
@pw_user = double("Struct::Passwd", :uid => 501)
@pw_group = double("Struct::Group", :gid => 20)
- Process.stub(:initgroups).and_return(true)
+ allow(Process).to receive(:initgroups).and_return(true)
- Etc.stub(:getpwnam).and_return(@pw_user)
- Etc.stub(:getgrnam).and_return(@pw_group)
+ allow(Etc).to receive(:getpwnam).and_return(@pw_user)
+ allow(Etc).to receive(:getgrnam).and_return(@pw_group)
end
describe "with sufficient privileges" do
before do
- Process.stub(:euid).and_return(0)
- Process.stub(:egid).and_return(0)
+ allow(Process).to receive(:euid).and_return(0)
+ allow(Process).to receive(:egid).and_return(0)
end
it "should initialize the supplemental group list" do
- Process.should_receive(:initgroups).with("aj", 20)
+ expect(Process).to receive(:initgroups).with("aj", 20)
Chef::Daemon._change_privilege("aj")
end
it "should attempt to change the process GID" do
- Process::GID.should_receive(:change_privilege).with(20).and_return(20)
+ expect(Process::GID).to receive(:change_privilege).with(20).and_return(20)
Chef::Daemon._change_privilege("aj")
end
it "should attempt to change the process UID" do
- Process::UID.should_receive(:change_privilege).with(501).and_return(501)
+ expect(Process::UID).to receive(:change_privilege).with(501).and_return(501)
Chef::Daemon._change_privilege("aj")
end
end
describe "with insufficient privileges" do
before do
- Process.stub(:euid).and_return(999)
- Process.stub(:egid).and_return(999)
+ allow(Process).to receive(:euid).and_return(999)
+ allow(Process).to receive(:egid).and_return(999)
end
it "should log an appropriate error message and fail miserably" do
- Process.stub(:initgroups).and_raise(Errno::EPERM)
+ allow(Process).to receive(:initgroups).and_raise(Errno::EPERM)
error = "Operation not permitted"
if RUBY_PLATFORM.match("solaris2") || RUBY_PLATFORM.match("aix")
error = "Not owner"
end
- Chef::Application.should_receive(:fatal!).with("Permission denied when trying to change 999:999 to 501:20. #{error}")
+ expect(Chef::Application).to receive(:fatal!).with("Permission denied when trying to change 999:999 to 501:20. #{error}")
Chef::Daemon._change_privilege("aj")
end
end
diff --git a/spec/unit/data_bag_item_spec.rb b/spec/unit/data_bag_item_spec.rb
index 5972d8a239..4cf6e59242 100644
--- a/spec/unit/data_bag_item_spec.rb
+++ b/spec/unit/data_bag_item_spec.rb
@@ -26,69 +26,69 @@ describe Chef::DataBagItem do
describe "initialize" do
it "should be a Chef::DataBagItem" do
- @data_bag_item.should be_a_kind_of(Chef::DataBagItem)
+ expect(@data_bag_item).to be_a_kind_of(Chef::DataBagItem)
end
end
describe "data_bag" do
it "should let you set the data_bag to a string" do
- @data_bag_item.data_bag("clowns").should == "clowns"
+ expect(@data_bag_item.data_bag("clowns")).to eq("clowns")
end
it "should return the current data_bag type" do
@data_bag_item.data_bag "clowns"
- @data_bag_item.data_bag.should == "clowns"
+ expect(@data_bag_item.data_bag).to eq("clowns")
end
it "should not accept spaces" do
- lambda { @data_bag_item.data_bag "clown masters" }.should raise_error(ArgumentError)
+ expect { @data_bag_item.data_bag "clown masters" }.to raise_error(ArgumentError)
end
it "should throw an ArgumentError if you feed it anything but a string" do
- lambda { @data_bag_item.data_bag Hash.new }.should raise_error(ArgumentError)
+ expect { @data_bag_item.data_bag Hash.new }.to raise_error(ArgumentError)
end
end
describe "raw_data" do
it "should let you set the raw_data with a hash" do
- lambda { @data_bag_item.raw_data = { "id" => "octahedron" } }.should_not raise_error
+ expect { @data_bag_item.raw_data = { "id" => "octahedron" } }.not_to raise_error
end
it "should let you set the raw_data from a mash" do
- lambda { @data_bag_item.raw_data = Mash.new({ "id" => "octahedron" }) }.should_not raise_error
+ expect { @data_bag_item.raw_data = Mash.new({ "id" => "octahedron" }) }.not_to raise_error
end
it "should raise an exception if you set the raw data without a key" do
- lambda { @data_bag_item.raw_data = { "monkey" => "pants" } }.should raise_error(ArgumentError)
+ expect { @data_bag_item.raw_data = { "monkey" => "pants" } }.to raise_error(ArgumentError)
end
it "should raise an exception if you set the raw data to something other than a hash" do
- lambda { @data_bag_item.raw_data = "katie rules" }.should raise_error(ArgumentError)
+ expect { @data_bag_item.raw_data = "katie rules" }.to raise_error(ArgumentError)
end
it "should accept alphanum/-/_ for the id" do
- lambda { @data_bag_item.raw_data = { "id" => "h1-_" } }.should_not raise_error
+ expect { @data_bag_item.raw_data = { "id" => "h1-_" } }.not_to raise_error
end
it "should accept alphanum.alphanum for the id" do
- lambda { @data_bag_item.raw_data = { "id" => "foo.bar" } }.should_not raise_error
+ expect { @data_bag_item.raw_data = { "id" => "foo.bar" } }.not_to raise_error
end
it "should accept .alphanum for the id" do
- lambda { @data_bag_item.raw_data = { "id" => ".bozo" } }.should_not raise_error
+ expect { @data_bag_item.raw_data = { "id" => ".bozo" } }.not_to raise_error
end
it "should raise an exception if the id contains anything but alphanum/-/_" do
- lambda { @data_bag_item.raw_data = { "id" => "!@#" } }.should raise_error(ArgumentError)
+ expect { @data_bag_item.raw_data = { "id" => "!@#" } }.to raise_error(ArgumentError)
end
it "should return the raw data" do
@data_bag_item.raw_data = { "id" => "highway_of_emptiness" }
- @data_bag_item.raw_data.should == { "id" => "highway_of_emptiness" }
+ expect(@data_bag_item.raw_data).to eq({ "id" => "highway_of_emptiness" })
end
it "should be a Mash by default" do
- @data_bag_item.raw_data.should be_a_kind_of(Mash)
+ expect(@data_bag_item.raw_data).to be_a_kind_of(Mash)
end
end
@@ -99,13 +99,13 @@ describe Chef::DataBagItem do
end
it "should return an object name based on the bag name and the raw_data id" do
- @data_bag_item.object_name.should == "data_bag_item_dreams_the_beatdown"
+ expect(@data_bag_item.object_name).to eq("data_bag_item_dreams_the_beatdown")
end
end
describe "class method object_name" do
it "should return an object name based based on the bag name and an id" do
- Chef::DataBagItem.object_name("zen", "master").should == "data_bag_item_zen_master"
+ expect(Chef::DataBagItem.object_name("zen", "master")).to eq("data_bag_item_zen_master")
end
end
@@ -115,12 +115,12 @@ describe Chef::DataBagItem do
end
it "responds to keys" do
- @data_bag_item.keys.should include("id")
- @data_bag_item.keys.should include("trials")
+ expect(@data_bag_item.keys).to include("id")
+ expect(@data_bag_item.keys).to include("trials")
end
it "supports element reference with []" do
- @data_bag_item["id"].should == "journey"
+ expect(@data_bag_item["id"]).to eq("journey")
end
it "implements all the methods of Hash" do
@@ -131,7 +131,7 @@ describe Chef::DataBagItem do
:invert, :update, :replace, :merge!, :merge, :has_key?, :has_value?,
:key?, :value?]
methods.each do |m|
- @data_bag_item.should respond_to(m)
+ expect(@data_bag_item).to respond_to(m)
end
end
@@ -145,20 +145,20 @@ describe Chef::DataBagItem do
end
it "should return a hash" do
- @to_hash.should be_a_kind_of(Hash)
+ expect(@to_hash).to be_a_kind_of(Hash)
end
it "should have the raw_data keys as top level keys" do
- @to_hash["id"].should == "whoa"
- @to_hash["i_know"].should == "kung_fu"
+ expect(@to_hash["id"]).to eq("whoa")
+ expect(@to_hash["i_know"]).to eq("kung_fu")
end
it "should have the chef_type of data_bag_item" do
- @to_hash["chef_type"].should == "data_bag_item"
+ expect(@to_hash["chef_type"]).to eq("data_bag_item")
end
it "should have the data_bag set" do
- @to_hash["data_bag"].should == "still_lost"
+ expect(@to_hash["data_bag"]).to eq("still_lost")
end
end
@@ -170,19 +170,19 @@ describe Chef::DataBagItem do
end
it "should deserialize to a Chef::DataBagItem object" do
- @deserial.should be_a_kind_of(Chef::DataBagItem)
+ expect(@deserial).to be_a_kind_of(Chef::DataBagItem)
end
it "should have a matching 'data_bag' value" do
- @deserial.data_bag.should == @data_bag_item.data_bag
+ expect(@deserial.data_bag).to eq(@data_bag_item.data_bag)
end
it "should have a matching 'id' key" do
- @deserial["id"].should == "octahedron"
+ expect(@deserial["id"]).to eq("octahedron")
end
it "should have a matching 'snooze' key" do
- @deserial["snooze"].should == { "finally" => "world_will" }
+ expect(@deserial["snooze"]).to eq({ "finally" => "world_will" })
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
@@ -193,7 +193,7 @@ describe Chef::DataBagItem do
describe "when converting to a string" do
it "converts to a string in the form data_bag_item[ID]" do
@data_bag_item['id'] = "heart of darkness"
- @data_bag_item.to_s.should == 'data_bag_item[heart of darkness]'
+ expect(@data_bag_item.to_s).to eq('data_bag_item[heart of darkness]')
end
it "inspects as data_bag_item[BAG, ID, RAW_DATA]" do
@@ -201,28 +201,28 @@ describe Chef::DataBagItem do
@data_bag_item.raw_data = raw_data
@data_bag_item.data_bag("books")
- @data_bag_item.inspect.should == "data_bag_item[\"books\", \"heart_of_darkness\", #{raw_data.inspect}]"
+ expect(@data_bag_item.inspect).to eq("data_bag_item[\"books\", \"heart_of_darkness\", #{raw_data.inspect}]")
end
end
describe "save" do
before do
@rest = double("Chef::REST")
- Chef::REST.stub(:new).and_return(@rest)
+ allow(Chef::REST).to receive(:new).and_return(@rest)
@data_bag_item['id'] = "heart of darkness"
raw_data = {"id" => "heart_of_darkness", "author" => "Conrad"}
@data_bag_item.raw_data = raw_data
@data_bag_item.data_bag("books")
end
it "should update the item when it already exists" do
- @rest.should_receive(:put_rest).with("data/books/heart_of_darkness", @data_bag_item)
+ expect(@rest).to receive(:put_rest).with("data/books/heart_of_darkness", @data_bag_item)
@data_bag_item.save
end
it "should create if the item is not found" do
exception = double("404 error", :code => "404")
- @rest.should_receive(:put_rest).and_raise(Net::HTTPServerException.new("foo", exception))
- @rest.should_receive(:post_rest).with("data/books", @data_bag_item)
+ expect(@rest).to receive(:put_rest).and_raise(Net::HTTPServerException.new("foo", exception))
+ expect(@rest).to receive(:post_rest).with("data/books", @data_bag_item)
@data_bag_item.save
end
describe "when whyrun mode is enabled" do
@@ -233,8 +233,8 @@ describe Chef::DataBagItem do
Chef::Config[:why_run] = false
end
it "should not save" do
- @rest.should_not_receive(:put_rest)
- @rest.should_not_receive(:post_rest)
+ expect(@rest).not_to receive(:put_rest)
+ expect(@rest).not_to receive(:post_rest)
@data_bag_item.data_bag("books")
@data_bag_item.save
end
@@ -252,21 +252,21 @@ describe Chef::DataBagItem do
describe "from an API call" do
before do
@http_client = double("Chef::REST")
- Chef::REST.stub(:new).and_return(@http_client)
+ allow(Chef::REST).to receive(:new).and_return(@http_client)
end
it "converts raw data to a data bag item" do
- @http_client.should_receive(:get_rest).with("data/users/charlie").and_return(@data_bag_item.to_hash)
+ expect(@http_client).to receive(:get_rest).with("data/users/charlie").and_return(@data_bag_item.to_hash)
item = Chef::DataBagItem.load(:users, "charlie")
- item.should be_a_kind_of(Chef::DataBagItem)
- item.should == @data_bag_item
+ expect(item).to be_a_kind_of(Chef::DataBagItem)
+ expect(item).to eq(@data_bag_item)
end
it "does not convert when a DataBagItem is returned from the API call" do
- @http_client.should_receive(:get_rest).with("data/users/charlie").and_return(@data_bag_item)
+ expect(@http_client).to receive(:get_rest).with("data/users/charlie").and_return(@data_bag_item)
item = Chef::DataBagItem.load(:users, "charlie")
- item.should be_a_kind_of(Chef::DataBagItem)
- item.should equal(@data_bag_item)
+ expect(item).to be_a_kind_of(Chef::DataBagItem)
+ expect(item).to equal(@data_bag_item)
end
end
@@ -280,10 +280,10 @@ describe Chef::DataBagItem do
end
it "converts the raw data to a data bag item" do
- Chef::DataBag.should_receive(:load).with('users').and_return({'charlie' => @data_bag_item.to_hash})
+ expect(Chef::DataBag).to receive(:load).with('users').and_return({'charlie' => @data_bag_item.to_hash})
item = Chef::DataBagItem.load('users', 'charlie')
- item.should be_a_kind_of(Chef::DataBagItem)
- item.should == @data_bag_item
+ expect(item).to be_a_kind_of(Chef::DataBagItem)
+ expect(item).to eq(@data_bag_item)
end
end
diff --git a/spec/unit/data_bag_spec.rb b/spec/unit/data_bag_spec.rb
index ff323902eb..f6db1e222a 100644
--- a/spec/unit/data_bag_spec.rb
+++ b/spec/unit/data_bag_spec.rb
@@ -22,36 +22,36 @@ require 'chef/data_bag'
describe Chef::DataBag do
before(:each) do
@data_bag = Chef::DataBag.new
- Chef::Platform::stub(:windows?) { false }
+ allow(Chef::Platform)::to receive(:windows?) { false }
end
describe "initialize" do
it "should be a Chef::DataBag" do
- @data_bag.should be_a_kind_of(Chef::DataBag)
+ expect(@data_bag).to be_a_kind_of(Chef::DataBag)
end
end
describe "name" do
it "should let you set the name to a string" do
- @data_bag.name("clowns").should == "clowns"
+ expect(@data_bag.name("clowns")).to eq("clowns")
end
it "should return the current name" do
@data_bag.name "clowns"
- @data_bag.name.should == "clowns"
+ expect(@data_bag.name).to eq("clowns")
end
it "should not accept spaces" do
- lambda { @data_bag.name "clown masters" }.should raise_error(ArgumentError)
+ expect { @data_bag.name "clown masters" }.to raise_error(ArgumentError)
end
it "should throw an ArgumentError if you feed it anything but a string" do
- lambda { @data_bag.name Hash.new }.should raise_error(ArgumentError)
+ expect { @data_bag.name Hash.new }.to raise_error(ArgumentError)
end
[ ".", "-", "_", "1"].each do |char|
it "should allow a '#{char}' character in the data bag name" do
- @data_bag.name("clown#{char}clown").should == "clown#{char}clown"
+ expect(@data_bag.name("clown#{char}clown")).to eq("clown#{char}clown")
end
end
end
@@ -63,14 +63,14 @@ describe Chef::DataBag do
end
it "should deserialize to a Chef::DataBag object" do
- @deserial.should be_a_kind_of(Chef::DataBag)
+ expect(@deserial).to be_a_kind_of(Chef::DataBag)
end
%w{
name
}.each do |t|
it "should match '#{t}'" do
- @deserial.send(t.to_sym).should == @data_bag.send(t.to_sym)
+ expect(@deserial.send(t.to_sym)).to eq(@data_bag.send(t.to_sym))
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
@@ -84,17 +84,17 @@ describe Chef::DataBag do
before do
@data_bag.name('piggly_wiggly')
@rest = double("Chef::REST")
- Chef::REST.stub(:new).and_return(@rest)
+ allow(Chef::REST).to receive(:new).and_return(@rest)
end
it "should silently proceed when the data bag already exists" do
exception = double("409 error", :code => "409")
- @rest.should_receive(:post_rest).and_raise(Net::HTTPServerException.new("foo", exception))
+ expect(@rest).to receive(:post_rest).and_raise(Net::HTTPServerException.new("foo", exception))
@data_bag.save
end
it "should create the data bag" do
- @rest.should_receive(:post_rest).with("data", @data_bag)
+ expect(@rest).to receive(:post_rest).with("data", @data_bag)
@data_bag.save
end
@@ -106,7 +106,7 @@ describe Chef::DataBag do
Chef::Config[:why_run] = false
end
it "should not save" do
- @rest.should_not_receive(:post_rest)
+ expect(@rest).not_to receive(:post_rest)
@data_bag.save
end
end
@@ -120,25 +120,25 @@ describe Chef::DataBag do
end
it "should get the data bag from the server" do
- Chef::REST.should_receive(:new).with('https://myserver.example.com').and_return(@http_client)
- @http_client.should_receive(:get_rest).with('data/foo')
+ expect(Chef::REST).to receive(:new).with('https://myserver.example.com').and_return(@http_client)
+ expect(@http_client).to receive(:get_rest).with('data/foo')
Chef::DataBag.load('foo')
end
it "should return the data bag" do
- Chef::REST.stub(:new).and_return(@http_client)
- @http_client.should_receive(:get_rest).with('data/foo').and_return({'bar' => 'https://myserver.example.com/data/foo/bar'})
+ allow(Chef::REST).to receive(:new).and_return(@http_client)
+ expect(@http_client).to receive(:get_rest).with('data/foo').and_return({'bar' => 'https://myserver.example.com/data/foo/bar'})
data_bag = Chef::DataBag.load('foo')
- data_bag.should == {'bar' => 'https://myserver.example.com/data/foo/bar'}
+ expect(data_bag).to eq({'bar' => 'https://myserver.example.com/data/foo/bar'})
end
end
def file_dir_stub(path, returns = true)
- File.should_receive(:directory?).with(path).and_return(returns)
+ expect(File).to receive(:directory?).with(path).and_return(returns)
end
def dir_glob_stub(path, returns = [])
- Dir.should_receive(:glob).with(File.join(path, 'foo/*.json')).and_return(returns)
+ expect(Dir).to receive(:glob).with(File.join(path, 'foo/*.json')).and_return(returns)
end
shared_examples_for "data bag in solo mode" do |data_bag_path|
@@ -177,21 +177,21 @@ describe Chef::DataBag do
dir_glob_stub(path)
end
end
- IO.should_receive(:read).with(File.join(@paths.first, 'foo/bar.json')).and_return('{"id": "bar", "name": "Bob Bar" }')
- IO.should_receive(:read).with(File.join(@paths.first, 'foo/baz.json')).and_return('{"id": "baz", "name": "John Baz" }')
+ expect(IO).to receive(:read).with(File.join(@paths.first, 'foo/bar.json')).and_return('{"id": "bar", "name": "Bob Bar" }')
+ expect(IO).to receive(:read).with(File.join(@paths.first, 'foo/baz.json')).and_return('{"id": "baz", "name": "John Baz" }')
data_bag = Chef::DataBag.load('foo')
- data_bag.should == { 'bar' => { 'id' => 'bar', 'name' => 'Bob Bar' }, 'baz' => { 'id' => 'baz', 'name' => 'John Baz' }}
+ expect(data_bag).to eq({ 'bar' => { 'id' => 'bar', 'name' => 'Bob Bar' }, 'baz' => { 'id' => 'baz', 'name' => 'John Baz' }})
end
it "should raise if data bag has items with similar names but different content" do
@paths.each do |path|
file_dir_stub(path)
item_with_different_content = "{\"id\": \"bar\", \"name\": \"Bob Bar\", \"path\": \"#{path}\"}"
- IO.should_receive(:read).with(File.join(path, 'foo/bar.json')).and_return(item_with_different_content)
+ expect(IO).to receive(:read).with(File.join(path, 'foo/bar.json')).and_return(item_with_different_content)
if data_bag_path.is_a?(String)
dir_glob_stub(path, [File.join(path, 'foo/bar.json'), File.join(path, 'foo/baz.json')])
item_2_with_different_content = '{"id": "bar", "name": "John Baz"}'
- IO.should_receive(:read).with(File.join(path, 'foo/baz.json')).and_return(item_2_with_different_content)
+ expect(IO).to receive(:read).with(File.join(path, 'foo/baz.json')).and_return(item_2_with_different_content)
else
dir_glob_stub(path, [File.join(path, 'foo/bar.json')])
end
@@ -204,12 +204,12 @@ describe Chef::DataBag do
file_dir_stub(path)
dir_glob_stub(path, [File.join(path, 'foo/bar.json'), File.join(path, 'foo/baz.json')])
item_with_same_content = '{"id": "bar", "name": "Bob Bar"}'
- IO.should_receive(:read).with(File.join(path, 'foo/bar.json')).and_return(item_with_same_content)
- IO.should_receive(:read).with(File.join(path, 'foo/baz.json')).and_return(item_with_same_content)
+ expect(IO).to receive(:read).with(File.join(path, 'foo/bar.json')).and_return(item_with_same_content)
+ expect(IO).to receive(:read).with(File.join(path, 'foo/baz.json')).and_return(item_with_same_content)
end
data_bag = Chef::DataBag.load('foo')
test_data_bag = { 'bar' => { 'id' => 'bar', 'name' => 'Bob Bar'} }
- data_bag.should == test_data_bag
+ expect(data_bag).to eq(test_data_bag)
end
it "should merge data bag items if there are no conflicts" do
@@ -217,33 +217,33 @@ describe Chef::DataBag do
file_dir_stub(path)
dir_glob_stub(path, [File.join(path, 'foo/bar.json'), File.join(path, 'foo/baz.json')])
test_item_with_same_content = '{"id": "bar", "name": "Bob Bar"}'
- IO.should_receive(:read).with(File.join(path, 'foo/bar.json')).and_return(test_item_with_same_content)
+ expect(IO).to receive(:read).with(File.join(path, 'foo/bar.json')).and_return(test_item_with_same_content)
test_uniq_item = "{\"id\": \"baz_#{index}\", \"name\": \"John Baz\", \"path\": \"#{path}\"}"
- IO.should_receive(:read).with(File.join(path, 'foo/baz.json')).and_return(test_uniq_item)
+ expect(IO).to receive(:read).with(File.join(path, 'foo/baz.json')).and_return(test_uniq_item)
end
data_bag = Chef::DataBag.load('foo')
test_data_bag = { 'bar' => { 'id' => 'bar', 'name' => 'Bob Bar'} }
@paths.each_with_index do |path, index|
test_data_bag["baz_#{index}"] = { "id" => "baz_#{index}", "name" => "John Baz", "path" => path }
end
- data_bag.should == test_data_bag
+ expect(data_bag).to eq(test_data_bag)
end
it "should return the data bag list" do
@paths.each do |path|
file_dir_stub(path)
- Dir.should_receive(:glob).and_return([File.join(path, 'foo'), File.join(path, 'bar')])
+ expect(Dir).to receive(:glob).and_return([File.join(path, 'foo'), File.join(path, 'bar')])
end
data_bag_list = Chef::DataBag.list
- data_bag_list.should == { 'bar' => 'bar', 'foo' => 'foo' }
+ expect(data_bag_list).to eq({ 'bar' => 'bar', 'foo' => 'foo' })
end
it 'should raise an error if the configured data_bag_path is invalid' do
file_dir_stub(@paths.first, false)
- lambda {
+ expect {
Chef::DataBag.load('foo')
- }.should raise_error Chef::Exceptions::InvalidDataBagPath, "Data bag path '/var/chef/data_bags' is invalid"
+ }.to raise_error Chef::Exceptions::InvalidDataBagPath, "Data bag path '/var/chef/data_bags' is invalid"
end
end
diff --git a/spec/unit/deprecation_spec.rb b/spec/unit/deprecation_spec.rb
index c5ab41fbab..9bd081a6c4 100644
--- a/spec/unit/deprecation_spec.rb
+++ b/spec/unit/deprecation_spec.rb
@@ -54,7 +54,7 @@ describe Chef::Deprecation do
it "defines all methods on #{class_object} that were available in 11.0" do
old_methods.each do |old_method|
- current_methods.should include(old_method.to_sym)
+ expect(current_methods).to include(old_method.to_sym)
end
end
end
@@ -62,24 +62,24 @@ describe Chef::Deprecation do
context 'deprecation warning messages' do
before(:each) do
@warning_output = [ ]
- Chef::Log.stub(:warn) { |msg| @warning_output << msg }
+ allow(Chef::Log).to receive(:warn) { |msg| @warning_output << msg }
end
it 'should be enabled for deprecated methods' do
TestClass.new.deprecated_method(10)
- @warning_output.should_not be_empty
+ expect(@warning_output).not_to be_empty
end
it 'should contain stack trace' do
TestClass.new.deprecated_method(10)
- @warning_output.join("").include?(".rb").should be_true
+ expect(@warning_output.join("").include?(".rb")).to be_truthy
end
end
it 'deprecated methods should still be called' do
test_instance = TestClass.new
test_instance.deprecated_method(10)
- test_instance.get_value.should == 10
+ expect(test_instance.get_value).to eq(10)
end
end
diff --git a/spec/unit/digester_spec.rb b/spec/unit/digester_spec.rb
index fdf20aca7c..51bcfbdde5 100644
--- a/spec/unit/digester_spec.rb
+++ b/spec/unit/digester_spec.rb
@@ -28,20 +28,20 @@ describe Chef::Digester do
describe "when computing checksums of cookbook files and templates" do
it "proxies the class method checksum_for_file to the instance" do
- @cache.should_receive(:checksum_for_file).with("a_file_or_a_fail")
+ expect(@cache).to receive(:checksum_for_file).with("a_file_or_a_fail")
Chef::Digester.checksum_for_file("a_file_or_a_fail")
end
it "computes a checksum of a file" do
fixture_file = CHEF_SPEC_DATA + "/checksum/random.txt"
expected = "09ee9c8cc70501763563bcf9c218d71b2fbf4186bf8e1e0da07f0f42c80a3394"
- @cache.checksum_for_file(fixture_file).should == expected
+ expect(@cache.checksum_for_file(fixture_file)).to eq(expected)
end
it "generates a checksum from a non-file IO object" do
io = StringIO.new("riseofthemachines\nriseofthechefs\n")
expected_md5 = '0e157ac1e2dd73191b76067fb6b4bceb'
- @cache.generate_md5_checksum(io).should == expected_md5
+ expect(@cache.generate_md5_checksum(io)).to eq(expected_md5)
end
end
diff --git a/spec/unit/dsl/data_query_spec.rb b/spec/unit/dsl/data_query_spec.rb
index 78cd5569e8..b93ae1f1d6 100644
--- a/spec/unit/dsl/data_query_spec.rb
+++ b/spec/unit/dsl/data_query_spec.rb
@@ -28,7 +28,7 @@ describe Chef::DSL::DataQuery do
let(:language) do
language = DataQueryDSLTester.new
- language.stub(:node).and_return(@node)
+ allow(language).to receive(:node).and_return(@node)
language
end
diff --git a/spec/unit/dsl/platform_introspection_spec.rb b/spec/unit/dsl/platform_introspection_spec.rb
index f00d5a2ab8..e41560c034 100644
--- a/spec/unit/dsl/platform_introspection_spec.rb
+++ b/spec/unit/dsl/platform_introspection_spec.rb
@@ -48,37 +48,37 @@ describe Chef::DSL::PlatformIntrospection::PlatformDependentValue do
end
it "returns the default value when the platform doesn't match" do
- @platform_specific_value.value_for_node(:platform => :dos).should == 'bork da bork'
+ expect(@platform_specific_value.value_for_node(:platform => :dos)).to eq('bork da bork')
end
it "returns a value for a platform set as a group" do
- @platform_specific_value.value_for_node(:platform => :centos).should == '"stable"'
+ expect(@platform_specific_value.value_for_node(:platform => :centos)).to eq('"stable"')
end
it "returns a value for the platform when it was set as a symbol but fetched as a string" do
- @platform_specific_value.value_for_node(:platform => "centos").should == '"stable"'
+ expect(@platform_specific_value.value_for_node(:platform => "centos")).to eq('"stable"')
end
it "returns a value for a specific platform version" do
node = {:platform => 'ubuntu', :platform_version => '10.04'}
- @platform_specific_value.value_for_node(node).should == 'using upstart more'
+ expect(@platform_specific_value.value_for_node(node)).to eq('using upstart more')
end
it "returns a platform-default value if the platform version doesn't match an explicit one" do
node = {:platform => 'ubuntu', :platform_version => '9.10' }
- @platform_specific_value.value_for_node(node).should == 'using init more'
+ expect(@platform_specific_value.value_for_node(node)).to eq('using init more')
end
it "returns nil if there is no default and no platforms match" do
# this matches the behavior in the original implementation.
# whether or not it's correct is another matter.
platform_specific_value = Chef::DSL::PlatformIntrospection::PlatformDependentValue.new({})
- platform_specific_value.value_for_node(:platform => 'foo').should be_nil
+ expect(platform_specific_value.value_for_node(:platform => 'foo')).to be_nil
end
it "raises an argument error if the platform hash is not correctly structured" do
bad_hash = {:ubuntu => :foo} # should be :ubuntu => {:default => 'foo'}
- lambda {Chef::DSL::PlatformIntrospection::PlatformDependentValue.new(bad_hash)}.should raise_error(ArgumentError)
+ expect {Chef::DSL::PlatformIntrospection::PlatformDependentValue.new(bad_hash)}.to raise_error(ArgumentError)
end
end
@@ -98,33 +98,33 @@ describe Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue do
end
it "returns the default value when the platform family doesn't match" do
- @platform_family_value.value_for_node(:platform_family => :os2).should == 'default value'
+ expect(@platform_family_value.value_for_node(:platform_family => :os2)).to eq('default value')
end
it "returns a value for the platform family when it was set as a string but fetched as a symbol" do
- @platform_family_value.value_for_node(:platform_family => :debian).should == "debian value"
+ expect(@platform_family_value.value_for_node(:platform_family => :debian)).to eq("debian value")
end
it "returns a value for the platform family when it was set as a symbol but fetched as a string" do
- @platform_family_value.value_for_node(:platform_family => "gentoo").should == "gentoo value"
+ expect(@platform_family_value.value_for_node(:platform_family => "gentoo")).to eq("gentoo value")
end
it "returns an array value stored for a platform family" do
- @platform_family_value.value_for_node(:platform_family => "suse").should == @array_values
+ expect(@platform_family_value.value_for_node(:platform_family => "suse")).to eq(@array_values)
end
it "returns a value for the platform family when it was set within an array hash key as a symbol" do
- @platform_family_value.value_for_node(:platform_family => :rhel).should == "redhatty value"
+ expect(@platform_family_value.value_for_node(:platform_family => :rhel)).to eq("redhatty value")
end
it "returns a value for the platform family when it was set within an array hash key as a string" do
- @platform_family_value.value_for_node(:platform_family => "fedora").should == "redhatty value"
+ expect(@platform_family_value.value_for_node(:platform_family => "fedora")).to eq("redhatty value")
end
it "returns nil if there is no default and no platforms match" do
platform_specific_value = Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue.new({})
- platform_specific_value.value_for_node(:platform_family => 'foo').should be_nil
+ expect(platform_specific_value.value_for_node(:platform_family => 'foo')).to be_nil
end
end
diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb
index 0d643514e0..0f2288740f 100644
--- a/spec/unit/dsl/reboot_pending_spec.rb
+++ b/spec/unit/dsl/reboot_pending_spec.rb
@@ -25,52 +25,52 @@ describe Chef::DSL::RebootPending do
let(:recipe) { Object.new.extend(Chef::DSL::RebootPending) }
before do
- recipe.stub(:platform?).and_return(false)
+ allow(recipe).to receive(:platform?).and_return(false)
end
context "platform is windows" do
before do
- recipe.stub(:platform?).with('windows').and_return(true)
- recipe.stub(:registry_key_exists?).and_return(false)
- recipe.stub(:registry_value_exists?).and_return(false)
+ allow(recipe).to receive(:platform?).with('windows').and_return(true)
+ allow(recipe).to receive(:registry_key_exists?).and_return(false)
+ allow(recipe).to receive(:registry_value_exists?).and_return(false)
end
it 'should return true if "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations" exists' do
- recipe.stub(:registry_value_exists?).with('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }).and_return(true)
- expect(recipe.reboot_pending?).to be_true
+ allow(recipe).to receive(:registry_value_exists?).with('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager', { :name => 'PendingFileRenameOperations' }).and_return(true)
+ expect(recipe.reboot_pending?).to be_truthy
end
it 'should return true if "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" exists' do
- recipe.stub(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired').and_return(true)
- expect(recipe.reboot_pending?).to be_true
+ allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired').and_return(true)
+ expect(recipe.reboot_pending?).to be_truthy
end
it 'should return true if key "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired" exists' do
- recipe.stub(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired').and_return(true)
- expect(recipe.reboot_pending?).to be_true
+ allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootRequired').and_return(true)
+ expect(recipe.reboot_pending?).to be_truthy
end
it 'should return true if value "HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile" contains specific data' do
- recipe.stub(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(true)
- recipe.stub(:registry_get_values).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(
+ allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(true)
+ allow(recipe).to receive(:registry_get_values).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(
[{:name => "Flags", :type => :dword, :data => 3}])
- expect(recipe.reboot_pending?).to be_true
+ expect(recipe.reboot_pending?).to be_truthy
end
end
context "platform is ubuntu" do
before do
- recipe.stub(:platform?).with('ubuntu').and_return(true)
+ allow(recipe).to receive(:platform?).with('ubuntu').and_return(true)
end
it 'should return true if /var/run/reboot-required exists' do
- File.stub(:exists?).with('/var/run/reboot-required').and_return(true)
- expect(recipe.reboot_pending?).to be_true
+ allow(File).to receive(:exists?).with('/var/run/reboot-required').and_return(true)
+ expect(recipe.reboot_pending?).to be_truthy
end
it 'should return false if /var/run/reboot-required does not exist' do
- File.stub(:exists?).with('/var/run/reboot-required').and_return(false)
- expect(recipe.reboot_pending?).to be_false
+ allow(File).to receive(:exists?).with('/var/run/reboot-required').and_return(false)
+ expect(recipe.reboot_pending?).to be_falsey
end
end
diff --git a/spec/unit/dsl/regsitry_helper_spec.rb b/spec/unit/dsl/regsitry_helper_spec.rb
index 7fe08e310f..6508a12b6f 100644
--- a/spec/unit/dsl/regsitry_helper_spec.rb
+++ b/spec/unit/dsl/regsitry_helper_spec.rb
@@ -33,22 +33,22 @@ describe Chef::Resource::RegistryKey do
context "tests registry dsl" do
it "resource can access registry_helper method registry_key_exists" do
- @resource.respond_to?('registry_key_exists?').should == true
+ expect(@resource.respond_to?('registry_key_exists?')).to eq(true)
end
it "resource can access registry_helper method registry_get_values" do
- @resource.respond_to?('registry_get_values').should == true
+ expect(@resource.respond_to?('registry_get_values')).to eq(true)
end
it "resource can access registry_helper method registry_has_subkey" do
- @resource.respond_to?('registry_has_subkeys?').should == true
+ expect(@resource.respond_to?('registry_has_subkeys?')).to eq(true)
end
it "resource can access registry_helper method registry_get_subkeys" do
- @resource.respond_to?('registry_get_subkeys').should == true
+ expect(@resource.respond_to?('registry_get_subkeys')).to eq(true)
end
it "resource can access registry_helper method registry_value_exists" do
- @resource.respond_to?('registry_value_exists?').should == true
+ expect(@resource.respond_to?('registry_value_exists?')).to eq(true)
end
it "resource can access registry_helper method data_value_exists" do
- @resource.respond_to?('registry_data_exists?').should == true
+ expect(@resource.respond_to?('registry_data_exists?')).to eq(true)
end
end
end
diff --git a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb
index 1da5efb36e..1e2b2a85e8 100644
--- a/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb
+++ b/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb
@@ -83,7 +83,7 @@ describe Chef::EncryptedDataBagItem::CheckEncrypted do
end
end
- context "when encryption version is 3", :ruby_20_only do
+ context "when encryption version is 3", :aes_256_gcm_only, :ruby_20_only do
include_examples "encryption detected" do
let(:version) { 3 }
let(:encryptor) { Chef::EncryptedDataBagItem::Encryptor::Version3Encryptor }
diff --git a/spec/unit/encrypted_data_bag_item_spec.rb b/spec/unit/encrypted_data_bag_item_spec.rb
index 9335889ef3..14afea507c 100644
--- a/spec/unit/encrypted_data_bag_item_spec.rb
+++ b/spec/unit/encrypted_data_bag_item_spec.rb
@@ -39,7 +39,7 @@ describe Chef::EncryptedDataBagItem::Encryptor do
let(:key) { "passwd" }
it "encrypts to format version 1 by default" do
- encryptor.should be_a_instance_of(Chef::EncryptedDataBagItem::Encryptor::Version1Encryptor)
+ expect(encryptor).to be_a_instance_of(Chef::EncryptedDataBagItem::Encryptor::Version1Encryptor)
end
describe "generating a random IV" do
@@ -49,14 +49,14 @@ describe Chef::EncryptedDataBagItem::Encryptor do
# No API in ruby OpenSSL to get the iv is used for the encryption back
# out. Instead we test if the encrypted data is the same. If it *is* the
# same, we assume the IV was the same each time.
- encryptor.encrypted_data.should_not eq encryptor2.encrypted_data
+ expect(encryptor.encrypted_data).not_to eq encryptor2.encrypted_data
end
end
describe "when encrypting a non-hash non-array value" do
let(:plaintext_data) { 5 }
it "serializes the value in a de-serializable way" do
- Chef::JSONCompat.from_json(encryptor.serialized_data)["json_wrapper"].should eq 5
+ expect(Chef::JSONCompat.from_json(encryptor.serialized_data)["json_wrapper"]).to eq 5
end
end
@@ -64,10 +64,10 @@ describe Chef::EncryptedDataBagItem::Encryptor do
describe "wrapping secret values in an envelope" do
it "wraps the encrypted data in an envelope with the iv and version" do
final_data = encryptor.for_encrypted_item
- final_data["encrypted_data"].should eq encryptor.encrypted_data
- final_data["iv"].should eq Base64.encode64(encryptor.iv)
- final_data["version"].should eq 1
- final_data["cipher"].should eq"aes-256-cbc"
+ expect(final_data["encrypted_data"]).to eq encryptor.encrypted_data
+ expect(final_data["iv"]).to eq Base64.encode64(encryptor.iv)
+ expect(final_data["version"]).to eq 1
+ expect(final_data["cipher"]).to eq"aes-256-cbc"
end
end
@@ -78,17 +78,17 @@ describe Chef::EncryptedDataBagItem::Encryptor do
end
it "creates a version 2 encryptor" do
- encryptor.should be_a_instance_of(Chef::EncryptedDataBagItem::Encryptor::Version2Encryptor)
+ expect(encryptor).to be_a_instance_of(Chef::EncryptedDataBagItem::Encryptor::Version2Encryptor)
end
it "generates an hmac based on ciphertext with different iv" do
encryptor2 = Chef::EncryptedDataBagItem::Encryptor.new(plaintext_data, key)
- encryptor.hmac.should_not eq(encryptor2.hmac)
+ expect(encryptor.hmac).not_to eq(encryptor2.hmac)
end
it "includes the hmac in the envelope" do
final_data = encryptor.for_encrypted_item
- final_data["hmac"].should eq(encryptor.hmac)
+ expect(final_data["hmac"]).to eq(encryptor.hmac)
end
end
@@ -97,26 +97,26 @@ describe Chef::EncryptedDataBagItem::Encryptor do
Chef::Config[:data_bag_encrypt_version] = 3
end
- context "on supported platforms", :ruby_gte_20_and_openssl_gte_101 do
+ context "on supported platforms", :aes_256_gcm_only, :ruby_20_only do
it "creates a version 3 encryptor" do
- encryptor.should be_a_instance_of(Chef::EncryptedDataBagItem::Encryptor::Version3Encryptor)
+ expect(encryptor).to be_a_instance_of(Chef::EncryptedDataBagItem::Encryptor::Version3Encryptor)
end
it "generates different authentication tags" do
encryptor3 = Chef::EncryptedDataBagItem::Encryptor.new(plaintext_data, key)
encryptor.for_encrypted_item # required to generate the auth_tag
encryptor3.for_encrypted_item
- encryptor.auth_tag.should_not eq(encryptor3.auth_tag)
+ expect(encryptor.auth_tag).not_to eq(encryptor3.auth_tag)
end
it "includes the auth_tag in the envelope" do
final_data = encryptor.for_encrypted_item
- final_data["auth_tag"].should eq(Base64::encode64(encryptor.auth_tag))
+ expect(final_data["auth_tag"]).to eq(Base64::encode64(encryptor.auth_tag))
end
it "throws an error if auth tag is read before encrypting the data" do
- lambda { encryptor.auth_tag }.should raise_error(Chef::EncryptedDataBagItem::EncryptionFailure)
+ expect { encryptor.auth_tag }.to raise_error(Chef::EncryptedDataBagItem::EncryptionFailure)
end
end # context on supported platforms
@@ -126,24 +126,24 @@ describe Chef::EncryptedDataBagItem::Encryptor do
it "throws an error warning about the Ruby version if it has no GCM support" do
# Force OpenSSL with AEAD support
- OpenSSL::Cipher.stub(:ciphers).and_return([ aead_algorithm ])
+ allow(OpenSSL::Cipher).to receive(:ciphers).and_return([ aead_algorithm ])
# Ruby without AEAD support
- OpenSSL::Cipher.should_receive(:method_defined?).with(:auth_data=).and_return(false)
- lambda { encryptor }.should raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/)
+ expect(OpenSSL::Cipher).to receive(:method_defined?).with(:auth_data=).and_return(false)
+ expect { encryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/)
end
it "throws an error warning about the OpenSSL version if it has no GCM support" do
# Force Ruby with AEAD support
- OpenSSL::Cipher.stub(:method_defined?).with(:auth_data=).and_return(true)
+ allow(OpenSSL::Cipher).to receive(:method_defined?).with(:auth_data=).and_return(true)
# OpenSSL without AEAD support
- OpenSSL::Cipher.should_receive(:ciphers).and_return([])
- lambda { encryptor }.should raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires an OpenSSL/)
+ expect(OpenSSL::Cipher).to receive(:ciphers).and_return([])
+ expect { encryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires an OpenSSL/)
end
context "on platforms with old Ruby", :ruby_lt_20 do
it "throws an error warning about the Ruby version" do
- lambda { encryptor }.should raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/)
+ expect { encryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/)
end
end # context on platforms with old Ruby
@@ -151,7 +151,7 @@ describe Chef::EncryptedDataBagItem::Encryptor do
context "on platforms with old OpenSSL", :openssl_lt_101 do
it "throws an error warning about the OpenSSL version" do
- lambda { encryptor }.should raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires an OpenSSL/)
+ expect { encryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires an OpenSSL/)
end
end # context on platforms with old OpenSSL
@@ -172,17 +172,17 @@ describe Chef::EncryptedDataBagItem::Decryptor do
shared_examples "decryption examples" do
it "decrypts the encrypted value" do
- decryptor.decrypted_data.should eq(json_wrapped_data)
+ expect(decryptor.decrypted_data).to eq(json_wrapped_data)
end
it "unwraps the encrypted data and returns it" do
- decryptor.for_decrypted_item.should eq plaintext_data
+ expect(decryptor.for_decrypted_item).to eq plaintext_data
end
end
context "when decrypting a version 3 (JSON+aes-256-gcm+random iv+auth tag) encrypted value" do
- context "on supported platforms", :ruby_gte_20_and_openssl_gte_101 do
+ context "on supported platforms", :aes_256_gcm_only, :ruby_20_only do
let(:encrypted_value) do
Chef::EncryptedDataBagItem::Encryptor::Version3Encryptor.new(plaintext_data, encryption_key).for_encrypted_item
@@ -194,12 +194,12 @@ describe Chef::EncryptedDataBagItem::Decryptor do
it "rejects the data if the authentication tag is wrong" do
encrypted_value["auth_tag"] = bogus_auth_tag
- lambda { decryptor.for_decrypted_item }.should raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
+ expect { decryptor.for_decrypted_item }.to raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
end
it "rejects the data if the authentication tag is missing" do
encrypted_value.delete("auth_tag")
- lambda { decryptor.for_decrypted_item }.should raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
+ expect { decryptor.for_decrypted_item }.to raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
end
end # context on supported platforms
@@ -217,7 +217,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do
context "on platforms with old Ruby", :ruby_lt_20 do
it "throws an error warning about the Ruby version" do
- lambda { decryptor }.should raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/)
+ expect { decryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/)
end
end # context on platforms with old Ruby
@@ -225,7 +225,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do
context "on platforms with old OpenSSL", :openssl_lt_101 do
it "throws an error warning about the OpenSSL version" do
- lambda { decryptor }.should raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires an OpenSSL/)
+ expect { decryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires an OpenSSL/)
end
end # context on unsupported platforms
@@ -249,12 +249,12 @@ describe Chef::EncryptedDataBagItem::Decryptor do
it "rejects the data if the hmac is wrong" do
encrypted_value["hmac"] = bogus_hmac
- lambda { decryptor.for_decrypted_item }.should raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
+ expect { decryptor.for_decrypted_item }.to raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
end
it "rejects the data if the hmac is missing" do
encrypted_value.delete("hmac")
- lambda { decryptor.for_decrypted_item }.should raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
+ expect { decryptor.for_decrypted_item }.to raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
end
end
@@ -266,7 +266,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do
end
it "selects the correct strategy for version 1" do
- decryptor.should be_a_instance_of Chef::EncryptedDataBagItem::Decryptor::Version1Decryptor
+ expect(decryptor).to be_a_instance_of Chef::EncryptedDataBagItem::Decryptor::Version1Decryptor
end
include_examples "decryption examples"
@@ -276,8 +276,8 @@ describe Chef::EncryptedDataBagItem::Decryptor do
# Over a large number of tests on a variety of systems, we occasionally
# see the decryption step "succeed" but return invalid data (e.g., not
# the original plain text) [CHEF-3858]
- decryptor.should_receive(:decrypted_data).and_return("lksajdf")
- lambda { decryptor.for_decrypted_item }.should raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
+ expect(decryptor).to receive(:decrypted_data).and_return("lksajdf")
+ expect { decryptor.for_decrypted_item }.to raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
end
end
@@ -285,7 +285,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do
let(:decryption_key) { "wrong-passwd" }
it "raises a sensible error" do
- lambda { decryptor.for_decrypted_item }.should raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
+ expect { decryptor.for_decrypted_item }.to raise_error(Chef::EncryptedDataBagItem::DecryptionFailure)
end
end
@@ -297,7 +297,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do
end
it "raises a sensible error" do
- lambda { decryptor.for_decrypted_item }.should raise_error(Chef::EncryptedDataBagItem::UnsupportedCipher)
+ expect { decryptor.for_decrypted_item }.to raise_error(Chef::EncryptedDataBagItem::UnsupportedCipher)
end
end
@@ -307,7 +307,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do
end
it "raises an error attempting to decrypt" do
- lambda { decryptor }.should raise_error(Chef::EncryptedDataBagItem::UnacceptableEncryptedDataBagItemFormat)
+ expect { decryptor }.to raise_error(Chef::EncryptedDataBagItem::UnacceptableEncryptedDataBagItemFormat)
end
end
@@ -320,11 +320,11 @@ describe Chef::EncryptedDataBagItem::Decryptor do
end
it "selects the correct strategy for version 0" do
- decryptor.should be_a_instance_of(Chef::EncryptedDataBagItem::Decryptor::Version0Decryptor)
+ expect(decryptor).to be_a_instance_of(Chef::EncryptedDataBagItem::Decryptor::Version0Decryptor)
end
it "decrypts the encrypted value" do
- decryptor.for_decrypted_item.should eq plaintext_data
+ expect(decryptor.for_decrypted_item).to eq plaintext_data
end
context "and version 1 format is required" do
@@ -333,7 +333,7 @@ describe Chef::EncryptedDataBagItem::Decryptor do
end
it "raises an error attempting to decrypt" do
- lambda { decryptor }.should raise_error(Chef::EncryptedDataBagItem::UnacceptableEncryptedDataBagItemFormat)
+ expect { decryptor }.to raise_error(Chef::EncryptedDataBagItem::UnacceptableEncryptedDataBagItemFormat)
end
end
@@ -355,27 +355,27 @@ describe Chef::EncryptedDataBagItem do
describe "encrypting" do
it "doesn't encrypt the 'id' key" do
- encoded_data["id"].should eq "item_name"
+ expect(encoded_data["id"]).to eq "item_name"
end
it "encrypts non-collection objects" do
- encoded_data["greeting"]["version"].should eq 1
- encoded_data["greeting"].should have_key("iv")
+ expect(encoded_data["greeting"]["version"]).to eq 1
+ expect(encoded_data["greeting"]).to have_key("iv")
iv = encoded_data["greeting"]["iv"]
encryptor = Chef::EncryptedDataBagItem::Encryptor.new("hello", secret, iv)
- encoded_data["greeting"]["encrypted_data"].should eq(encryptor.for_encrypted_item["encrypted_data"])
+ expect(encoded_data["greeting"]["encrypted_data"]).to eq(encryptor.for_encrypted_item["encrypted_data"])
end
it "encrypts nested values" do
- encoded_data["nested"]["version"].should eq 1
- encoded_data["nested"].should have_key("iv")
+ expect(encoded_data["nested"]["version"]).to eq 1
+ expect(encoded_data["nested"]).to have_key("iv")
iv = encoded_data["nested"]["iv"]
encryptor = Chef::EncryptedDataBagItem::Encryptor.new(plaintext_data["nested"], secret, iv)
- encoded_data["nested"]["encrypted_data"].should eq(encryptor.for_encrypted_item["encrypted_data"])
+ expect(encoded_data["nested"]["encrypted_data"]).to eq(encryptor.for_encrypted_item["encrypted_data"])
end
end
@@ -383,31 +383,31 @@ describe Chef::EncryptedDataBagItem do
describe "decrypting" do
it "doesn't try to decrypt 'id'" do
- encrypted_data_bag_item["id"].should eq(plaintext_data["id"])
+ expect(encrypted_data_bag_item["id"]).to eq(plaintext_data["id"])
end
it "decrypts 'greeting'" do
- encrypted_data_bag_item["greeting"].should eq(plaintext_data["greeting"])
+ expect(encrypted_data_bag_item["greeting"]).to eq(plaintext_data["greeting"])
end
it "decrypts 'nested'" do
- encrypted_data_bag_item["nested"].should eq(plaintext_data["nested"])
+ expect(encrypted_data_bag_item["nested"]).to eq(plaintext_data["nested"])
end
it "decrypts everyting via to_hash" do
- encrypted_data_bag_item.to_hash.should eq(plaintext_data)
+ expect(encrypted_data_bag_item.to_hash).to eq(plaintext_data)
end
it "handles missing keys gracefully" do
- encrypted_data_bag_item["no-such-key"].should be_nil
+ expect(encrypted_data_bag_item["no-such-key"]).to be_nil
end
end
describe "loading" do
it "should defer to Chef::DataBagItem.load" do
- Chef::DataBagItem.stub(:load).with(:the_bag, "my_codes").and_return(encoded_data)
+ allow(Chef::DataBagItem).to receive(:load).with(:the_bag, "my_codes").and_return(encoded_data)
edbi = Chef::EncryptedDataBagItem.load(:the_bag, "my_codes", secret)
- edbi["greeting"].should eq(plaintext_data["greeting"])
+ expect(edbi["greeting"]).to eq(plaintext_data["greeting"])
end
end
@@ -416,45 +416,45 @@ describe Chef::EncryptedDataBagItem do
context "when /var/mysecret exists" do
before do
- ::File.stub(:exist?).with("/var/mysecret").and_return(true)
- IO.stub(:read).with("/var/mysecret").and_return(secret)
+ allow(::File).to receive(:exist?).with("/var/mysecret").and_return(true)
+ allow(IO).to receive(:read).with("/var/mysecret").and_return(secret)
end
it "load_secret('/var/mysecret') reads the secret" do
- Chef::EncryptedDataBagItem.load_secret("/var/mysecret").should eq secret
+ expect(Chef::EncryptedDataBagItem.load_secret("/var/mysecret")).to eq secret
end
end
context "when /etc/chef/encrypted_data_bag_secret exists" do
before do
path = Chef::Config.platform_specific_path("/etc/chef/encrypted_data_bag_secret")
- ::File.stub(:exist?).with(path).and_return(true)
- IO.stub(:read).with(path).and_return(secret)
+ allow(::File).to receive(:exist?).with(path).and_return(true)
+ allow(IO).to receive(:read).with(path).and_return(secret)
end
it "load_secret(nil) reads the secret" do
- Chef::EncryptedDataBagItem.load_secret(nil).should eq secret
+ expect(Chef::EncryptedDataBagItem.load_secret(nil)).to eq secret
end
end
context "when /etc/chef/encrypted_data_bag_secret does not exist" do
before do
path = Chef::Config.platform_specific_path("/etc/chef/encrypted_data_bag_secret")
- ::File.stub(:exist?).with(path).and_return(false)
+ allow(::File).to receive(:exist?).with(path).and_return(false)
end
it "load_secret(nil) emits a reasonable error message" do
- lambda { Chef::EncryptedDataBagItem.load_secret(nil) }.should raise_error(ArgumentError, /No secret specified and no secret found at #{Chef::Config[:encrypted_data_bag_secret]}/)
+ expect { Chef::EncryptedDataBagItem.load_secret(nil) }.to raise_error(ArgumentError, /No secret specified and no secret found at #{Chef::Config[:encrypted_data_bag_secret]}/)
end
end
context "path argument is a URL" do
before do
- Kernel.stub(:open).with("http://www.opscode.com/").and_return(StringIO.new(secret))
+ allow(Kernel).to receive(:open).with("http://www.opscode.com/").and_return(StringIO.new(secret))
end
it "reads from the URL" do
- Chef::EncryptedDataBagItem.load_secret("http://www.opscode.com/").should eq secret
+ expect(Chef::EncryptedDataBagItem.load_secret("http://www.opscode.com/")).to eq secret
end
end
end
diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb
index ffb8fbfeaf..ee3b8b21e1 100644
--- a/spec/unit/environment_spec.rb
+++ b/spec/unit/environment_spec.rb
@@ -29,75 +29,75 @@ describe Chef::Environment do
describe "initialize" do
it "should be a Chef::Environment" do
- @environment.should be_a_kind_of(Chef::Environment)
+ expect(@environment).to be_a_kind_of(Chef::Environment)
end
end
describe "name" do
it "should let you set the name to a string" do
- @environment.name("production").should == "production"
+ expect(@environment.name("production")).to eq("production")
end
it "should return the current name" do
@environment.name("production")
- @environment.name.should == "production"
+ expect(@environment.name).to eq("production")
end
it "should not accept spaces" do
- lambda { @environment.name("production environment") }.should raise_error(ArgumentError)
+ expect { @environment.name("production environment") }.to raise_error(ArgumentError)
end
it "should not accept anything but strings" do
- lambda { @environment.name(Array.new) }.should raise_error(ArgumentError)
- lambda { @environment.name(Hash.new) }.should raise_error(ArgumentError)
- lambda { @environment.name(2) }.should raise_error(ArgumentError)
+ expect { @environment.name(Array.new) }.to raise_error(ArgumentError)
+ expect { @environment.name(Hash.new) }.to raise_error(ArgumentError)
+ expect { @environment.name(2) }.to raise_error(ArgumentError)
end
end
describe "description" do
it "should let you set the description to a string" do
- @environment.description("this is my test environment").should == "this is my test environment"
+ expect(@environment.description("this is my test environment")).to eq("this is my test environment")
end
it "should return the correct description" do
@environment.description("I like running tests")
- @environment.description.should == "I like running tests"
+ expect(@environment.description).to eq("I like running tests")
end
it "should not accept anything but strings" do
- lambda { @environment.description(Array.new) }.should raise_error(ArgumentError)
- lambda { @environment.description(Hash.new) }.should raise_error(ArgumentError)
- lambda { @environment.description(42) }.should raise_error(ArgumentError)
+ expect { @environment.description(Array.new) }.to raise_error(ArgumentError)
+ expect { @environment.description(Hash.new) }.to raise_error(ArgumentError)
+ expect { @environment.description(42) }.to raise_error(ArgumentError)
end
end
describe "default attributes" do
it "should let you set the attributes hash explicitly" do
- @environment.default_attributes({ :one => 'two' }).should == { :one => 'two' }
+ expect(@environment.default_attributes({ :one => 'two' })).to eq({ :one => 'two' })
end
it "should let you return the attributes hash" do
@environment.default_attributes({ :one => 'two' })
- @environment.default_attributes.should == { :one => 'two' }
+ expect(@environment.default_attributes).to eq({ :one => 'two' })
end
it "should throw an ArgumentError if we aren't a kind of hash" do
- lambda { @environment.default_attributes(Array.new) }.should raise_error(ArgumentError)
+ expect { @environment.default_attributes(Array.new) }.to raise_error(ArgumentError)
end
end
describe "override attributes" do
it "should let you set the attributes hash explicitly" do
- @environment.override_attributes({ :one => 'two' }).should == { :one => 'two' }
+ expect(@environment.override_attributes({ :one => 'two' })).to eq({ :one => 'two' })
end
it "should let you return the attributes hash" do
@environment.override_attributes({ :one => 'two' })
- @environment.override_attributes.should == { :one => 'two' }
+ expect(@environment.override_attributes).to eq({ :one => 'two' })
end
it "should throw an ArgumentError if we aren't a kind of hash" do
- lambda { @environment.override_attributes(Array.new) }.should raise_error(ArgumentError)
+ expect { @environment.override_attributes(Array.new) }.to raise_error(ArgumentError)
end
end
@@ -111,22 +111,22 @@ describe Chef::Environment do
end
it "should let you set the cookbook versions in a hash" do
- @environment.cookbook_versions(@cookbook_versions).should == @cookbook_versions
+ expect(@environment.cookbook_versions(@cookbook_versions)).to eq(@cookbook_versions)
end
it "should return the cookbook versions" do
@environment.cookbook_versions(@cookbook_versions)
- @environment.cookbook_versions.should == @cookbook_versions
+ expect(@environment.cookbook_versions).to eq(@cookbook_versions)
end
it "should not accept anything but a hash" do
- lambda { @environment.cookbook_versions("I am a string!") }.should raise_error(ArgumentError)
- lambda { @environment.cookbook_versions(Array.new) }.should raise_error(ArgumentError)
- lambda { @environment.cookbook_versions(42) }.should raise_error(ArgumentError)
+ expect { @environment.cookbook_versions("I am a string!") }.to raise_error(ArgumentError)
+ expect { @environment.cookbook_versions(Array.new) }.to raise_error(ArgumentError)
+ expect { @environment.cookbook_versions(42) }.to raise_error(ArgumentError)
end
it "should validate the hash" do
- Chef::Environment.should_receive(:validate_cookbook_versions).with(@cookbook_versions).and_return true
+ expect(Chef::Environment).to receive(:validate_cookbook_versions).with(@cookbook_versions).and_return true
@environment.cookbook_versions(@cookbook_versions)
end
end
@@ -134,11 +134,11 @@ describe Chef::Environment do
describe "cookbook" do
it "should set the version of the cookbook in the cookbook_versions hash" do
@environment.cookbook("apt", "~> 1.2.3")
- @environment.cookbook_versions["apt"].should == "~> 1.2.3"
+ expect(@environment.cookbook_versions["apt"]).to eq("~> 1.2.3")
end
it "should validate the cookbook version it is passed" do
- Chef::Environment.should_receive(:validate_cookbook_version).with(">= 1.2.3").and_return true
+ expect(Chef::Environment).to receive(:validate_cookbook_version).with(">= 1.2.3").and_return true
@environment.cookbook("apt", ">= 1.2.3")
end
end
@@ -157,9 +157,9 @@ describe Chef::Environment do
it "should update everything but name" do
@environment.update_from!(@example)
- @environment.name.should == "prod"
- @environment.description.should == @example.description
- @environment.cookbook_versions.should == @example.cookbook_versions
+ expect(@environment.name).to eq("prod")
+ expect(@environment.description).to eq(@example.description)
+ expect(@environment.cookbook_versions).to eq(@example.cookbook_versions)
end
end
@@ -173,16 +173,16 @@ describe Chef::Environment do
%w{name description cookbook_versions}.each do |t|
it "should include '#{t}'" do
- @hash[t].should == @environment.send(t.to_sym)
+ expect(@hash[t]).to eq(@environment.send(t.to_sym))
end
end
it "should include 'json_class'" do
- @hash["json_class"].should == "Chef::Environment"
+ expect(@hash["json_class"]).to eq("Chef::Environment")
end
it "should include 'chef_type'" do
- @hash["chef_type"].should == "environment"
+ expect(@hash["chef_type"]).to eq("environment")
end
end
@@ -196,16 +196,16 @@ describe Chef::Environment do
%w{name description cookbook_versions}.each do |t|
it "should include '#{t}'" do
- @json.should =~ /"#{t}":#{Regexp.escape(Chef::JSONCompat.to_json(@environment.send(t.to_sym)))}/
+ expect(@json).to match(/"#{t}":#{Regexp.escape(Chef::JSONCompat.to_json(@environment.send(t.to_sym)))}/)
end
end
it "should include 'json_class'" do
- @json.should =~ /"json_class":"Chef::Environment"/
+ expect(@json).to match(/"json_class":"Chef::Environment"/)
end
it "should include 'chef_type'" do
- @json.should =~ /"chef_type":"environment"/
+ expect(@json).to match(/"chef_type":"environment"/)
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
@@ -230,12 +230,12 @@ describe Chef::Environment do
end
it "should return a Chef::Environment" do
- @environment.should be_a_kind_of(Chef::Environment)
+ expect(@environment).to be_a_kind_of(Chef::Environment)
end
%w{name description cookbook_versions}.each do |t|
it "should match '#{t}'" do
- @environment.send(t.to_sym).should == @data[t]
+ expect(@environment.send(t.to_sym)).to eq(@data[t])
end
end
end
@@ -251,39 +251,39 @@ describe Chef::Environment do
it "should validate the version string of each cookbook" do
@cookbook_versions.each do |cookbook, version|
- Chef::Environment.should_receive(:validate_cookbook_version).with(version).and_return true
+ expect(Chef::Environment).to receive(:validate_cookbook_version).with(version).and_return true
end
Chef::Environment.validate_cookbook_versions(@cookbook_versions)
end
it "should return false if anything other than a hash is passed as the argument" do
- Chef::Environment.validate_cookbook_versions(Array.new).should == false
- Chef::Environment.validate_cookbook_versions(42).should == false
- Chef::Environment.validate_cookbook_versions(Chef::CookbookVersion.new("meta")).should == false
- Chef::Environment.validate_cookbook_versions("cookbook => 1.2.3").should == false
+ expect(Chef::Environment.validate_cookbook_versions(Array.new)).to eq(false)
+ expect(Chef::Environment.validate_cookbook_versions(42)).to eq(false)
+ expect(Chef::Environment.validate_cookbook_versions(Chef::CookbookVersion.new("meta"))).to eq(false)
+ expect(Chef::Environment.validate_cookbook_versions("cookbook => 1.2.3")).to eq(false)
end
end
describe "self.validate_cookbook_version" do
it "should validate correct version numbers" do
- Chef::Environment.validate_cookbook_version("= 1.2.3").should == true
- Chef::Environment.validate_cookbook_version("=1.2.3").should == true
- Chef::Environment.validate_cookbook_version(">= 0.0.3").should == true
- Chef::Environment.validate_cookbook_version(">=0.0.3").should == true
+ expect(Chef::Environment.validate_cookbook_version("= 1.2.3")).to eq(true)
+ expect(Chef::Environment.validate_cookbook_version("=1.2.3")).to eq(true)
+ expect(Chef::Environment.validate_cookbook_version(">= 0.0.3")).to eq(true)
+ expect(Chef::Environment.validate_cookbook_version(">=0.0.3")).to eq(true)
# A lone version is allowed, interpreted as implicit '='
- Chef::Environment.validate_cookbook_version("1.2.3").should == true
+ expect(Chef::Environment.validate_cookbook_version("1.2.3")).to eq(true)
end
it "should return false when an invalid version is given" do
- Chef::Environment.validate_cookbook_version(Chef::CookbookVersion.new("meta")).should == false
- Chef::Environment.validate_cookbook_version("= 1.2.3a").should == false
- Chef::Environment.validate_cookbook_version("=1.2.3a").should == false
- Chef::Environment.validate_cookbook_version("= 1").should == false
- Chef::Environment.validate_cookbook_version("=1").should == false
- Chef::Environment.validate_cookbook_version("= a").should == false
- Chef::Environment.validate_cookbook_version("=a").should == false
- Chef::Environment.validate_cookbook_version("= 1.2.3.4").should == false
- Chef::Environment.validate_cookbook_version("=1.2.3.4").should == false
+ expect(Chef::Environment.validate_cookbook_version(Chef::CookbookVersion.new("meta"))).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("= 1.2.3a")).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("=1.2.3a")).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("= 1")).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("=1")).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("= a")).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("=a")).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("= 1.2.3.4")).to eq(false)
+ expect(Chef::Environment.validate_cookbook_version("=1.2.3.4")).to eq(false)
end
describe "in solo mode" do
@@ -296,9 +296,9 @@ describe Chef::Environment do
end
it "should raise and exception" do
- lambda {
+ expect {
Chef::Environment.validate_cookbook_version("= 1.2.3.4")
- }.should raise_error Chef::Exceptions::IllegalVersionConstraint,
+ }.to raise_error Chef::Exceptions::IllegalVersionConstraint,
"Environment cookbook version constraints not allowed in chef-solo"
end
end
@@ -312,17 +312,17 @@ describe Chef::Environment do
it "updates the name from parameters[:name]" do
@environment.update_from_params(:name => "kurrupt")
- @environment.name.should == "kurrupt"
+ expect(@environment.name).to eq("kurrupt")
end
it "validates the name given in the params" do
- @environment.update_from_params(:name => "@$%^&*()").should be_false
- @environment.invalid_fields[:name].should == %q|Option name's value @$%^&*() does not match regular expression /^[\-[:alnum:]_]+$/|
+ expect(@environment.update_from_params(:name => "@$%^&*()")).to be_falsey
+ expect(@environment.invalid_fields[:name]).to eq(%q|Option name's value @$%^&*() does not match regular expression /^[\-[:alnum:]_]+$/|)
end
it "updates the description from parameters[:description]" do
@environment.update_from_params(:description => "wow, writing your own object mapper is kinda painful")
- @environment.description.should == "wow, writing your own object mapper is kinda painful"
+ expect(@environment.description).to eq("wow, writing your own object mapper is kinda painful")
end
it "updates cookbook version constraints from the hash in parameters[:cookbook_version_constraints]" do
@@ -331,34 +331,34 @@ describe Chef::Environment do
# the way merb does params
params = {:name=>"superbowl", :cookbook_version => {"0" => "apache2 ~> 1.0.0", "1" => "nginx < 2.0.0"}}
@environment.update_from_params(params)
- @environment.cookbook_versions.should == {"apache2" => "~> 1.0.0", "nginx" => "< 2.0.0"}
+ expect(@environment.cookbook_versions).to eq({"apache2" => "~> 1.0.0", "nginx" => "< 2.0.0"})
end
it "validates the cookbook constraints" do
params = {:cookbook_version => {"0" => "apache2 >>> 1.0.0"}}
- @environment.update_from_params(params).should be_false
+ expect(@environment.update_from_params(params)).to be_falsey
err_msg = @environment.invalid_fields[:cookbook_version]["0"]
- err_msg.should == "apache2 >>> 1.0.0 is not a valid cookbook constraint"
+ expect(err_msg).to eq("apache2 >>> 1.0.0 is not a valid cookbook constraint")
end
it "is not valid if the name is not present" do
- @environment.validate_required_attrs_present.should be_false
- @environment.invalid_fields[:name].should == "name cannot be empty"
+ expect(@environment.validate_required_attrs_present).to be_falsey
+ expect(@environment.invalid_fields[:name]).to eq("name cannot be empty")
end
it "is not valid after updating from params if the name is not present" do
- @environment.update_from_params({}).should be_false
- @environment.invalid_fields[:name].should == "name cannot be empty"
+ expect(@environment.update_from_params({})).to be_falsey
+ expect(@environment.invalid_fields[:name]).to eq("name cannot be empty")
end
it "updates default attributes from a JSON string in params[:attributes]" do
@environment.update_from_params(:name => "fuuu", :default_attributes => %q|{"fuuu":"RAGE"}|)
- @environment.default_attributes.should == {"fuuu" => "RAGE"}
+ expect(@environment.default_attributes).to eq({"fuuu" => "RAGE"})
end
it "updates override attributes from a JSON string in params[:attributes]" do
@environment.update_from_params(:name => "fuuu", :override_attributes => %q|{"foo":"override"}|)
- @environment.override_attributes.should == {"foo" => "override"}
+ expect(@environment.override_attributes).to eq({"foo" => "override"})
end
end
@@ -366,25 +366,25 @@ describe Chef::Environment do
describe "api model" do
before(:each) do
@rest = double("Chef::REST")
- Chef::REST.stub(:new).and_return(@rest)
+ allow(Chef::REST).to receive(:new).and_return(@rest)
@query = double("Chef::Search::Query")
- Chef::Search::Query.stub(:new).and_return(@query)
+ allow(Chef::Search::Query).to receive(:new).and_return(@query)
end
describe "list" do
describe "inflated" do
it "should return a hash of environment names and objects" do
e1 = double("Chef::Environment", :name => "one")
- @query.should_receive(:search).with(:environment).and_yield(e1)
+ expect(@query).to receive(:search).with(:environment).and_yield(e1)
r = Chef::Environment.list(true)
- r["one"].should == e1
+ expect(r["one"]).to eq(e1)
end
end
it "should return a hash of environment names and urls" do
- @rest.should_receive(:get_rest).and_return({ "one" => "http://foo" })
+ expect(@rest).to receive(:get_rest).and_return({ "one" => "http://foo" })
r = Chef::Environment.list
- r["one"].should == "http://foo"
+ expect(r["one"]).to eq("http://foo")
end
end
end
@@ -401,18 +401,18 @@ describe Chef::Environment do
end
it "should get the environment from the environment_path" do
- File.should_receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
- File.should_receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(false)
- File.should_receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).exactly(2).times.and_return(true)
- File.should_receive(:readable?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(true)
+ expect(File).to receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
+ expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(false)
+ expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).exactly(2).times.and_return(true)
+ expect(File).to receive(:readable?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(true)
role_dsl="name \"foo\"\ndescription \"desc\"\n"
- IO.should_receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(role_dsl)
+ expect(IO).to receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(role_dsl)
Chef::Environment.load('foo')
end
it "should return a Chef::Environment object from JSON" do
- File.should_receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
- File.should_receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(true)
+ expect(File).to receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
+ expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(true)
environment_hash = {
"name" => "foo",
"default_attributes" => {
@@ -424,45 +424,45 @@ describe Chef::Environment do
"description" => "desc",
"chef_type" => "environment"
}
- IO.should_receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(Chef::JSONCompat.to_json(environment_hash))
+ expect(IO).to receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(Chef::JSONCompat.to_json(environment_hash))
environment = Chef::Environment.load('foo')
- environment.should be_a_kind_of(Chef::Environment)
- environment.name.should == environment_hash['name']
- environment.description.should == environment_hash['description']
- environment.default_attributes.should == environment_hash['default_attributes']
+ expect(environment).to be_a_kind_of(Chef::Environment)
+ expect(environment.name).to eq(environment_hash['name'])
+ expect(environment.description).to eq(environment_hash['description'])
+ expect(environment.default_attributes).to eq(environment_hash['default_attributes'])
end
it "should return a Chef::Environment object from Ruby DSL" do
- File.should_receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
- File.should_receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(false)
- File.should_receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).exactly(2).times.and_return(true)
- File.should_receive(:readable?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(true)
+ expect(File).to receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
+ expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(false)
+ expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).exactly(2).times.and_return(true)
+ expect(File).to receive(:readable?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(true)
role_dsl="name \"foo\"\ndescription \"desc\"\n"
- IO.should_receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(role_dsl)
+ expect(IO).to receive(:read).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(role_dsl)
environment = Chef::Environment.load('foo')
- environment.should be_a_kind_of(Chef::Environment)
- environment.name.should == 'foo'
- environment.description.should == 'desc'
+ expect(environment).to be_a_kind_of(Chef::Environment)
+ expect(environment.name).to eq('foo')
+ expect(environment.description).to eq('desc')
end
it 'should raise an error if the configured environment_path is invalid' do
- File.should_receive(:directory?).with(Chef::Config[:environment_path]).and_return(false)
+ expect(File).to receive(:directory?).with(Chef::Config[:environment_path]).and_return(false)
- lambda {
+ expect {
Chef::Environment.load('foo')
- }.should raise_error Chef::Exceptions::InvalidEnvironmentPath, "Environment path '/var/chef/environments' is invalid"
+ }.to raise_error Chef::Exceptions::InvalidEnvironmentPath, "Environment path '/var/chef/environments' is invalid"
end
it 'should raise an error if the file does not exist' do
- File.should_receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
- File.should_receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(false)
- File.should_receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(false)
+ expect(File).to receive(:directory?).with(Chef::Config[:environment_path]).and_return(true)
+ expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.json')).and_return(false)
+ expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], 'foo.rb')).and_return(false)
- lambda {
+ expect {
Chef::Environment.load('foo')
- }.should raise_error Chef::Exceptions::EnvironmentNotFound, "Environment 'foo' could not be loaded from disk"
+ }.to raise_error Chef::Exceptions::EnvironmentNotFound, "Environment 'foo' could not be loaded from disk"
end
end
end
diff --git a/spec/unit/exceptions_spec.rb b/spec/unit/exceptions_spec.rb
index 21b0abb9bf..6318ec9227 100644
--- a/spec/unit/exceptions_spec.rb
+++ b/spec/unit/exceptions_spec.rb
@@ -72,7 +72,7 @@ describe Chef::Exceptions do
exception_to_super_class.each do |exception, expected_super_class|
it "should have an exception class of #{exception} which inherits from #{expected_super_class}" do
- lambda{ raise exception }.should raise_error(expected_super_class)
+ expect{ raise exception }.to raise_error(expected_super_class)
end
if exception.methods.include?(:to_json)
diff --git a/spec/unit/file_access_control_spec.rb b/spec/unit/file_access_control_spec.rb
index 4e257c2a22..cd0bd55cc3 100644
--- a/spec/unit/file_access_control_spec.rb
+++ b/spec/unit/file_access_control_spec.rb
@@ -43,47 +43,47 @@ describe Chef::FileAccessControl do
end
it "has a resource" do
- @fac.resource.should equal(@resource)
+ expect(@fac.resource).to equal(@resource)
end
it "has a file to manage" do
- @fac.file.should == '/tmp/different_file.txt'
+ expect(@fac.file).to eq('/tmp/different_file.txt')
end
it "is not modified yet" do
- @fac.should_not be_modified
+ expect(@fac).not_to be_modified
end
it "determines the uid of the owner specified by the resource" do
- Etc.should_receive(:getpwnam).with('toor').and_return(OpenStruct.new(:uid => 2342))
- @fac.target_uid.should == 2342
+ expect(Etc).to receive(:getpwnam).with('toor').and_return(OpenStruct.new(:uid => 2342))
+ expect(@fac.target_uid).to eq(2342)
end
it "raises a Chef::Exceptions::UserIDNotFound error when Etc can't find the user's name" do
- Etc.should_receive(:getpwnam).with('toor').and_raise(ArgumentError)
- lambda { @fac.target_uid ; @provider_requirements.run(:create) }.should raise_error(Chef::Exceptions::UserIDNotFound, "cannot determine user id for 'toor', does the user exist on this system?")
+ expect(Etc).to receive(:getpwnam).with('toor').and_raise(ArgumentError)
+ expect { @fac.target_uid ; @provider_requirements.run(:create) }.to raise_error(Chef::Exceptions::UserIDNotFound, "cannot determine user id for 'toor', does the user exist on this system?")
end
it "does not attempt to resolve the uid if the user is not specified" do
resource = Chef::Resource::File.new("a file")
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.target_uid.should be_nil
+ expect(fac.target_uid).to be_nil
end
it "does not want to update the owner if none is specified" do
resource = Chef::Resource::File.new("a file")
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.should_update_owner?.should be_false
+ expect(fac.should_update_owner?).to be_falsey
end
it "raises an ArgumentError if the resource's owner is set to something wack" do
@resource.instance_variable_set(:@owner, :diaf)
- lambda { @fac.target_uid ; @provider_requirements.run(:create) }.should raise_error(ArgumentError)
+ expect { @fac.target_uid ; @provider_requirements.run(:create) }.to raise_error(ArgumentError)
end
it "uses the resource's uid for the target uid when the resource's owner is specified by an integer" do
@resource.owner(2342)
- @fac.target_uid.should == 2342
+ expect(@fac.target_uid).to eq(2342)
end
it "wraps uids to their negative complements to correctly handle negative uids" do
@@ -93,28 +93,28 @@ describe Chef::FileAccessControl do
# uids. So we have to get ruby and negative uids to smoke the peace pipe
# with each other.
@resource.owner('nobody')
- Etc.should_receive(:getpwnam).with('nobody').and_return(OpenStruct.new(:uid => (4294967294)))
- @fac.target_uid.should == -2
+ expect(Etc).to receive(:getpwnam).with('nobody').and_return(OpenStruct.new(:uid => (4294967294)))
+ expect(@fac.target_uid).to eq(-2)
end
it "does not wrap uids to their negative complements beyond -9" do
# More: when OSX userIDs are created by ActiveDirectory sync, it tends to use huge numbers
# which had been incorrectly wrapped. It does not look like the OSX IDs go below -2
@resource.owner('bigdude')
- Etc.should_receive(:getpwnam).with('bigdude').and_return(OpenStruct.new(:uid => (4294967286)))
- @fac.target_uid.should == 4294967286
+ expect(Etc).to receive(:getpwnam).with('bigdude').and_return(OpenStruct.new(:uid => (4294967286)))
+ expect(@fac.target_uid).to eq(4294967286)
end
it "wants to update the owner when the current owner is nil (creating a file)" do
@current_resource.owner(nil)
@resource.owner(2342)
- @fac.should_update_owner?.should be_true
+ expect(@fac.should_update_owner?).to be_truthy
end
it "wants to update the owner when the current owner doesn't match desired" do
@current_resource.owner(3224)
@resource.owner(2342)
- @fac.should_update_owner?.should be_true
+ expect(@fac.should_update_owner?).to be_truthy
end
it "includes updating ownership in its list of desired changes" do
@@ -122,72 +122,72 @@ describe Chef::FileAccessControl do
resource.owner(2342)
@current_resource.owner(100)
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.describe_changes.should == ["change owner from '100' to '2342'"]
+ expect(fac.describe_changes).to eq(["change owner from '100' to '2342'"])
end
it "sets the file's owner as specified in the resource when the current owner is incorrect" do
@resource.owner(2342)
- File.should_receive(:chown).with(2342, nil, '/tmp/different_file.txt')
+ expect(File).to receive(:chown).with(2342, nil, '/tmp/different_file.txt')
@fac.set_owner
- @fac.should be_modified
+ expect(@fac).to be_modified
end
it "doesn't set the file's owner if it already matches" do
@resource.owner(2342)
@current_resource.owner(2342)
- File.should_not_receive(:chown)
+ expect(File).not_to receive(:chown)
@fac.set_owner
- @fac.should_not be_modified
+ expect(@fac).not_to be_modified
end
it "doesn't want to update a file's owner when it's already correct" do
@resource.owner(2342)
@current_resource.owner(2342)
- @fac.should_update_owner?.should be_false
+ expect(@fac.should_update_owner?).to be_falsey
end
it "determines the gid of the group specified by the resource" do
- Etc.should_receive(:getgrnam).with('wheel').and_return(OpenStruct.new(:gid => 2342))
- @fac.target_gid.should == 2342
+ expect(Etc).to receive(:getgrnam).with('wheel').and_return(OpenStruct.new(:gid => 2342))
+ expect(@fac.target_gid).to eq(2342)
end
it "uses a user specified gid as the gid" do
@resource.group(2342)
- @fac.target_gid.should == 2342
+ expect(@fac.target_gid).to eq(2342)
end
it "raises a Chef::Exceptions::GroupIDNotFound error when Etc can't find the user's name" do
- Etc.should_receive(:getgrnam).with('wheel').and_raise(ArgumentError)
- lambda { @fac.target_gid; @provider_requirements.run(:create) }.should raise_error(Chef::Exceptions::GroupIDNotFound, "cannot determine group id for 'wheel', does the group exist on this system?")
+ expect(Etc).to receive(:getgrnam).with('wheel').and_raise(ArgumentError)
+ expect { @fac.target_gid; @provider_requirements.run(:create) }.to raise_error(Chef::Exceptions::GroupIDNotFound, "cannot determine group id for 'wheel', does the group exist on this system?")
end
it "does not attempt to resolve a gid when none is supplied" do
resource = Chef::Resource::File.new('crab')
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.target_gid.should be_nil
+ expect(fac.target_gid).to be_nil
end
it "does not want to update the group when no target group is specified" do
resource = Chef::Resource::File.new('crab')
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.should_update_group?.should be_false
+ expect(fac.should_update_group?).to be_falsey
end
it "raises an error when the supplied group name is an alien" do
@resource.instance_variable_set(:@group, :failburger)
- lambda { @fac.target_gid; @provider_requirements.run(:create) }.should raise_error(ArgumentError)
+ expect { @fac.target_gid; @provider_requirements.run(:create) }.to raise_error(ArgumentError)
end
it "wants to update the group when the current group is nil (creating a file)" do
@resource.group(2342)
@current_resource.group(nil)
- @fac.should_update_group?.should be_true
+ expect(@fac.should_update_group?).to be_truthy
end
it "wants to update the group when the current group doesn't match the target group" do
@resource.group(2342)
@current_resource.group(815)
- @fac.should_update_group?.should be_true
+ expect(@fac.should_update_group?).to be_truthy
end
it "includes updating the group in the list of changes" do
@@ -195,22 +195,22 @@ describe Chef::FileAccessControl do
resource.group(2342)
@current_resource.group(815)
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.describe_changes.should == ["change group from '815' to '2342'"]
+ expect(fac.describe_changes).to eq(["change group from '815' to '2342'"])
end
it "sets the file's group as specified in the resource when the group is not correct" do
@resource.group(2342)
@current_resource.group(815)
- File.should_receive(:chown).with(nil, 2342, '/tmp/different_file.txt')
+ expect(File).to receive(:chown).with(nil, 2342, '/tmp/different_file.txt')
@fac.set_group
- @fac.should be_modified
+ expect(@fac).to be_modified
end
it "doesn't want to modify the file's group when the current group is correct" do
@resource.group(2342)
@current_resource.group(2342)
- @fac.should_update_group?.should be_false
+ expect(@fac.should_update_group?).to be_falsey
end
it "doesnt set the file's group if it is already correct" do
@@ -218,43 +218,43 @@ describe Chef::FileAccessControl do
@current_resource.group(2342)
# @fac.stub(:stat).and_return(OpenStruct.new(:gid => 2342))
- File.should_not_receive(:chown)
+ expect(File).not_to receive(:chown)
@fac.set_group
- @fac.should_not be_modified
+ expect(@fac).not_to be_modified
end
it "uses the supplied mode as octal when it's a string" do
@resource.mode('444')
- @fac.target_mode.should == 292 # octal 444 => decimal 292
+ expect(@fac.target_mode).to eq(292) # octal 444 => decimal 292
end
it "uses the supplied mode verbatim when it's an integer" do
@resource.mode(00444)
- @fac.target_mode.should == 292
+ expect(@fac.target_mode).to eq(292)
end
it "does not try to determine the mode when none is given" do
resource = Chef::Resource::File.new('blahblah')
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.target_mode.should be_nil
+ expect(fac.target_mode).to be_nil
end
it "doesn't want to update the mode when no target mode is given" do
resource = Chef::Resource::File.new('blahblah')
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.should_update_mode?.should be_false
+ expect(fac.should_update_mode?).to be_falsey
end
it "wants to update the mode when the current mode is nil (creating a file)" do
@resource.mode("0400")
@current_resource.mode(nil)
- @fac.should_update_mode?.should be_true
+ expect(@fac.should_update_mode?).to be_truthy
end
it "wants to update the mode when the desired mode does not match the current mode" do
@resource.mode("0400")
@current_resource.mode("0644")
- @fac.should_update_mode?.should be_true
+ expect(@fac.should_update_mode?).to be_truthy
end
it "includes changing the mode in the list of desired changes" do
@@ -262,41 +262,41 @@ describe Chef::FileAccessControl do
resource.mode("0750")
@current_resource.mode("0444")
fac = Chef::FileAccessControl.new(@current_resource, resource, @provider)
- fac.describe_changes.should == ["change mode from '0444' to '0750'"]
+ expect(fac.describe_changes).to eq(["change mode from '0444' to '0750'"])
end
it "sets the file's mode as specified in the resource when the current modes are incorrect" do
# stat returns modes like 0100644 (octal) => 33188 (decimal)
#@fac.stub(:stat).and_return(OpenStruct.new(:mode => 33188))
@current_resource.mode("0644")
- File.should_receive(:chmod).with(256, '/tmp/different_file.txt')
+ expect(File).to receive(:chmod).with(256, '/tmp/different_file.txt')
@fac.set_mode
- @fac.should be_modified
+ expect(@fac).to be_modified
end
it "does not want to update the mode when the current mode is correct" do
@current_resource.mode("0400")
- @fac.should_update_mode?.should be_false
+ expect(@fac.should_update_mode?).to be_falsey
end
it "does not set the file's mode when the current modes are correct" do
#@fac.stub(:stat).and_return(OpenStruct.new(:mode => 0100400))
@current_resource.mode("0400")
- File.should_not_receive(:chmod)
+ expect(File).not_to receive(:chmod)
@fac.set_mode
- @fac.should_not be_modified
+ expect(@fac).not_to be_modified
end
it "sets all access controls on a file" do
- @fac.stub(:stat).and_return(OpenStruct.new(:owner => 99, :group => 99, :mode => 0100444))
+ allow(@fac).to receive(:stat).and_return(OpenStruct.new(:owner => 99, :group => 99, :mode => 0100444))
@resource.mode(0400)
@resource.owner(0)
@resource.group(0)
- File.should_receive(:chmod).with(0400, '/tmp/different_file.txt')
- File.should_receive(:chown).with(0, nil, '/tmp/different_file.txt')
- File.should_receive(:chown).with(nil, 0, '/tmp/different_file.txt')
+ expect(File).to receive(:chmod).with(0400, '/tmp/different_file.txt')
+ expect(File).to receive(:chown).with(0, nil, '/tmp/different_file.txt')
+ expect(File).to receive(:chown).with(nil, 0, '/tmp/different_file.txt')
@fac.set_all
- @fac.should be_modified
+ expect(@fac).to be_modified
end
end
end
diff --git a/spec/unit/file_cache_spec.rb b/spec/unit/file_cache_spec.rb
index f57f11dcc2..a24c3d3b97 100644
--- a/spec/unit/file_cache_spec.rb
+++ b/spec/unit/file_cache_spec.rb
@@ -32,11 +32,11 @@ describe Chef::FileCache do
describe "when the relative path to the cache file doesn't exist" do
it "creates intermediate directories as needed" do
Chef::FileCache.store("whiz/bang", "I found a poop")
- File.should exist(File.join(@file_cache_path, 'whiz'))
+ expect(File).to exist(File.join(@file_cache_path, 'whiz'))
end
it "creates the cached file at the correct relative path" do
- File.should_receive(:open).with(File.join(@file_cache_path, 'whiz', 'bang'), "w",416).and_yield(@io)
+ expect(File).to receive(:open).with(File.join(@file_cache_path, 'whiz', 'bang'), "w",416).and_yield(@io)
Chef::FileCache.store("whiz/bang", "borkborkbork")
end
@@ -44,12 +44,12 @@ describe Chef::FileCache do
describe "when storing a file" do
before do
- File.stub(:open).and_yield(@io)
+ allow(File).to receive(:open).and_yield(@io)
end
it "should print the contents to the file" do
Chef::FileCache.store("whiz/bang", "borkborkbork")
- @io.string.should == "borkborkbork"
+ expect(@io.string).to eq("borkborkbork")
end
end
@@ -58,11 +58,11 @@ describe Chef::FileCache do
it "finds and reads the cached file" do
FileUtils.mkdir_p(File.join(@file_cache_path, 'whiz'))
File.open(File.join(@file_cache_path, 'whiz', 'bang'), 'w') { |f| f.print("borkborkbork") }
- Chef::FileCache.load('whiz/bang').should == 'borkborkbork'
+ expect(Chef::FileCache.load('whiz/bang')).to eq('borkborkbork')
end
it "should raise a Chef::Exceptions::FileNotFound if the file doesn't exist" do
- lambda { Chef::FileCache.load('whiz/bang') }.should raise_error(Chef::Exceptions::FileNotFound)
+ expect { Chef::FileCache.load('whiz/bang') }.to raise_error(Chef::Exceptions::FileNotFound)
end
end
@@ -74,7 +74,7 @@ describe Chef::FileCache do
it "unlinks the file" do
Chef::FileCache.delete("whiz/bang")
- File.should_not exist(File.join(@file_cache_path, 'whiz', 'bang'))
+ expect(File).not_to exist(File.join(@file_cache_path, 'whiz', 'bang'))
end
end
@@ -88,11 +88,11 @@ describe Chef::FileCache do
end
it "should return the relative paths" do
- Chef::FileCache.list.sort.should == %w{snappy/patter whiz/bang}
+ expect(Chef::FileCache.list.sort).to eq(%w{snappy/patter whiz/bang})
end
it "searches for cached files by globbing" do
- Chef::FileCache.find('snappy/**/*').should == %w{snappy/patter}
+ expect(Chef::FileCache.find('snappy/**/*')).to eq(%w{snappy/patter})
end
end
@@ -104,11 +104,11 @@ describe Chef::FileCache do
it "has a key if the corresponding cache file exists" do
FileUtils.touch(File.join(@file_cache_path, 'whiz', 'bang'))
- Chef::FileCache.should have_key("whiz/bang")
+ expect(Chef::FileCache).to have_key("whiz/bang")
end
it "doesn't have a key if the corresponding cache file doesn't exist" do
- Chef::FileCache.should_not have_key("whiz/bang")
+ expect(Chef::FileCache).not_to have_key("whiz/bang")
end
end
end
diff --git a/spec/unit/file_content_management/deploy/cp_spec.rb b/spec/unit/file_content_management/deploy/cp_spec.rb
index dacf39295c..5c6583e8a6 100644
--- a/spec/unit/file_content_management/deploy/cp_spec.rb
+++ b/spec/unit/file_content_management/deploy/cp_spec.rb
@@ -26,7 +26,7 @@ describe Chef::FileContentManagement::Deploy::Cp do
describe "creating the file" do
it "touches the file to create it" do
- FileUtils.should_receive(:touch).with(target_file_path)
+ expect(FileUtils).to receive(:touch).with(target_file_path)
content_deployer.create(target_file_path)
end
end
@@ -36,7 +36,7 @@ describe Chef::FileContentManagement::Deploy::Cp do
let(:staging_file_path) { "/tmp/random-dir/staging-file.tmp" }
it "copies the staging file's content" do
- FileUtils.should_receive(:cp).with(staging_file_path, target_file_path)
+ expect(FileUtils).to receive(:cp).with(staging_file_path, target_file_path)
content_deployer.deploy(staging_file_path, target_file_path)
end
diff --git a/spec/unit/file_content_management/deploy/mv_unix_spec.rb b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
index 0e8662b8ec..4511f91180 100644
--- a/spec/unit/file_content_management/deploy/mv_unix_spec.rb
+++ b/spec/unit/file_content_management/deploy/mv_unix_spec.rb
@@ -26,7 +26,7 @@ describe Chef::FileContentManagement::Deploy::MvUnix do
describe "creating the file" do
it "touches the file to create it" do
- FileUtils.should_receive(:touch).with(target_file_path)
+ expect(FileUtils).to receive(:touch).with(target_file_path)
content_deployer.create(target_file_path)
end
end
@@ -44,9 +44,9 @@ describe Chef::FileContentManagement::Deploy::MvUnix do
end
before do
- File.should_receive(:stat).with(target_file_path).and_return(target_file_stat)
- File.should_receive(:chmod).with(target_file_mode, staging_file_path).and_return(1)
- FileUtils.should_receive(:mv).with(staging_file_path, target_file_path)
+ expect(File).to receive(:stat).with(target_file_path).and_return(target_file_stat)
+ expect(File).to receive(:chmod).with(target_file_mode, staging_file_path).and_return(1)
+ expect(FileUtils).to receive(:mv).with(staging_file_path, target_file_path)
end
# This context represents the case where:
@@ -63,8 +63,8 @@ describe Chef::FileContentManagement::Deploy::MvUnix do
let(:target_file_gid) { 1001 }
before do
- File.should_receive(:chown).with(target_file_uid, nil, staging_file_path).and_return(1)
- File.should_receive(:chown).with(nil, target_file_gid, staging_file_path).and_return(1)
+ expect(File).to receive(:chown).with(target_file_uid, nil, staging_file_path).and_return(1)
+ expect(File).to receive(:chown).with(nil, target_file_gid, staging_file_path).and_return(1)
end
it "fixes up permissions and moves the file into place" do
@@ -85,11 +85,11 @@ describe Chef::FileContentManagement::Deploy::MvUnix do
let(:target_file_gid) { 20 }
before do
- File.should_receive(:chown).with(target_file_uid, nil, staging_file_path).and_raise(Errno::EPERM)
- File.should_receive(:chown).with(nil, target_file_gid, staging_file_path).and_raise(Errno::EPERM)
+ expect(File).to receive(:chown).with(target_file_uid, nil, staging_file_path).and_raise(Errno::EPERM)
+ expect(File).to receive(:chown).with(nil, target_file_gid, staging_file_path).and_raise(Errno::EPERM)
- Chef::Log.should_receive(:warn).with(/^Could not set uid/)
- Chef::Log.should_receive(:warn).with(/^Could not set gid/)
+ expect(Chef::Log).to receive(:warn).with(/^Could not set uid/)
+ expect(Chef::Log).to receive(:warn).with(/^Could not set gid/)
end
it "fixes up permissions and moves the file into place" do
diff --git a/spec/unit/file_content_management/deploy/mv_windows_spec.rb b/spec/unit/file_content_management/deploy/mv_windows_spec.rb
index 7c2a2d7e71..c52001cd26 100644
--- a/spec/unit/file_content_management/deploy/mv_windows_spec.rb
+++ b/spec/unit/file_content_management/deploy/mv_windows_spec.rb
@@ -41,7 +41,7 @@ describe Chef::FileContentManagement::Deploy::MvWindows do
describe "creating the file" do
it "touches the file to create it" do
- FileUtils.should_receive(:touch).with(target_file_path)
+ expect(FileUtils).to receive(:touch).with(target_file_path)
content_deployer.create(target_file_path)
end
end
@@ -59,8 +59,8 @@ describe Chef::FileContentManagement::Deploy::MvWindows do
end
before do
- Chef::ReservedNames::Win32::Security::SecurableObject.
- stub(:new).
+ allow(Chef::ReservedNames::Win32::Security::SecurableObject).
+ to receive(:new).
with(target_file_path).
and_return(target_file_security_object, updated_target_security_object)
@@ -68,11 +68,11 @@ describe Chef::FileContentManagement::Deploy::MvWindows do
context "when run without adminstrator privileges" do
before do
- target_file_security_object.should_receive(:security_descriptor).and_raise(Chef::Exceptions::Win32APIError)
+ expect(target_file_security_object).to receive(:security_descriptor).and_raise(Chef::Exceptions::Win32APIError)
end
it "errors out with a WindowsNotAdmin error" do
- lambda { content_deployer.deploy(staging_file_path, target_file_path)}.should raise_error(Chef::Exceptions::WindowsNotAdmin)
+ expect { content_deployer.deploy(staging_file_path, target_file_path)}.to raise_error(Chef::Exceptions::WindowsNotAdmin)
end
end
@@ -94,19 +94,19 @@ describe Chef::FileContentManagement::Deploy::MvWindows do
before do
- target_file_security_object.stub(:security_descriptor).and_return(target_file_security_descriptor)
+ allow(target_file_security_object).to receive(:security_descriptor).and_return(target_file_security_descriptor)
- FileUtils.should_receive(:mv).with(staging_file_path, target_file_path)
+ expect(FileUtils).to receive(:mv).with(staging_file_path, target_file_path)
- updated_target_security_object.should_receive(:group=).with(original_target_file_group)
- updated_target_security_object.should_receive(:owner=).with(original_target_file_owner)
+ expect(updated_target_security_object).to receive(:group=).with(original_target_file_group)
+ expect(updated_target_security_object).to receive(:owner=).with(original_target_file_owner)
end
context "and the target file has no dacl or sacl" do
before do
- target_file_security_descriptor.stub(:dacl_present?).and_return(false)
- target_file_security_descriptor.stub(:sacl_present?).and_return(false)
+ allow(target_file_security_descriptor).to receive(:dacl_present?).and_return(false)
+ allow(target_file_security_descriptor).to receive(:sacl_present?).and_return(false)
end
it "fixes up permissions and moves the file into place" do
@@ -129,26 +129,26 @@ describe Chef::FileContentManagement::Deploy::MvWindows do
let(:custom_sacl) { double("Windows ACL for non-inherited sacl aces") }
before do
- target_file_security_descriptor.stub(:dacl_present?).and_return(true)
- target_file_security_descriptor.stub(:dacl_inherits?).and_return(dacl_inherits?)
+ allow(target_file_security_descriptor).to receive(:dacl_present?).and_return(true)
+ allow(target_file_security_descriptor).to receive(:dacl_inherits?).and_return(dacl_inherits?)
- target_file_security_descriptor.stub(:dacl).and_return(original_target_file_dacl)
- Chef::ReservedNames::Win32::Security::ACL.
- should_receive(:create).
+ allow(target_file_security_descriptor).to receive(:dacl).and_return(original_target_file_dacl)
+ expect(Chef::ReservedNames::Win32::Security::ACL).
+ to receive(:create).
with([not_inherited_dacl_ace]).
and_return(custom_dacl)
- target_file_security_descriptor.stub(:sacl_present?).and_return(true)
- target_file_security_descriptor.stub(:sacl_inherits?).and_return(sacl_inherits?)
+ allow(target_file_security_descriptor).to receive(:sacl_present?).and_return(true)
+ allow(target_file_security_descriptor).to receive(:sacl_inherits?).and_return(sacl_inherits?)
- target_file_security_descriptor.stub(:sacl).and_return(original_target_file_sacl)
- Chef::ReservedNames::Win32::Security::ACL.
- should_receive(:create).
+ allow(target_file_security_descriptor).to receive(:sacl).and_return(original_target_file_sacl)
+ expect(Chef::ReservedNames::Win32::Security::ACL).
+ to receive(:create).
with([not_inherited_sacl_ace]).
and_return(custom_sacl)
- updated_target_security_object.should_receive(:set_dacl).with(custom_dacl, dacl_inherits?)
- updated_target_security_object.should_receive(:set_sacl).with(custom_sacl, sacl_inherits?)
+ expect(updated_target_security_object).to receive(:set_dacl).with(custom_dacl, dacl_inherits?)
+ expect(updated_target_security_object).to receive(:set_sacl).with(custom_sacl, sacl_inherits?)
end
context "and the dacl and sacl don't inherit" do
diff --git a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
index 95911689e4..ac19e91922 100644
--- a/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb
@@ -51,7 +51,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
# Error inspector originally used file_cache_path which is incorrect on
# chef-solo. Using cookbook_path should do the right thing for client and
# solo.
- Chef::Config.stub(:cookbook_path).and_return([ "/home/someuser/dev-laptop/cookbooks" ])
+ allow(Chef::Config).to receive(:cookbook_path).and_return([ "/home/someuser/dev-laptop/cookbooks" ])
@trace = [
"/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
"/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
@@ -65,15 +65,15 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
"/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
"/home/someuser/dev-laptop/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
]
- @inspector.filtered_bt.should == @expected_filtered_trace
+ expect(@inspector.filtered_bt).to eq(@expected_filtered_trace)
end
end
describe "when explaining an error in the compile phase" do
before do
- Chef::Config.stub(:cookbook_path).and_return([ "/var/chef/cache/cookbooks" ])
+ allow(Chef::Config).to receive(:cookbook_path).and_return([ "/var/chef/cache/cookbooks" ])
recipe_lines = BAD_RECIPE.split("\n").map {|l| l << "\n" }
- IO.should_receive(:readlines).with("/var/chef/cache/cookbooks/syntax-err/recipes/default.rb").and_return(recipe_lines)
+ expect(IO).to receive(:readlines).with("/var/chef/cache/cookbooks/syntax-err/recipes/default.rb").and_return(recipe_lines)
@trace = [
"/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:14:in `from_file'",
"/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
@@ -86,7 +86,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
end
it "finds the line number of the error from the stacktrace" do
- @inspector.culprit_line.should == 14
+ expect(@inspector.culprit_line).to eq(14)
end
it "prints a pretty message" do
@@ -96,9 +96,9 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
describe "when explaining an error on windows" do
before do
- Chef::Config.stub(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ])
+ allow(Chef::Config).to receive(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ])
recipe_lines = BAD_RECIPE.split("\n").map {|l| l << "\n" }
- IO.should_receive(:readlines).at_least(1).times.with(/:\/opscode\/chef\/var\/cache\/cookbooks\/foo\/recipes\/default.rb/).and_return(recipe_lines)
+ expect(IO).to receive(:readlines).at_least(1).times.with(/:\/opscode\/chef\/var\/cache\/cookbooks\/foo\/recipes\/default.rb/).and_return(recipe_lines)
@trace = [
"C:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb:14 in `from_file'",
"C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:144:in `rescue in block in load_libraries'",
@@ -131,7 +131,7 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
describe "and examining the stack trace for a recipe" do
it "find the culprit recipe name when the drive letter is upper case" do
- @inspector.culprit_file.should == "C:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb"
+ expect(@inspector.culprit_file).to eq("C:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb")
end
it "find the culprit recipe name when the drive letter is lower case" do
@@ -139,12 +139,12 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
@exception.set_backtrace(@trace)
@inspector = described_class.new(@path, @exception)
@inspector.add_explanation(@description)
- @inspector.culprit_file.should == "c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb"
+ expect(@inspector.culprit_file).to eq("c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb")
end
end
it "finds the line number of the error from the stack trace" do
- @inspector.culprit_line.should == 14
+ expect(@inspector.culprit_line).to eq(14)
end
it "prints a pretty message" do
@@ -154,9 +154,9 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
describe "when explaining an error on windows, and the backtrace lowercases the drive letter" do
before do
- Chef::Config.stub(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ])
+ allow(Chef::Config).to receive(:cookbook_path).and_return([ "C:/opscode/chef/var/cache/cookbooks" ])
recipe_lines = BAD_RECIPE.split("\n").map {|l| l << "\n" }
- IO.should_receive(:readlines).with("c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb").and_return(recipe_lines)
+ expect(IO).to receive(:readlines).with("c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb").and_return(recipe_lines)
@trace = [
"c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb:14 in `from_file'",
"c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.14.0/lib/chef/run_context.rb:144:in `rescue in block in load_libraries'",
@@ -187,11 +187,11 @@ describe Chef::Formatters::ErrorInspectors::CompileErrorInspector do
end
it "finds the culprit recipe name from the stacktrace" do
- @inspector.culprit_file.should == "c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb"
+ expect(@inspector.culprit_file).to eq("c:/opscode/chef/var/cache/cookbooks/foo/recipes/default.rb")
end
it "finds the line number of the error from the stack trace" do
- @inspector.culprit_line.should == 14
+ expect(@inspector.culprit_line).to eq(14)
end
it "prints a pretty message" do
diff --git a/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb
index 06d45472e4..7e4d89f144 100644
--- a/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb
@@ -34,7 +34,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
@response_body = %Q({"error": [{"message": "gtfo"}])
@response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) forbidden", @response)
@inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception)
@@ -42,7 +42,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
end
it "prints a nice message" do
- lambda { @description.display(@outputter) }.should_not raise_error
+ expect { @description.display(@outputter) }.not_to raise_error
end
end
@@ -55,7 +55,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
@response_body = "{\"error\":[\"{\\\"non_existent_cookbooks\\\":[\\\"apache2\\\"],\\\"cookbooks_with_no_versions\\\":[\\\"users\\\"],\\\"message\\\":\\\"Run list contains invalid items: no such cookbook nope.\\\"}\"]}"
@response = Net::HTTPPreconditionFailed.new("1.1", "412", "(response) unauthorized")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) precondition failed", @response)
@inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception)
@@ -66,9 +66,9 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
@description.display(@outputter)
@outputter_output.rewind
observed_output = @outputter_output.read
- observed_output.should include("apache2")
- observed_output.should include("users")
- observed_output.should_not include("Run list contains invalid items: no such cookbook nope.")
+ expect(observed_output).to include("apache2")
+ expect(observed_output).to include("users")
+ expect(observed_output).not_to include("Run list contains invalid items: no such cookbook nope.")
end
end
@@ -83,7 +83,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
@response_body = "{\"error\":[{\"non_existent_cookbooks\":[],\"cookbooks_with_no_versions\":[],\"message\":\"unable to solve dependencies in alotted time.\"}]}"
@response = Net::HTTPPreconditionFailed.new("1.1", "412", "(response) unauthorized")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) precondition failed", @response)
@inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception)
@@ -93,7 +93,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
it "prints a pretty message" do
@description.display(@outputter)
@outputter_output.rewind
- @outputter_output.read.should include("unable to solve dependencies in alotted time.")
+ expect(@outputter_output.read).to include("unable to solve dependencies in alotted time.")
end
end
@@ -106,7 +106,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
@response_body = "{\"error\":[{\"non_existent_cookbooks\":[\"apache2\"],\"cookbooks_with_no_versions\":[\"users\"],\"message\":\"Run list contains invalid items: no such cookbook nope.\"}]}"
@response = Net::HTTPPreconditionFailed.new("1.1", "412", "(response) unauthorized")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) precondition failed", @response)
@inspector = Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector.new(@expanded_run_list, @exception)
@@ -117,9 +117,9 @@ describe Chef::Formatters::ErrorInspectors::CookbookResolveErrorInspector do
@description.display(@outputter)
@outputter_output.rewind
observed_output = @outputter_output.read
- observed_output.should include("apache2")
- observed_output.should include("users")
- observed_output.should_not include("Run list contains invalid items: no such cookbook nope.")
+ expect(observed_output).to include("apache2")
+ expect(observed_output).to include("users")
+ expect(observed_output).not_to include("Run list contains invalid items: no such cookbook nope.")
end
end
diff --git a/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb
index 87c3708ef1..775a1838f3 100644
--- a/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Formatters::ErrorInspectors::CookbookSyncErrorInspector do
before do
@response_body = "sad trombone orchestra"
@response = Net::HTTPBadGateway.new("1.1", "502", "(response) bad gateway")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPFatalError.new("(exception) bad gateway", @response)
@inspector = described_class.new({}, @exception)
@inspector.add_explanation(@description)
diff --git a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb
index 6691553ddd..ee957ed450 100644
--- a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb
@@ -42,7 +42,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
@outputter = Chef::Formatters::IndentableOutputStream.new(@stdout, STDERR)
#@outputter = Chef::Formatters::IndentableOutputStream.new(STDOUT, STDERR)
- Chef::Config.stub(:cookbook_path).and_return([ "/var/chef/cache" ])
+ allow(Chef::Config).to receive(:cookbook_path).and_return([ "/var/chef/cache" ])
end
describe "when explaining an error converging a resource" do
@@ -74,7 +74,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
"/var/chef/cache/cookbooks/syntax-err/recipes/default.rb:11:in `from_file'",
]
- @inspector.filtered_bt.should == @expected_filtered_trace
+ expect(@inspector.filtered_bt).to eq(@expected_filtered_trace)
end
it "prints a pretty message" do
@@ -105,7 +105,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
it "includes contextual info from the template error in the output" do
@description.display(@outputter)
- @stdout.string.should include(@error.source_listing)
+ expect(@stdout.string).to include(@error.source_listing)
end
@@ -115,40 +115,40 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
before do
# fake code to run through #recipe_snippet
source_file = [ "if true", "var = non_existant", "end" ]
- IO.stub(:readlines).and_return(source_file)
- File.stub(:exists?).and_return(true)
+ allow(IO).to receive(:readlines).and_return(source_file)
+ allow(File).to receive(:exists?).and_return(true)
end
it "parses a Windows path" do
source_line = "C:/Users/btm/chef/chef/spec/unit/fake_file.rb:2: undefined local variable or method `non_existant' for main:Object (NameError)"
@resource.source_line = source_line
@inspector = Chef::Formatters::ErrorInspectors::ResourceFailureInspector.new(@resource, :create, @exception)
- @inspector.recipe_snippet.should match(/^# In C:\/Users\/btm/)
+ expect(@inspector.recipe_snippet).to match(/^# In C:\/Users\/btm/)
end
it "parses a unix path" do
source_line = "/home/btm/src/chef/chef/spec/unit/fake_file.rb:2: undefined local variable or method `non_existant' for main:Object (NameError)"
@resource.source_line = source_line
@inspector = Chef::Formatters::ErrorInspectors::ResourceFailureInspector.new(@resource, :create, @exception)
- @inspector.recipe_snippet.should match(/^# In \/home\/btm/)
+ expect(@inspector.recipe_snippet).to match(/^# In \/home\/btm/)
end
context "when the recipe file does not exist" do
before do
- File.stub(:exists?).and_return(false)
- IO.stub(:readlines).and_raise(Errno::ENOENT)
+ allow(File).to receive(:exists?).and_return(false)
+ allow(IO).to receive(:readlines).and_raise(Errno::ENOENT)
end
it "does not try to parse a recipe in chef-shell/irb (CHEF-3411)" do
@resource.source_line = "(irb#1):1:in `irb_binding'"
@inspector = Chef::Formatters::ErrorInspectors::ResourceFailureInspector.new(@resource, :create, @exception)
- @inspector.recipe_snippet.should be_nil
+ expect(@inspector.recipe_snippet).to be_nil
end
it "does not raise an exception trying to load a non-existant file (CHEF-3411)" do
@resource.source_line = "/somewhere/in/space"
@inspector = Chef::Formatters::ErrorInspectors::ResourceFailureInspector.new(@resource, :create, @exception)
- lambda { @inspector.recipe_snippet }.should_not raise_error
+ expect { @inspector.recipe_snippet }.not_to raise_error
end
end
end
@@ -175,7 +175,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do
end
it "does not generate an error" do
- lambda { @inspector.add_explanation(@description) }.should_not raise_error
+ expect { @inspector.add_explanation(@description) }.not_to raise_error
@description.display(@outputter)
end
end
diff --git a/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb b/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb
index 7f68c4fba4..1cd97596a7 100644
--- a/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb
+++ b/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb
@@ -55,10 +55,10 @@ describe Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector do
@response_body = "forbidden"
@response = Net::HTTPForbidden.new("1.1", "403", "(response) forbidden")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) forbidden", @response)
@inspector = Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector.new(@node, @exception)
- @inspector.stub(:config).and_return(:node_name => "unit-test.example.com")
+ allow(@inspector).to receive(:config).and_return(:node_name => "unit-test.example.com")
@inspector.add_explanation(@description)
end
@@ -73,11 +73,11 @@ describe Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector do
before do
@response_body = "check your key and node name"
@response = Net::HTTPUnauthorized.new("1.1", "401", "(response) unauthorized")
- @response.stub(:body).and_return(@response_body)
+ allow(@response).to receive(:body).and_return(@response_body)
@exception = Net::HTTPServerException.new("(exception) unauthorized", @response)
@inspector = Chef::Formatters::ErrorInspectors::RunListExpansionErrorInspector.new(@node, @exception)
- @inspector.stub(:config).and_return(:node_name => "unit-test.example.com",
+ allow(@inspector).to receive(:config).and_return(:node_name => "unit-test.example.com",
:client_key => "/etc/chef/client.pem",
:chef_server_url => "http://chef.example.com")
diff --git a/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
index a122ac5515..9089177e18 100644
--- a/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
+++ b/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb
@@ -31,8 +31,8 @@ describe Chef::GuardInterpreter::ResourceGuardInterpreter do
let(:resource) do
resource = Chef::Resource.new("powershell_unit_test", run_context)
- resource.stub(:run_action)
- resource.stub(:updated).and_return(true)
+ allow(resource).to receive(:run_action)
+ allow(resource).to receive(:updated).and_return(true)
resource
end
diff --git a/spec/unit/handler/json_file_spec.rb b/spec/unit/handler/json_file_spec.rb
index 05270e4731..f6c14a166e 100644
--- a/spec/unit/handler/json_file_spec.rb
+++ b/spec/unit/handler/json_file_spec.rb
@@ -24,12 +24,12 @@ describe Chef::Handler::JsonFile do
end
it "accepts arbitrary config options" do
- @handler.config[:the_sun].should == "will rise"
+ expect(@handler.config[:the_sun]).to eq("will rise")
end
it "creates the directory where the reports will be saved" do
- FileUtils.should_receive(:mkdir_p).with('/tmp/foobarbazqux')
- File.should_receive(:chmod).with(00700, '/tmp/foobarbazqux')
+ expect(FileUtils).to receive(:mkdir_p).with('/tmp/foobarbazqux')
+ expect(File).to receive(:chmod).with(00700, '/tmp/foobarbazqux')
@handler.build_report_dir
end
@@ -39,25 +39,25 @@ describe Chef::Handler::JsonFile do
@events = Chef::EventDispatch::Dispatcher.new
@run_status = Chef::RunStatus.new(@node, @events)
@expected_time = Time.now
- Time.stub(:now).and_return(@expected_time, @expected_time + 5)
+ allow(Time).to receive(:now).and_return(@expected_time, @expected_time + 5)
@run_status.start_clock
@run_status.stop_clock
@run_context = Chef::RunContext.new(@node, {}, @events)
@run_status.run_context = @run_context
@run_status.exception = Exception.new("Boy howdy!")
@file_mock = StringIO.new
- File.stub(:open).and_yield(@file_mock)
+ allow(File).to receive(:open).and_yield(@file_mock)
end
it "saves run status data to a file as JSON" do
- @handler.should_receive(:build_report_dir)
+ expect(@handler).to receive(:build_report_dir)
@handler.run_report_unsafe(@run_status)
reported_data = Chef::JSONCompat.from_json(@file_mock.string)
- reported_data['exception'].should == "Exception: Boy howdy!"
- reported_data['start_time'].should == @expected_time.to_s
- reported_data['end_time'].should == (@expected_time + 5).to_s
- reported_data['elapsed_time'].should == 5
+ expect(reported_data['exception']).to eq("Exception: Boy howdy!")
+ expect(reported_data['start_time']).to eq(@expected_time.to_s)
+ expect(reported_data['end_time']).to eq((@expected_time + 5).to_s)
+ expect(reported_data['elapsed_time']).to eq(5)
end
end
diff --git a/spec/unit/handler_spec.rb b/spec/unit/handler_spec.rb
index 3a7e046dd5..a9aa0e0b50 100644
--- a/spec/unit/handler_spec.rb
+++ b/spec/unit/handler_spec.rb
@@ -42,54 +42,54 @@ describe Chef::Handler do
@run_status.run_context = @run_context
@start_time = Time.now
@end_time = @start_time + 4.2
- Time.stub(:now).and_return(@start_time, @end_time)
+ allow(Time).to receive(:now).and_return(@start_time, @end_time)
@run_status.start_clock
@run_status.stop_clock
end
it "has a shortcut for the exception" do
- @handler.exception.should == @exception
+ expect(@handler.exception).to eq(@exception)
end
it "has a shortcut for the backtrace" do
- @handler.backtrace.should == @backtrace
+ expect(@handler.backtrace).to eq(@backtrace)
end
it "has a shortcut for all resources" do
- @handler.all_resources.should == @all_resources
+ expect(@handler.all_resources).to eq(@all_resources)
end
it "has a shortcut for just the updated resources" do
- @handler.updated_resources.should == [@all_resources.first]
+ expect(@handler.updated_resources).to eq([@all_resources.first])
end
it "has a shortcut for the start time" do
- @handler.start_time.should == @start_time
+ expect(@handler.start_time).to eq(@start_time)
end
it "has a shortcut for the end time" do
- @handler.end_time.should == @end_time
+ expect(@handler.end_time).to eq(@end_time)
end
it "has a shortcut for the elapsed time" do
- @handler.elapsed_time.should == 4.2
+ expect(@handler.elapsed_time).to eq(4.2)
end
it "has a shortcut for the node" do
- @handler.node.should == @node
+ expect(@handler.node).to eq(@node)
end
it "has a shortcut for the run context" do
- @handler.run_context.should == @run_context
+ expect(@handler.run_context).to eq(@run_context)
end
it "has a shortcut for the success? and failed? predicates" do
- @handler.success?.should be_false # becuase there's an exception
- @handler.failed?.should be_true
+ expect(@handler.success?).to be_falsey # becuase there's an exception
+ expect(@handler.failed?).to be_truthy
end
it "has a shortcut to the hash representation of the run status" do
- @handler.data.should == @run_status.to_hash
+ expect(@handler.data).to eq(@run_status.to_hash)
end
end
@@ -100,16 +100,16 @@ describe Chef::Handler do
$report_ran = true
raise Exception, "I died the deth"
end
- lambda {@handler.run_report_safely(@run_status)}.should_not raise_error
- $report_ran.should be_true
+ expect {@handler.run_report_safely(@run_status)}.not_to raise_error
+ expect($report_ran).to be_truthy
end
it "does not fail if the report handler does not raise an exception" do
$report_ran = false
def @handler.report
$report_ran = true
end
- lambda {@handler.run_report_safely(@run_status)}.should_not raise_error
- $report_ran.should be_true
+ expect {@handler.run_report_safely(@run_status)}.not_to raise_error
+ expect($report_ran).to be_truthy
end
end
@@ -123,46 +123,46 @@ describe Chef::Handler do
@run_status.run_context = @run_context
@start_time = Time.now
@end_time = @start_time + 4.2
- Time.stub(:now).and_return(@start_time, @end_time)
+ allow(Time).to receive(:now).and_return(@start_time, @end_time)
@run_status.start_clock
@run_status.stop_clock
end
it "has a shortcut for all resources" do
- @handler.all_resources.should == @all_resources
+ expect(@handler.all_resources).to eq(@all_resources)
end
it "has a shortcut for just the updated resources" do
- @handler.updated_resources.should == [@all_resources.first]
+ expect(@handler.updated_resources).to eq([@all_resources.first])
end
it "has a shortcut for the start time" do
- @handler.start_time.should == @start_time
+ expect(@handler.start_time).to eq(@start_time)
end
it "has a shortcut for the end time" do
- @handler.end_time.should == @end_time
+ expect(@handler.end_time).to eq(@end_time)
end
it "has a shortcut for the elapsed time" do
- @handler.elapsed_time.should == 4.2
+ expect(@handler.elapsed_time).to eq(4.2)
end
it "has a shortcut for the node" do
- @handler.node.should == @node
+ expect(@handler.node).to eq(@node)
end
it "has a shortcut for the run context" do
- @handler.run_context.should == @run_context
+ expect(@handler.run_context).to eq(@run_context)
end
it "has a shortcut for the success? and failed? predicates" do
- @handler.success?.should be_true
- @handler.failed?.should be_false
+ expect(@handler.success?).to be_truthy
+ expect(@handler.failed?).to be_falsey
end
it "has a shortcut to the hash representation of the run status" do
- @handler.data.should == @run_status.to_hash
+ expect(@handler.data).to eq(@run_status.to_hash)
end
end
@@ -170,45 +170,45 @@ describe Chef::Handler do
describe "when running a start handler" do
before do
@start_time = Time.now
- Time.stub(:now).and_return(@start_time)
+ allow(Time).to receive(:now).and_return(@start_time)
@run_status.start_clock
end
it "should not have all resources" do
- @handler.all_resources.should be_false
+ expect(@handler.all_resources).to be_falsey
end
it "should not have updated resources" do
- @handler.updated_resources.should be_false
+ expect(@handler.updated_resources).to be_falsey
end
it "has a shortcut for the start time" do
- @handler.start_time.should == @start_time
+ expect(@handler.start_time).to eq(@start_time)
end
it "does not have a shortcut for the end time" do
- @handler.end_time.should be_false
+ expect(@handler.end_time).to be_falsey
end
it "does not have a shortcut for the elapsed time" do
- @handler.elapsed_time.should be_false
+ expect(@handler.elapsed_time).to be_falsey
end
it "has a shortcut for the node" do
- @handler.node.should == @node
+ expect(@handler.node).to eq(@node)
end
it "does not have a shortcut for the run context" do
- @handler.run_context.should be_false
+ expect(@handler.run_context).to be_falsey
end
it "has a shortcut for the success? and failed? predicates" do
- @handler.success?.should be_true # for some reason this is true
- @handler.failed?.should be_false
+ expect(@handler.success?).to be_truthy # for some reason this is true
+ expect(@handler.failed?).to be_falsey
end
it "has a shortcut to the hash representation of the run status" do
- @handler.data.should == @run_status.to_hash
+ expect(@handler.data).to eq(@run_status.to_hash)
end
end
diff --git a/spec/unit/http/basic_client_spec.rb b/spec/unit/http/basic_client_spec.rb
index cb1f2fd979..eb133f943e 100644
--- a/spec/unit/http/basic_client_spec.rb
+++ b/spec/unit/http/basic_client_spec.rb
@@ -35,7 +35,7 @@ describe "HTTP Connection" do
end
it "should set an open timeout" do
- subject.build_http_client.open_timeout.should_not be_nil
+ expect(subject.build_http_client.open_timeout).not_to be_nil
end
end
@@ -52,12 +52,12 @@ describe "HTTP Connection" do
it "should contain the host" do
proxy_uri = subject.proxy_uri
- proxy_uri.host.should == proxy_host
+ expect(proxy_uri.host).to eq(proxy_host)
end
it "should contain the port" do
proxy_uri = subject.proxy_uri
- proxy_uri.port.should == proxy_port
+ expect(proxy_uri.port).to eq(proxy_port)
end
end
diff --git a/spec/unit/http/http_request_spec.rb b/spec/unit/http/http_request_spec.rb
index d573d4c5dc..3bba201963 100644
--- a/spec/unit/http/http_request_spec.rb
+++ b/spec/unit/http/http_request_spec.rb
@@ -25,31 +25,31 @@ describe Chef::HTTP::HTTPRequest do
it "should not include port 80 in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com'), '')
- request.headers['Host'].should eql('dummy.com')
+ expect(request.headers['Host']).to eql('dummy.com')
end
it "should not include explicit port 80 in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:80'), '')
- request.headers['Host'].should eql('dummy.com')
+ expect(request.headers['Host']).to eql('dummy.com')
end
it "should include explicit port 8000 in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:8000'), '')
- request.headers['Host'].should eql('dummy.com:8000')
+ expect(request.headers['Host']).to eql('dummy.com:8000')
end
it "should include explicit 443 port in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:443'), '')
- request.headers['Host'].should eql('dummy.com:443')
+ expect(request.headers['Host']).to eql('dummy.com:443')
end
it "should pass on explicit Host header unchanged" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:8000'), '', { 'Host' => 'yourhost.com:8888' })
- request.headers['Host'].should eql('yourhost.com:8888')
+ expect(request.headers['Host']).to eql('yourhost.com:8888')
end
end
@@ -59,25 +59,25 @@ describe Chef::HTTP::HTTPRequest do
it "should not include port 443 in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com'), '')
- request.headers['Host'].should eql('dummy.com')
+ expect(request.headers['Host']).to eql('dummy.com')
end
it "should include explicit port 80 in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com:80'), '')
- request.headers['Host'].should eql('dummy.com:80')
+ expect(request.headers['Host']).to eql('dummy.com:80')
end
it "should include explicit port 8000 in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com:8000'), '')
- request.headers['Host'].should eql('dummy.com:8000')
+ expect(request.headers['Host']).to eql('dummy.com:8000')
end
it "should not include explicit port 443 in Host header" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com:443'), '')
- request.headers['Host'].should eql('dummy.com')
+ expect(request.headers['Host']).to eql('dummy.com')
end
end
@@ -85,7 +85,7 @@ describe Chef::HTTP::HTTPRequest do
it "should pass on explicit Host header unchanged" do
request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:8000'), '', { 'Host' => 'myhost.com:80' })
- request.headers['Host'].should eql('myhost.com:80')
+ expect(request.headers['Host']).to eql('myhost.com:80')
end
end
diff --git a/spec/unit/http/simple_spec.rb b/spec/unit/http/simple_spec.rb
index b33ef1d553..c8fb52e8b2 100644
--- a/spec/unit/http/simple_spec.rb
+++ b/spec/unit/http/simple_spec.rb
@@ -25,8 +25,8 @@ describe Chef::HTTP::Simple do
content_length = middlewares.find_index { |e| e.is_a? Chef::HTTP::ValidateContentLength }
decompressor = middlewares.find_index { |e| e.is_a? Chef::HTTP::Decompressor }
- content_length.should_not be_nil
- decompressor.should_not be_nil
- (decompressor < content_length).should be_true
+ expect(content_length).not_to be_nil
+ expect(decompressor).not_to be_nil
+ expect(decompressor < content_length).to be_truthy
end
end
diff --git a/spec/unit/http/ssl_policies_spec.rb b/spec/unit/http/ssl_policies_spec.rb
index b95e13a370..5ebebf39b1 100644
--- a/spec/unit/http/ssl_policies_spec.rb
+++ b/spec/unit/http/ssl_policies_spec.rb
@@ -45,31 +45,31 @@ describe "HTTP SSL Policy" do
end
it "configures the HTTP client to use SSL when given a URL with the https protocol" do
- http_client.use_ssl?.should be_true
+ expect(http_client.use_ssl?).to be_truthy
end
it "sets the OpenSSL verify mode to verify_peer" do
- http_client.verify_mode.should == OpenSSL::SSL::VERIFY_PEER
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
end
it "raises a ConfigurationError if :ssl_ca_path is set to a path that doesn't exist" do
Chef::Config[:ssl_ca_path] = "/dev/null/nothing_here"
- lambda {http_client}.should raise_error(Chef::Exceptions::ConfigurationError)
+ expect {http_client}.to raise_error(Chef::Exceptions::ConfigurationError)
end
it "should set the CA path if that is set in the configuration" do
Chef::Config[:ssl_ca_path] = File.join(CHEF_SPEC_DATA, "ssl")
- http_client.ca_path.should == File.join(CHEF_SPEC_DATA, "ssl")
+ expect(http_client.ca_path).to eq(File.join(CHEF_SPEC_DATA, "ssl"))
end
it "raises a ConfigurationError if :ssl_ca_file is set to a file that does not exist" do
Chef::Config[:ssl_ca_file] = "/dev/null/nothing_here"
- lambda {http_client}.should raise_error(Chef::Exceptions::ConfigurationError)
+ expect {http_client}.to raise_error(Chef::Exceptions::ConfigurationError)
end
it "should set the CA file if that is set in the configuration" do
Chef::Config[:ssl_ca_file] = CHEF_SPEC_DATA + '/ssl/5e707473.0'
- http_client.ca_file.should == CHEF_SPEC_DATA + '/ssl/5e707473.0'
+ expect(http_client.ca_file).to eq(CHEF_SPEC_DATA + '/ssl/5e707473.0')
end
end
@@ -80,7 +80,7 @@ describe "HTTP SSL Policy" do
end
it "sets the OpenSSL verify mode to :verify_none" do
- http_client.verify_mode.should == OpenSSL::SSL::VERIFY_NONE
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_NONE)
end
end
@@ -90,26 +90,26 @@ describe "HTTP SSL Policy" do
it "raises ConfigurationError if the certificate file doesn't exist" do
Chef::Config[:ssl_client_cert] = "/dev/null/nothing_here"
Chef::Config[:ssl_client_key] = CHEF_SPEC_DATA + '/ssl/chef-rspec.key'
- lambda {http_client}.should raise_error(Chef::Exceptions::ConfigurationError)
+ expect {http_client}.to raise_error(Chef::Exceptions::ConfigurationError)
end
it "raises ConfigurationError if the certificate file doesn't exist" do
Chef::Config[:ssl_client_cert] = CHEF_SPEC_DATA + '/ssl/chef-rspec.cert'
Chef::Config[:ssl_client_key] = "/dev/null/nothing_here"
- lambda {http_client}.should raise_error(Chef::Exceptions::ConfigurationError)
+ expect {http_client}.to raise_error(Chef::Exceptions::ConfigurationError)
end
it "raises a ConfigurationError if one of :ssl_client_cert and :ssl_client_key is set but not both" do
Chef::Config[:ssl_client_cert] = "/dev/null/nothing_here"
Chef::Config[:ssl_client_key] = nil
- lambda {http_client}.should raise_error(Chef::Exceptions::ConfigurationError)
+ expect {http_client}.to raise_error(Chef::Exceptions::ConfigurationError)
end
it "configures the HTTP client's cert and private key" do
Chef::Config[:ssl_client_cert] = CHEF_SPEC_DATA + '/ssl/chef-rspec.cert'
Chef::Config[:ssl_client_key] = CHEF_SPEC_DATA + '/ssl/chef-rspec.key'
- http_client.cert.to_s.should == OpenSSL::X509::Certificate.new(IO.read(CHEF_SPEC_DATA + '/ssl/chef-rspec.cert')).to_s
- http_client.key.to_s.should == IO.read(CHEF_SPEC_DATA + '/ssl/chef-rspec.key')
+ expect(http_client.cert.to_s).to eq(OpenSSL::X509::Certificate.new(IO.read(CHEF_SPEC_DATA + '/ssl/chef-rspec.cert')).to_s)
+ expect(http_client.key.to_s).to eq(IO.read(CHEF_SPEC_DATA + '/ssl/chef-rspec.key'))
end
end
@@ -125,7 +125,7 @@ describe "HTTP SSL Policy" do
end
it "enables verification of self-signed certificates" do
- http_client.cert_store.verify(self_signed_crt).should be_true
+ expect(http_client.cert_store.verify(self_signed_crt)).to be_truthy
end
it "enables verification of cert chains" do
@@ -137,7 +137,7 @@ describe "HTTP SSL Policy" do
# If the machine running the test doesn't have ruby SSL configured correctly,
# then the root cert also has to be loaded for the test to succeed.
# The system under test **SHOULD** do both of these things.
- http_client.cert_store.verify(additional_pem).should be_true
+ expect(http_client.cert_store.verify(additional_pem)).to be_truthy
end
context "and some certs are duplicates" do
@@ -161,7 +161,7 @@ describe "HTTP SSL Policy" do
end
it "sets the OpenSSL verify mode to verify_peer" do
- http_client.verify_mode.should == OpenSSL::SSL::VERIFY_PEER
+ expect(http_client.verify_mode).to eq(OpenSSL::SSL::VERIFY_PEER)
end
end
diff --git a/spec/unit/http/validate_content_length_spec.rb b/spec/unit/http/validate_content_length_spec.rb
index 091f2b0757..34b6a61a3a 100644
--- a/spec/unit/http/validate_content_length_spec.rb
+++ b/spec/unit/http/validate_content_length_spec.rb
@@ -45,7 +45,7 @@ describe Chef::HTTP::ValidateContentLength do
let(:response) {
m = double('HttpResponse', :body => response_body)
- m.stub(:[]) do |key|
+ allow(m).to receive(:[]) do |key|
response_headers[key]
end
@@ -85,7 +85,7 @@ describe Chef::HTTP::ValidateContentLength do
before(:each) {
Chef::Log.level = :debug
- Chef::Log.stub(:debug) do |message|
+ allow(Chef::Log).to receive(:debug) do |message|
debug_stream.puts message
end
}
@@ -95,7 +95,7 @@ describe Chef::HTTP::ValidateContentLength do
let(:response_body) { "Thanks for checking in." }
it "shouldn't raise error" do
- lambda { run_content_length_validation }.should_not raise_error
+ expect { run_content_length_validation }.not_to raise_error
end
end
@@ -108,7 +108,7 @@ describe Chef::HTTP::ValidateContentLength do
it "should skip validation and log for debug" do
run_content_length_validation
- debug_output.should include("HTTP server did not include a Content-Length header in response")
+ expect(debug_output).to include("HTTP server did not include a Content-Length header in response")
end
end
end
@@ -121,7 +121,7 @@ describe Chef::HTTP::ValidateContentLength do
it "should validate correctly" do
run_content_length_validation
- debug_output.should include("Content-Length validated correctly.")
+ expect(debug_output).to include("Content-Length validated correctly.")
end
end
end
@@ -134,7 +134,7 @@ describe Chef::HTTP::ValidateContentLength do
let(:request_type) { req_type.to_sym }
it "should raise ContentLengthMismatch error" do
- lambda { run_content_length_validation }.should raise_error(Chef::Exceptions::ContentLengthMismatch)
+ expect { run_content_length_validation }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
end
end
end
@@ -144,7 +144,7 @@ describe Chef::HTTP::ValidateContentLength do
let(:streaming_length) { 12 }
it "should raise ContentLengthMismatch error" do
- lambda { run_content_length_validation }.should raise_error(Chef::Exceptions::ContentLengthMismatch)
+ expect { run_content_length_validation }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
end
end
@@ -162,7 +162,7 @@ describe Chef::HTTP::ValidateContentLength do
it "should skip validation and log for debug" do
run_content_length_validation
- debug_output.should include("Transfer-Encoding header is set, skipping Content-Length check.")
+ expect(debug_output).to include("Transfer-Encoding header is set, skipping Content-Length check.")
end
end
end
@@ -171,16 +171,16 @@ describe Chef::HTTP::ValidateContentLength do
describe "when client is being reused" do
before do
run_content_length_validation
- debug_output.should include("Content-Length validated correctly.")
+ expect(debug_output).to include("Content-Length validated correctly.")
end
it "should reset internal counter" do
- middleware.instance_variable_get(:@content_length_counter).should be_nil
+ expect(middleware.instance_variable_get(:@content_length_counter)).to be_nil
end
it "should validate correctly second time" do
run_content_length_validation
- debug_output.should include("Content-Length validated correctly.")
+ expect(debug_output).to include("Content-Length validated correctly.")
end
end
diff --git a/spec/unit/http_spec.rb b/spec/unit/http_spec.rb
index 1cd226b4ee..60d36eb4a0 100644
--- a/spec/unit/http_spec.rb
+++ b/spec/unit/http_spec.rb
@@ -31,17 +31,17 @@ describe Chef::HTTP do
it 'should return a correctly formatted url 1/3 CHEF-5261' do
http = Chef::HTTP.new('http://www.getchef.com')
- http.create_url('api/endpoint').should eql(URI.parse('http://www.getchef.com/api/endpoint'))
+ expect(http.create_url('api/endpoint')).to eql(URI.parse('http://www.getchef.com/api/endpoint'))
end
it 'should return a correctly formatted url 2/3 CHEF-5261' do
http = Chef::HTTP.new('http://www.getchef.com/')
- http.create_url('/organization/org/api/endpoint/').should eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint/'))
+ expect(http.create_url('/organization/org/api/endpoint/')).to eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint/'))
end
it 'should return a correctly formatted url 3/3 CHEF-5261' do
http = Chef::HTTP.new('http://www.getchef.com/organization/org///')
- http.create_url('///api/endpoint?url=http://foo.bar').should eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint?url=http://foo.bar'))
+ expect(http.create_url('///api/endpoint?url=http://foo.bar')).to eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint?url=http://foo.bar'))
end
end # create_url
@@ -50,20 +50,20 @@ describe Chef::HTTP do
it 'should return nil for a "200 Success" response (CHEF-4762)' do
resp = Net::HTTPOK.new("1.1", 200, "OK")
- resp.should_receive(:read_body).and_return(nil)
+ expect(resp).to receive(:read_body).and_return(nil)
http = Chef::HTTP.new("")
- Chef::HTTP::BasicClient.any_instance.should_receive(:request).and_return(["request", resp])
+ expect_any_instance_of(Chef::HTTP::BasicClient).to receive(:request).and_return(["request", resp])
- http.head("http://www.getchef.com/").should eql(nil)
+ expect(http.head("http://www.getchef.com/")).to eql(nil)
end
it 'should return false for a "304 Not Modified" response (CHEF-4762)' do
resp = Net::HTTPNotModified.new("1.1", 304, "Not Modified")
- resp.should_receive(:read_body).and_return(nil)
+ expect(resp).to receive(:read_body).and_return(nil)
http = Chef::HTTP.new("")
- Chef::HTTP::BasicClient.any_instance.should_receive(:request).and_return(["request", resp])
+ expect_any_instance_of(Chef::HTTP::BasicClient).to receive(:request).and_return(["request", resp])
- http.head("http://www.getchef.com/").should eql(false)
+ expect(http.head("http://www.getchef.com/")).to eql(false)
end
end # head
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 70cdd20f35..27731ea9f6 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -23,16 +23,16 @@ require 'net/ssh'
describe Chef::Knife::Bootstrap do
before do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
end
let(:knife) do
Chef::Log.logger = Logger.new(StringIO.new)
Chef::Config[:knife][:bootstrap_template] = bootstrap_template unless bootstrap_template.nil?
- k = Chef::Knife::Bootstrap.new
+ k = Chef::Knife::Bootstrap.new(bootstrap_cli_options)
k.merge_configs
- k.ui.stub(:stderr).and_return(stderr)
+ allow(k.ui).to receive(:stderr).and_return(stderr)
allow(k).to receive(:encryption_secret_provided_ignore_encrypt_flag?).and_return(false)
k
end
@@ -41,9 +41,35 @@ describe Chef::Knife::Bootstrap do
let(:bootstrap_template) { nil }
+ let(:bootstrap_cli_options) { [ ] }
+
it "should use chef-full as default template" do
- knife.bootstrap_template.should be_a_kind_of(String)
- File.basename(knife.bootstrap_template).should eq("chef-full")
+ expect(knife.bootstrap_template).to be_a_kind_of(String)
+ expect(File.basename(knife.bootstrap_template)).to eq("chef-full")
+ end
+
+ context "with :distro and :bootstrap_template cli options" do
+ let(:bootstrap_cli_options) { [ "--bootstrap-template", "my-template", "--distro", "other-template" ] }
+
+ it "should select bootstrap template" do
+ expect(File.basename(knife.bootstrap_template)).to eq("my-template")
+ end
+ end
+
+ context "with :distro and :template_file cli options" do
+ let(:bootstrap_cli_options) { [ "--distro", "my-template", "--template-file", "other-template" ] }
+
+ it "should select bootstrap template" do
+ expect(File.basename(knife.bootstrap_template)).to eq("other-template")
+ end
+ end
+
+ context "with :bootstrap_template and :template_file cli options" do
+ let(:bootstrap_cli_options) { [ "--bootstrap-template", "my-template", "--template-file", "other-template" ] }
+
+ it "should select bootstrap template" do
+ expect(File.basename(knife.bootstrap_template)).to eq("my-template")
+ end
end
context "when finding templates" do
@@ -52,7 +78,7 @@ describe Chef::Knife::Bootstrap do
let(:bootstrap_template) { "/opt/blah/not/exists/template.erb" }
it "raises an error" do
- lambda { knife.find_template }.should raise_error
+ expect { knife.find_template }.to raise_error
end
end
@@ -60,8 +86,8 @@ describe Chef::Knife::Bootstrap do
let(:bootstrap_template) { File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test.erb")) }
it "loads the given file as the template" do
- Chef::Log.should_receive(:debug)
- knife.find_template.should eq(File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test.erb")))
+ expect(Chef::Log).to receive(:debug)
+ expect(knife.find_template).to eq(File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test.erb")))
end
end
end
@@ -78,7 +104,7 @@ describe Chef::Knife::Bootstrap do
let(:gem_files_template_path) { "/Users/schisamo/.rvm/gems/ruby-1.9.2-p180@chef-0.10/gems/knife-windows-0.5.4/lib/chef/knife/bootstrap/fake-bootstrap-template.erb" }
def configure_chef_config_dir
- Chef::Knife.stub(:chef_config_dir).and_return("/knife/chef/config")
+ allow(Chef::Knife).to receive(:chef_config_dir).and_return("/knife/chef/config")
end
def configure_env_home
@@ -86,13 +112,13 @@ describe Chef::Knife::Bootstrap do
end
def configure_gem_files
- Gem.stub(:find_files).and_return([ gem_files_template_path ])
+ allow(Gem).to receive(:find_files).and_return([ gem_files_template_path ])
end
before(:each) do
@original_home = ENV['HOME']
ENV['HOME'] = nil
- File.should_receive(:exists?).with(bootstrap_template).and_return(false)
+ expect(File).to receive(:exists?).with(bootstrap_template).and_return(false)
end
after(:each) do
@@ -105,11 +131,11 @@ describe Chef::Knife::Bootstrap do
configure_env_home
configure_gem_files
- File.should_receive(:exists?).with(builtin_template_path).and_return(true)
+ expect(File).to receive(:exists?).with(builtin_template_path).and_return(true)
end
it "should load the template from built-in templates" do
- knife.find_template.should eq(builtin_template_path)
+ expect(knife.find_template).to eq(builtin_template_path)
end
end
@@ -119,8 +145,8 @@ describe Chef::Knife::Bootstrap do
configure_env_home
configure_gem_files
- File.should_receive(:exists?).with(builtin_template_path).and_return(false)
- File.should_receive(:exists?).with(chef_config_dir_template_path).and_return(true)
+ expect(File).to receive(:exists?).with(builtin_template_path).and_return(false)
+ expect(File).to receive(:exists?).with(chef_config_dir_template_path).and_return(true)
it "should load the template from chef_config_dir" do
knife.find_template.should eq(chef_config_dir_template_path)
@@ -134,13 +160,13 @@ describe Chef::Knife::Bootstrap do
configure_env_home
configure_gem_files
- File.should_receive(:exists?).with(builtin_template_path).and_return(false)
- File.should_receive(:exists?).with(chef_config_dir_template_path).and_return(false)
- File.should_receive(:exists?).with(env_home_template_path).and_return(true)
+ expect(File).to receive(:exists?).with(builtin_template_path).and_return(false)
+ expect(File).to receive(:exists?).with(chef_config_dir_template_path).and_return(false)
+ expect(File).to receive(:exists?).with(env_home_template_path).and_return(true)
end
it "should load the template from chef_config_dir" do
- knife.find_template.should eq(env_home_template_path)
+ expect(knife.find_template).to eq(env_home_template_path)
end
end
@@ -149,13 +175,13 @@ describe Chef::Knife::Bootstrap do
configure_chef_config_dir
configure_gem_files
- File.should_receive(:exists?).with(builtin_template_path).and_return(false)
- File.should_receive(:exists?).with(chef_config_dir_template_path).and_return(false)
- File.should_receive(:exists?).with(gem_files_template_path).and_return(true)
+ expect(File).to receive(:exists?).with(builtin_template_path).and_return(false)
+ expect(File).to receive(:exists?).with(chef_config_dir_template_path).and_return(false)
+ expect(File).to receive(:exists?).with(gem_files_template_path).and_return(true)
end
it "should load the template from Gem files" do
- knife.find_template.should eq(gem_files_template_path)
+ expect(knife.find_template).to eq(gem_files_template_path)
end
end
end
@@ -166,7 +192,7 @@ describe Chef::Knife::Bootstrap do
it "sets the knife :bootstrap_template config" do
knife.parse_options([t,"blahblah"])
knife.merge_configs
- knife.bootstrap_template.should eq("blahblah")
+ expect(knife.bootstrap_template).to eq("blahblah")
end
end
end
@@ -175,19 +201,19 @@ describe Chef::Knife::Bootstrap do
let(:bootstrap_template) { File.expand_path(File.join(CHEF_SPEC_DATA, "bootstrap", "test.erb")) }
it "should return an empty run_list" do
- knife.render_template.should == '{"run_list":[]}'
+ expect(knife.render_template).to eq('{"run_list":[]}')
end
it "should have role[base] in the run_list" do
knife.parse_options(["-r","role[base]"])
knife.merge_configs
- knife.render_template.should == '{"run_list":["role[base]"]}'
+ expect(knife.render_template).to eq('{"run_list":["role[base]"]}')
end
it "should have role[base] and recipe[cupcakes] in the run_list" do
knife.parse_options(["-r", "role[base],recipe[cupcakes]"])
knife.merge_configs
- knife.render_template.should == '{"run_list":["role[base]","recipe[cupcakes]"]}'
+ expect(knife.render_template).to eq('{"run_list":["role[base]","recipe[cupcakes]"]}')
end
it "should have foo => {bar => baz} in the first_boot" do
@@ -195,7 +221,7 @@ describe Chef::Knife::Bootstrap do
knife.merge_configs
expected_hash = FFI_Yajl::Parser.new.parse('{"foo":{"bar":"baz"},"run_list":[]}')
actual_hash = FFI_Yajl::Parser.new.parse(knife.render_template)
- actual_hash.should == expected_hash
+ expect(actual_hash).to eq(expected_hash)
end
end
@@ -205,14 +231,14 @@ describe Chef::Knife::Bootstrap do
it "should create a hint file when told to" do
knife.parse_options(["--hint", "openstack"])
knife.merge_configs
- knife.render_template.should match /\/etc\/chef\/ohai\/hints\/openstack.json/
+ expect(knife.render_template).to match /\/etc\/chef\/ohai\/hints\/openstack.json/
end
it "should populate a hint file with JSON when given a file to read" do
- ::File.stub(:read).and_return('{ "foo" : "bar" }')
+ allow(::File).to receive(:read).and_return('{ "foo" : "bar" }')
knife.parse_options(["--hint", "openstack=hints/openstack.json"])
knife.merge_configs
- knife.render_template.should match /\{\"foo\":\"bar\"\}/
+ expect(knife.render_template).to match /\{\"foo\":\"bar\"\}/
end
end
@@ -235,7 +261,7 @@ describe Chef::Knife::Bootstrap do
let(:setting) { "api.opscode.com" }
it "renders the client.rb with a single FQDN no_proxy entry" do
- rendered_template.should match(%r{.*no_proxy\s*"api.opscode.com".*})
+ expect(rendered_template).to match(%r{.*no_proxy\s*"api.opscode.com".*})
end
end
@@ -243,7 +269,7 @@ describe Chef::Knife::Bootstrap do
let(:setting) { "api.opscode.com,172.16.10.*" }
it "renders the client.rb with comma-separated FQDN and wildcard IP address no_proxy entries" do
- rendered_template.should match(%r{.*no_proxy\s*"api.opscode.com,172.16.10.\*".*})
+ expect(rendered_template).to match(%r{.*no_proxy\s*"api.opscode.com,172.16.10.\*".*})
end
end
@@ -251,7 +277,7 @@ describe Chef::Knife::Bootstrap do
let(:options) { ["--node-ssl-verify-mode", "none"] }
it "renders the client.rb with ssl_verify_mode set to :verify_none" do
- rendered_template.should match(/ssl_verify_mode :verify_none/)
+ expect(rendered_template).to match(/ssl_verify_mode :verify_none/)
end
end
@@ -259,7 +285,7 @@ describe Chef::Knife::Bootstrap do
let(:options) { ["--node-ssl-verify-mode", "peer"] }
it "renders the client.rb with ssl_verify_mode set to :verify_peer" do
- rendered_template.should match(/ssl_verify_mode :verify_peer/)
+ expect(rendered_template).to match(/ssl_verify_mode :verify_peer/)
end
end
@@ -267,7 +293,7 @@ describe Chef::Knife::Bootstrap do
let(:options) { ["--node-ssl-verify-mode", "all"] }
it "raises error" do
- lambda{ rendered_template }.should raise_error
+ expect{ rendered_template }.to raise_error
end
end
@@ -275,7 +301,7 @@ describe Chef::Knife::Bootstrap do
let(:options) { ["--node-verify-api-cert"] }
it "renders the client.rb with verify_api_cert set to true" do
- rendered_template.should match(/verify_api_cert true/)
+ expect(rendered_template).to match(/verify_api_cert true/)
end
end
@@ -283,7 +309,7 @@ describe Chef::Knife::Bootstrap do
let(:options) { ["--no-node-verify-api-cert"] }
it "renders the client.rb with verify_api_cert set to false" do
- rendered_template.should match(/verify_api_cert false/)
+ expect(rendered_template).to match(/verify_api_cert false/)
end
end
end
@@ -301,13 +327,13 @@ describe Chef::Knife::Bootstrap do
it "creates a secret file" do
expect(knife).to receive(:encryption_secret_provided_ignore_encrypt_flag?).and_return(true)
expect(knife).to receive(:read_secret).and_return(secret)
- rendered_template.should match(%r{#{secret}})
+ expect(rendered_template).to match(%r{#{secret}})
end
it "renders the client.rb with an encrypted_data_bag_secret entry" do
expect(knife).to receive(:encryption_secret_provided_ignore_encrypt_flag?).and_return(true)
expect(knife).to receive(:read_secret).and_return(secret)
- rendered_template.should match(%r{encrypted_data_bag_secret\s*"/etc/chef/encrypted_data_bag_secret"})
+ expect(rendered_template).to match(%r{encrypted_data_bag_secret\s*"/etc/chef/encrypted_data_bag_secret"})
end
end
@@ -322,8 +348,8 @@ describe Chef::Knife::Bootstrap do
before do
Chef::Config[:trusted_certs_dir] = trusted_certs_dir
- IO.stub(:read).and_call_original
- IO.stub(:read).with(File.expand_path(Chef::Config[:validation_key])).and_return("")
+ allow(IO).to receive(:read).and_call_original
+ allow(IO).to receive(:read).with(File.expand_path(Chef::Config[:validation_key])).and_return("")
end
def certificates
@@ -331,22 +357,22 @@ describe Chef::Knife::Bootstrap do
end
it "creates /etc/chef/trusted_certs" do
- rendered_template.should match(%r{mkdir -p /etc/chef/trusted_certs})
+ expect(rendered_template).to match(%r{mkdir -p /etc/chef/trusted_certs})
end
it "copies the certificates in the directory" do
certificates.each do |cert|
- IO.should_receive(:read).with(File.expand_path(cert))
+ expect(IO).to receive(:read).with(File.expand_path(cert))
end
certificates.each do |cert|
- rendered_template.should match(%r{cat > /etc/chef/trusted_certs/#{File.basename(cert)} <<'EOP'})
+ expect(rendered_template).to match(%r{cat > /etc/chef/trusted_certs/#{File.basename(cert)} <<'EOP'})
end
end
it "doesn't create /etc/chef/trusted_certs if :trusted_certs_dir is empty" do
- Dir.should_receive(:glob).with(File.join(trusted_certs_dir, "*.{crt,pem}")).and_return([])
- rendered_template.should_not match(%r{mkdir -p /etc/chef/trusted_certs})
+ expect(Dir).to receive(:glob).with(File.join(trusted_certs_dir, "*.{crt,pem}")).and_return([])
+ expect(rendered_template).not_to match(%r{mkdir -p /etc/chef/trusted_certs})
end
end
@@ -361,101 +387,97 @@ describe Chef::Knife::Bootstrap do
Chef::Config[:knife][:ssh_port] = nil
knife.config[:forward_agent] = true
knife.config[:identity_file] = "~/.ssh/me.rsa"
- knife.stub(:render_template).and_return("")
+ allow(knife).to receive(:render_template).and_return("")
knife.knife_ssh
end
it "configures the hostname" do
- knife_ssh.name_args.first.should == "foo.example.com"
+ expect(knife_ssh.name_args.first).to eq("foo.example.com")
end
it "configures the ssh user" do
- knife_ssh.config[:ssh_user].should == 'rooty'
+ expect(knife_ssh.config[:ssh_user]).to eq('rooty')
end
it "configures the ssh password" do
- knife_ssh.config[:ssh_password].should == 'open_sesame'
+ expect(knife_ssh.config[:ssh_password]).to eq('open_sesame')
end
it "configures the ssh port" do
- knife_ssh.config[:ssh_port].should == '4001'
+ expect(knife_ssh.config[:ssh_port]).to eq('4001')
end
it "configures the ssh agent forwarding" do
- knife_ssh.config[:forward_agent].should == true
+ expect(knife_ssh.config[:forward_agent]).to eq(true)
end
it "configures the ssh identity file" do
- knife_ssh.config[:identity_file].should == '~/.ssh/me.rsa'
+ expect(knife_ssh.config[:identity_file]).to eq('~/.ssh/me.rsa')
end
end
context "validating use_sudo_password" do
before do
knife.config[:ssh_password] = "password"
- knife.stub(:render_template).and_return("")
+ allow(knife).to receive(:render_template).and_return("")
end
it "use_sudo_password contains description and long params for help" do
- knife.options.should have_key(:use_sudo_password) \
- and knife.options[:use_sudo_password][:description].to_s.should_not == ''\
- and knife.options[:use_sudo_password][:long].to_s.should_not == ''
+ expect(knife.options).to have_key(:use_sudo_password) \
+ and expect(knife.options[:use_sudo_password][:description].to_s).not_to eq('')\
+ and expect(knife.options[:use_sudo_password][:long].to_s).not_to eq('')
end
it "uses the password from --ssh-password for sudo when --use-sudo-password is set" do
knife.config[:use_sudo] = true
knife.config[:use_sudo_password] = true
- knife.ssh_command.should include("echo \'#{knife.config[:ssh_password]}\' | sudo -S")
+ expect(knife.ssh_command).to include("echo \'#{knife.config[:ssh_password]}\' | sudo -S")
end
it "should not honor --use-sudo-password when --use-sudo is not set" do
knife.config[:use_sudo] = false
knife.config[:use_sudo_password] = true
- knife.ssh_command.should_not include("echo #{knife.config[:ssh_password]} | sudo -S")
+ expect(knife.ssh_command).not_to include("echo #{knife.config[:ssh_password]} | sudo -S")
end
end
context "from the knife config file" do
let(:knife_ssh) do
knife.name_args = ["config.example.com"]
- knife.config[:ssh_user] = nil
- knife.config[:ssh_port] = nil
- knife.config[:ssh_gateway] = nil
- knife.config[:forward_agent] = nil
- knife.config[:identity_file] = nil
- knife.config[:host_key_verify] = nil
Chef::Config[:knife][:ssh_user] = "curiosity"
Chef::Config[:knife][:ssh_port] = "2430"
Chef::Config[:knife][:forward_agent] = true
Chef::Config[:knife][:identity_file] = "~/.ssh/you.rsa"
Chef::Config[:knife][:ssh_gateway] = "towel.blinkenlights.nl"
Chef::Config[:knife][:host_key_verify] = true
- knife.stub(:render_template).and_return("")
+ allow(knife).to receive(:render_template).and_return("")
+ knife.config = {}
+ knife.merge_configs
knife.knife_ssh
end
it "configures the ssh user" do
- knife_ssh.config[:ssh_user].should == 'curiosity'
+ expect(knife_ssh.config[:ssh_user]).to eq('curiosity')
end
it "configures the ssh port" do
- knife_ssh.config[:ssh_port].should == '2430'
+ expect(knife_ssh.config[:ssh_port]).to eq('2430')
end
it "configures the ssh agent forwarding" do
- knife_ssh.config[:forward_agent].should == true
+ expect(knife_ssh.config[:forward_agent]).to eq(true)
end
it "configures the ssh identity file" do
- knife_ssh.config[:identity_file].should == '~/.ssh/you.rsa'
+ expect(knife_ssh.config[:identity_file]).to eq('~/.ssh/you.rsa')
end
it "configures the ssh gateway" do
- knife_ssh.config[:ssh_gateway].should == 'towel.blinkenlights.nl'
+ expect(knife_ssh.config[:ssh_gateway]).to eq('towel.blinkenlights.nl')
end
it "configures the host key verify mode" do
- knife_ssh.config[:host_key_verify].should == true
+ expect(knife_ssh.config[:host_key_verify]).to eq(true)
end
end
@@ -464,27 +486,27 @@ describe Chef::Knife::Bootstrap do
knife.name_args = ["foo.example.com"]
knife.config[:ssh_user] = "rooty"
knife.config[:identity_file] = "~/.ssh/me.rsa"
- knife.stub(:render_template).and_return("")
+ allow(knife).to receive(:render_template).and_return("")
k = knife.knife_ssh
- k.stub(:get_password).and_return('typed_in_password')
- knife.stub(:knife_ssh).and_return(k)
+ allow(k).to receive(:get_password).and_return('typed_in_password')
+ allow(knife).to receive(:knife_ssh).and_return(k)
knife.knife_ssh_with_password_auth
end
it "prompts the user for a password " do
- knife_ssh_with_password_auth.config[:ssh_password].should == 'typed_in_password'
+ expect(knife_ssh_with_password_auth.config[:ssh_password]).to eq('typed_in_password')
end
it "configures knife not to use the identity file that didn't work previously" do
- knife_ssh_with_password_auth.config[:identity_file].should be_nil
+ expect(knife_ssh_with_password_auth.config[:identity_file]).to be_nil
end
end
end
it "verifies that a server to bootstrap was given as a command line arg" do
knife.name_args = nil
- lambda { knife.run }.should raise_error(SystemExit)
- stderr.string.should match /ERROR:.+FQDN or ip/
+ expect { knife.run }.to raise_error(SystemExit)
+ expect(stderr.string).to match /ERROR:.+FQDN or ip/
end
describe "when running the bootstrap" do
@@ -492,31 +514,31 @@ describe Chef::Knife::Bootstrap do
knife.name_args = ["foo.example.com"]
knife.config[:ssh_user] = "rooty"
knife.config[:identity_file] = "~/.ssh/me.rsa"
- knife.stub(:render_template).and_return("")
+ allow(knife).to receive(:render_template).and_return("")
knife_ssh = knife.knife_ssh
- knife.stub(:knife_ssh).and_return(knife_ssh)
+ allow(knife).to receive(:knife_ssh).and_return(knife_ssh)
knife_ssh
end
it "configures the underlying ssh command and then runs it" do
- knife_ssh.should_receive(:run)
+ expect(knife_ssh).to receive(:run)
knife.run
end
it "falls back to password based auth when auth fails the first time" do
- knife.stub(:puts)
+ allow(knife).to receive(:puts)
fallback_knife_ssh = knife_ssh.dup
- knife_ssh.should_receive(:run).and_raise(Net::SSH::AuthenticationFailed.new("no ssh for you"))
- knife.stub(:knife_ssh_with_password_auth).and_return(fallback_knife_ssh)
- fallback_knife_ssh.should_receive(:run)
+ expect(knife_ssh).to receive(:run).and_raise(Net::SSH::AuthenticationFailed.new("no ssh for you"))
+ allow(knife).to receive(:knife_ssh_with_password_auth).and_return(fallback_knife_ssh)
+ expect(fallback_knife_ssh).to receive(:run)
knife.run
end
it "raises the exception if config[:ssh_password] is set and an authentication exception is raised" do
knife.config[:ssh_password] = "password"
- knife_ssh.should_receive(:run).and_raise(Net::SSH::AuthenticationFailed)
- lambda { knife.run }.should raise_error(Net::SSH::AuthenticationFailed)
+ expect(knife_ssh).to receive(:run).and_raise(Net::SSH::AuthenticationFailed)
+ expect { knife.run }.to raise_error(Net::SSH::AuthenticationFailed)
end
end
diff --git a/spec/unit/knife/client_bulk_delete_spec.rb b/spec/unit/knife/client_bulk_delete_spec.rb
index d5cfda9885..45bb4dd16c 100644
--- a/spec/unit/knife/client_bulk_delete_spec.rb
+++ b/spec/unit/knife/client_bulk_delete_spec.rb
@@ -28,10 +28,10 @@ describe Chef::Knife::ClientBulkDelete do
k = Chef::Knife::ClientBulkDelete.new
k.name_args = name_args
k.config = option_args
- k.ui.stub(:stdout).and_return(stdout_io)
- k.ui.stub(:stderr).and_return(stderr_io)
- k.ui.stub(:confirm).and_return(knife_confirm)
- k.ui.stub(:confirm_without_exit).and_return(knife_confirm)
+ allow(k.ui).to receive(:stdout).and_return(stdout_io)
+ allow(k.ui).to receive(:stderr).and_return(stderr_io)
+ allow(k.ui).to receive(:confirm).and_return(knife_confirm)
+ allow(k.ui).to receive(:confirm_without_exit).and_return(knife_confirm)
k
}
@@ -47,7 +47,7 @@ describe Chef::Knife::ClientBulkDelete do
nonvalidator_client_names.each do |client_name|
client = Chef::ApiClient.new()
client.name(client_name)
- client.stub(:destroy).and_return(true)
+ allow(client).to receive(:destroy).and_return(true)
clients[client_name] = client
end
@@ -61,8 +61,8 @@ describe Chef::Knife::ClientBulkDelete do
validator_client_names.each do |validator_client_name|
validator_client = Chef::ApiClient.new()
validator_client.name(validator_client_name)
- validator_client.stub(:validator).and_return(true)
- validator_client.stub(:destroy).and_return(true)
+ allow(validator_client).to receive(:validator).and_return(true)
+ allow(validator_client).to receive(:destroy).and_return(true)
clients[validator_client_name] = validator_client
end
@@ -75,7 +75,7 @@ describe Chef::Knife::ClientBulkDelete do
}
before(:each) do
- Chef::ApiClient.stub(:list).and_return(clients)
+ allow(Chef::ApiClient).to receive(:list).and_return(clients)
end
describe "run" do
@@ -83,44 +83,44 @@ describe Chef::Knife::ClientBulkDelete do
let(:name_args) { [ ] }
it "should exit if the regex is not provided" do
- lambda { knife.run }.should raise_error(SystemExit)
+ expect { knife.run }.to raise_error(SystemExit)
end
end
describe "with any clients" do
it "should get the list of the clients" do
- Chef::ApiClient.should_receive(:list)
+ expect(Chef::ApiClient).to receive(:list)
knife.run
end
it "should print the name of the clients" do
knife.run
client_names.each do |client_name|
- stdout.should include(client_name)
+ expect(stdout).to include(client_name)
end
end
it "should confirm you really want to delete them" do
- knife.ui.should_receive(:confirm)
+ expect(knife.ui).to receive(:confirm)
knife.run
end
describe "without --delete-validators" do
it "should mention that validator clients wont be deleted" do
knife.run
- stdout.should include("Following clients are validators and will not be deleted.")
+ expect(stdout).to include("Following clients are validators and will not be deleted.")
info = stdout.index "Following clients are validators and will not be deleted."
val = stdout.index "myorg-validator"
- (val > info).should be_true
+ expect(val > info).to be_truthy
end
it "should only delete nonvalidator clients" do
nonvalidator_clients.each_value do |c|
- c.should_receive(:destroy)
+ expect(c).to receive(:destroy)
end
validator_clients.each_value do |c|
- c.should_not_receive(:destroy)
+ expect(c).not_to receive(:destroy)
end
knife.run
@@ -132,18 +132,18 @@ describe Chef::Knife::ClientBulkDelete do
it "should mention that validator clients will be deleted" do
knife.run
- stdout.should include("The following validators will be deleted")
+ expect(stdout).to include("The following validators will be deleted")
end
it "should confirm twice" do
- knife.ui.should_receive(:confirm).once
- knife.ui.should_receive(:confirm_without_exit).once
+ expect(knife.ui).to receive(:confirm).once
+ expect(knife.ui).to receive(:confirm_without_exit).once
knife.run
end
it "should delete all clients" do
clients.each_value do |c|
- c.should_receive(:destroy)
+ expect(c).to receive(:destroy)
end
knife.run
@@ -155,10 +155,10 @@ describe Chef::Knife::ClientBulkDelete do
let(:name_args) { [ "^ti" ] }
it "should only delete clients that match the regex" do
- clients["tim"].should_receive(:destroy)
- clients["stephen"].should_not_receive(:destroy)
- clients["dan"].should_not_receive(:destroy)
- clients["myorg-validator"].should_not_receive(:destroy)
+ expect(clients["tim"]).to receive(:destroy)
+ expect(clients["stephen"]).not_to receive(:destroy)
+ expect(clients["dan"]).not_to receive(:destroy)
+ expect(clients["myorg-validator"]).not_to receive(:destroy)
knife.run
end
end
diff --git a/spec/unit/knife/client_create_spec.rb b/spec/unit/knife/client_create_spec.rb
index 59238d69ec..8e7cc4a5e3 100644
--- a/spec/unit/knife/client_create_spec.rb
+++ b/spec/unit/knife/client_create_spec.rb
@@ -31,53 +31,53 @@ describe Chef::Knife::ClientCreate do
}
@knife.name_args = [ "adam" ]
@client = Chef::ApiClient.new
- @client.stub(:save).and_return({ 'private_key' => '' })
- @knife.stub(:edit_data).and_return(@client)
- @knife.stub(:puts)
- Chef::ApiClient.stub(:new).and_return(@client)
+ allow(@client).to receive(:save).and_return({ 'private_key' => '' })
+ allow(@knife).to receive(:edit_data).and_return(@client)
+ allow(@knife).to receive(:puts)
+ allow(Chef::ApiClient).to receive(:new).and_return(@client)
@stderr = StringIO.new
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
describe "run" do
it "should create a new Client" do
- Chef::ApiClient.should_receive(:new).and_return(@client)
+ expect(Chef::ApiClient).to receive(:new).and_return(@client)
@knife.run
- @stderr.string.should match /created client.+adam/i
+ expect(@stderr.string).to match /created client.+adam/i
end
it "should set the Client name" do
- @client.should_receive(:name).with("adam")
+ expect(@client).to receive(:name).with("adam")
@knife.run
end
it "by default it is not an admin" do
- @client.should_receive(:admin).with(false)
+ expect(@client).to receive(:admin).with(false)
@knife.run
end
it "by default it is not a validator" do
- @client.should_receive(:validator).with(false)
+ expect(@client).to receive(:validator).with(false)
@knife.run
end
it "should allow you to edit the data" do
- @knife.should_receive(:edit_data).with(@client)
+ expect(@knife).to receive(:edit_data).with(@client)
@knife.run
end
it "should save the Client" do
- @client.should_receive(:save)
+ expect(@client).to receive(:save)
@knife.run
end
describe "with -f or --file" do
it "should write the private key to a file" do
@knife.config[:file] = "/tmp/monkeypants"
- @client.stub(:save).and_return({ 'private_key' => "woot" })
+ allow(@client).to receive(:save).and_return({ 'private_key' => "woot" })
filehandle = double("Filehandle")
- filehandle.should_receive(:print).with('woot')
- File.should_receive(:open).with("/tmp/monkeypants", "w").and_yield(filehandle)
+ expect(filehandle).to receive(:print).with('woot')
+ expect(File).to receive(:open).with("/tmp/monkeypants", "w").and_yield(filehandle)
@knife.run
end
end
@@ -85,7 +85,7 @@ describe Chef::Knife::ClientCreate do
describe "with -a or --admin" do
it "should create an admin client" do
@knife.config[:admin] = true
- @client.should_receive(:admin).with(true)
+ expect(@client).to receive(:admin).with(true)
@knife.run
end
end
@@ -93,7 +93,7 @@ describe Chef::Knife::ClientCreate do
describe "with --validator" do
it "should create an validator client" do
@knife.config[:validator] = true
- @client.should_receive(:validator).with(true)
+ expect(@client).to receive(:validator).with(true)
@knife.run
end
end
diff --git a/spec/unit/knife/client_delete_spec.rb b/spec/unit/knife/client_delete_spec.rb
index c7908a0934..0fb5e0bab7 100644
--- a/spec/unit/knife/client_delete_spec.rb
+++ b/spec/unit/knife/client_delete_spec.rb
@@ -30,52 +30,52 @@ describe Chef::Knife::ClientDelete do
describe 'run' do
it 'should delete the client' do
- @knife.should_receive(:delete_object).with(Chef::ApiClient, 'adam', 'client')
+ expect(@knife).to receive(:delete_object).with(Chef::ApiClient, 'adam', 'client')
@knife.run
end
it 'should print usage and exit when a client name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
describe 'with a validator' do
before(:each) do
- Chef::Knife::UI.stub(:confirm).and_return(true)
- @knife.stub(:confirm).and_return(true)
+ allow(Chef::Knife::UI).to receive(:confirm).and_return(true)
+ allow(@knife).to receive(:confirm).and_return(true)
@client = Chef::ApiClient.new
- Chef::ApiClient.should_receive(:load).and_return(@client)
+ expect(Chef::ApiClient).to receive(:load).and_return(@client)
end
it 'should delete non-validator client if --delete-validators is not set' do
@knife.config[:delete_validators] = false
- @client.should_receive(:destroy).and_return(@client)
- @knife.should_receive(:msg)
+ expect(@client).to receive(:destroy).and_return(@client)
+ expect(@knife).to receive(:msg)
@knife.run
end
it 'should delete non-validator client if --delete-validators is set' do
@knife.config[:delete_validators] = true
- @client.should_receive(:destroy).and_return(@client)
- @knife.should_receive(:msg)
+ expect(@client).to receive(:destroy).and_return(@client)
+ expect(@knife).to receive(:msg)
@knife.run
end
it 'should not delete validator client if --delete-validators is not set' do
@client.validator(true)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run}.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run}.to raise_error(SystemExit)
end
it 'should delete validator client if --delete-validators is set' do
@knife.config[:delete_validators] = true
- @client.should_receive(:destroy).and_return(@client)
- @knife.should_receive(:msg)
+ expect(@client).to receive(:destroy).and_return(@client)
+ expect(@knife).to receive(:msg)
@knife.run
end
diff --git a/spec/unit/knife/client_edit_spec.rb b/spec/unit/knife/client_edit_spec.rb
index 1d7049be30..c040c5e2f2 100644
--- a/spec/unit/knife/client_edit_spec.rb
+++ b/spec/unit/knife/client_edit_spec.rb
@@ -26,15 +26,15 @@ describe Chef::Knife::ClientEdit do
describe 'run' do
it 'should edit the client' do
- @knife.should_receive(:edit_object).with(Chef::ApiClient, 'adam')
+ expect(@knife).to receive(:edit_object).with(Chef::ApiClient, 'adam')
@knife.run
end
it 'should print usage and exit when a client name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
end
diff --git a/spec/unit/knife/client_list_spec.rb b/spec/unit/knife/client_list_spec.rb
index c4834ad8d1..eff01da4e9 100644
--- a/spec/unit/knife/client_list_spec.rb
+++ b/spec/unit/knife/client_list_spec.rb
@@ -26,8 +26,8 @@ describe Chef::Knife::ClientList do
describe 'run' do
it 'should list the clients' do
- Chef::ApiClient.should_receive(:list)
- @knife.should_receive(:format_list_for_display)
+ expect(Chef::ApiClient).to receive(:list)
+ expect(@knife).to receive(:format_list_for_display)
@knife.run
end
end
diff --git a/spec/unit/knife/client_reregister_spec.rb b/spec/unit/knife/client_reregister_spec.rb
index daf18d5d25..f1be4ed570 100644
--- a/spec/unit/knife/client_reregister_spec.rb
+++ b/spec/unit/knife/client_reregister_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Knife::ClientReregister do
@knife.name_args = [ 'adam' ]
@client_mock = double('client_mock', :private_key => "foo_key")
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
context "when no client name is given on the command line" do
@@ -33,29 +33,29 @@ describe Chef::Knife::ClientReregister do
end
it 'should print usage and exit when a client name is not provided' do
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
context 'when not configured for file output' do
it 'reregisters the client and prints the key' do
- Chef::ApiClient.should_receive(:reregister).with('adam').and_return(@client_mock)
+ expect(Chef::ApiClient).to receive(:reregister).with('adam').and_return(@client_mock)
@knife.run
- @stdout.string.should match( /foo_key/ )
+ expect(@stdout.string).to match( /foo_key/ )
end
end
context 'when configured for file output' do
it 'should write the private key to a file' do
- Chef::ApiClient.should_receive(:reregister).with('adam').and_return(@client_mock)
+ expect(Chef::ApiClient).to receive(:reregister).with('adam').and_return(@client_mock)
@knife.config[:file] = '/tmp/monkeypants'
filehandle = StringIO.new
- File.should_receive(:open).with('/tmp/monkeypants', 'w').and_yield(filehandle)
+ expect(File).to receive(:open).with('/tmp/monkeypants', 'w').and_yield(filehandle)
@knife.run
- filehandle.string.should == "foo_key"
+ expect(filehandle.string).to eq("foo_key")
end
end
diff --git a/spec/unit/knife/configure_client_spec.rb b/spec/unit/knife/configure_client_spec.rb
index de2a5a41e5..363743f8cc 100644
--- a/spec/unit/knife/configure_client_spec.rb
+++ b/spec/unit/knife/configure_client_spec.rb
@@ -26,16 +26,16 @@ describe Chef::Knife::ConfigureClient do
Chef::Config[:validation_key] = '/etc/chef/validation.pem'
@stderr = StringIO.new
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
describe 'run' do
it 'should print usage and exit when a directory is not provided' do
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal).with(/must provide the directory/)
- lambda {
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal).with(/must provide the directory/)
+ expect {
@knife.run
- }.should raise_error SystemExit
+ }.to raise_error SystemExit
end
describe 'when specifing a directory' do
@@ -43,39 +43,39 @@ describe Chef::Knife::ConfigureClient do
@knife.name_args = ['/home/bob/.chef']
@client_file = StringIO.new
@validation_file = StringIO.new
- File.should_receive(:open).with('/home/bob/.chef/client.rb', 'w').
+ expect(File).to receive(:open).with('/home/bob/.chef/client.rb', 'w').
and_yield(@client_file)
- File.should_receive(:open).with('/home/bob/.chef/validation.pem', 'w').
+ expect(File).to receive(:open).with('/home/bob/.chef/validation.pem', 'w').
and_yield(@validation_file)
- IO.should_receive(:read).and_return('foo_bar_baz')
+ expect(IO).to receive(:read).and_return('foo_bar_baz')
end
it 'should recursively create the directory' do
- FileUtils.should_receive(:mkdir_p).with('/home/bob/.chef')
+ expect(FileUtils).to receive(:mkdir_p).with('/home/bob/.chef')
@knife.run
end
it 'should write out the config file' do
- FileUtils.stub(:mkdir_p)
+ allow(FileUtils).to receive(:mkdir_p)
@knife.run
- @client_file.string.should match /log_level\s+\:info/
- @client_file.string.should match /log_location\s+STDOUT/
- @client_file.string.should match /chef_server_url\s+'https\:\/\/chef\.example\.com'/
- @client_file.string.should match /validation_client_name\s+'chef-validator'/
+ expect(@client_file.string).to match /log_level\s+\:info/
+ expect(@client_file.string).to match /log_location\s+STDOUT/
+ expect(@client_file.string).to match /chef_server_url\s+'https\:\/\/chef\.example\.com'/
+ expect(@client_file.string).to match /validation_client_name\s+'chef-validator'/
end
it 'should write out the validation.pem file' do
- FileUtils.stub(:mkdir_p)
+ allow(FileUtils).to receive(:mkdir_p)
@knife.run
- @validation_file.string.should match /foo_bar_baz/
+ expect(@validation_file.string).to match /foo_bar_baz/
end
it 'should print information on what is being configured' do
- FileUtils.stub(:mkdir_p)
+ allow(FileUtils).to receive(:mkdir_p)
@knife.run
- @stderr.string.should match /creating client configuration/i
- @stderr.string.should match /writing client\.rb/i
- @stderr.string.should match /writing validation\.pem/i
+ expect(@stderr.string).to match /creating client configuration/i
+ expect(@stderr.string).to match /writing client\.rb/i
+ expect(@stderr.string).to match /writing validation\.pem/i
end
end
end
diff --git a/spec/unit/knife/configure_spec.rb b/spec/unit/knife/configure_spec.rb
index c16019dcf7..e3ea1f052c 100644
--- a/spec/unit/knife/configure_spec.rb
+++ b/spec/unit/knife/configure_spec.rb
@@ -7,19 +7,19 @@ describe Chef::Knife::Configure do
Chef::Config[:node_name] = "webmonkey.example.com"
@knife = Chef::Knife::Configure.new
@rest_client = double("null rest client", :post_rest => { :result => :true })
- @knife.stub(:rest).and_return(@rest_client)
+ allow(@knife).to receive(:rest).and_return(@rest_client)
@out = StringIO.new
- @knife.ui.stub(:stdout).and_return(@out)
+ allow(@knife.ui).to receive(:stdout).and_return(@out)
@knife.config[:config_file] = '/home/you/.chef/knife.rb'
@in = StringIO.new("\n" * 7)
- @knife.ui.stub(:stdin).and_return(@in)
+ allow(@knife.ui).to receive(:stdin).and_return(@in)
@err = StringIO.new
- @knife.ui.stub(:stderr).and_return(@err)
+ allow(@knife.ui).to receive(:stderr).and_return(@err)
- Ohai::System.stub(:new).and_return(ohai)
+ allow(Ohai::System).to receive(:new).and_return(ohai)
end
@@ -27,8 +27,8 @@ describe Chef::Knife::Configure do
let(:ohai) do
o = {}
- o.stub(:require_plugin)
- o.stub(:load_plugins)
+ allow(o).to receive(:require_plugin)
+ allow(o).to receive(:load_plugins)
o[:fqdn] = fqdn
o
end
@@ -44,63 +44,63 @@ describe Chef::Knife::Configure do
it "asks the user for the URL of the chef server" do
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter the chef server URL: [#{default_server_url}]"))
- @knife.chef_server.should == default_server_url
+ expect(@out.string).to match(Regexp.escape("Please enter the chef server URL: [#{default_server_url}]"))
+ expect(@knife.chef_server).to eq(default_server_url)
end
it "asks the user for the clientname they want for the new client if -i is specified" do
@knife.config[:initial] = true
- Etc.stub(:getlogin).and_return("a-new-user")
+ allow(Etc).to receive(:getlogin).and_return("a-new-user")
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter a name for the new user: [a-new-user]"))
- @knife.new_client_name.should == Etc.getlogin
+ expect(@out.string).to match(Regexp.escape("Please enter a name for the new user: [a-new-user]"))
+ expect(@knife.new_client_name).to eq(Etc.getlogin)
end
it "should not ask the user for the clientname they want for the new client if -i and --node_name are specified" do
@knife.config[:initial] = true
@knife.config[:node_name] = 'testnode'
- Etc.stub(:getlogin).and_return("a-new-user")
+ allow(Etc).to receive(:getlogin).and_return("a-new-user")
@knife.ask_user_for_config
- @out.string.should_not match(Regexp.escape("Please enter a name for the new user"))
- @knife.new_client_name.should == 'testnode'
+ expect(@out.string).not_to match(Regexp.escape("Please enter a name for the new user"))
+ expect(@knife.new_client_name).to eq('testnode')
end
it "asks the user for the existing API username or clientname if -i is not specified" do
- Etc.stub(:getlogin).and_return("a-new-user")
+ allow(Etc).to receive(:getlogin).and_return("a-new-user")
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter an existing username or clientname for the API: [a-new-user]"))
- @knife.new_client_name.should == Etc.getlogin
+ expect(@out.string).to match(Regexp.escape("Please enter an existing username or clientname for the API: [a-new-user]"))
+ expect(@knife.new_client_name).to eq(Etc.getlogin)
end
it "asks the user for the existing admin client's name if -i is specified" do
@knife.config[:initial] = true
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter the existing admin name: [admin]"))
- @knife.admin_client_name.should == 'admin'
+ expect(@out.string).to match(Regexp.escape("Please enter the existing admin name: [admin]"))
+ expect(@knife.admin_client_name).to eq('admin')
end
it "should not ask the user for the existing admin client's name if -i and --admin-client_name are specified" do
@knife.config[:initial] = true
@knife.config[:admin_client_name] = 'my-webui'
@knife.ask_user_for_config
- @out.string.should_not match(Regexp.escape("Please enter the existing admin:"))
- @knife.admin_client_name.should == 'my-webui'
+ expect(@out.string).not_to match(Regexp.escape("Please enter the existing admin:"))
+ expect(@knife.admin_client_name).to eq('my-webui')
end
it "should not ask the user for the existing admin client's name if -i is not specified" do
@knife.ask_user_for_config
- @out.string.should_not match(Regexp.escape("Please enter the existing admin: [admin]"))
- @knife.admin_client_name.should_not == 'admin'
+ expect(@out.string).not_to match(Regexp.escape("Please enter the existing admin: [admin]"))
+ expect(@knife.admin_client_name).not_to eq('admin')
end
it "asks the user for the location of the existing admin key if -i is specified" do
@knife.config[:initial] = true
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter the location of the existing admin's private key: [#{default_admin_key}]"))
+ expect(@out.string).to match(Regexp.escape("Please enter the location of the existing admin's private key: [#{default_admin_key}]"))
if windows?
- @knife.admin_client_key.capitalize.should == default_admin_key_win32.capitalize
+ expect(@knife.admin_client_key.capitalize).to eq(default_admin_key_win32.capitalize)
else
- @knife.admin_client_key.should == default_admin_key
+ expect(@knife.admin_client_key).to eq(default_admin_key)
end
end
@@ -108,61 +108,61 @@ describe Chef::Knife::Configure do
@knife.config[:initial] = true
@knife.config[:admin_client_key] = '/home/you/.chef/my-webui.pem'
@knife.ask_user_for_config
- @out.string.should_not match(Regexp.escape("Please enter the location of the existing admin client's private key:"))
+ expect(@out.string).not_to match(Regexp.escape("Please enter the location of the existing admin client's private key:"))
if windows?
- @knife.admin_client_key.should match %r{^[A-Za-z]:/home/you/\.chef/my-webui\.pem$}
+ expect(@knife.admin_client_key).to match %r{^[A-Za-z]:/home/you/\.chef/my-webui\.pem$}
else
- @knife.admin_client_key.should == '/home/you/.chef/my-webui.pem'
+ expect(@knife.admin_client_key).to eq('/home/you/.chef/my-webui.pem')
end
end
it "should not ask the user for the location of the existing admin key if -i is not specified" do
@knife.ask_user_for_config
- @out.string.should_not match(Regexp.escape("Please enter the location of the existing admin client's private key: [#{default_admin_key}]"))
+ expect(@out.string).not_to match(Regexp.escape("Please enter the location of the existing admin client's private key: [#{default_admin_key}]"))
if windows?
- @knife.admin_client_key.should_not == default_admin_key_win32
+ expect(@knife.admin_client_key).not_to eq(default_admin_key_win32)
else
- @knife.admin_client_key.should_not == default_admin_key
+ expect(@knife.admin_client_key).not_to eq(default_admin_key)
end
end
it "asks the user for the location of a chef repo" do
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter the path to a chef repository (or leave blank):"))
- @knife.chef_repo.should == ''
+ expect(@out.string).to match(Regexp.escape("Please enter the path to a chef repository (or leave blank):"))
+ expect(@knife.chef_repo).to eq('')
end
it "asks the users for the name of the validation client" do
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter the validation clientname: [chef-validator]"))
- @knife.validation_client_name.should == 'chef-validator'
+ expect(@out.string).to match(Regexp.escape("Please enter the validation clientname: [chef-validator]"))
+ expect(@knife.validation_client_name).to eq('chef-validator')
end
it "should not ask the users for the name of the validation client if --validation_client_name is specified" do
@knife.config[:validation_client_name] = 'my-validator'
@knife.ask_user_for_config
- @out.string.should_not match(Regexp.escape("Please enter the validation clientname:"))
- @knife.validation_client_name.should == 'my-validator'
+ expect(@out.string).not_to match(Regexp.escape("Please enter the validation clientname:"))
+ expect(@knife.validation_client_name).to eq('my-validator')
end
it "asks the users for the location of the validation key" do
@knife.ask_user_for_config
- @out.string.should match(Regexp.escape("Please enter the location of the validation key: [#{default_validator_key}]"))
+ expect(@out.string).to match(Regexp.escape("Please enter the location of the validation key: [#{default_validator_key}]"))
if windows?
- @knife.validation_key.capitalize.should == default_validator_key_win32.capitalize
+ expect(@knife.validation_key.capitalize).to eq(default_validator_key_win32.capitalize)
else
- @knife.validation_key.should == default_validator_key
+ expect(@knife.validation_key).to eq(default_validator_key)
end
end
it "should not ask the users for the location of the validation key if --validation_key is specified" do
@knife.config[:validation_key] = '/home/you/.chef/my-validation.pem'
@knife.ask_user_for_config
- @out.string.should_not match(Regexp.escape("Please enter the location of the validation key:"))
+ expect(@out.string).not_to match(Regexp.escape("Please enter the location of the validation key:"))
if windows?
- @knife.validation_key.should match %r{^[A-Za-z]:/home/you/\.chef/my-validation\.pem$}
+ expect(@knife.validation_key).to match %r{^[A-Za-z]:/home/you/\.chef/my-validation\.pem$}
else
- @knife.validation_key.should == '/home/you/.chef/my-validation.pem'
+ expect(@knife.validation_key).to eq('/home/you/.chef/my-validation.pem')
end
end
@@ -176,68 +176,68 @@ describe Chef::Knife::Configure do
@knife.config[:validation_key] = '/home/you/.chef/my-validation.pem'
@knife.config[:repository] = ''
@knife.config[:client_key] = '/home/you/a-new-user.pem'
- Etc.stub(:getlogin).and_return('a-new-user')
+ allow(Etc).to receive(:getlogin).and_return('a-new-user')
@knife.ask_user_for_config
- @out.string.should match(/\s*/)
+ expect(@out.string).to match(/\s*/)
- @knife.new_client_name.should == 'testnode'
- @knife.chef_server.should == 'http://localhost:5000'
- @knife.admin_client_name.should == 'my-webui'
+ expect(@knife.new_client_name).to eq('testnode')
+ expect(@knife.chef_server).to eq('http://localhost:5000')
+ expect(@knife.admin_client_name).to eq('my-webui')
if windows?
- @knife.admin_client_key.should match %r{^[A-Za-z]:/home/you/\.chef/my-webui\.pem$}
- @knife.validation_key.should match %r{^[A-Za-z]:/home/you/\.chef/my-validation\.pem$}
- @knife.new_client_key.should match %r{^[A-Za-z]:/home/you/a-new-user\.pem$}
+ expect(@knife.admin_client_key).to match %r{^[A-Za-z]:/home/you/\.chef/my-webui\.pem$}
+ expect(@knife.validation_key).to match %r{^[A-Za-z]:/home/you/\.chef/my-validation\.pem$}
+ expect(@knife.new_client_key).to match %r{^[A-Za-z]:/home/you/a-new-user\.pem$}
else
- @knife.admin_client_key.should == '/home/you/.chef/my-webui.pem'
- @knife.validation_key.should == '/home/you/.chef/my-validation.pem'
- @knife.new_client_key.should == '/home/you/a-new-user.pem'
+ expect(@knife.admin_client_key).to eq('/home/you/.chef/my-webui.pem')
+ expect(@knife.validation_key).to eq('/home/you/.chef/my-validation.pem')
+ expect(@knife.new_client_key).to eq('/home/you/a-new-user.pem')
end
- @knife.validation_client_name.should == 'my-validator'
- @knife.chef_repo.should == ''
+ expect(@knife.validation_client_name).to eq('my-validator')
+ expect(@knife.chef_repo).to eq('')
end
it "writes the new data to a config file" do
- File.stub(:expand_path).with("/home/you/.chef/knife.rb").and_return("/home/you/.chef/knife.rb")
- File.stub(:expand_path).with("/home/you/.chef/#{Etc.getlogin}.pem").and_return("/home/you/.chef/#{Etc.getlogin}.pem")
- File.stub(:expand_path).with(default_validator_key).and_return(default_validator_key)
- File.stub(:expand_path).with(default_admin_key).and_return(default_admin_key)
- FileUtils.should_receive(:mkdir_p).with("/home/you/.chef")
+ allow(File).to receive(:expand_path).with("/home/you/.chef/knife.rb").and_return("/home/you/.chef/knife.rb")
+ allow(File).to receive(:expand_path).with("/home/you/.chef/#{Etc.getlogin}.pem").and_return("/home/you/.chef/#{Etc.getlogin}.pem")
+ allow(File).to receive(:expand_path).with(default_validator_key).and_return(default_validator_key)
+ allow(File).to receive(:expand_path).with(default_admin_key).and_return(default_admin_key)
+ expect(FileUtils).to receive(:mkdir_p).with("/home/you/.chef")
config_file = StringIO.new
- ::File.should_receive(:open).with("/home/you/.chef/knife.rb", "w").and_yield config_file
+ expect(::File).to receive(:open).with("/home/you/.chef/knife.rb", "w").and_yield config_file
@knife.config[:repository] = '/home/you/chef-repo'
@knife.run
- config_file.string.should match(/^node_name[\s]+'#{Etc.getlogin}'$/)
- config_file.string.should match(%r{^client_key[\s]+'/home/you/.chef/#{Etc.getlogin}.pem'$})
- config_file.string.should match(/^validation_client_name\s+'chef-validator'$/)
- config_file.string.should match(%r{^validation_key\s+'#{default_validator_key}'$})
- config_file.string.should match(%r{^chef_server_url\s+'#{default_server_url}'$})
- config_file.string.should match(%r{cookbook_path\s+\[ '/home/you/chef-repo/cookbooks' \]})
+ expect(config_file.string).to match(/^node_name[\s]+'#{Etc.getlogin}'$/)
+ expect(config_file.string).to match(%r{^client_key[\s]+'/home/you/.chef/#{Etc.getlogin}.pem'$})
+ expect(config_file.string).to match(/^validation_client_name\s+'chef-validator'$/)
+ expect(config_file.string).to match(%r{^validation_key\s+'#{default_validator_key}'$})
+ expect(config_file.string).to match(%r{^chef_server_url\s+'#{default_server_url}'$})
+ expect(config_file.string).to match(%r{cookbook_path\s+\[ '/home/you/chef-repo/cookbooks' \]})
end
it "creates a new client when given the --initial option" do
- File.should_receive(:expand_path).with("/home/you/.chef/knife.rb").and_return("/home/you/.chef/knife.rb")
- File.should_receive(:expand_path).with("/home/you/.chef/a-new-user.pem").and_return("/home/you/.chef/a-new-user.pem")
- File.should_receive(:expand_path).with(default_validator_key).and_return(default_validator_key)
- File.should_receive(:expand_path).with(default_admin_key).and_return(default_admin_key)
+ expect(File).to receive(:expand_path).with("/home/you/.chef/knife.rb").and_return("/home/you/.chef/knife.rb")
+ expect(File).to receive(:expand_path).with("/home/you/.chef/a-new-user.pem").and_return("/home/you/.chef/a-new-user.pem")
+ expect(File).to receive(:expand_path).with(default_validator_key).and_return(default_validator_key)
+ expect(File).to receive(:expand_path).with(default_admin_key).and_return(default_admin_key)
Chef::Config[:node_name] = "webmonkey.example.com"
user_command = Chef::Knife::UserCreate.new
- user_command.should_receive(:run)
+ expect(user_command).to receive(:run)
- Etc.stub(:getlogin).and_return("a-new-user")
+ allow(Etc).to receive(:getlogin).and_return("a-new-user")
- Chef::Knife::UserCreate.stub(:new).and_return(user_command)
- FileUtils.should_receive(:mkdir_p).with("/home/you/.chef")
- ::File.should_receive(:open).with("/home/you/.chef/knife.rb", "w")
+ allow(Chef::Knife::UserCreate).to receive(:new).and_return(user_command)
+ expect(FileUtils).to receive(:mkdir_p).with("/home/you/.chef")
+ expect(::File).to receive(:open).with("/home/you/.chef/knife.rb", "w")
@knife.config[:initial] = true
@knife.config[:user_password] = "blah"
@knife.run
- user_command.name_args.should == Array("a-new-user")
- user_command.config[:user_password].should == "blah"
- user_command.config[:admin].should be_true
- user_command.config[:file].should == "/home/you/.chef/a-new-user.pem"
- user_command.config[:yes].should be_true
- user_command.config[:disable_editing].should be_true
+ expect(user_command.name_args).to eq(Array("a-new-user"))
+ expect(user_command.config[:user_password]).to eq("blah")
+ expect(user_command.config[:admin]).to be_truthy
+ expect(user_command.config[:file]).to eq("/home/you/.chef/a-new-user.pem")
+ expect(user_command.config[:yes]).to be_truthy
+ expect(user_command.config[:disable_editing]).to be_truthy
end
end
diff --git a/spec/unit/knife/cookbook_bulk_delete_spec.rb b/spec/unit/knife/cookbook_bulk_delete_spec.rb
index fb4b1d1484..98cd06bbbc 100644
--- a/spec/unit/knife/cookbook_bulk_delete_spec.rb
+++ b/spec/unit/knife/cookbook_bulk_delete_spec.rb
@@ -28,19 +28,19 @@ describe Chef::Knife::CookbookBulkDelete do
@knife.name_args = ["."]
@stdout = StringIO.new
@stderr = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:stderr).and_return(@stderr)
- @knife.ui.stub(:confirm).and_return(true)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:confirm).and_return(true)
@cookbooks = Hash.new
%w{cheezburger pizza lasagna}.each do |cookbook_name|
cookbook = Chef::CookbookVersion.new(cookbook_name)
@cookbooks[cookbook_name] = cookbook
end
@rest = double("Chef::REST")
- @rest.stub(:get_rest).and_return(@cookbooks)
- @rest.stub(:delete_rest).and_return(true)
- @knife.stub(:rest).and_return(@rest)
- Chef::CookbookVersion.stub(:list).and_return(@cookbooks)
+ allow(@rest).to receive(:get_rest).and_return(@cookbooks)
+ allow(@rest).to receive(:delete_rest).and_return(true)
+ allow(@knife).to receive(:rest).and_return(@rest)
+ allow(Chef::CookbookVersion).to receive(:list).and_return(@cookbooks)
end
@@ -49,41 +49,41 @@ describe Chef::Knife::CookbookBulkDelete do
describe "when there are several cookbooks on the server" do
before do
@cheezburger = {'cheezburger' => {"url" => "file:///dev/null", "versions" => [{"url" => "file:///dev/null-cheez", "version" => "1.0.0"}]}}
- @rest.stub(:get_rest).with('cookbooks/cheezburger').and_return(@cheezburger)
+ allow(@rest).to receive(:get_rest).with('cookbooks/cheezburger').and_return(@cheezburger)
@pizza = {'pizza' => {"url" => "file:///dev/null", "versions" => [{"url" => "file:///dev/null-pizza", "version" => "2.0.0"}]}}
- @rest.stub(:get_rest).with('cookbooks/pizza').and_return(@pizza)
+ allow(@rest).to receive(:get_rest).with('cookbooks/pizza').and_return(@pizza)
@lasagna = {'lasagna' => {"url" => "file:///dev/null", "versions" => [{"url" => "file:///dev/null-lasagna", "version" => "3.0.0"}]}}
- @rest.stub(:get_rest).with('cookbooks/lasagna').and_return(@lasagna)
+ allow(@rest).to receive(:get_rest).with('cookbooks/lasagna').and_return(@lasagna)
end
it "should print the cookbooks you are about to delete" do
expected = @knife.ui.list(@cookbooks.keys.sort, :columns_down)
@knife.run
- @stdout.string.should match(/#{expected}/)
+ expect(@stdout.string).to match(/#{expected}/)
end
it "should confirm you really want to delete them" do
- @knife.ui.should_receive(:confirm)
+ expect(@knife.ui).to receive(:confirm)
@knife.run
end
it "should delete each cookbook" do
{"cheezburger" => "1.0.0", "pizza" => "2.0.0", "lasagna" => '3.0.0'}.each do |cookbook_name, version|
- @rest.should_receive(:delete_rest).with("cookbooks/#{cookbook_name}/#{version}")
+ expect(@rest).to receive(:delete_rest).with("cookbooks/#{cookbook_name}/#{version}")
end
@knife.run
end
it "should only delete cookbooks that match the regex" do
@knife.name_args = ["cheezburger"]
- @rest.should_receive(:delete_rest).with('cookbooks/cheezburger/1.0.0')
+ expect(@rest).to receive(:delete_rest).with('cookbooks/cheezburger/1.0.0')
@knife.run
end
end
it "should exit if the regex is not provided" do
@knife.name_args = []
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/cookbook_create_spec.rb b/spec/unit/knife/cookbook_create_spec.rb
index 06475d3ac9..3354432d39 100644
--- a/spec/unit/knife/cookbook_create_spec.rb
+++ b/spec/unit/knife/cookbook_create_spec.rb
@@ -26,29 +26,29 @@ describe Chef::Knife::CookbookCreate do
@knife.config = {}
@knife.name_args = ["foobar"]
@stdout = StringIO.new
- @knife.stub(:stdout).and_return(@stdout)
+ allow(@knife).to receive(:stdout).and_return(@stdout)
end
describe "run" do
# Fixes CHEF-2579
it "should expand the path of the cookbook directory" do
- File.should_receive(:expand_path).with("~/tmp/monkeypants")
+ expect(File).to receive(:expand_path).with("~/tmp/monkeypants")
@knife.config = {:cookbook_path => "~/tmp/monkeypants"}
- @knife.stub(:create_cookbook)
- @knife.stub(:create_readme)
- @knife.stub(:create_changelog)
- @knife.stub(:create_metadata)
+ allow(@knife).to receive(:create_cookbook)
+ allow(@knife).to receive(:create_readme)
+ allow(@knife).to receive(:create_changelog)
+ allow(@knife).to receive(:create_metadata)
@knife.run
end
it "should create a new cookbook with default values to copyright name, email, readme format and license if those are not supplied" do
@dir = Dir.tmpdir
@knife.config = {:cookbook_path => @dir}
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "YOUR_COMPANY_NAME", "none")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "YOUR_COMPANY_NAME", "YOUR_EMAIL", "none", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "YOUR_COMPANY_NAME", "none")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "YOUR_COMPANY_NAME", "YOUR_EMAIL", "none", "md")
@knife.run
end
@@ -59,10 +59,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_copyright => "Opscode, Inc"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "YOUR_EMAIL", "none", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "YOUR_EMAIL", "none", "md")
@knife.run
end
@@ -74,10 +74,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_email => "nuo@opscode.com"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "none", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "none", "md")
@knife.run
end
@@ -90,10 +90,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_license => "apachev2"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "apachev2")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "apachev2", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "apachev2")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "apachev2", "md")
@knife.run
end
@@ -106,10 +106,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_license => false
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "none", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "none", "md")
@knife.run
end
@@ -122,10 +122,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_license => "false"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "none", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "none")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "none", "md")
@knife.run
end
@@ -138,10 +138,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_license => "gplv2"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv2")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "gplv2", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv2")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "gplv2", "md")
@knife.run
end
@@ -154,10 +154,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_license => "gplv3"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv3")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "gplv3", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "gplv3")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "gplv3", "md")
@knife.run
end
@@ -170,10 +170,10 @@ describe Chef::Knife::CookbookCreate do
:cookbook_license => "mit"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "md")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "md")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "md")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "md")
@knife.run
end
@@ -187,10 +187,10 @@ describe Chef::Knife::CookbookCreate do
:readme_format => "rdoc"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "rdoc")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "rdoc")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "rdoc")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "rdoc")
@knife.run
end
@@ -204,10 +204,10 @@ describe Chef::Knife::CookbookCreate do
:readme_format => "mkd"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "mkd")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "mkd")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "mkd")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "mkd")
@knife.run
end
@@ -221,10 +221,10 @@ describe Chef::Knife::CookbookCreate do
:readme_format => "txt"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "txt")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "txt")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "txt")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "txt")
@knife.run
end
@@ -238,10 +238,10 @@ describe Chef::Knife::CookbookCreate do
:readme_format => "foo"
}
@knife.name_args=["foobar"]
- @knife.should_receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
- @knife.should_receive(:create_readme).with(@dir, @knife.name_args.first, "foo")
- @knife.should_receive(:create_changelog).with(@dir, @knife.name_args.first)
- @knife.should_receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "foo")
+ expect(@knife).to receive(:create_cookbook).with(@dir, @knife.name_args.first, "Opscode, Inc", "mit")
+ expect(@knife).to receive(:create_readme).with(@dir, @knife.name_args.first, "foo")
+ expect(@knife).to receive(:create_changelog).with(@dir, @knife.name_args.first)
+ expect(@knife).to receive(:create_metadata).with(@dir, @knife.name_args.first, "Opscode, Inc", "nuo@opscode.com", "mit", "foo")
@knife.run
end
@@ -252,7 +252,7 @@ describe Chef::Knife::CookbookCreate do
it "should throw an argument error" do
@dir = Dir.tmpdir
- lambda{@knife.run}.should raise_error(ArgumentError)
+ expect{@knife.run}.to raise_error(ArgumentError)
end
end
diff --git a/spec/unit/knife/cookbook_delete_spec.rb b/spec/unit/knife/cookbook_delete_spec.rb
index 53b120be71..4e75a689e3 100644
--- a/spec/unit/knife/cookbook_delete_spec.rb
+++ b/spec/unit/knife/cookbook_delete_spec.rb
@@ -24,29 +24,29 @@ describe Chef::Knife::CookbookDelete do
@knife.name_args = ['foobar']
@knife.cookbook_name = 'foobar'
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
@stderr = StringIO.new
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
describe 'run' do
it 'should print usage and exit when a cookbook name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
describe 'when specifying a cookbook name' do
it 'should delete the cookbook without a specific version' do
- @knife.should_receive(:delete_without_explicit_version)
+ expect(@knife).to receive(:delete_without_explicit_version)
@knife.run
end
describe 'and a version' do
it 'should delete the specific version of the cookbook' do
@knife.name_args << '1.0.0'
- @knife.should_receive(:delete_explicit_version)
+ expect(@knife).to receive(:delete_explicit_version)
@knife.run
end
end
@@ -54,7 +54,7 @@ describe Chef::Knife::CookbookDelete do
describe 'with -a or --all' do
it 'should delete all versions of the cookbook' do
@knife.config[:all] = true
- @knife.should_receive(:delete_all_versions)
+ expect(@knife).to receive(:delete_all_versions)
@knife.run
end
end
@@ -62,9 +62,9 @@ describe Chef::Knife::CookbookDelete do
describe 'with -p or --purge' do
it 'should prompt to purge the files' do
@knife.config[:purge] = true
- @knife.should_receive(:confirm).
+ expect(@knife).to receive(:confirm).
with(/.+Are you sure you want to purge files.+/)
- @knife.should_receive(:delete_without_explicit_version)
+ expect(@knife).to receive(:delete_without_explicit_version)
@knife.run
end
end
@@ -75,10 +75,10 @@ describe Chef::Knife::CookbookDelete do
it 'should delete the specific cookbook version' do
@knife.cookbook_name = 'foobar'
@knife.version = '1.0.0'
- @knife.should_receive(:delete_object).with(Chef::CookbookVersion,
+ expect(@knife).to receive(:delete_object).with(Chef::CookbookVersion,
'foobar version 1.0.0',
'cookbook').and_yield()
- @knife.should_receive(:delete_request).with('cookbooks/foobar/1.0.0')
+ expect(@knife).to receive(:delete_request).with('cookbooks/foobar/1.0.0')
@knife.delete_explicit_version
end
end
@@ -86,8 +86,8 @@ describe Chef::Knife::CookbookDelete do
describe 'delete_all_versions' do
it 'should prompt to delete all versions of the cookbook' do
@knife.cookbook_name = 'foobar'
- @knife.should_receive(:confirm).with('Do you really want to delete all versions of foobar')
- @knife.should_receive(:delete_all_without_confirmation)
+ expect(@knife).to receive(:confirm).with('Do you really want to delete all versions of foobar')
+ expect(@knife).to receive(:delete_all_without_confirmation)
@knife.delete_all_versions
end
end
@@ -95,9 +95,9 @@ describe Chef::Knife::CookbookDelete do
describe 'delete_all_without_confirmation' do
it 'should delete all versions without confirmation' do
versions = ['1.0.0', '1.1.0']
- @knife.should_receive(:available_versions).and_return(versions)
+ expect(@knife).to receive(:available_versions).and_return(versions)
versions.each do |v|
- @knife.should_receive(:delete_version_without_confirmation).with(v)
+ expect(@knife).to receive(:delete_version_without_confirmation).with(v)
end
@knife.delete_all_without_confirmation
end
@@ -105,20 +105,20 @@ describe Chef::Knife::CookbookDelete do
describe 'delete_without_explicit_version' do
it 'should exit if there are no available versions' do
- @knife.should_receive(:available_versions).and_return(nil)
- lambda { @knife.delete_without_explicit_version }.should raise_error(SystemExit)
+ expect(@knife).to receive(:available_versions).and_return(nil)
+ expect { @knife.delete_without_explicit_version }.to raise_error(SystemExit)
end
it 'should delete the version if only one is found' do
- @knife.should_receive(:available_versions).at_least(:once).and_return(['1.0.0'])
- @knife.should_receive(:delete_explicit_version)
+ expect(@knife).to receive(:available_versions).at_least(:once).and_return(['1.0.0'])
+ expect(@knife).to receive(:delete_explicit_version)
@knife.delete_without_explicit_version
end
it 'should ask which version(s) to delete if multiple are found' do
- @knife.should_receive(:available_versions).at_least(:once).and_return(['1.0.0', '1.1.0'])
- @knife.should_receive(:ask_which_versions_to_delete).and_return(['1.0.0', '1.1.0'])
- @knife.should_receive(:delete_versions_without_confirmation).with(['1.0.0', '1.1.0'])
+ expect(@knife).to receive(:available_versions).at_least(:once).and_return(['1.0.0', '1.1.0'])
+ expect(@knife).to receive(:ask_which_versions_to_delete).and_return(['1.0.0', '1.1.0'])
+ expect(@knife).to receive(:delete_versions_without_confirmation).with(['1.0.0', '1.1.0'])
@knife.delete_without_explicit_version
end
end
@@ -126,7 +126,7 @@ describe Chef::Knife::CookbookDelete do
describe 'available_versions' do
before(:each) do
@rest_mock = double('rest')
- @knife.should_receive(:rest).and_return(@rest_mock)
+ expect(@knife).to receive(:rest).and_return(@rest_mock)
@cookbook_data = { 'foobar' => { 'versions' => [{'version' => '1.0.0'},
{'version' => '1.1.0'},
{'version' => '2.0.0'} ]}
@@ -134,85 +134,85 @@ describe Chef::Knife::CookbookDelete do
end
it 'should return the list of versions of the cookbook' do
- @rest_mock.should_receive(:get_rest).with('cookbooks/foobar').and_return(@cookbook_data)
- @knife.available_versions.should == ['1.0.0', '1.1.0', '2.0.0']
+ expect(@rest_mock).to receive(:get_rest).with('cookbooks/foobar').and_return(@cookbook_data)
+ expect(@knife.available_versions).to eq(['1.0.0', '1.1.0', '2.0.0'])
end
it 'should raise if an error other than HTTP 404 is returned' do
exception = Net::HTTPServerException.new('500 Internal Server Error', '500')
- @rest_mock.should_receive(:get_rest).and_raise(exception)
- lambda { @knife.available_versions }.should raise_error Net::HTTPServerException
+ expect(@rest_mock).to receive(:get_rest).and_raise(exception)
+ expect { @knife.available_versions }.to raise_error Net::HTTPServerException
end
describe "if the cookbook can't be found" do
before(:each) do
- @rest_mock.should_receive(:get_rest).
+ expect(@rest_mock).to receive(:get_rest).
and_raise(Net::HTTPServerException.new('404 Not Found', '404'))
end
it 'should print an error' do
@knife.available_versions
- @stderr.string.should match /error.+cannot find a cookbook named foobar/i
+ expect(@stderr.string).to match /error.+cannot find a cookbook named foobar/i
end
it 'should return nil' do
- @knife.available_versions.should == nil
+ expect(@knife.available_versions).to eq(nil)
end
end
end
describe 'ask_which_version_to_delete' do
before(:each) do
- @knife.stub(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0'])
+ allow(@knife).to receive(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0'])
end
it 'should prompt the user to select a version' do
prompt = /Which version\(s\) do you want to delete\?.+1\. foobar 1\.0\.0.+2\. foobar 1\.1\.0.+3\. foobar 2\.0\.0.+4\. All versions.+/m
- @knife.should_receive(:ask_question).with(prompt).and_return('1')
+ expect(@knife).to receive(:ask_question).with(prompt).and_return('1')
@knife.ask_which_versions_to_delete
end
it "should print an error and exit if a version wasn't specified" do
- @knife.should_receive(:ask_question).and_return('')
- @knife.ui.should_receive(:error).with(/no versions specified/i)
- lambda { @knife.ask_which_versions_to_delete }.should raise_error(SystemExit)
+ expect(@knife).to receive(:ask_question).and_return('')
+ expect(@knife.ui).to receive(:error).with(/no versions specified/i)
+ expect { @knife.ask_which_versions_to_delete }.to raise_error(SystemExit)
end
it 'should print an error if an invalid choice was selected' do
- @knife.should_receive(:ask_question).and_return('100')
- @knife.ui.should_receive(:error).with(/100 is not a valid choice/i)
+ expect(@knife).to receive(:ask_question).and_return('100')
+ expect(@knife.ui).to receive(:error).with(/100 is not a valid choice/i)
@knife.ask_which_versions_to_delete
end
it 'should return the selected versions' do
- @knife.should_receive(:ask_question).and_return('1, 3')
- @knife.ask_which_versions_to_delete.should == ['1.0.0', '2.0.0']
+ expect(@knife).to receive(:ask_question).and_return('1, 3')
+ expect(@knife.ask_which_versions_to_delete).to eq(['1.0.0', '2.0.0'])
end
it "should return all of the versions if 'all' was selected" do
- @knife.should_receive(:ask_question).and_return('4')
- @knife.ask_which_versions_to_delete.should == [:all]
+ expect(@knife).to receive(:ask_question).and_return('4')
+ expect(@knife.ask_which_versions_to_delete).to eq([:all])
end
end
describe 'delete_version_without_confirmation' do
it 'should delete the cookbook version' do
- @knife.should_receive(:delete_request).with('cookbooks/foobar/1.0.0')
+ expect(@knife).to receive(:delete_request).with('cookbooks/foobar/1.0.0')
@knife.delete_version_without_confirmation('1.0.0')
end
it 'should output that the cookbook was deleted' do
- @knife.stub(:delete_request)
+ allow(@knife).to receive(:delete_request)
@knife.delete_version_without_confirmation('1.0.0')
- @stderr.string.should match /deleted cookbook\[foobar\]\[1.0.0\]/im
+ expect(@stderr.string).to match /deleted cookbook\[foobar\]\[1.0.0\]/im
end
describe 'with --print-after' do
it 'should display the cookbook data' do
object = ''
@knife.config[:print_after] = true
- @knife.stub(:delete_request).and_return(object)
- @knife.should_receive(:format_for_display).with(object)
+ allow(@knife).to receive(:delete_request).and_return(object)
+ expect(@knife).to receive(:format_for_display).with(object)
@knife.delete_version_without_confirmation('1.0.0')
end
end
@@ -222,7 +222,7 @@ describe Chef::Knife::CookbookDelete do
it 'should delete each version without confirmation' do
versions = ['1.0.0', '1.1.0']
versions.each do |v|
- @knife.should_receive(:delete_version_without_confirmation).with(v)
+ expect(@knife).to receive(:delete_version_without_confirmation).with(v)
end
@knife.delete_versions_without_confirmation(versions)
end
@@ -230,7 +230,7 @@ describe Chef::Knife::CookbookDelete do
describe 'with -a or --all' do
it 'should delete all versions without confirmation' do
versions = [:all]
- @knife.should_receive(:delete_all_without_confirmation)
+ expect(@knife).to receive(:delete_all_without_confirmation)
@knife.delete_versions_without_confirmation(versions)
end
end
diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb
index 6f40a3396b..7ca1adfcb5 100644
--- a/spec/unit/knife/cookbook_download_spec.rb
+++ b/spec/unit/knife/cookbook_download_spec.rb
@@ -22,22 +22,22 @@ describe Chef::Knife::CookbookDownload do
before(:each) do
@knife = Chef::Knife::CookbookDownload.new
@stderr = StringIO.new
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
describe 'run' do
it 'should print usage and exit when a cookbook name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal).with(/must specify a cookbook name/)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal).with(/must specify a cookbook name/)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should exit with a fatal error when there is no cookbook on the server' do
@knife.name_args = ['foobar', nil]
- @knife.should_receive(:determine_version).and_return(nil)
- @knife.ui.should_receive(:fatal).with('No such cookbook found')
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:determine_version).and_return(nil)
+ expect(@knife.ui).to receive(:fatal).with('No such cookbook found')
+ expect { @knife.run }.to raise_error(SystemExit)
end
describe 'with a cookbook name' do
@@ -45,7 +45,7 @@ describe Chef::Knife::CookbookDownload do
@knife.name_args = ['foobar']
@knife.config[:download_directory] = '/var/tmp/chef'
@rest_mock = double('rest')
- @knife.stub(:rest).and_return(@rest_mock)
+ allow(@knife).to receive(:rest).and_return(@rest_mock)
@manifest_data = {
:recipes => [
@@ -67,17 +67,17 @@ describe Chef::Knife::CookbookDownload do
}
@cookbook_mock = double('cookbook')
- @cookbook_mock.stub(:version).and_return('1.0.0')
- @cookbook_mock.stub(:manifest).and_return(@manifest_data)
- @rest_mock.should_receive(:get_rest).with('cookbooks/foobar/1.0.0').
+ allow(@cookbook_mock).to receive(:version).and_return('1.0.0')
+ allow(@cookbook_mock).to receive(:manifest).and_return(@manifest_data)
+ expect(@rest_mock).to receive(:get_rest).with('cookbooks/foobar/1.0.0').
and_return(@cookbook_mock)
end
it 'should determine which version if one was not explicitly specified'do
- @cookbook_mock.stub(:manifest).and_return({})
- @knife.should_receive(:determine_version).and_return('1.0.0')
- File.should_receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(false)
- Chef::CookbookVersion.stub(:COOKBOOK_SEGEMENTS).and_return([])
+ allow(@cookbook_mock).to receive(:manifest).and_return({})
+ expect(@knife).to receive(:determine_version).and_return('1.0.0')
+ expect(File).to receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(false)
+ allow(Chef::CookbookVersion).to receive(:COOKBOOK_SEGEMENTS).and_return([])
@knife.run
end
@@ -88,50 +88,50 @@ describe Chef::Knife::CookbookDownload do
@files_mocks = {}
@files.map { |f| File.basename(f) }.flatten.uniq.each do |f|
@files_mocks[f] = double("#{f}_mock")
- @files_mocks[f].stub(:path).and_return("/var/tmp/#{f}")
+ allow(@files_mocks[f]).to receive(:path).and_return("/var/tmp/#{f}")
end
end
it 'should print an error and exit if the cookbook download directory already exists' do
- File.should_receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(true)
- @knife.ui.should_receive(:fatal).with(/\/var\/tmp\/chef\/foobar-1\.0\.0 exists/i)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(File).to receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(true)
+ expect(@knife.ui).to receive(:fatal).with(/\/var\/tmp\/chef\/foobar-1\.0\.0 exists/i)
+ expect { @knife.run }.to raise_error(SystemExit)
end
describe 'when downloading the cookbook' do
before(:each) do
@files.map { |f| File.dirname(f) }.flatten.uniq.each do |dir|
- FileUtils.should_receive(:mkdir_p).with("/var/tmp/chef/foobar-1.0.0/#{dir}").
+ expect(FileUtils).to receive(:mkdir_p).with("/var/tmp/chef/foobar-1.0.0/#{dir}").
at_least(:once)
end
@files_mocks.each_pair do |file, mock|
- @rest_mock.should_receive(:get_rest).with("http://example.org/files/#{file}", true).
+ expect(@rest_mock).to receive(:get_rest).with("http://example.org/files/#{file}", true).
and_return(mock)
end
- @rest_mock.should_receive(:sign_on_redirect=).with(false).at_least(:once)
+ expect(@rest_mock).to receive(:sign_on_redirect=).with(false).at_least(:once)
@files.each do |f|
- FileUtils.should_receive(:mv).
+ expect(FileUtils).to receive(:mv).
with("/var/tmp/#{File.basename(f)}", "/var/tmp/chef/foobar-1.0.0/#{f}")
end
end
it "should download the cookbook when the cookbook download directory doesn't exist" do
- File.should_receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(false)
+ expect(File).to receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(false)
@knife.run
['attributes', 'recipes', 'templates'].each do |segment|
- @stderr.string.should match /downloading #{segment}/im
+ expect(@stderr.string).to match /downloading #{segment}/im
end
- @stderr.string.should match /downloading foobar cookbook version 1\.0\.0/im
- @stderr.string.should match /cookbook downloaded to \/var\/tmp\/chef\/foobar-1\.0\.0/im
+ expect(@stderr.string).to match /downloading foobar cookbook version 1\.0\.0/im
+ expect(@stderr.string).to match /cookbook downloaded to \/var\/tmp\/chef\/foobar-1\.0\.0/im
end
describe 'with -f or --force' do
it 'should remove the existing the cookbook download directory if it exists' do
@knife.config[:force] = true
- File.should_receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(true)
- FileUtils.should_receive(:rm_rf).with('/var/tmp/chef/foobar-1.0.0')
+ expect(File).to receive(:exists?).with('/var/tmp/chef/foobar-1.0.0').and_return(true)
+ expect(FileUtils).to receive(:rm_rf).with('/var/tmp/chef/foobar-1.0.0')
@knife.run
end
end
@@ -145,30 +145,30 @@ describe Chef::Knife::CookbookDownload do
describe 'determine_version' do
it 'should return nil if there are no versions' do
- @knife.should_receive(:available_versions).and_return(nil)
- @knife.determine_version.should == nil
- @knife.version.should == nil
+ expect(@knife).to receive(:available_versions).and_return(nil)
+ expect(@knife.determine_version).to eq(nil)
+ expect(@knife.version).to eq(nil)
end
it 'should return and set the version if there is only one version' do
- @knife.should_receive(:available_versions).at_least(:once).and_return(['1.0.0'])
- @knife.determine_version.should == '1.0.0'
- @knife.version.should == '1.0.0'
+ expect(@knife).to receive(:available_versions).at_least(:once).and_return(['1.0.0'])
+ expect(@knife.determine_version).to eq('1.0.0')
+ expect(@knife.version).to eq('1.0.0')
end
it 'should ask which version to download and return it if there is more than one' do
- @knife.should_receive(:available_versions).at_least(:once).and_return(['1.0.0', '2.0.0'])
- @knife.should_receive(:ask_which_version).and_return('1.0.0')
- @knife.determine_version.should == '1.0.0'
+ expect(@knife).to receive(:available_versions).at_least(:once).and_return(['1.0.0', '2.0.0'])
+ expect(@knife).to receive(:ask_which_version).and_return('1.0.0')
+ expect(@knife.determine_version).to eq('1.0.0')
end
describe 'with -N or --latest' do
it 'should return and set the version to the latest version' do
@knife.config[:latest] = true
- @knife.should_receive(:available_versions).at_least(:once).
+ expect(@knife).to receive(:available_versions).at_least(:once).
and_return(['1.0.0', '1.1.0', '2.0.0'])
@knife.determine_version
- @knife.version.to_s.should == '2.0.0'
+ expect(@knife.version.to_s).to eq('2.0.0')
end
end
end
@@ -179,23 +179,23 @@ describe Chef::Knife::CookbookDownload do
end
it 'should return nil if there are no versions' do
- Chef::CookbookVersion.should_receive(:available_versions).
+ expect(Chef::CookbookVersion).to receive(:available_versions).
with('foobar').
and_return(nil)
- @knife.available_versions.should == nil
+ expect(@knife.available_versions).to eq(nil)
end
it 'should return the available versions' do
- Chef::CookbookVersion.should_receive(:available_versions).
+ expect(Chef::CookbookVersion).to receive(:available_versions).
with('foobar').
and_return(['1.1.0', '2.0.0', '1.0.0'])
- @knife.available_versions.should == [Chef::Version.new('1.0.0'),
+ expect(@knife.available_versions).to eq([Chef::Version.new('1.0.0'),
Chef::Version.new('1.1.0'),
- Chef::Version.new('2.0.0')]
+ Chef::Version.new('2.0.0')])
end
it 'should avoid multiple API calls to the server' do
- Chef::CookbookVersion.should_receive(:available_versions).
+ expect(Chef::CookbookVersion).to receive(:available_versions).
once.
with('foobar').
and_return(['1.1.0', '2.0.0', '1.0.0'])
@@ -207,31 +207,31 @@ describe Chef::Knife::CookbookDownload do
describe 'ask_which_version' do
before(:each) do
@knife.cookbook_name = 'foobar'
- @knife.stub(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0'])
+ allow(@knife).to receive(:available_versions).and_return(['1.0.0', '1.1.0', '2.0.0'])
end
it 'should prompt the user to select a version' do
prompt = /Which version do you want to download\?.+1\. foobar 1\.0\.0.+2\. foobar 1\.1\.0.+3\. foobar 2\.0\.0.+/m
- @knife.should_receive(:ask_question).with(prompt).and_return('1')
+ expect(@knife).to receive(:ask_question).with(prompt).and_return('1')
@knife.ask_which_version
end
it "should set the version to the user's selection" do
- @knife.should_receive(:ask_question).and_return('1')
+ expect(@knife).to receive(:ask_question).and_return('1')
@knife.ask_which_version
- @knife.version.should == '1.0.0'
+ expect(@knife.version).to eq('1.0.0')
end
it "should print an error and exit if a version wasn't specified" do
- @knife.should_receive(:ask_question).and_return('')
- @knife.ui.should_receive(:error).with(/is not a valid value/i)
- lambda { @knife.ask_which_version }.should raise_error(SystemExit)
+ expect(@knife).to receive(:ask_question).and_return('')
+ expect(@knife.ui).to receive(:error).with(/is not a valid value/i)
+ expect { @knife.ask_which_version }.to raise_error(SystemExit)
end
it 'should print an error if an invalid choice was selected' do
- @knife.should_receive(:ask_question).and_return('100')
- @knife.ui.should_receive(:error).with(/'100' is not a valid value/i)
- lambda { @knife.ask_which_version }.should raise_error(SystemExit)
+ expect(@knife).to receive(:ask_question).and_return('100')
+ expect(@knife.ui).to receive(:error).with(/'100' is not a valid value/i)
+ expect { @knife.ask_which_version }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/cookbook_list_spec.rb b/spec/unit/knife/cookbook_list_spec.rb
index 9ff16edb37..559f700bb4 100644
--- a/spec/unit/knife/cookbook_list_spec.rb
+++ b/spec/unit/knife/cookbook_list_spec.rb
@@ -22,7 +22,7 @@ describe Chef::Knife::CookbookList do
before do
@knife = Chef::Knife::CookbookList.new
@rest_mock = double('rest')
- @knife.stub(:rest).and_return(@rest_mock)
+ allow(@knife).to receive(:rest).and_return(@rest_mock)
@cookbook_names = ['apache2', 'mysql']
@base_url = 'https://server.example.com/cookbooks'
@cookbook_data = {}
@@ -32,22 +32,22 @@ describe Chef::Knife::CookbookList do
'url' => "#{@base_url}/#{item}/1.0.1"}]}
end
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe 'run' do
it 'should display the latest version of the cookbooks' do
- @rest_mock.should_receive(:get_rest).with('/cookbooks?num_versions=1').
+ expect(@rest_mock).to receive(:get_rest).with('/cookbooks?num_versions=1').
and_return(@cookbook_data)
@knife.run
@cookbook_names.each do |item|
- @stdout.string.should match /#{item}\s+1\.0\.1/
+ expect(@stdout.string).to match /#{item}\s+1\.0\.1/
end
end
it 'should query cookbooks for the configured environment' do
@knife.config[:environment] = 'production'
- @rest_mock.should_receive(:get_rest).
+ expect(@rest_mock).to receive(:get_rest).
with('/environments/production/cookbooks?num_versions=1').
and_return(@cookbook_data)
@knife.run
@@ -56,11 +56,11 @@ describe Chef::Knife::CookbookList do
describe 'with -w or --with-uri' do
it 'should display the cookbook uris' do
@knife.config[:with_uri] = true
- @rest_mock.stub(:get_rest).and_return(@cookbook_data)
+ allow(@rest_mock).to receive(:get_rest).and_return(@cookbook_data)
@knife.run
@cookbook_names.each do |item|
pattern = /#{Regexp.escape(@cookbook_data[item]['versions'].first['url'])}/
- @stdout.string.should match pattern
+ expect(@stdout.string).to match pattern
end
end
end
@@ -75,11 +75,11 @@ describe Chef::Knife::CookbookList do
it 'should display all versions of the cookbooks' do
@knife.config[:all_versions] = true
- @rest_mock.should_receive(:get_rest).with('/cookbooks?num_versions=all').
+ expect(@rest_mock).to receive(:get_rest).with('/cookbooks?num_versions=all').
and_return(@cookbook_data)
@knife.run
@cookbook_names.each do |item|
- @stdout.string.should match /#{item}\s+1\.0\.1\s+1\.0\.0/
+ expect(@stdout.string).to match /#{item}\s+1\.0\.1\s+1\.0\.0/
end
end
end
diff --git a/spec/unit/knife/cookbook_metadata_from_file_spec.rb b/spec/unit/knife/cookbook_metadata_from_file_spec.rb
index 68ab6740ab..456e378ca2 100644
--- a/spec/unit/knife/cookbook_metadata_from_file_spec.rb
+++ b/spec/unit/knife/cookbook_metadata_from_file_spec.rb
@@ -27,10 +27,10 @@ describe Chef::Knife::CookbookMetadataFromFile do
@tgt = File.expand_path(File.join(CHEF_SPEC_DATA, "metadata", "quick_start", "metadata.json"))
@knife = Chef::Knife::CookbookMetadataFromFile.new
@knife.name_args = [ @src ]
- @knife.stub(:to_json_pretty).and_return(true)
+ allow(@knife).to receive(:to_json_pretty).and_return(true)
@md = Chef::Cookbook::Metadata.new
- Chef::Cookbook::Metadata.stub(:new).and_return(@md)
- $stdout.stub(:write)
+ allow(Chef::Cookbook::Metadata).to receive(:new).and_return(@md)
+ allow($stdout).to receive(:write)
end
after do
@@ -41,23 +41,23 @@ describe Chef::Knife::CookbookMetadataFromFile do
describe "run" do
it "should determine cookbook name from path" do
- @md.should_receive(:name).with()
- @md.should_receive(:name).with("quick_start")
+ expect(@md).to receive(:name).with(no_args)
+ expect(@md).to receive(:name).with("quick_start")
@knife.run
end
it "should load the metadata source" do
- @md.should_receive(:from_file).with(@src)
+ expect(@md).to receive(:from_file).with(@src)
@knife.run
end
it "should write out the metadata to the correct location" do
- File.should_receive(:open).with(@tgt, "w")
+ expect(File).to receive(:open).with(@tgt, "w")
@knife.run
end
it "should generate json from the metadata" do
- Chef::JSONCompat.should_receive(:to_json_pretty).with(@md)
+ expect(Chef::JSONCompat).to receive(:to_json_pretty).with(@md)
@knife.run
end
diff --git a/spec/unit/knife/cookbook_metadata_spec.rb b/spec/unit/knife/cookbook_metadata_spec.rb
index 1d6568739c..861d85f1f7 100644
--- a/spec/unit/knife/cookbook_metadata_spec.rb
+++ b/spec/unit/knife/cookbook_metadata_spec.rb
@@ -26,25 +26,25 @@ describe Chef::Knife::CookbookMetadata do
@json_data = '{ "version": "1.0.0" }'
@stdout = StringIO.new
@stderr = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
describe 'run' do
it 'should print an error and exit if a cookbook name was not provided' do
@knife.name_args = []
- @knife.ui.should_receive(:error).with(/you must specify the cookbook.+use the --all/i)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:error).with(/you must specify the cookbook.+use the --all/i)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should print an error and exit if an empty cookbook name was provided' do
@knife.name_args = ['']
- @knife.ui.should_receive(:error).with(/you must specify the cookbook.+use the --all/i)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:error).with(/you must specify the cookbook.+use the --all/i)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should generate the metadata for the cookbook' do
- @knife.should_receive(:generate_metadata).with('foobar')
+ expect(@knife).to receive(:generate_metadata).with('foobar')
@knife.run
end
@@ -59,21 +59,21 @@ describe Chef::Knife::CookbookMetadata do
"foo" => @foo,
"bar" => @bar
}
- @cookbook_loader.should_receive(:load_cookbooks).and_return(@cookbook_loader)
- @knife.should_receive(:generate_metadata).with('foo')
- @knife.should_receive(:generate_metadata).with('bar')
+ expect(@cookbook_loader).to receive(:load_cookbooks).and_return(@cookbook_loader)
+ expect(@knife).to receive(:generate_metadata).with('foo')
+ expect(@knife).to receive(:generate_metadata).with('bar')
end
it 'should generate the metadata for each cookbook' do
Chef::Config[:cookbook_path] = @cookbook_dir
- Chef::CookbookLoader.should_receive(:new).with(@cookbook_dir).and_return(@cookbook_loader)
+ expect(Chef::CookbookLoader).to receive(:new).with(@cookbook_dir).and_return(@cookbook_loader)
@knife.run
end
describe 'and with -o or --cookbook-path' do
it 'should look in the provided path and generate cookbook metadata' do
@knife.config[:cookbook_path] = '/opt/chef/cookbooks'
- Chef::CookbookLoader.should_receive(:new).with('/opt/chef/cookbooks').and_return(@cookbook_loader)
+ expect(Chef::CookbookLoader).to receive(:new).with('/opt/chef/cookbooks').and_return(@cookbook_loader)
@knife.run
end
end
@@ -84,21 +84,21 @@ describe Chef::Knife::CookbookMetadata do
describe 'generate_metadata' do
before(:each) do
@knife.config[:cookbook_path] = @cookbook_dir
- File.stub(:expand_path).with("#{@cookbook_dir}/foobar/metadata.rb").
+ allow(File).to receive(:expand_path).with("#{@cookbook_dir}/foobar/metadata.rb").
and_return("#{@cookbook_dir}/foobar/metadata.rb")
end
it 'should generate the metadata from metadata.rb if it exists' do
- File.should_receive(:exists?).with("#{@cookbook_dir}/foobar/metadata.rb").
+ expect(File).to receive(:exists?).with("#{@cookbook_dir}/foobar/metadata.rb").
and_return(true)
- @knife.should_receive(:generate_metadata_from_file).with('foobar', "#{@cookbook_dir}/foobar/metadata.rb")
+ expect(@knife).to receive(:generate_metadata_from_file).with('foobar', "#{@cookbook_dir}/foobar/metadata.rb")
@knife.run
end
it 'should validate the metadata json if metadata.rb does not exist' do
- File.should_receive(:exists?).with("#{@cookbook_dir}/foobar/metadata.rb").
+ expect(File).to receive(:exists?).with("#{@cookbook_dir}/foobar/metadata.rb").
and_return(false)
- @knife.should_receive(:validate_metadata_json).with(@cookbook_dir, 'foobar')
+ expect(@knife).to receive(:validate_metadata_json).with(@cookbook_dir, 'foobar')
@knife.run
end
end
@@ -110,16 +110,16 @@ describe Chef::Knife::CookbookMetadata do
end
it 'should generate the metatdata json from metatdata.rb' do
- Chef::Cookbook::Metadata.stub(:new).and_return(@metadata_mock)
- @metadata_mock.should_receive(:name).with('foobar')
- @metadata_mock.should_receive(:from_file).with("#{@cookbook_dir}/foobar/metadata.rb")
- File.should_receive(:open).with("#{@cookbook_dir}/foobar/metadata.json", 'w').
+ allow(Chef::Cookbook::Metadata).to receive(:new).and_return(@metadata_mock)
+ expect(@metadata_mock).to receive(:name).with('foobar')
+ expect(@metadata_mock).to receive(:from_file).with("#{@cookbook_dir}/foobar/metadata.rb")
+ expect(File).to receive(:open).with("#{@cookbook_dir}/foobar/metadata.json", 'w').
and_yield(@json_file_mock)
- @json_file_mock.should_receive(:write).with(@json_data)
- Chef::JSONCompat.should_receive(:to_json_pretty).with(@metadata_mock).
+ expect(@json_file_mock).to receive(:write).with(@json_data)
+ expect(Chef::JSONCompat).to receive(:to_json_pretty).with(@metadata_mock).
and_return(@json_data)
@knife.generate_metadata_from_file('foobar', "#{@cookbook_dir}/foobar/metadata.rb")
- @stderr.string.should match /generating metadata for foobar from #{@cookbook_dir}\/foobar\/metadata\.rb/im
+ expect(@stderr.string).to match /generating metadata for foobar from #{@cookbook_dir}\/foobar\/metadata\.rb/im
end
{ Chef::Exceptions::ObsoleteDependencySyntax => 'obsolote dependency',
@@ -127,32 +127,32 @@ describe Chef::Knife::CookbookMetadata do
}.each_pair do |klass, description|
it "should print an error and exit when an #{description} syntax exception is encountered" do
exception = klass.new("#{description} blah")
- Chef::Cookbook::Metadata.stub(:new).and_raise(exception)
- lambda {
+ allow(Chef::Cookbook::Metadata).to receive(:new).and_raise(exception)
+ expect {
@knife.generate_metadata_from_file('foobar', "#{@cookbook_dir}/foobar/metadata.rb")
- }.should raise_error(SystemExit)
- @stderr.string.should match /error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im
- @stderr.string.should match /in #{@cookbook_dir}\/foobar\/metadata\.rb/im
- @stderr.string.should match /#{description} blah/im
+ }.to raise_error(SystemExit)
+ expect(@stderr.string).to match /error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im
+ expect(@stderr.string).to match /in #{@cookbook_dir}\/foobar\/metadata\.rb/im
+ expect(@stderr.string).to match /#{description} blah/im
end
end
end
describe 'validate_metadata_json' do
it 'should validate the metadata json' do
- File.should_receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json").
+ expect(File).to receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json").
and_return(true)
- IO.should_receive(:read).with("#{@cookbook_dir}/foobar/metadata.json").
+ expect(IO).to receive(:read).with("#{@cookbook_dir}/foobar/metadata.json").
and_return(@json_data)
- Chef::Cookbook::Metadata.should_receive(:validate_json).with(@json_data)
+ expect(Chef::Cookbook::Metadata).to receive(:validate_json).with(@json_data)
@knife.validate_metadata_json(@cookbook_dir, 'foobar')
end
it 'should not try to validate the metadata json if the file does not exist' do
- File.should_receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json").
+ expect(File).to receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json").
and_return(false)
- IO.should_not_receive(:read)
- Chef::Cookbook::Metadata.should_not_receive(:validate_json)
+ expect(IO).not_to receive(:read)
+ expect(Chef::Cookbook::Metadata).not_to receive(:validate_json)
@knife.validate_metadata_json(@cookbook_dir, 'foobar')
end
@@ -160,18 +160,18 @@ describe Chef::Knife::CookbookMetadata do
Chef::Exceptions::InvalidVersionConstraint => 'invalid version constraint'
}.each_pair do |klass, description|
it "should print an error and exit when an #{description} syntax exception is encountered" do
- File.should_receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json").
+ expect(File).to receive(:exist?).with("#{@cookbook_dir}/foobar/metadata.json").
and_return(true)
- IO.should_receive(:read).with("#{@cookbook_dir}/foobar/metadata.json").
+ expect(IO).to receive(:read).with("#{@cookbook_dir}/foobar/metadata.json").
and_return(@json_data)
exception = klass.new("#{description} blah")
- Chef::Cookbook::Metadata.stub(:validate_json).and_raise(exception)
- lambda {
+ allow(Chef::Cookbook::Metadata).to receive(:validate_json).and_raise(exception)
+ expect {
@knife.validate_metadata_json(@cookbook_dir, 'foobar')
- }.should raise_error(SystemExit)
- @stderr.string.should match /error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im
- @stderr.string.should match /in #{@cookbook_dir}\/foobar\/metadata\.json/im
- @stderr.string.should match /#{description} blah/im
+ }.to raise_error(SystemExit)
+ expect(@stderr.string).to match /error: the cookbook 'foobar' contains invalid or obsolete metadata syntax/im
+ expect(@stderr.string).to match /in #{@cookbook_dir}\/foobar\/metadata\.json/im
+ expect(@stderr.string).to match /#{description} blah/im
end
end
end
diff --git a/spec/unit/knife/cookbook_show_spec.rb b/spec/unit/knife/cookbook_show_spec.rb
index b862c3154c..bf480e3678 100644
--- a/spec/unit/knife/cookbook_show_spec.rb
+++ b/spec/unit/knife/cookbook_show_spec.rb
@@ -26,18 +26,18 @@ describe Chef::Knife::CookbookShow do
@knife.config = { }
@knife.name_args = [ "cookbook_name" ]
@rest = double(Chef::REST)
- @knife.stub(:rest).and_return(@rest)
- @knife.stub(:pretty_print).and_return(true)
- @knife.stub(:output).and_return(true)
+ allow(@knife).to receive(:rest).and_return(@rest)
+ allow(@knife).to receive(:pretty_print).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
end
describe "run" do
describe "with 0 arguments: help" do
it 'should should print usage and exit when given no arguments' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
@@ -56,15 +56,15 @@ describe Chef::Knife::CookbookShow do
end
it "should show the raw cookbook data" do
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name").and_return(@response)
- @knife.should_receive(:format_cookbook_list_for_display).with(@response)
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name").and_return(@response)
+ expect(@knife).to receive(:format_cookbook_list_for_display).with(@response)
@knife.run
end
it "should respect the user-supplied environment" do
@knife.config[:environment] = "foo"
- @rest.should_receive(:get_rest).with("environments/foo/cookbooks/cookbook_name").and_return(@response)
- @knife.should_receive(:format_cookbook_list_for_display).with(@response)
+ expect(@rest).to receive(:get_rest).with("environments/foo/cookbooks/cookbook_name").and_return(@response)
+ expect(@knife).to receive(:format_cookbook_list_for_display).with(@response)
@knife.run
end
end
@@ -76,8 +76,8 @@ describe Chef::Knife::CookbookShow do
end
it "should show the specific part of a cookbook" do
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@response)
- @knife.should_receive(:output).with(@response)
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@response)
+ expect(@knife).to receive(:output).with(@response)
@knife.run
end
end
@@ -101,8 +101,8 @@ describe Chef::Knife::CookbookShow do
end
it "should print the json of the part" do
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
- @knife.should_receive(:output).with(@cookbook_response.manifest["recipes"])
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
+ expect(@knife).to receive(:output).with(@cookbook_response.manifest["recipes"])
@knife.run
end
end
@@ -125,9 +125,9 @@ describe Chef::Knife::CookbookShow do
end
it "should print the raw result of the request (likely a file!)" do
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
- @rest.should_receive(:get_rest).with("http://example.org/files/default.rb", true).and_return(StringIO.new(@response))
- @knife.should_receive(:pretty_print).with(@response)
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
+ expect(@rest).to receive(:get_rest).with("http://example.org/files/default.rb", true).and_return(StringIO.new(@response))
+ expect(@knife).to receive(:pretty_print).with(@response)
@knife.run
end
end
@@ -177,9 +177,9 @@ describe Chef::Knife::CookbookShow do
@knife.config[:platform] = "example_platform"
@knife.config[:platform_version] = "1.0"
@knife.config[:fqdn] = "examplehost.example.org"
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
- @rest.should_receive(:get_rest).with("http://example.org/files/1111", true).and_return(StringIO.new(@response))
- @knife.should_receive(:pretty_print).with(@response)
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
+ expect(@rest).to receive(:get_rest).with("http://example.org/files/1111", true).and_return(StringIO.new(@response))
+ expect(@knife).to receive(:pretty_print).with(@response)
@knife.run
end
end
@@ -189,9 +189,9 @@ describe Chef::Knife::CookbookShow do
@knife.config[:platform] = "ubuntu"
@knife.config[:platform_version] = "1.0"
@knife.config[:fqdn] = "differenthost.example.org"
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
- @rest.should_receive(:get_rest).with("http://example.org/files/3333", true).and_return(StringIO.new(@response))
- @knife.should_receive(:pretty_print).with(@response)
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
+ expect(@rest).to receive(:get_rest).with("http://example.org/files/3333", true).and_return(StringIO.new(@response))
+ expect(@knife).to receive(:pretty_print).with(@response)
@knife.run
end
end
@@ -201,18 +201,18 @@ describe Chef::Knife::CookbookShow do
@knife.config[:platform] = "ubuntu"
@knife.config[:platform_version] = "9.10"
@knife.config[:fqdn] = "differenthost.example.org"
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
- @rest.should_receive(:get_rest).with("http://example.org/files/2222", true).and_return(StringIO.new(@response))
- @knife.should_receive(:pretty_print).with(@response)
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
+ expect(@rest).to receive(:get_rest).with("http://example.org/files/2222", true).and_return(StringIO.new(@response))
+ expect(@knife).to receive(:pretty_print).with(@response)
@knife.run
end
end
describe "with none of the arguments, it should use the default" do
it "should pass them all" do
- @rest.should_receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
- @rest.should_receive(:get_rest).with("http://example.org/files/4444", true).and_return(StringIO.new(@response))
- @knife.should_receive(:pretty_print).with(@response)
+ expect(@rest).to receive(:get_rest).with("cookbooks/cookbook_name/0.1.0").and_return(@cookbook_response)
+ expect(@rest).to receive(:get_rest).with("http://example.org/files/4444", true).and_return(StringIO.new(@response))
+ expect(@knife).to receive(:pretty_print).with(@response)
@knife.run
end
end
diff --git a/spec/unit/knife/cookbook_site_download_spec.rb b/spec/unit/knife/cookbook_site_download_spec.rb
index 76ce6508d7..6676fb34a1 100644
--- a/spec/unit/knife/cookbook_site_download_spec.rb
+++ b/spec/unit/knife/cookbook_site_download_spec.rb
@@ -33,9 +33,9 @@ describe Chef::Knife::CookbookSiteDownload do
'latest_version' => "#{@cookbook_api_url}/apache2/versions/#{@version_us}",
'replacement' => 'other_apache2' }
- @knife.ui.stub(:stderr).and_return(@stderr)
- @knife.stub(:noauth_rest).and_return(@noauth_rest)
- @noauth_rest.should_receive(:get_rest).
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
+ allow(@knife).to receive(:noauth_rest).and_return(@noauth_rest)
+ expect(@noauth_rest).to receive(:get_rest).
with("#{@cookbook_api_url}/apache2").
and_return(@current_data)
end
@@ -46,9 +46,9 @@ describe Chef::Knife::CookbookSiteDownload do
end
it 'should warn with info about the replacement' do
- @knife.ui.should_receive(:warn).
+ expect(@knife.ui).to receive(:warn).
with(/.+deprecated.+replaced by other_apache2.+/i)
- @knife.ui.should_receive(:warn).
+ expect(@knife.ui).to receive(:warn).
with(/use --force.+download.+/i)
@knife.run
end
@@ -61,15 +61,15 @@ describe Chef::Knife::CookbookSiteDownload do
@temp_file = double( :path => "/tmp/apache2_#{@version_us}.tgz" )
@file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
- @noauth_rest.should_receive(:sign_on_redirect=).with(false)
+ expect(@noauth_rest).to receive(:sign_on_redirect=).with(false)
end
context 'downloading the latest version' do
before do
- @noauth_rest.should_receive(:get_rest).
+ expect(@noauth_rest).to receive(:get_rest).
with(@current_data['latest_version']).
and_return(@cookbook_data)
- @noauth_rest.should_receive(:get_rest).
+ expect(@noauth_rest).to receive(:get_rest).
with(@cookbook_data['file'], true).
and_return(@temp_file)
end
@@ -81,40 +81,40 @@ describe Chef::Knife::CookbookSiteDownload do
end
it 'should download the latest version' do
- @knife.ui.should_receive(:warn).
+ expect(@knife.ui).to receive(:warn).
with(/.+deprecated.+replaced by other_apache2.+/i)
- FileUtils.should_receive(:cp).with(@temp_file.path, @file)
+ expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
@knife.run
- @stderr.string.should match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- @stderr.string.should match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
+ expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
end
end
it 'should download the latest version' do
- FileUtils.should_receive(:cp).with(@temp_file.path, @file)
+ expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
@knife.run
- @stderr.string.should match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- @stderr.string.should match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
+ expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
end
context 'with -f or --file' do
before do
@file = '/opt/chef/cookbooks/apache2.tar.gz'
@knife.config[:file] = @file
- FileUtils.should_receive(:cp).with(@temp_file.path, @file)
+ expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
end
it 'should download the cookbook to the desired file' do
@knife.run
- @stderr.string.should match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- @stderr.string.should match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
+ expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
end
end
it 'should provide an accessor to the version' do
- FileUtils.stub(:cp).and_return(true)
- @knife.version.should == @version
+ allow(FileUtils).to receive(:cp).and_return(true)
+ expect(@knife.version).to eq(@version)
@knife.run
end
end
@@ -131,16 +131,16 @@ describe Chef::Knife::CookbookSiteDownload do
end
it 'should download the desired version' do
- @noauth_rest.should_receive(:get_rest).
+ expect(@noauth_rest).to receive(:get_rest).
with("#{@cookbook_api_url}/apache2/versions/#{@version_us}").
and_return(@cookbook_data)
- @noauth_rest.should_receive(:get_rest).
+ expect(@noauth_rest).to receive(:get_rest).
with(@cookbook_data['file'], true).
and_return(@temp_file)
- FileUtils.should_receive(:cp).with(@temp_file.path, @file)
+ expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
@knife.run
- @stderr.string.should match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
- @stderr.string.should match /cookbook save.+#{Regexp.escape(@file)}/i
+ expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i
+ expect(@stderr.string).to match /cookbook save.+#{Regexp.escape(@file)}/i
end
end
diff --git a/spec/unit/knife/cookbook_site_install_spec.rb b/spec/unit/knife/cookbook_site_install_spec.rb
index ff87a81b49..c4bd8f67d2 100644
--- a/spec/unit/knife/cookbook_site_install_spec.rb
+++ b/spec/unit/knife/cookbook_site_install_spec.rb
@@ -23,7 +23,7 @@ describe Chef::Knife::CookbookSiteInstall do
require 'chef/knife/core/cookbook_scm_repo'
@stdout = StringIO.new
@knife = Chef::Knife::CookbookSiteInstall.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
@knife.config = {}
if Chef::Platform.windows?
@install_path = 'C:/tmp/chef'
@@ -34,18 +34,18 @@ describe Chef::Knife::CookbookSiteInstall do
@stdout = StringIO.new
@stderr = StringIO.new
- @knife.stub(:stderr).and_return(@stdout)
- @knife.stub(:stdout).and_return(@stdout)
+ allow(@knife).to receive(:stderr).and_return(@stdout)
+ allow(@knife).to receive(:stdout).and_return(@stdout)
#Assume all external commands would have succeed. :(
- File.stub(:unlink)
- File.stub(:rmtree)
- @knife.stub(:shell_out!).and_return(true)
+ allow(File).to receive(:unlink)
+ allow(File).to receive(:rmtree)
+ allow(@knife).to receive(:shell_out!).and_return(true)
#CookbookSiteDownload Stup
@downloader = {}
- @knife.stub(:download_cookbook_to).and_return(@downloader)
- @downloader.stub(:version).and_return do
+ allow(@knife).to receive(:download_cookbook_to).and_return(@downloader)
+ allow(@downloader).to receive(:version) do
if @knife.name_args.size == 2
@knife.name_args[1]
else
@@ -57,49 +57,49 @@ describe Chef::Knife::CookbookSiteInstall do
@repo = double(:sanity_check => true, :reset_to_default_state => true,
:prepare_to_import => true, :finalize_updates_to => true,
:merge_updates_from => true)
- Chef::Knife::CookbookSCMRepo.stub(:new).and_return(@repo)
+ allow(Chef::Knife::CookbookSCMRepo).to receive(:new).and_return(@repo)
end
describe "run" do
it "should return an error if a cookbook name is not provided" do
@knife.name_args = []
- @knife.ui.should_receive(:error).with("Please specify a cookbook to download and install.")
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:error).with("Please specify a cookbook to download and install.")
+ expect { @knife.run }.to raise_error(SystemExit)
end
it "should return an error if more than two arguments are given" do
@knife.name_args = ["foo", "bar", "baz"]
- @knife.ui.should_receive(:error).with("Installing multiple cookbooks at once is not supported.")
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
+ expect { @knife.run }.to raise_error(SystemExit)
end
it "should return an error if the second argument is not a version" do
@knife.name_args = ["getting-started", "1pass"]
- @knife.ui.should_receive(:error).with("Installing multiple cookbooks at once is not supported.")
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
+ expect { @knife.run }.to raise_error(SystemExit)
end
it "should return an error if the second argument is a four-digit version" do
@knife.name_args = ["getting-started", "0.0.0.1"]
- @knife.ui.should_receive(:error).with("Installing multiple cookbooks at once is not supported.")
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
+ expect { @knife.run }.to raise_error(SystemExit)
end
it "should return an error if the second argument is a one-digit version" do
@knife.name_args = ["getting-started", "1"]
- @knife.ui.should_receive(:error).with("Installing multiple cookbooks at once is not supported.")
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
+ expect { @knife.run }.to raise_error(SystemExit)
end
it "should install the specified version if second argument is a three-digit version" do
@knife.name_args = ["getting-started", "0.1.0"]
@knife.config[:no_deps] = true
upstream_file = File.join(@install_path, "getting-started.tar.gz")
- @knife.should_receive(:download_cookbook_to).with(upstream_file)
- @knife.should_receive(:extract_cookbook).with(upstream_file, "0.1.0")
- @knife.should_receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
- @repo.should_receive(:merge_updates_from).with("getting-started", "0.1.0")
+ expect(@knife).to receive(:download_cookbook_to).with(upstream_file)
+ expect(@knife).to receive(:extract_cookbook).with(upstream_file, "0.1.0")
+ expect(@knife).to receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
+ expect(@repo).to receive(:merge_updates_from).with("getting-started", "0.1.0")
@knife.run
end
@@ -107,10 +107,10 @@ describe Chef::Knife::CookbookSiteInstall do
@knife.name_args = ["getting-started", "0.1"]
@knife.config[:no_deps] = true
upstream_file = File.join(@install_path, "getting-started.tar.gz")
- @knife.should_receive(:download_cookbook_to).with(upstream_file)
- @knife.should_receive(:extract_cookbook).with(upstream_file, "0.1")
- @knife.should_receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
- @repo.should_receive(:merge_updates_from).with("getting-started", "0.1")
+ expect(@knife).to receive(:download_cookbook_to).with(upstream_file)
+ expect(@knife).to receive(:extract_cookbook).with(upstream_file, "0.1")
+ expect(@knife).to receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
+ expect(@repo).to receive(:merge_updates_from).with("getting-started", "0.1")
@knife.run
end
@@ -118,10 +118,10 @@ describe Chef::Knife::CookbookSiteInstall do
@knife.name_args = ["getting-started"]
@knife.config[:no_deps] = true
upstream_file = File.join(@install_path, "getting-started.tar.gz")
- @knife.should_receive(:download_cookbook_to).with(upstream_file)
- @knife.should_receive(:extract_cookbook).with(upstream_file, "0.3.0")
- @knife.should_receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
- @repo.should_receive(:merge_updates_from).with("getting-started", "0.3.0")
+ expect(@knife).to receive(:download_cookbook_to).with(upstream_file)
+ expect(@knife).to receive(:extract_cookbook).with(upstream_file, "0.3.0")
+ expect(@knife).to receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
+ expect(@repo).to receive(:merge_updates_from).with("getting-started", "0.3.0")
@knife.run
end
@@ -130,8 +130,8 @@ describe Chef::Knife::CookbookSiteInstall do
@knife.config[:use_current_branch] = true
@knife.config[:no_deps] = true
upstream_file = File.join(@install_path, "getting-started.tar.gz")
- @repo.should_not_receive(:prepare_to_import)
- @repo.should_not_receive(:reset_to_default_state)
+ expect(@repo).not_to receive(:prepare_to_import)
+ expect(@repo).not_to receive(:reset_to_default_state)
@knife.run
end
@@ -140,11 +140,11 @@ describe Chef::Knife::CookbookSiteInstall do
@knife.config[:no_deps] = true
@knife.name_args = ["getting-started"]
upstream_file = File.join(@install_path, "getting-started.tar.gz")
- @knife.should_receive(:download_cookbook_to).with(upstream_file)
- @knife.should_receive(:extract_cookbook).with(upstream_file, "0.3.0")
- @knife.should_receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
- @repo.should_receive(:merge_updates_from).with("getting-started", "0.3.0")
- lambda { @knife.run }.should_not raise_error
+ expect(@knife).to receive(:download_cookbook_to).with(upstream_file)
+ expect(@knife).to receive(:extract_cookbook).with(upstream_file, "0.3.0")
+ expect(@knife).to receive(:clear_existing_files).with(File.join(@install_path, "getting-started"))
+ expect(@repo).to receive(:merge_updates_from).with("getting-started", "0.3.0")
+ expect { @knife.run }.not_to raise_error
end
end
end
diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb
index b85db98d53..0f97261ad4 100644
--- a/spec/unit/knife/cookbook_site_share_spec.rb
+++ b/spec/unit/knife/cookbook_site_share_spec.rb
@@ -32,27 +32,27 @@ describe Chef::Knife::CookbookSiteShare do
@cookbook = Chef::CookbookVersion.new('cookbook_name')
@cookbook_loader = double('Chef::CookbookLoader')
- @cookbook_loader.stub(:cookbook_exists?).and_return(true)
- @cookbook_loader.stub(:[]).and_return(@cookbook)
- Chef::CookbookLoader.stub(:new).and_return(@cookbook_loader)
+ allow(@cookbook_loader).to receive(:cookbook_exists?).and_return(true)
+ allow(@cookbook_loader).to receive(:[]).and_return(@cookbook)
+ allow(Chef::CookbookLoader).to receive(:new).and_return(@cookbook_loader)
@noauth_rest = double(Chef::REST)
- @knife.stub(:noauth_rest).and_return(@noauth_rest)
+ allow(@knife).to receive(:noauth_rest).and_return(@noauth_rest)
@cookbook_uploader = Chef::CookbookUploader.new('herpderp', :rest => "norest")
- Chef::CookbookUploader.stub(:new).and_return(@cookbook_uploader)
- @cookbook_uploader.stub(:validate_cookbooks).and_return(true)
- Chef::CookbookSiteStreamingUploader.stub(:create_build_dir).and_return(Dir.mktmpdir)
+ allow(Chef::CookbookUploader).to receive(:new).and_return(@cookbook_uploader)
+ allow(@cookbook_uploader).to receive(:validate_cookbooks).and_return(true)
+ allow(Chef::CookbookSiteStreamingUploader).to receive(:create_build_dir).and_return(Dir.mktmpdir)
- @knife.stub(:shell_out!).and_return(true)
+ allow(@knife).to receive(:shell_out!).and_return(true)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe 'run' do
before(:each) do
- @knife.stub(:do_upload).and_return(true)
+ allow(@knife).to receive(:do_upload).and_return(true)
@category_response = {
"name" => "cookbook_name",
"category" => "Testing Category"
@@ -66,72 +66,72 @@ describe Chef::Knife::CookbookSiteShare do
end
it 'should set true to config[:dry_run] as default' do
- @knife.config[:dry_run].should be_false
+ expect(@knife.config[:dry_run]).to be_falsey
end
it 'should should print usage and exit when given no arguments' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should not fail when given only 1 argument and can determine category' do
@knife.name_args = ['cookbook_name']
- @noauth_rest.should_receive(:get_rest).with("http://cookbooks.opscode.com/api/v1/cookbooks/cookbook_name").and_return(@category_response)
- @knife.should_receive(:do_upload)
+ expect(@noauth_rest).to receive(:get_rest).with("http://cookbooks.opscode.com/api/v1/cookbooks/cookbook_name").and_return(@category_response)
+ expect(@knife).to receive(:do_upload)
@knife.run
end
it 'should print error and exit when given only 1 argument and cannot determine category' do
@knife.name_args = ['cookbook_name']
- @noauth_rest.should_receive(:get_rest).with("http://cookbooks.opscode.com/api/v1/cookbooks/cookbook_name").and_return(@bad_category_response)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@noauth_rest).to receive(:get_rest).with("http://cookbooks.opscode.com/api/v1/cookbooks/cookbook_name").and_return(@bad_category_response)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should print error and exit when given only 1 argument and Chef::REST throws an exception' do
@knife.name_args = ['cookbook_name']
- @noauth_rest.should_receive(:get_rest).with("http://cookbooks.opscode.com/api/v1/cookbooks/cookbook_name") { raise Errno::ECONNREFUSED, "Connection refused" }
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@noauth_rest).to receive(:get_rest).with("http://cookbooks.opscode.com/api/v1/cookbooks/cookbook_name") { raise Errno::ECONNREFUSED, "Connection refused" }
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should check if the cookbook exists' do
- @cookbook_loader.should_receive(:cookbook_exists?)
+ expect(@cookbook_loader).to receive(:cookbook_exists?)
@knife.run
end
it "should exit and log to error if the cookbook doesn't exist" do
- @cookbook_loader.stub(:cookbook_exists?).and_return(false)
- @knife.ui.should_receive(:error)
- lambda { @knife.run }.should raise_error(SystemExit)
+ allow(@cookbook_loader).to receive(:cookbook_exists?).and_return(false)
+ expect(@knife.ui).to receive(:error)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should make a tarball of the cookbook' do
- @knife.should_receive(:shell_out!) do |args|
- args.to_s.should match(/tar -czf/)
+ expect(@knife).to receive(:shell_out!) do |args|
+ expect(args.to_s).to match(/tar -czf/)
end
@knife.run
end
it 'should exit and log to error when the tarball creation fails' do
- @knife.stub(:shell_out!).and_raise(Chef::Exceptions::Exec)
- @knife.ui.should_receive(:error)
- lambda { @knife.run }.should raise_error(SystemExit)
+ allow(@knife).to receive(:shell_out!).and_raise(Chef::Exceptions::Exec)
+ expect(@knife.ui).to receive(:error)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should upload the cookbook and clean up the tarball' do
- @knife.should_receive(:do_upload)
- FileUtils.should_receive(:rm_rf)
+ expect(@knife).to receive(:do_upload)
+ expect(FileUtils).to receive(:rm_rf)
@knife.run
end
context "when the --dry-run flag is specified" do
before do
- Chef::CookbookSiteStreamingUploader.stub(:create_build_dir).and_return("/var/tmp/dummy")
+ allow(Chef::CookbookSiteStreamingUploader).to receive(:create_build_dir).and_return("/var/tmp/dummy")
@knife.config = { :dry_run => true }
- @knife.stub_chain(:shell_out!, :stdout).and_return('file')
+ allow(@knife).to receive_message_chain(:shell_out!, :stdout).and_return('file')
end
it "should list files in the tarball" do
@@ -152,46 +152,46 @@ describe Chef::Knife::CookbookSiteShare do
before(:each) do
@upload_response = double('Net::HTTPResponse')
- Chef::CookbookSiteStreamingUploader.stub(:post).and_return(@upload_response)
+ allow(Chef::CookbookSiteStreamingUploader).to receive(:post).and_return(@upload_response)
@stdout = StringIO.new
@stderr = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:stderr).and_return(@stderr)
- File.stub(:open).and_return(true)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
+ allow(File).to receive(:open).and_return(true)
end
it 'should post the cookbook to "https://supermarket.getchef.com"' do
response_text = Chef::JSONCompat.to_json({:uri => 'https://supermarket.getchef.com/cookbooks/cookbook_name'})
- @upload_response.stub(:body).and_return(response_text)
- @upload_response.stub(:code).and_return(201)
- Chef::CookbookSiteStreamingUploader.should_receive(:post).with(/supermarket\.getchef\.com/, anything(), anything(), anything())
+ allow(@upload_response).to receive(:body).and_return(response_text)
+ allow(@upload_response).to receive(:code).and_return(201)
+ expect(Chef::CookbookSiteStreamingUploader).to receive(:post).with(/supermarket\.getchef\.com/, anything(), anything(), anything())
@knife.run
end
it 'should alert the user when a version already exists' do
response_text = Chef::JSONCompat.to_json({:error_messages => ['Version already exists']})
- @upload_response.stub(:body).and_return(response_text)
- @upload_response.stub(:code).and_return(409)
- lambda { @knife.run }.should raise_error(SystemExit)
- @stderr.string.should match(/ERROR(.+)cookbook already exists/)
+ allow(@upload_response).to receive(:body).and_return(response_text)
+ allow(@upload_response).to receive(:code).and_return(409)
+ expect { @knife.run }.to raise_error(SystemExit)
+ expect(@stderr.string).to match(/ERROR(.+)cookbook already exists/)
end
it 'should pass any errors on to the user' do
response_text = Chef::JSONCompat.to_json({:error_messages => ["You're holding it wrong"]})
- @upload_response.stub(:body).and_return(response_text)
- @upload_response.stub(:code).and_return(403)
- lambda { @knife.run }.should raise_error(SystemExit)
- @stderr.string.should match("ERROR(.*)You're holding it wrong")
+ allow(@upload_response).to receive(:body).and_return(response_text)
+ allow(@upload_response).to receive(:code).and_return(403)
+ expect { @knife.run }.to raise_error(SystemExit)
+ expect(@stderr.string).to match("ERROR(.*)You're holding it wrong")
end
it 'should print the body if no errors are exposed on failure' do
response_text = Chef::JSONCompat.to_json({:system_error => "Your call was dropped", :reason => "There's a map for that"})
- @upload_response.stub(:body).and_return(response_text)
- @upload_response.stub(:code).and_return(500)
- @knife.ui.should_receive(:error).with(/#{Regexp.escape(response_text)}/)#.ordered
- @knife.ui.should_receive(:error).with(/Unknown error/)#.ordered
- lambda { @knife.run }.should raise_error(SystemExit)
+ allow(@upload_response).to receive(:body).and_return(response_text)
+ allow(@upload_response).to receive(:code).and_return(500)
+ expect(@knife.ui).to receive(:error).with(/#{Regexp.escape(response_text)}/)#.ordered
+ expect(@knife.ui).to receive(:error).with(/Unknown error/)#.ordered
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/cookbook_site_unshare_spec.rb b/spec/unit/knife/cookbook_site_unshare_spec.rb
index 14cda65b43..ec46a8705c 100644
--- a/spec/unit/knife/cookbook_site_unshare_spec.rb
+++ b/spec/unit/knife/cookbook_site_unshare_spec.rb
@@ -24,13 +24,13 @@ describe Chef::Knife::CookbookSiteUnshare do
before(:each) do
@knife = Chef::Knife::CookbookSiteUnshare.new
@knife.name_args = ['cookbook_name']
- @knife.stub(:confirm).and_return(true)
+ allow(@knife).to receive(:confirm).and_return(true)
@rest = double('Chef::REST')
- @rest.stub(:delete_rest).and_return(true)
- @knife.stub(:rest).and_return(@rest)
+ allow(@rest).to receive(:delete_rest).and_return(true)
+ allow(@knife).to receive(:rest).and_return(@rest)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe 'run' do
@@ -38,37 +38,37 @@ describe Chef::Knife::CookbookSiteUnshare do
describe 'with no cookbook argument' do
it 'should print the usage and exit' do
@knife.name_args = []
- @knife.ui.should_receive(:fatal)
- @knife.should_receive(:show_usage)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:fatal)
+ expect(@knife).to receive(:show_usage)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
it 'should confirm you want to unshare the cookbook' do
- @knife.should_receive(:confirm)
+ expect(@knife).to receive(:confirm)
@knife.run
end
it 'should send a delete request to the cookbook site' do
- @rest.should_receive(:delete_rest)
+ expect(@rest).to receive(:delete_rest)
@knife.run
end
it 'should log an error and exit when forbidden' do
exception = double('403 "Forbidden"', :code => '403')
- @rest.stub(:delete_rest).and_raise(Net::HTTPServerException.new('403 "Forbidden"', exception))
- @knife.ui.should_receive(:error)
- lambda { @knife.run }.should raise_error(SystemExit)
+ allow(@rest).to receive(:delete_rest).and_raise(Net::HTTPServerException.new('403 "Forbidden"', exception))
+ expect(@knife.ui).to receive(:error)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'should re-raise any non-forbidden errors on delete_rest' do
exception = double('500 "Application Error"', :code => '500')
- @rest.stub(:delete_rest).and_raise(Net::HTTPServerException.new('500 "Application Error"', exception))
- lambda { @knife.run }.should raise_error(Net::HTTPServerException)
+ allow(@rest).to receive(:delete_rest).and_raise(Net::HTTPServerException.new('500 "Application Error"', exception))
+ expect { @knife.run }.to raise_error(Net::HTTPServerException)
end
it 'should log a success message' do
- @knife.ui.should_receive(:info)
+ expect(@knife.ui).to receive(:info)
@knife.run
end
diff --git a/spec/unit/knife/cookbook_test_spec.rb b/spec/unit/knife/cookbook_test_spec.rb
index 0e261c02a4..ce74bcaa5d 100644
--- a/spec/unit/knife/cookbook_test_spec.rb
+++ b/spec/unit/knife/cookbook_test_spec.rb
@@ -26,55 +26,55 @@ describe Chef::Knife::CookbookTest do
Chef::Config[:node_name] = "webmonkey.example.com"
@knife = Chef::Knife::CookbookTest.new
@knife.config[:cookbook_path] = File.join(CHEF_SPEC_DATA,'cookbooks')
- @knife.cookbook_loader.stub(:cookbook_exists?).and_return(true)
+ allow(@knife.cookbook_loader).to receive(:cookbook_exists?).and_return(true)
@cookbooks = []
%w{tats central_market jimmy_johns pho}.each do |cookbook_name|
@cookbooks << Chef::CookbookVersion.new(cookbook_name)
end
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe "run" do
it "should test the cookbook" do
- @knife.stub(:test_cookbook).and_return(true)
+ allow(@knife).to receive(:test_cookbook).and_return(true)
@knife.name_args = ["italian"]
- @knife.should_receive(:test_cookbook).with("italian")
+ expect(@knife).to receive(:test_cookbook).with("italian")
@knife.run
end
it "should test multiple cookbooks when provided" do
- @knife.stub(:test_cookbook).and_return(true)
+ allow(@knife).to receive(:test_cookbook).and_return(true)
@knife.name_args = ["tats", "jimmy_johns"]
- @knife.should_receive(:test_cookbook).with("tats")
- @knife.should_receive(:test_cookbook).with("jimmy_johns")
- @knife.should_not_receive(:test_cookbook).with("central_market")
- @knife.should_not_receive(:test_cookbook).with("pho")
+ expect(@knife).to receive(:test_cookbook).with("tats")
+ expect(@knife).to receive(:test_cookbook).with("jimmy_johns")
+ expect(@knife).not_to receive(:test_cookbook).with("central_market")
+ expect(@knife).not_to receive(:test_cookbook).with("pho")
@knife.run
end
it "should test both ruby and templates" do
@knife.name_args = ["example"]
- @knife.config[:cookbook_path].should_not be_empty
+ expect(@knife.config[:cookbook_path]).not_to be_empty
Array(@knife.config[:cookbook_path]).reverse.each do |path|
- @knife.should_receive(:test_ruby).with(an_instance_of(Chef::Cookbook::SyntaxCheck))
- @knife.should_receive(:test_templates).with(an_instance_of(Chef::Cookbook::SyntaxCheck))
+ expect(@knife).to receive(:test_ruby).with(an_instance_of(Chef::Cookbook::SyntaxCheck))
+ expect(@knife).to receive(:test_templates).with(an_instance_of(Chef::Cookbook::SyntaxCheck))
end
@knife.run
end
describe "with -a or --all" do
it "should test all of the cookbooks" do
- @knife.stub(:test_cookbook).and_return(true)
+ allow(@knife).to receive(:test_cookbook).and_return(true)
@knife.config[:all] = true
@loader = {}
- @loader.stub(:load_cookbooks).and_return(@loader)
+ allow(@loader).to receive(:load_cookbooks).and_return(@loader)
@cookbooks.each do |cookbook|
@loader[cookbook.name] = cookbook
end
- @knife.stub(:cookbook_loader).and_return(@loader)
+ allow(@knife).to receive(:cookbook_loader).and_return(@loader)
@loader.each do |key, cookbook|
- @knife.should_receive(:test_cookbook).with(cookbook.name)
+ expect(@knife).to receive(:test_cookbook).with(cookbook.name)
end
@knife.run
end
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb
index e5c9a40cf1..5dbd456ad8 100644
--- a/spec/unit/knife/cookbook_upload_spec.rb
+++ b/spec/unit/knife/cookbook_upload_spec.rb
@@ -31,8 +31,8 @@ describe Chef::Knife::CookbookUpload do
let(:cookbook_loader) do
cookbook_loader = cookbooks_by_name.dup
- cookbook_loader.stub(:merged_cookbooks).and_return([])
- cookbook_loader.stub(:load_cookbooks).and_return(cookbook_loader)
+ allow(cookbook_loader).to receive(:merged_cookbooks).and_return([])
+ allow(cookbook_loader).to receive(:load_cookbooks).and_return(cookbook_loader)
cookbook_loader
end
@@ -45,23 +45,23 @@ describe Chef::Knife::CookbookUpload do
let(:knife) do
k = Chef::Knife::CookbookUpload.new
k.name_args = name_args
- k.ui.stub(:stdout).and_return(output)
- k.ui.stub(:stderr).and_return(output)
+ allow(k.ui).to receive(:stdout).and_return(output)
+ allow(k.ui).to receive(:stderr).and_return(output)
k
end
before(:each) do
- Chef::CookbookLoader.stub(:new).and_return(cookbook_loader)
+ allow(Chef::CookbookLoader).to receive(:new).and_return(cookbook_loader)
end
describe 'with --concurrency' do
it 'should upload cookbooks with predefined concurrency' do
- Chef::CookbookVersion.stub(:list_all_versions).and_return({})
+ allow(Chef::CookbookVersion).to receive(:list_all_versions).and_return({})
knife.config[:concurrency] = 3
test_cookbook = Chef::CookbookVersion.new('test_cookbook', '/tmp/blah')
- cookbook_loader.stub(:each).and_yield("test_cookbook", test_cookbook)
- cookbook_loader.stub(:cookbook_names).and_return(["test_cookbook"])
- Chef::CookbookUploader.should_receive(:new).
+ allow(cookbook_loader).to receive(:each).and_yield("test_cookbook", test_cookbook)
+ allow(cookbook_loader).to receive(:cookbook_names).and_return(["test_cookbook"])
+ expect(Chef::CookbookUploader).to receive(:new).
with( kind_of(Array), { :force => nil, :concurrency => 3}).
and_return(double("Chef::CookbookUploader", :upload_cookbooks=> true))
knife.run
@@ -70,26 +70,26 @@ describe Chef::Knife::CookbookUpload do
describe 'run' do
before(:each) do
- Chef::CookbookUploader.stub(:new => cookbook_uploader)
- Chef::CookbookVersion.stub(:list_all_versions).and_return({})
+ allow(Chef::CookbookUploader).to receive_messages(:new => cookbook_uploader)
+ allow(Chef::CookbookVersion).to receive(:list_all_versions).and_return({})
end
it 'should print usage and exit when a cookbook name is not provided' do
knife.name_args = []
- knife.should_receive(:show_usage)
- knife.ui.should_receive(:fatal)
- lambda { knife.run }.should raise_error(SystemExit)
+ expect(knife).to receive(:show_usage)
+ expect(knife.ui).to receive(:fatal)
+ expect { knife.run }.to raise_error(SystemExit)
end
describe 'when specifying a cookbook name' do
it 'should upload the cookbook' do
- knife.should_receive(:upload).once
+ expect(knife).to receive(:upload).once
knife.run
end
it 'should report on success' do
- knife.should_receive(:upload).once
- knife.ui.should_receive(:info).with(/Uploaded 1 cookbook/)
+ expect(knife).to receive(:upload).once
+ expect(knife.ui).to receive(:info).with(/Uploaded 1 cookbook/)
knife.run
end
end
@@ -97,7 +97,7 @@ describe Chef::Knife::CookbookUpload do
describe 'when specifying the same cookbook name twice' do
it 'should upload the cookbook only once' do
knife.name_args = ['test_cookbook', 'test_cookbook']
- knife.should_receive(:upload).once
+ expect(knife).to receive(:upload).once
knife.run
end
end
@@ -105,8 +105,8 @@ describe Chef::Knife::CookbookUpload do
context "when uploading a cookbook that uses deprecated overlays" do
before do
- cookbook_loader.stub(:merged_cookbooks).and_return(['test_cookbook'])
- cookbook_loader.stub(:merged_cookbook_paths).
+ allow(cookbook_loader).to receive(:merged_cookbooks).and_return(['test_cookbook'])
+ allow(cookbook_loader).to receive(:merged_cookbook_paths).
and_return({'test_cookbook' => %w{/path/one/test_cookbook /path/two/test_cookbook}})
end
@@ -123,7 +123,7 @@ test_cookbook:
/path/one/test_cookbook
/path/two/test_cookbook
E
- output.string.should include(expected_message)
+ expect(output.string).to include(expected_message)
end
end
@@ -139,17 +139,17 @@ E
end
it "should read only one cookbook" do
- cookbook_loader.should_receive(:[]).once.with('test_cookbook1').and_call_original
+ expect(cookbook_loader).to receive(:[]).once.with('test_cookbook1').and_call_original
knife.run
end
it "should not read all cookbooks" do
- cookbook_loader.should_not_receive(:load_cookbooks)
+ expect(cookbook_loader).not_to receive(:load_cookbooks)
knife.run
end
it "should upload only one cookbook" do
- knife.should_receive(:upload).exactly(1).times
+ expect(knife).to receive(:upload).exactly(1).times
knife.run
end
end
@@ -181,13 +181,13 @@ E
it "should upload all dependencies once" do
knife.config[:depends] = true
- knife.stub(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2", "test_cookbook3"])
- knife.should_receive(:upload).exactly(3).times
- lambda do
+ allow(knife).to receive(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2", "test_cookbook3"])
+ expect(knife).to receive(:upload).exactly(3).times
+ expect do
Timeout::timeout(5) do
knife.run
end
- end.should_not raise_error
+ end.not_to raise_error
end
end
@@ -196,50 +196,50 @@ E
before(:each) do
cookbook.metadata.depends("dependency")
- cookbook_loader.stub(:[]) do |ckbk|
+ allow(cookbook_loader).to receive(:[]) do |ckbk|
{ "test_cookbook" => cookbook,
"dependency" => cookbook_dependency}[ckbk]
end
- knife.stub(:cookbook_names).and_return(["cookbook_dependency", "test_cookbook"])
+ allow(knife).to receive(:cookbook_names).and_return(["cookbook_dependency", "test_cookbook"])
@stdout, @stderr, @stdin = StringIO.new, StringIO.new, StringIO.new
knife.ui = Chef::Knife::UI.new(@stdout, @stderr, @stdin, {})
end
it 'should exit and not upload the cookbook' do
- cookbook_loader.should_receive(:[]).once.with('test_cookbook')
- cookbook_loader.should_not_receive(:load_cookbooks)
- cookbook_uploader.should_not_receive(:upload_cookbooks)
+ expect(cookbook_loader).to receive(:[]).once.with('test_cookbook')
+ expect(cookbook_loader).not_to receive(:load_cookbooks)
+ expect(cookbook_uploader).not_to receive(:upload_cookbooks)
expect {knife.run}.to raise_error(SystemExit)
end
it 'should output a message for a single missing dependency' do
expect {knife.run}.to raise_error(SystemExit)
- @stderr.string.should include('Cookbook test_cookbook depends on cookbooks which are not currently')
- @stderr.string.should include('being uploaded and cannot be found on the server.')
- @stderr.string.should include("The missing cookbook(s) are: 'dependency' version '>= 0.0.0'")
+ expect(@stderr.string).to include('Cookbook test_cookbook depends on cookbooks which are not currently')
+ expect(@stderr.string).to include('being uploaded and cannot be found on the server.')
+ expect(@stderr.string).to include("The missing cookbook(s) are: 'dependency' version '>= 0.0.0'")
end
it 'should output a message for a multiple missing dependencies which are concatenated' do
cookbook_dependency2 = Chef::CookbookVersion.new('dependency2')
cookbook.metadata.depends("dependency2")
- cookbook_loader.stub(:[]) do |ckbk|
+ allow(cookbook_loader).to receive(:[]) do |ckbk|
{ "test_cookbook" => cookbook,
"dependency" => cookbook_dependency,
"dependency2" => cookbook_dependency2}[ckbk]
end
- knife.stub(:cookbook_names).and_return(["dependency", "dependency2", "test_cookbook"])
+ allow(knife).to receive(:cookbook_names).and_return(["dependency", "dependency2", "test_cookbook"])
expect {knife.run}.to raise_error(SystemExit)
- @stderr.string.should include('Cookbook test_cookbook depends on cookbooks which are not currently')
- @stderr.string.should include('being uploaded and cannot be found on the server.')
- @stderr.string.should include("The missing cookbook(s) are:")
- @stderr.string.should include("'dependency' version '>= 0.0.0'")
- @stderr.string.should include("'dependency2' version '>= 0.0.0'")
+ expect(@stderr.string).to include('Cookbook test_cookbook depends on cookbooks which are not currently')
+ expect(@stderr.string).to include('being uploaded and cannot be found on the server.')
+ expect(@stderr.string).to include("The missing cookbook(s) are:")
+ expect(@stderr.string).to include("'dependency' version '>= 0.0.0'")
+ expect(@stderr.string).to include("'dependency2' version '>= 0.0.0'")
end
end
it "should freeze the version of the cookbooks if --freeze is specified" do
knife.config[:freeze] = true
- cookbook.should_receive(:freeze_version).once
+ expect(cookbook).to receive(:freeze_version).once
knife.run
end
@@ -248,25 +248,25 @@ E
knife.config[:all] = true
@test_cookbook1 = Chef::CookbookVersion.new('test_cookbook1', '/tmp/blah')
@test_cookbook2 = Chef::CookbookVersion.new('test_cookbook2', '/tmp/blah')
- cookbook_loader.stub(:each).and_yield("test_cookbook1", @test_cookbook1).and_yield("test_cookbook2", @test_cookbook2)
- cookbook_loader.stub(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2"])
+ allow(cookbook_loader).to receive(:each).and_yield("test_cookbook1", @test_cookbook1).and_yield("test_cookbook2", @test_cookbook2)
+ allow(cookbook_loader).to receive(:cookbook_names).and_return(["test_cookbook1", "test_cookbook2"])
end
it 'should upload all cookbooks' do
- knife.should_receive(:upload).once
+ expect(knife).to receive(:upload).once
knife.run
end
it 'should report on success' do
- knife.should_receive(:upload).once
- knife.ui.should_receive(:info).with(/Uploaded all cookbooks/)
+ expect(knife).to receive(:upload).once
+ expect(knife.ui).to receive(:info).with(/Uploaded all cookbooks/)
knife.run
end
it 'should update the version constraints for an environment' do
- knife.stub(:assert_environment_valid!).and_return(true)
+ allow(knife).to receive(:assert_environment_valid!).and_return(true)
knife.config[:environment] = "production"
- knife.should_receive(:update_version_constraints).once
+ expect(knife).to receive(:update_version_constraints).once
knife.run
end
end
@@ -274,21 +274,21 @@ E
describe 'when a frozen cookbook exists on the server' do
it 'should fail to replace it' do
exception = Chef::Exceptions::CookbookFrozen.new
- cookbook_uploader.should_receive(:upload_cookbooks).
+ expect(cookbook_uploader).to receive(:upload_cookbooks).
and_raise(exception)
- knife.ui.stub(:error)
- knife.ui.should_receive(:error).with(exception)
- lambda { knife.run }.should raise_error(SystemExit)
+ allow(knife.ui).to receive(:error)
+ expect(knife.ui).to receive(:error).with(exception)
+ expect { knife.run }.to raise_error(SystemExit)
end
it 'should not update the version constraints for an environment' do
- knife.stub(:assert_environment_valid!).and_return(true)
+ allow(knife).to receive(:assert_environment_valid!).and_return(true)
knife.config[:environment] = "production"
- knife.stub(:upload).and_raise(Chef::Exceptions::CookbookFrozen)
- knife.ui.should_receive(:error).with(/Failed to upload 1 cookbook/)
- knife.ui.should_receive(:warn).with(/Not updating version constraints/)
- knife.should_not_receive(:update_version_constraints)
- lambda { knife.run }.should raise_error(SystemExit)
+ allow(knife).to receive(:upload).and_raise(Chef::Exceptions::CookbookFrozen)
+ expect(knife.ui).to receive(:error).with(/Failed to upload 1 cookbook/)
+ expect(knife.ui).to receive(:warn).with(/Not updating version constraints/)
+ expect(knife).not_to receive(:update_version_constraints)
+ expect { knife.run }.to raise_error(SystemExit)
end
end
end # run
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb
index cd53088419..1291571358 100644
--- a/spec/unit/knife/core/bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/bootstrap_context_spec.rb
@@ -35,18 +35,18 @@ describe Chef::Knife::Core::BootstrapContext do
subject(:bootstrap_context) { described_class.new(config, run_list, chef_config, secret) }
it "runs chef with the first-boot.json in the _default environment" do
- bootstrap_context.start_chef.should eq "chef-client -j /etc/chef/first-boot.json -E _default"
+ expect(bootstrap_context.start_chef).to eq "chef-client -j /etc/chef/first-boot.json -E _default"
end
describe "when in verbosity mode" do
let(:config) { {:verbosity => 2} }
it "adds '-l debug' when verbosity is >= 2" do
- bootstrap_context.start_chef.should eq "chef-client -j /etc/chef/first-boot.json -l debug -E _default"
+ expect(bootstrap_context.start_chef).to eq "chef-client -j /etc/chef/first-boot.json -l debug -E _default"
end
end
it "reads the validation key" do
- bootstrap_context.validation_key.should eq IO.read(File.join(CHEF_SPEC_DATA, 'ssl', 'private_key.pem'))
+ expect(bootstrap_context.validation_key).to eq IO.read(File.join(CHEF_SPEC_DATA, 'ssl', 'private_key.pem'))
end
it "generates the config file data" do
@@ -56,7 +56,7 @@ chef_server_url "http://chef.example.com:4444"
validation_client_name "chef-validator-testing"
# Using default node name (fqdn)
EXPECTED
- bootstrap_context.config_content.should eq expected
+ expect(bootstrap_context.config_content).to eq expected
end
it "does not set a default log_level" do
@@ -66,14 +66,14 @@ EXPECTED
describe "alternate chef-client path" do
let(:chef_config){ {:chef_client_path => '/usr/local/bin/chef-client'} }
it "runs chef-client from another path when specified" do
- bootstrap_context.start_chef.should eq "/usr/local/bin/chef-client -j /etc/chef/first-boot.json -E _default"
+ expect(bootstrap_context.start_chef).to eq "/usr/local/bin/chef-client -j /etc/chef/first-boot.json -E _default"
end
end
describe "validation key path that contains a ~" do
let(:chef_config){ {:validation_key => '~/my.key'} }
it "reads the validation key when it contains a ~" do
- IO.should_receive(:read).with(File.expand_path("my.key", ENV['HOME']))
+ expect(IO).to receive(:read).with(File.expand_path("my.key", ENV['HOME']))
bootstrap_context.validation_key
end
end
@@ -81,44 +81,44 @@ EXPECTED
describe "when an explicit node name is given" do
let(:config){ {:chef_node_name => 'foobar.example.com' }}
it "sets the node name in the client.rb" do
- bootstrap_context.config_content.should match(/node_name "foobar\.example\.com"/)
+ expect(bootstrap_context.config_content).to match(/node_name "foobar\.example\.com"/)
end
end
describe "when bootstrapping into a specific environment" do
let(:chef_config){ {:environment => "prodtastic"} }
it "starts chef in the configured environment" do
- bootstrap_context.start_chef.should == 'chef-client -j /etc/chef/first-boot.json -E prodtastic'
+ expect(bootstrap_context.start_chef).to eq('chef-client -j /etc/chef/first-boot.json -E prodtastic')
end
end
describe "when JSON attributes are given" do
let(:config) { {:first_boot_attributes => {:baz => :quux}} }
it "adds the attributes to first_boot" do
- Chef::JSONCompat.to_json(bootstrap_context.first_boot).should eq(Chef::JSONCompat.to_json({:baz => :quux, :run_list => run_list}))
+ expect(Chef::JSONCompat.to_json(bootstrap_context.first_boot)).to eq(Chef::JSONCompat.to_json({:baz => :quux, :run_list => run_list}))
end
end
describe "when JSON attributes are NOT given" do
it "sets first_boot equal to run_list" do
- Chef::JSONCompat.to_json(bootstrap_context.first_boot).should eq(Chef::JSONCompat.to_json({:run_list => run_list}))
+ expect(Chef::JSONCompat.to_json(bootstrap_context.first_boot)).to eq(Chef::JSONCompat.to_json({:run_list => run_list}))
end
end
describe "when an encrypted_data_bag_secret is provided" do
let(:secret) { "supersekret" }
it "reads the encrypted_data_bag_secret" do
- bootstrap_context.encrypted_data_bag_secret.should eq "supersekret"
+ expect(bootstrap_context.encrypted_data_bag_secret).to eq "supersekret"
end
end
describe "to support compatibility with existing templates" do
it "sets the @config instance variable" do
- bootstrap_context.instance_variable_get(:@config).should eq config
+ expect(bootstrap_context.instance_variable_get(:@config)).to eq config
end
it "sets the @run_list instance variable" do
- bootstrap_context.instance_variable_get(:@run_list).should eq run_list
+ expect(bootstrap_context.instance_variable_get(:@run_list)).to eq run_list
end
end
@@ -130,7 +130,7 @@ EXPECTED
end
it "should send the full version to the installer" do
- bootstrap_context.latest_current_chef_version_string.should eq("-v 11.12.4")
+ expect(bootstrap_context.latest_current_chef_version_string).to eq("-v 11.12.4")
end
end
@@ -142,20 +142,20 @@ EXPECTED
end
it "should send the full version to the installer and set the pre-release flag" do
- bootstrap_context.latest_current_chef_version_string.should eq("-v 11.12.4.rc.0 -p")
+ expect(bootstrap_context.latest_current_chef_version_string).to eq("-v 11.12.4.rc.0 -p")
end
end
describe "when a bootstrap_version is not specified" do
it "should send the latest current to the installer" do
# Intentionally hard coded in order not to replicate the logic.
- bootstrap_context.latest_current_chef_version_string.should eq("-v #{Chef::VERSION.to_i}")
+ expect(bootstrap_context.latest_current_chef_version_string).to eq("-v #{Chef::VERSION.to_i}")
end
end
describe "ssl_verify_mode" do
it "isn't set in the config_content by default" do
- bootstrap_context.config_content.should_not include("ssl_verify_mode")
+ expect(bootstrap_context.config_content).not_to include("ssl_verify_mode")
end
describe "when configured in config" do
@@ -166,14 +166,14 @@ EXPECTED
end
it "uses the config value" do
- bootstrap_context.config_content.should include("ssl_verify_mode :verify_peer")
+ expect(bootstrap_context.config_content).to include("ssl_verify_mode :verify_peer")
end
describe "when configured via CLI" do
let(:config) {{:node_ssl_verify_mode => "none"}}
it "uses CLI value" do
- bootstrap_context.config_content.should include("ssl_verify_mode :verify_none")
+ expect(bootstrap_context.config_content).to include("ssl_verify_mode :verify_none")
end
end
end
@@ -181,7 +181,7 @@ EXPECTED
describe "verify_api_cert" do
it "isn't set in the config_content by default" do
- bootstrap_context.config_content.should_not include("verify_api_cert")
+ expect(bootstrap_context.config_content).not_to include("verify_api_cert")
end
describe "when configured in config" do
@@ -192,14 +192,14 @@ EXPECTED
end
it "uses the config value" do
- bootstrap_context.config_content.should include("verify_api_cert false")
+ expect(bootstrap_context.config_content).to include("verify_api_cert false")
end
describe "when configured via CLI" do
let(:config) {{:node_verify_api_cert => true}}
it "uses CLI value" do
- bootstrap_context.config_content.should include("verify_api_cert true")
+ expect(bootstrap_context.config_content).to include("verify_api_cert true")
end
end
end
diff --git a/spec/unit/knife/core/cookbook_scm_repo_spec.rb b/spec/unit/knife/core/cookbook_scm_repo_spec.rb
index 69da5400b0..2d66df31c1 100644
--- a/spec/unit/knife/core/cookbook_scm_repo_spec.rb
+++ b/spec/unit/knife/core/cookbook_scm_repo_spec.rb
@@ -39,45 +39,45 @@ BRANCHES
end
it "has a path to the cookbook repo" do
- @cookbook_repo.repo_path.should == @repo_path
+ expect(@cookbook_repo.repo_path).to eq(@repo_path)
end
it "has a default branch" do
- @cookbook_repo.default_branch.should == 'master'
+ expect(@cookbook_repo.default_branch).to eq('master')
end
describe "when sanity checking the repo" do
it "exits when the directory does not exist" do
- ::File.should_receive(:directory?).with(@repo_path).and_return(false)
- lambda {@cookbook_repo.sanity_check}.should raise_error(SystemExit)
+ expect(::File).to receive(:directory?).with(@repo_path).and_return(false)
+ expect {@cookbook_repo.sanity_check}.to raise_error(SystemExit)
end
describe "and the repo dir exists" do
before do
- ::File.stub(:directory?).with(@repo_path).and_return(true)
+ allow(::File).to receive(:directory?).with(@repo_path).and_return(true)
end
it "exits when there is no git repo" do
- ::File.stub(:directory?).with(/.*\.git/).and_return(false)
- lambda {@cookbook_repo.sanity_check}.should raise_error(SystemExit)
+ allow(::File).to receive(:directory?).with(/.*\.git/).and_return(false)
+ expect {@cookbook_repo.sanity_check}.to raise_error(SystemExit)
end
describe "and the repo is a git repo" do
before do
- ::File.stub(:directory?).with(File.join(@repo_path, '.git')).and_return(true)
+ allow(::File).to receive(:directory?).with(File.join(@repo_path, '.git')).and_return(true)
end
it "exits when the default branch doesn't exist" do
@nobranches = Mixlib::ShellOut.new.tap {|s|s.stdout.replace "\n"}
- @cookbook_repo.should_receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@nobranches)
- lambda {@cookbook_repo.sanity_check}.should raise_error(SystemExit)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@nobranches)
+ expect {@cookbook_repo.sanity_check}.to raise_error(SystemExit)
end
describe "and the default branch exists" do
before do
@master_branch = Mixlib::ShellOut.new
@master_branch.stdout.replace "* master\n"
- @cookbook_repo.should_receive(:shell_out!).with("git branch --no-color", :cwd => @repo_path).and_return(@master_branch)
+ expect(@cookbook_repo).to receive(:shell_out!).with("git branch --no-color", :cwd => @repo_path).and_return(@master_branch)
end
it "exits when the git repo is dirty" do
@@ -85,14 +85,14 @@ BRANCHES
@dirty_status.stdout.replace(<<-DIRTY)
M chef/lib/chef/knife/cookbook_site_vendor.rb
DIRTY
- @cookbook_repo.should_receive(:shell_out!).with('git status --porcelain', :cwd => @repo_path).and_return(@dirty_status)
- lambda {@cookbook_repo.sanity_check}.should raise_error(SystemExit)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git status --porcelain', :cwd => @repo_path).and_return(@dirty_status)
+ expect {@cookbook_repo.sanity_check}.to raise_error(SystemExit)
end
describe "and the repo is clean" do
before do
@clean_status = Mixlib::ShellOut.new.tap {|s| s.stdout.replace("\n")}
- @cookbook_repo.stub(:shell_out!).with('git status --porcelain', :cwd => @repo_path).and_return(@clean_status)
+ allow(@cookbook_repo).to receive(:shell_out!).with('git status --porcelain', :cwd => @repo_path).and_return(@clean_status)
end
it "passes the sanity check" do
@@ -106,35 +106,35 @@ DIRTY
end
it "resets to default state by checking out the default branch" do
- @cookbook_repo.should_receive(:shell_out!).with('git checkout master', :cwd => @repo_path)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git checkout master', :cwd => @repo_path)
@cookbook_repo.reset_to_default_state
end
it "determines if a the pristine copy branch exists" do
- @cookbook_repo.should_receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
- @cookbook_repo.branch_exists?("chef-vendor-apache2").should be_true
- @cookbook_repo.should_receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
- @cookbook_repo.branch_exists?("chef-vendor-nginx").should be_false
+ expect(@cookbook_repo).to receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
+ expect(@cookbook_repo.branch_exists?("chef-vendor-apache2")).to be_truthy
+ expect(@cookbook_repo).to receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
+ expect(@cookbook_repo.branch_exists?("chef-vendor-nginx")).to be_falsey
end
it "determines if a the branch not exists correctly without substring search" do
- @cookbook_repo.should_receive(:shell_out!).twice.with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
- @cookbook_repo.should_not be_branch_exists("chef-vendor-absent")
- @cookbook_repo.should be_branch_exists("chef-vendor-absent-new")
+ expect(@cookbook_repo).to receive(:shell_out!).twice.with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
+ expect(@cookbook_repo).not_to be_branch_exists("chef-vendor-absent")
+ expect(@cookbook_repo).to be_branch_exists("chef-vendor-absent-new")
end
describe "when the pristine copy branch does not exist" do
it "prepares for import by creating the pristine copy branch" do
- @cookbook_repo.should_receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
- @cookbook_repo.should_receive(:shell_out!).with('git checkout -b chef-vendor-nginx', :cwd => @repo_path)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git checkout -b chef-vendor-nginx', :cwd => @repo_path)
@cookbook_repo.prepare_to_import("nginx")
end
end
describe "when the pristine copy branch does exist" do
it "prepares for import by checking out the pristine copy branch" do
- @cookbook_repo.should_receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
- @cookbook_repo.should_receive(:shell_out!).with('git checkout chef-vendor-apache2', :cwd => @repo_path)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git branch --no-color', :cwd => @repo_path).and_return(@branch_list)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git checkout chef-vendor-apache2', :cwd => @repo_path)
@cookbook_repo.prepare_to_import("apache2")
end
end
@@ -143,15 +143,15 @@ DIRTY
before do
@updates = Mixlib::ShellOut.new
@updates.stdout.replace("\n")
- @cookbook_repo.stub(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates)
+ allow(@cookbook_repo).to receive(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates)
end
it "shows no changes in the pristine copy" do
- @cookbook_repo.updated?('apache2').should be_false
+ expect(@cookbook_repo.updated?('apache2')).to be_falsey
end
it "does nothing to finalize the updates" do
- @cookbook_repo.finalize_updates_to('apache2', '1.2.3').should be_false
+ expect(@cookbook_repo.finalize_updates_to('apache2', '1.2.3')).to be_falsey
end
end
@@ -159,18 +159,18 @@ DIRTY
before do
@updates = Mixlib::ShellOut.new
@updates.stdout.replace(" M cookbooks/apache2/recipes/default.rb\n")
- @cookbook_repo.stub(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates)
+ allow(@cookbook_repo).to receive(:shell_out!).with('git status --porcelain -- apache2', :cwd => @repo_path).and_return(@updates)
end
it "shows changes in the pristine copy" do
- @cookbook_repo.updated?('apache2').should be_true
+ expect(@cookbook_repo.updated?('apache2')).to be_truthy
end
it "commits the changes to the repo and tags the commit" do
- @cookbook_repo.should_receive(:shell_out!).with("git add apache2", :cwd => @repo_path)
- @cookbook_repo.should_receive(:shell_out!).with("git commit -m \"Import apache2 version 1.2.3\" -- apache2", :cwd => @repo_path)
- @cookbook_repo.should_receive(:shell_out!).with("git tag -f cookbook-site-imported-apache2-1.2.3", :cwd => @repo_path)
- @cookbook_repo.finalize_updates_to("apache2", "1.2.3").should be_true
+ expect(@cookbook_repo).to receive(:shell_out!).with("git add apache2", :cwd => @repo_path)
+ expect(@cookbook_repo).to receive(:shell_out!).with("git commit -m \"Import apache2 version 1.2.3\" -- apache2", :cwd => @repo_path)
+ expect(@cookbook_repo).to receive(:shell_out!).with("git tag -f cookbook-site-imported-apache2-1.2.3", :cwd => @repo_path)
+ expect(@cookbook_repo.finalize_updates_to("apache2", "1.2.3")).to be_truthy
end
end
@@ -180,7 +180,7 @@ DIRTY
end
it "resets to default state by checking out the default branch" do
- @cookbook_repo.should_receive(:shell_out!).with('git checkout develop', :cwd => @repo_path)
+ expect(@cookbook_repo).to receive(:shell_out!).with('git checkout develop', :cwd => @repo_path)
@cookbook_repo.reset_to_default_state
end
end
diff --git a/spec/unit/knife/core/object_loader_spec.rb b/spec/unit/knife/core/object_loader_spec.rb
index 53a538da91..67fa858029 100644
--- a/spec/unit/knife/core/object_loader_spec.rb
+++ b/spec/unit/knife/core/object_loader_spec.rb
@@ -24,17 +24,17 @@ describe Chef::Knife::Core::ObjectLoader do
before(:each) do
@knife = Chef::Knife.new
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
Dir.chdir(File.join(CHEF_SPEC_DATA, 'object_loader'))
end
shared_examples_for "Chef object" do |chef_class|
it "should create a #{chef_class} object" do
- @object.should be_a_kind_of(chef_class)
+ expect(@object).to be_a_kind_of(chef_class)
end
it "should has a attribute 'name'" do
- @object.name.should eql('test')
+ expect(@object.name).to eql('test')
end
end
diff --git a/spec/unit/knife/core/subcommand_loader_spec.rb b/spec/unit/knife/core/subcommand_loader_spec.rb
index 53664cb528..df42cff2ea 100644
--- a/spec/unit/knife/core/subcommand_loader_spec.rb
+++ b/spec/unit/knife/core/subcommand_loader_spec.rb
@@ -20,22 +20,22 @@ require 'spec_helper'
describe Chef::Knife::SubcommandLoader do
before do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
@home = File.join(CHEF_SPEC_DATA, 'knife-home')
@env = {'HOME' => @home}
@loader = Chef::Knife::SubcommandLoader.new(File.join(CHEF_SPEC_DATA, 'knife-site-subcommands'), @env)
end
it "builds a list of the core subcommand file require paths" do
- @loader.subcommand_files.should_not be_empty
+ expect(@loader.subcommand_files).not_to be_empty
@loader.subcommand_files.each do |require_path|
- require_path.should match(/chef\/knife\/.*|plugins\/knife\/.*/)
+ expect(require_path).to match(/chef\/knife\/.*|plugins\/knife\/.*/)
end
end
it "finds files installed via rubygems" do
- @loader.find_subcommands_via_rubygems.should include('chef/knife/node_create')
- @loader.find_subcommands_via_rubygems.each {|rel_path, abs_path| abs_path.should match(%r[chef/knife/.+])}
+ expect(@loader.find_subcommands_via_rubygems).to include('chef/knife/node_create')
+ @loader.find_subcommands_via_rubygems.each {|rel_path, abs_path| expect(abs_path).to match(%r[chef/knife/.+])}
end
it "finds files from latest version of installed gems" do
@@ -44,74 +44,148 @@ describe Chef::Knife::SubcommandLoader do
'/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_base.rb',
'/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/ec2_otherstuff.rb'
]
- $LOAD_PATH.should_receive(:map).and_return([])
+ expect($LOAD_PATH).to receive(:map).and_return([])
if Gem::Specification.respond_to? :latest_specs
- Gem::Specification.should_receive(:latest_specs).with(true).and_return(gems)
- gems[0].should_receive(:matches_for_glob).with(/chef\/knife\/\*\.rb\{(.*),\.rb,(.*)\}/).and_return(gem_files)
+ expect(Gem::Specification).to receive(:latest_specs).with(true).and_return(gems)
+ expect(gems[0]).to receive(:matches_for_glob).with(/chef\/knife\/\*\.rb\{(.*),\.rb,(.*)\}/).and_return(gem_files)
else
- Gem.source_index.should_receive(:latest_specs).with(true).and_return(gems)
- gems[0].should_receive(:require_paths).twice.and_return(['lib'])
- gems[0].should_receive(:full_gem_path).and_return('/usr/lib/ruby/gems/knife-ec2-0.5.12')
- Dir.should_receive(:[]).with('/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/*.rb').and_return(gem_files)
+ expect(Gem.source_index).to receive(:latest_specs).with(true).and_return(gems)
+ expect(gems[0]).to receive(:require_paths).twice.and_return(['lib'])
+ expect(gems[0]).to receive(:full_gem_path).and_return('/usr/lib/ruby/gems/knife-ec2-0.5.12')
+ expect(Dir).to receive(:[]).with('/usr/lib/ruby/gems/knife-ec2-0.5.12/lib/chef/knife/*.rb').and_return(gem_files)
end
- @loader.should_receive(:find_subcommands_via_dirglob).and_return({})
- @loader.find_subcommands_via_rubygems.values.select { |file| file =~ /knife-ec2/ }.sort.should == gem_files
+ expect(@loader).to receive(:find_subcommands_via_dirglob).and_return({})
+ expect(@loader.find_subcommands_via_rubygems.values.select { |file| file =~ /knife-ec2/ }.sort).to eq(gem_files)
end
it "finds files using a dirglob when rubygems is not available" do
- @loader.find_subcommands_via_dirglob.should include('chef/knife/node_create')
- @loader.find_subcommands_via_dirglob.each {|rel_path, abs_path| abs_path.should match(%r[chef/knife/.+])}
+ expect(@loader.find_subcommands_via_dirglob).to include('chef/knife/node_create')
+ @loader.find_subcommands_via_dirglob.each {|rel_path, abs_path| expect(abs_path).to match(%r[chef/knife/.+])}
end
it "finds user-specific subcommands in the user's ~/.chef directory" do
expected_command = File.join(@home, '.chef', 'plugins', 'knife', 'example_home_subcommand.rb')
- @loader.site_subcommands.should include(expected_command)
+ expect(@loader.site_subcommands).to include(expected_command)
end
it "finds repo specific subcommands by searching for a .chef directory" do
expected_command = File.join(CHEF_SPEC_DATA, 'knife-site-subcommands', 'plugins', 'knife', 'example_subcommand.rb')
- @loader.site_subcommands.should include(expected_command)
+ expect(@loader.site_subcommands).to include(expected_command)
end
- describe "finding 3rd party plugins" do
+ # https://github.com/opscode/chef-dk/issues/227
+ #
+ # `knife` in ChefDK isn't from a gem install, it's directly run from a clone
+ # of the source, but there can be one or more versions of chef also installed
+ # as a gem. If the gem install contains a command that doesn't exist in the
+ # source tree of the "primary" chef install, it can be loaded and cause an
+ # error. We also want to ensure that we only load builtin commands from the
+ # "primary" chef install.
+ context "when a different version of chef is also installed as a gem" do
+
+ let(:all_found_commands) do
+ [
+ "/opt/chefdk/embedded/apps/chef/lib/chef/knife/bootstrap.rb",
+ "/opt/chefdk/embedded/apps/chef/lib/chef/knife/client_bulk_delete.rb",
+ "/opt/chefdk/embedded/apps/chef/lib/chef/knife/client_create.rb",
+
+ # We use the fake version 1.0.0 because that version doesn't exist,
+ # which ensures it won't ever equal "chef-#{Chef::VERSION}"
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/bootstrap.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/client_bulk_delete.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/client_create.rb",
+
+ # Test that we don't accept a version number that is different only in
+ # trailing characters, e.g. we are running Chef 12.0.0 but there is a
+ # Chef 12.0.0.rc.0 gem also:
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-#{Chef::VERSION}.rc.0/lib/chef/knife/thing.rb",
+
+ # This command is "extra" compared to what's in the embedded/apps/chef install:
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/data_bag_secret_options.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-vault-2.2.4/lib/chef/knife/decrypt.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/knife-spork-1.4.1/lib/chef/knife/spork-bump.rb",
+
+ # These are fake commands that have names designed to test that the
+ # regex is strict enough
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-foo-#{Chef::VERSION}/lib/chef/knife/chef-foo.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/foo-chef-#{Chef::VERSION}/lib/chef/knife/foo-chef.rb",
+
+ # In a real scenario, we'd use rubygems APIs to only select the most
+ # recent gem, but for this test we want to check that we're doing the
+ # right thing both when the plugin version matches and does not match
+ # the current chef version. Looking at
+ # `SubcommandLoader::MATCHES_THIS_CHEF_GEM` and
+ # `SubcommandLoader::MATCHES_CHEF_GEM` should make it clear why we want
+ # to test these two cases.
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-bar-1.0.0/lib/chef/knife/chef-bar.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb"
+ ]
+ end
+
+ let(:expected_valid_commands) do
+ [
+ "/opt/chefdk/embedded/apps/chef/lib/chef/knife/bootstrap.rb",
+ "/opt/chefdk/embedded/apps/chef/lib/chef/knife/client_bulk_delete.rb",
+ "/opt/chefdk/embedded/apps/chef/lib/chef/knife/client_create.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-vault-2.2.4/lib/chef/knife/decrypt.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/knife-spork-1.4.1/lib/chef/knife/spork-bump.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-foo-#{Chef::VERSION}/lib/chef/knife/chef-foo.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/foo-chef-#{Chef::VERSION}/lib/chef/knife/foo-chef.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-bar-1.0.0/lib/chef/knife/chef-bar.rb",
+ "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/bar-chef-1.0.0/lib/chef/knife/bar-chef.rb"
+ ]
+ end
+
+ before do
+ expect(@loader).to receive(:find_files_latest_gems).with("chef/knife/*.rb").and_return(all_found_commands)
+ expect(@loader).to receive(:find_subcommands_via_dirglob).and_return({})
+ end
+
+ it "ignores commands from the non-matching gem install" do
+ expect(@loader.find_subcommands_via_rubygems.values).to eq(expected_valid_commands)
+ end
+
+ end
+
+ describe "finding 3rd party plugins" do
let(:env_home) { "/home/alice" }
let(:manifest_path) { env_home + "/.chef/plugin_manifest.json" }
before do
env_dup = ENV.to_hash
- ENV.stub(:[]).and_return { |key| env_dup[key] }
- ENV.stub(:[]).with("HOME").and_return(env_home)
+ allow(ENV).to receive(:[]) { |key| env_dup[key] }
+ allow(ENV).to receive(:[]).with("HOME").and_return(env_home)
end
context "when there is not a ~/.chef/plugin_manifest.json file" do
before do
- File.stub(:exist?).with(manifest_path).and_return(false)
+ allow(File).to receive(:exist?).with(manifest_path).and_return(false)
end
it "searches rubygems for plugins" do
if Gem::Specification.respond_to?(:latest_specs)
- Gem::Specification.should_receive(:latest_specs).and_call_original
+ expect(Gem::Specification).to receive(:latest_specs).and_call_original
else
- Gem.source_index.should_receive(:latest_specs).and_call_original
+ expect(Gem.source_index).to receive(:latest_specs).and_call_original
end
@loader.subcommand_files.each do |require_path|
- require_path.should match(/chef\/knife\/.*|plugins\/knife\/.*/)
+ expect(require_path).to match(/chef\/knife\/.*|plugins\/knife\/.*/)
end
end
context "and HOME environment variable is not set" do
before do
- ENV.stub(:[]).with("HOME").and_return(nil)
+ allow(ENV).to receive(:[]).with("HOME").and_return(nil)
end
it "searches rubygems for plugins" do
if Gem::Specification.respond_to?(:latest_specs)
- Gem::Specification.should_receive(:latest_specs).and_call_original
+ expect(Gem::Specification).to receive(:latest_specs).and_call_original
else
- Gem.source_index.should_receive(:latest_specs).and_call_original
+ expect(Gem.source_index).to receive(:latest_specs).and_call_original
end
@loader.subcommand_files.each do |require_path|
- require_path.should match(/chef\/knife\/.*|plugins\/knife\/.*/)
+ expect(require_path).to match(/chef\/knife\/.*|plugins\/knife\/.*/)
end
end
end
@@ -135,13 +209,13 @@ describe Chef::Knife::SubcommandLoader do
let(:manifest_json) { Chef::JSONCompat.to_json(manifest_content) }
before do
- File.stub(:exist?).with(manifest_path).and_return(true)
- File.stub(:read).with(manifest_path).and_return(manifest_json)
+ allow(File).to receive(:exist?).with(manifest_path).and_return(true)
+ allow(File).to receive(:read).with(manifest_path).and_return(manifest_json)
end
it "uses paths from the manifest instead of searching gems" do
- Gem::Specification.should_not_receive(:latest_specs).and_call_original
- @loader.subcommand_files.should include(ec2_server_create_plugin)
+ expect(Gem::Specification).not_to receive(:latest_specs).and_call_original
+ expect(@loader.subcommand_files).to include(ec2_server_create_plugin)
end
end
diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb
index ed1037ebd5..83fff4c082 100644
--- a/spec/unit/knife/core/ui_spec.rb
+++ b/spec/unit/knife/core/ui_spec.rb
@@ -67,16 +67,16 @@ describe Chef::Knife::UI do
@ui.config[:disable_editing] = false
@ui.config[:editor] = my_editor
@mock = double('Tempfile')
- @mock.should_receive(:sync=).with(true)
- @mock.should_receive(:puts).with(json_from_ruby)
- @mock.should_receive(:close)
- @mock.should_receive(:path).at_least(:once).and_return(temp_path)
- Tempfile.should_receive(:open).with([ 'knife-edit-', '.json' ]).and_yield(@mock)
+ expect(@mock).to receive(:sync=).with(true)
+ expect(@mock).to receive(:puts).with(json_from_ruby)
+ expect(@mock).to receive(:close)
+ expect(@mock).to receive(:path).at_least(:once).and_return(temp_path)
+ expect(Tempfile).to receive(:open).with([ 'knife-edit-', '.json' ]).and_yield(@mock)
end
context "and the editor works" do
before do
- @ui.should_receive(:system).with("#{my_editor} #{temp_path}").and_return(true)
- IO.should_receive(:read).with(temp_path).and_return(json_from_editor)
+ expect(@ui).to receive(:system).with("#{my_editor} #{temp_path}").and_return(true)
+ expect(IO).to receive(:read).with(temp_path).and_return(json_from_editor)
end
context "when parse_output is false" do
@@ -93,8 +93,8 @@ describe Chef::Knife::UI do
end
context "when running the editor fails with nil" do
before do
- @ui.should_receive(:system).with("#{my_editor} #{temp_path}").and_return(nil)
- IO.should_not_receive(:read)
+ expect(@ui).to receive(:system).with("#{my_editor} #{temp_path}").and_return(nil)
+ expect(IO).not_to receive(:read)
end
it "throws an exception" do
expect{ subject }.to raise_error(RuntimeError)
@@ -102,8 +102,8 @@ describe Chef::Knife::UI do
end
context "when running the editor fails with false" do
before do
- @ui.should_receive(:system).with("#{my_editor} #{temp_path}").and_return(false)
- IO.should_not_receive(:read)
+ expect(@ui).to receive(:system).with("#{my_editor} #{temp_path}").and_return(false)
+ expect(IO).not_to receive(:read)
end
it "throws an exception" do
expect{ subject }.to raise_error(RuntimeError)
@@ -115,13 +115,13 @@ describe Chef::Knife::UI do
@ui.config[:disable_editing] = false
@ui.config[:editor] = my_editor
@tempfile = Tempfile.new([ 'knife-edit-', '.json' ])
- Tempfile.should_receive(:open).with([ 'knife-edit-', '.json' ]).and_yield(@tempfile)
+ expect(Tempfile).to receive(:open).with([ 'knife-edit-', '.json' ]).and_yield(@tempfile)
end
context "and the editor works" do
before do
- @ui.should_receive(:system).with("#{my_editor} #{@tempfile.path}").and_return(true)
- IO.should_receive(:read).with(@tempfile.path).and_return(json_from_editor)
+ expect(@ui).to receive(:system).with("#{my_editor} #{@tempfile.path}").and_return(true)
+ expect(IO).to receive(:read).with(@tempfile.path).and_return(json_from_editor)
end
context "when parse_output is false" do
@@ -153,33 +153,33 @@ describe Chef::Knife::UI do
describe "format_list_for_display" do
it "should print the full hash if --with-uri is true" do
@ui.config[:with_uri] = true
- @ui.format_list_for_display({ :marcy => :playground }).should == { :marcy => :playground }
+ expect(@ui.format_list_for_display({ :marcy => :playground })).to eq({ :marcy => :playground })
end
it "should print only the keys if --with-uri is false" do
@ui.config[:with_uri] = false
- @ui.format_list_for_display({ :marcy => :playground }).should == [ :marcy ]
+ expect(@ui.format_list_for_display({ :marcy => :playground })).to eq([ :marcy ])
end
end
shared_examples "an output mehthod handling IO exceptions" do |method|
it "should throw Errno::EIO exceptions" do
- @out.stub(:puts).and_raise(Errno::EIO)
- @err.stub(:puts).and_raise(Errno::EIO)
- lambda {@ui.send(method, "hi")}.should raise_error(Errno::EIO)
+ allow(@out).to receive(:puts).and_raise(Errno::EIO)
+ allow(@err).to receive(:puts).and_raise(Errno::EIO)
+ expect {@ui.send(method, "hi")}.to raise_error(Errno::EIO)
end
it "should ignore Errno::EPIPE exceptions (CHEF-3516)" do
- @out.stub(:puts).and_raise(Errno::EPIPE)
- @err.stub(:puts).and_raise(Errno::EPIPE)
- lambda {@ui.send(method, "hi")}.should raise_error(SystemExit)
+ allow(@out).to receive(:puts).and_raise(Errno::EPIPE)
+ allow(@err).to receive(:puts).and_raise(Errno::EPIPE)
+ expect {@ui.send(method, "hi")}.to raise_error(SystemExit)
end
it "should throw Errno::EPIPE exceptions with -VV (CHEF-3516)" do
@config[:verbosity] = 2
- @out.stub(:puts).and_raise(Errno::EPIPE)
- @err.stub(:puts).and_raise(Errno::EPIPE)
- lambda {@ui.send(method, "hi")}.should raise_error(Errno::EPIPE)
+ allow(@out).to receive(:puts).and_raise(Errno::EPIPE)
+ allow(@err).to receive(:puts).and_raise(Errno::EPIPE)
+ expect {@ui.send(method, "hi")}.to raise_error(Errno::EPIPE)
end
end
@@ -188,12 +188,12 @@ describe Chef::Knife::UI do
it "formats strings appropriately" do
@ui.output("hi")
- @out.string.should == "hi\n"
+ expect(@out.string).to eq("hi\n")
end
it "formats hashes appropriately" do
@ui.output({'hi' => 'a', 'lo' => 'b' })
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
hi: a
lo: b
EOM
@@ -201,12 +201,12 @@ EOM
it "formats empty hashes appropriately" do
@ui.output({})
- @out.string.should == "\n"
+ expect(@out.string).to eq("\n")
end
it "formats arrays appropriately" do
@ui.output([ 'a', 'b' ])
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a
b
EOM
@@ -214,22 +214,22 @@ EOM
it "formats empty arrays appropriately" do
@ui.output([ ])
- @out.string.should == "\n"
+ expect(@out.string).to eq("\n")
end
it "formats single-member arrays appropriately" do
@ui.output([ 'a' ])
- @out.string.should == "a\n"
+ expect(@out.string).to eq("a\n")
end
it "formats nested single-member arrays appropriately" do
@ui.output([ [ 'a' ] ])
- @out.string.should == "a\n"
+ expect(@out.string).to eq("a\n")
end
it "formats nested arrays appropriately" do
@ui.output([ [ 'a', 'b' ], [ 'c', 'd' ]])
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a
b
@@ -240,7 +240,7 @@ EOM
it "formats nested arrays with single- and empty subarrays appropriately" do
@ui.output([ [ 'a', 'b' ], [ 'c' ], [], [ 'd', 'e' ]])
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a
b
@@ -254,7 +254,7 @@ EOM
it "formats arrays of hashes with extra lines in between for readability" do
@ui.output([ { 'a' => 'b', 'c' => 'd' }, { 'x' => 'y' }, { 'm' => 'n', 'o' => 'p' }])
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a: b
c: d
@@ -267,7 +267,7 @@ EOM
it "formats hashes with empty array members appropriately" do
@ui.output({ 'a' => [], 'b' => 'c' })
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a:
b: c
EOM
@@ -275,7 +275,7 @@ EOM
it "formats hashes with single-member array values appropriately" do
@ui.output({ 'a' => [ 'foo' ], 'b' => 'c' })
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a: foo
b: c
EOM
@@ -283,7 +283,7 @@ EOM
it "formats hashes with array members appropriately" do
@ui.output({ 'a' => [ 'foo', 'bar' ], 'b' => 'c' })
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a:
foo
bar
@@ -293,7 +293,7 @@ EOM
it "formats hashes with single-member nested array values appropriately" do
@ui.output({ 'a' => [ [ 'foo' ] ], 'b' => 'c' })
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a:
foo
b: c
@@ -304,12 +304,12 @@ EOM
@ui.output({ 'a' => [ [ 'foo', 'bar' ], [ 'baz', 'bjork' ] ], 'b' => 'c' })
# XXX: using a HEREDOC at this point results in a line with required spaces which auto-whitespace removal settings
# on editors will remove and will break this test.
- @out.string.should == "a:\n foo\n bar\n \n baz\n bjork\nb: c\n"
+ expect(@out.string).to eq("a:\n foo\n bar\n \n baz\n bjork\nb: c\n")
end
it "formats hashes with hash values appropriately" do
@ui.output({ 'a' => { 'aa' => 'bb', 'cc' => 'dd' }, 'b' => 'c' })
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a:
aa: bb
cc: dd
@@ -319,7 +319,7 @@ EOM
it "formats hashes with empty hash values appropriately" do
@ui.output({ 'a' => { }, 'b' => 'c' })
- @out.string.should == <<EOM
+ expect(@out.string).to eq <<EOM
a:
b: c
EOM
@@ -341,20 +341,20 @@ EOM
describe "format_for_display" do
it "should return the raw data" do
input = { :gi => :go }
- @ui.format_for_display(input).should == input
+ expect(@ui.format_for_display(input)).to eq(input)
end
describe "with --attribute passed" do
it "should return the deeply nested attribute" do
input = { "gi" => { "go" => "ge" }, "id" => "sample-data-bag-item" }
@ui.config[:attribute] = "gi.go"
- @ui.format_for_display(input).should == { "sample-data-bag-item" => { "gi.go" => "ge" } }
+ expect(@ui.format_for_display(input)).to eq({ "sample-data-bag-item" => { "gi.go" => "ge" } })
end
it "should return multiple attributes" do
input = { "gi" => "go", "hi" => "ho", "id" => "sample-data-bag-item" }
@ui.config[:attribute] = ["gi", "hi"]
- @ui.format_for_display(input).should == { "sample-data-bag-item" => { "gi" => "go", "hi"=> "ho" } }
+ expect(@ui.format_for_display(input)).to eq({ "sample-data-bag-item" => { "gi" => "go", "hi"=> "ho" } })
end
end
@@ -365,8 +365,8 @@ EOM
input.run_list("role[monkey]", "role[churchmouse]")
@ui.config[:run_list] = true
response = @ui.format_for_display(input)
- response["sample-node"]["run_list"][0].should == "role[monkey]"
- response["sample-node"]["run_list"][1].should == "role[churchmouse]"
+ expect(response["sample-node"]["run_list"][0]).to eq("role[monkey]")
+ expect(response["sample-node"]["run_list"][1]).to eq("role[churchmouse]")
end
end
end
@@ -388,7 +388,7 @@ EOM
it "should return an array of the cookbooks with versions" do
expected_response = [ "cookbook_name 3.0.0 2.0.0 1.0.0" ]
response = @ui.format_cookbook_list_for_display(@item)
- response.should == expected_response
+ expect(response).to eq(expected_response)
end
describe "with --with-uri" do
@@ -400,15 +400,15 @@ EOM
"3.0.0" => "http://url/cookbooks/3.0.0"}
}
@ui.config[:with_uri] = true
- @ui.format_cookbook_list_for_display(@item).should == response
+ expect(@ui.format_cookbook_list_for_display(@item)).to eq(response)
end
end
context "when running on Windows" do
before(:each) do
stdout = double('StringIO', :tty? => true)
- @ui.stub(:stdout).and_return(stdout)
- Chef::Platform.stub(:windows?) { true }
+ allow(@ui).to receive(:stdout).and_return(stdout)
+ allow(Chef::Platform).to receive(:windows?) { true }
Chef::Config.reset
end
@@ -444,36 +444,36 @@ EOM
let(:append_instructions) { true }
def run_confirm
- @ui.stub(:stdout).and_return(stdout)
- @ui.stdin.stub(:readline).and_return(answer)
+ allow(@ui).to receive(:stdout).and_return(stdout)
+ allow(@ui.stdin).to receive(:readline).and_return(answer)
@ui.confirm(question, append_instructions, default_choice)
end
def run_confirm_without_exit
- @ui.stub(:stdout).and_return(stdout)
- @ui.stdin.stub(:readline).and_return(answer)
+ allow(@ui).to receive(:stdout).and_return(stdout)
+ allow(@ui.stdin).to receive(:readline).and_return(answer)
@ui.confirm_without_exit(question, append_instructions, default_choice)
end
shared_examples_for "confirm with positive answer" do
it "confirm should return true" do
- run_confirm.should be_true
+ expect(run_confirm).to be_truthy
end
it "confirm_without_exit should return true" do
- run_confirm_without_exit.should be_true
+ expect(run_confirm_without_exit).to be_truthy
end
end
shared_examples_for "confirm with negative answer" do
it "confirm should exit 3" do
- lambda {
+ expect {
run_confirm
- }.should raise_error(SystemExit) { |e| e.status.should == 3 }
+ }.to raise_error(SystemExit) { |e| expect(e.status).to eq(3) }
end
it "confirm_without_exit should return false" do
- run_confirm_without_exit.should be_false
+ expect(run_confirm_without_exit).to be_falsey
end
end
@@ -482,7 +482,7 @@ EOM
it "should show 'Y/n' in the instructions" do
run_confirm
- output.should include("Y/n")
+ expect(output).to include("Y/n")
end
describe "with empty answer" do
@@ -503,7 +503,7 @@ EOM
it "should show 'y/N' in the instructions" do
run_confirm
- output.should include("y/N")
+ expect(output).to include("y/N")
end
describe "with empty answer" do
@@ -538,8 +538,8 @@ EOM
describe "with --y or --yes passed" do
it "should return true" do
@ui.config[:yes] = true
- run_confirm.should be_true
- output.should eq("")
+ expect(run_confirm).to be_truthy
+ expect(output).to eq("")
end
end
end
@@ -547,18 +547,18 @@ EOM
describe "when asking for free-form user input" do
it "asks a question and returns the answer provided by the user" do
out = StringIO.new
- @ui.stub(:stdout).and_return(out)
- @ui.stub(:stdin).and_return(StringIO.new("http://mychefserver.example.com\n"))
- @ui.ask_question("your chef server URL?").should == "http://mychefserver.example.com"
- out.string.should == "your chef server URL?"
+ allow(@ui).to receive(:stdout).and_return(out)
+ allow(@ui).to receive(:stdin).and_return(StringIO.new("http://mychefserver.example.com\n"))
+ expect(@ui.ask_question("your chef server URL?")).to eq("http://mychefserver.example.com")
+ expect(out.string).to eq("your chef server URL?")
end
it "suggests a default setting and returns the default when the user's response only contains whitespace" do
out = StringIO.new
- @ui.stub(:stdout).and_return(out)
- @ui.stub(:stdin).and_return(StringIO.new(" \n"))
- @ui.ask_question("your chef server URL? ", :default => 'http://localhost:4000').should == "http://localhost:4000"
- out.string.should == "your chef server URL? [http://localhost:4000] "
+ allow(@ui).to receive(:stdout).and_return(out)
+ allow(@ui).to receive(:stdin).and_return(StringIO.new(" \n"))
+ expect(@ui.ask_question("your chef server URL? ", :default => 'http://localhost:4000')).to eq("http://localhost:4000")
+ expect(out.string).to eq("your chef server URL? [http://localhost:4000] ")
end
end
diff --git a/spec/unit/knife/data_bag_from_file_spec.rb b/spec/unit/knife/data_bag_from_file_spec.rb
index 8de046e7a4..3882bff349 100644
--- a/spec/unit/knife/data_bag_from_file_spec.rb
+++ b/spec/unit/knife/data_bag_from_file_spec.rb
@@ -26,7 +26,7 @@ Chef::Knife::DataBagFromFile.load_deps
describe Chef::Knife::DataBagFromFile do
before :each do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
Chef::Config[:node_name] = "webmonkey.example.com"
FileUtils.mkdir_p([db_folder, db_folder2])
db_file.write(Chef::JSONCompat.to_json(plain_data))
diff --git a/spec/unit/knife/environment_compare_spec.rb b/spec/unit/knife/environment_compare_spec.rb
index 3606b617a9..6d4d3ead52 100644
--- a/spec/unit/knife/environment_compare_spec.rb
+++ b/spec/unit/knife/environment_compare_spec.rb
@@ -27,21 +27,21 @@ describe Chef::Knife::EnvironmentCompare do
"citm" => "http://localhost:4000/environments/citm"
}
- @knife.stub(:environment_list).and_return(@environments)
+ allow(@knife).to receive(:environment_list).and_return(@environments)
@constraints = {
"cita" => { "foo" => "= 1.0.1", "bar" => "= 0.0.4" },
"citm" => { "foo" => "= 1.0.1", "bar" => "= 0.0.2" }
}
- @knife.stub(:constraint_list).and_return(@constraints)
+ allow(@knife).to receive(:constraint_list).and_return(@constraints)
@cookbooks = { "foo"=>"= 1.0.1", "bar"=>"= 0.0.1" }
- @knife.stub(:cookbook_list).and_return(@cookbooks)
+ allow(@knife).to receive(:cookbook_list).and_return(@cookbooks)
@rest_double = double('rest')
- @knife.stub(:rest).and_return(@rest_double)
+ allow(@knife).to receive(:rest).and_return(@rest_double)
@cookbook_names = ['apache2', 'mysql', 'foo', 'bar', 'dummy', 'chef_handler']
@base_url = 'https://server.example.com/cookbooks'
@cookbook_data = {}
@@ -51,10 +51,10 @@ describe Chef::Knife::EnvironmentCompare do
'url' => "#{@base_url}/#{item}/1.0.1"}]}
end
- @rest_double.stub(:get_rest).with("/cookbooks?num_versions=1").and_return(@cookbook_data)
+ allow(@rest_double).to receive(:get_rest).with("/cookbooks?num_versions=1").and_return(@cookbook_data)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe 'run' do
@@ -62,14 +62,14 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:format] = 'summary'
@knife.run
@environments.each do |item, url|
- @stdout.string.should match /#{item}/ and @stdout.string.lines.count.should be 4
+ expect(@stdout.string).to match /#{item}/ and expect(@stdout.string.lines.count).to be 4
end
end
it 'should display 4 number of lines' do
@knife.config[:format] = 'summary'
@knife.run
- @stdout.string.lines.count.should be 4
+ expect(@stdout.string.lines.count).to be 4
end
end
@@ -79,7 +79,7 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:mismatch] = true
@knife.run
@constraints.each do |item, ver|
- @stdout.string.should match /#{ver[1]}/
+ expect(@stdout.string).to match /#{ver[1]}/
end
end
@@ -87,7 +87,7 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:format] = 'summary'
@knife.config[:mismatch] = true
@knife.run
- @stdout.string.lines.count.should be 3
+ expect(@stdout.string.lines.count).to be 3
end
end
@@ -97,7 +97,7 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:all] = true
@knife.run
@constraints.each do |item, ver|
- @stdout.string.should match /#{ver[1]}/
+ expect(@stdout.string).to match /#{ver[1]}/
end
end
@@ -105,7 +105,7 @@ describe Chef::Knife::EnvironmentCompare do
@knife.config[:format] = 'summary'
@knife.config[:all] = true
@knife.run
- @stdout.string.lines.count.should be 8
+ expect(@stdout.string.lines.count).to be 8
end
end
diff --git a/spec/unit/knife/environment_create_spec.rb b/spec/unit/knife/environment_create_spec.rb
index 81bf6731b7..04e45048ef 100644
--- a/spec/unit/knife/environment_create_spec.rb
+++ b/spec/unit/knife/environment_create_spec.rb
@@ -21,49 +21,49 @@ require 'spec_helper'
describe Chef::Knife::EnvironmentCreate do
before(:each) do
@knife = Chef::Knife::EnvironmentCreate.new
- @knife.stub(:msg).and_return true
- @knife.stub(:output).and_return true
- @knife.stub(:show_usage).and_return true
+ allow(@knife).to receive(:msg).and_return true
+ allow(@knife).to receive(:output).and_return true
+ allow(@knife).to receive(:show_usage).and_return true
@knife.name_args = [ "production" ]
@environment = Chef::Environment.new
- @environment.stub(:save)
+ allow(@environment).to receive(:save)
- Chef::Environment.stub(:new).and_return @environment
- @knife.stub(:edit_data).and_return @environment
+ allow(Chef::Environment).to receive(:new).and_return @environment
+ allow(@knife).to receive(:edit_data).and_return @environment
end
describe "run" do
it "should create a new environment" do
- Chef::Environment.should_receive(:new)
+ expect(Chef::Environment).to receive(:new)
@knife.run
end
it "should set the environment name" do
- @environment.should_receive(:name).with("production")
+ expect(@environment).to receive(:name).with("production")
@knife.run
end
it "should not print the environment" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
it "should prompt you to edit the data" do
- @knife.should_receive(:edit_data).with(@environment)
+ expect(@knife).to receive(:edit_data).with(@environment)
@knife.run
end
it "should save the environment" do
- @environment.should_receive(:save)
+ expect(@environment).to receive(:save)
@knife.run
end
it "should show usage and exit when no environment name is provided" do
@knife.name_args = [ ]
- @knife.ui.should_receive(:fatal)
- @knife.should_receive(:show_usage)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:fatal)
+ expect(@knife).to receive(:show_usage)
+ expect { @knife.run }.to raise_error(SystemExit)
end
describe "with --description" do
@@ -72,7 +72,7 @@ describe Chef::Knife::EnvironmentCreate do
end
it "should set the description" do
- @environment.should_receive(:description).with("This is production")
+ expect(@environment).to receive(:description).with("This is production")
@knife.run
end
end
@@ -83,7 +83,7 @@ describe Chef::Knife::EnvironmentCreate do
end
it "should pretty print the environment, formatted for display" do
- @knife.should_receive(:output).with(@environment)
+ expect(@knife).to receive(:output).with(@environment)
@knife.run
end
end
diff --git a/spec/unit/knife/environment_delete_spec.rb b/spec/unit/knife/environment_delete_spec.rb
index 0f6b5f3272..95df6e15fe 100644
--- a/spec/unit/knife/environment_delete_spec.rb
+++ b/spec/unit/knife/environment_delete_spec.rb
@@ -21,50 +21,50 @@ require 'spec_helper'
describe Chef::Knife::EnvironmentDelete do
before(:each) do
@knife = Chef::Knife::EnvironmentDelete.new
- @knife.stub(:msg).and_return true
- @knife.stub(:output).and_return true
- @knife.stub(:show_usage).and_return true
- @knife.stub(:confirm).and_return true
+ allow(@knife).to receive(:msg).and_return true
+ allow(@knife).to receive(:output).and_return true
+ allow(@knife).to receive(:show_usage).and_return true
+ allow(@knife).to receive(:confirm).and_return true
@knife.name_args = [ "production" ]
@environment = Chef::Environment.new
@environment.name("production")
@environment.description("Please delete me")
- @environment.stub(:destroy).and_return true
- Chef::Environment.stub(:load).and_return @environment
+ allow(@environment).to receive(:destroy).and_return true
+ allow(Chef::Environment).to receive(:load).and_return @environment
end
it "should confirm that you want to delete" do
- @knife.should_receive(:confirm)
+ expect(@knife).to receive(:confirm)
@knife.run
end
it "should load the environment" do
- Chef::Environment.should_receive(:load).with("production")
+ expect(Chef::Environment).to receive(:load).with("production")
@knife.run
end
it "should delete the environment" do
- @environment.should_receive(:destroy)
+ expect(@environment).to receive(:destroy)
@knife.run
end
it "should not print the environment" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
it "should show usage and exit when no environment name is provided" do
@knife.name_args = []
- @knife.ui.should_receive(:fatal)
- @knife.should_receive(:show_usage)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:fatal)
+ expect(@knife).to receive(:show_usage)
+ expect { @knife.run }.to raise_error(SystemExit)
end
describe "with --print-after" do
it "should pretty print the environment, formatted for display" do
@knife.config[:print_after] = true
- @knife.should_receive(:output).with(@environment)
+ expect(@knife).to receive(:output).with(@environment)
@knife.run
end
end
diff --git a/spec/unit/knife/environment_edit_spec.rb b/spec/unit/knife/environment_edit_spec.rb
index a82ead0b6b..61c2663a41 100644
--- a/spec/unit/knife/environment_edit_spec.rb
+++ b/spec/unit/knife/environment_edit_spec.rb
@@ -21,26 +21,26 @@ require 'spec_helper'
describe Chef::Knife::EnvironmentEdit do
before(:each) do
@knife = Chef::Knife::EnvironmentEdit.new
- @knife.ui.stub(:msg).and_return true
- @knife.ui.stub(:output).and_return true
- @knife.ui.stub(:show_usage).and_return true
+ allow(@knife.ui).to receive(:msg).and_return true
+ allow(@knife.ui).to receive(:output).and_return true
+ allow(@knife.ui).to receive(:show_usage).and_return true
@knife.name_args = [ "production" ]
@environment = Chef::Environment.new
@environment.name("production")
@environment.description("Please edit me")
- @environment.stub(:save).and_return true
- Chef::Environment.stub(:load).and_return @environment
- @knife.ui.stub(:edit_data).and_return @environment
+ allow(@environment).to receive(:save).and_return true
+ allow(Chef::Environment).to receive(:load).and_return @environment
+ allow(@knife.ui).to receive(:edit_data).and_return @environment
end
it "should load the environment" do
- Chef::Environment.should_receive(:load).with("production")
+ expect(Chef::Environment).to receive(:load).with("production")
@knife.run
end
it "should let you edit the environment" do
- @knife.ui.should_receive(:edit_data).with(@environment)
+ expect(@knife.ui).to receive(:edit_data).with(@environment)
@knife.run
end
@@ -48,31 +48,31 @@ describe Chef::Knife::EnvironmentEdit do
pansy = Chef::Environment.new
@environment.name("new_environment_name")
- @knife.ui.should_receive(:edit_data).with(@environment).and_return(pansy)
- pansy.should_receive(:save)
+ expect(@knife.ui).to receive(:edit_data).with(@environment).and_return(pansy)
+ expect(pansy).to receive(:save)
@knife.run
end
it "should not save the unedited environment data" do
- @environment.should_not_receive(:save)
+ expect(@environment).not_to receive(:save)
@knife.run
end
it "should not print the environment" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
it "shoud show usage and exit when no environment name is provided" do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect { @knife.run }.to raise_error(SystemExit)
end
describe "with --print-after" do
it "should pretty print the environment, formatted for display" do
@knife.config[:print_after] = true
- @knife.ui.should_receive(:output).with(@environment)
+ expect(@knife.ui).to receive(:output).with(@environment)
@knife.run
end
end
diff --git a/spec/unit/knife/environment_from_file_spec.rb b/spec/unit/knife/environment_from_file_spec.rb
index 562e7f8cf5..d150e5ee64 100644
--- a/spec/unit/knife/environment_from_file_spec.rb
+++ b/spec/unit/knife/environment_from_file_spec.rb
@@ -23,24 +23,24 @@ Chef::Knife::EnvironmentFromFile.load_deps
describe Chef::Knife::EnvironmentFromFile do
before(:each) do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
@knife = Chef::Knife::EnvironmentFromFile.new
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
@knife.name_args = [ "spec.rb" ]
@environment = Chef::Environment.new
@environment.name("spec")
@environment.description("runs the unit tests")
@environment.cookbook_versions({"apt" => "= 1.2.3"})
- @environment.stub(:save).and_return true
- @knife.loader.stub(:load_from).and_return @environment
+ allow(@environment).to receive(:save).and_return true
+ allow(@knife.loader).to receive(:load_from).and_return @environment
end
describe "run" do
it "loads the environment data from a file and saves it" do
- @knife.loader.should_receive(:load_from).with('environments', 'spec.rb').and_return(@environment)
- @environment.should_receive(:save)
+ expect(@knife.loader).to receive(:load_from).with('environments', 'spec.rb').and_return(@environment)
+ expect(@environment).to receive(:save)
@knife.run
end
@@ -48,41 +48,41 @@ describe Chef::Knife::EnvironmentFromFile do
before(:each) do
@env_apple = @environment.dup
@env_apple.name("apple")
- @knife.loader.stub(:load_from).with("apple.rb").and_return @env_apple
+ allow(@knife.loader).to receive(:load_from).with("apple.rb").and_return @env_apple
end
it "loads multiple environments if given" do
@knife.name_args = [ "spec.rb", "apple.rb" ]
- @environment.should_receive(:save).twice
+ expect(@environment).to receive(:save).twice
@knife.run
end
it "loads all environments with -a" do
- File.stub(:expand_path).with("./environments/").and_return("/tmp/environments")
- Dir.stub(:glob).with("/tmp/environments/*.{json,rb}").and_return(["spec.rb", "apple.rb"])
+ allow(File).to receive(:expand_path).with("./environments/").and_return("/tmp/environments")
+ allow(Dir).to receive(:glob).with("/tmp/environments/*.{json,rb}").and_return(["spec.rb", "apple.rb"])
@knife.name_args = []
- @knife.stub(:config).and_return({:all => true})
- @environment.should_receive(:save).twice
+ allow(@knife).to receive(:config).and_return({:all => true})
+ expect(@environment).to receive(:save).twice
@knife.run
end
end
it "should not print the environment" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
it "should show usage and exit if not filename is provided" do
@knife.name_args = []
- @knife.ui.should_receive(:fatal)
- @knife.should_receive(:show_usage)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:fatal)
+ expect(@knife).to receive(:show_usage)
+ expect { @knife.run }.to raise_error(SystemExit)
end
describe "with --print-after" do
it "should pretty print the environment, formatted for display" do
@knife.config[:print_after] = true
- @knife.should_receive(:output)
+ expect(@knife).to receive(:output)
@knife.run
end
end
diff --git a/spec/unit/knife/environment_list_spec.rb b/spec/unit/knife/environment_list_spec.rb
index 25d2714d23..6488a073b6 100644
--- a/spec/unit/knife/environment_list_spec.rb
+++ b/spec/unit/knife/environment_list_spec.rb
@@ -21,33 +21,33 @@ require 'spec_helper'
describe Chef::Knife::EnvironmentList do
before(:each) do
@knife = Chef::Knife::EnvironmentList.new
- @knife.stub(:msg).and_return true
- @knife.stub(:output).and_return true
- @knife.stub(:show_usage).and_return true
+ allow(@knife).to receive(:msg).and_return true
+ allow(@knife).to receive(:output).and_return true
+ allow(@knife).to receive(:show_usage).and_return true
@environments = {
"production" => "http://localhost:4000/environments/production",
"development" => "http://localhost:4000/environments/development",
"testing" => "http://localhost:4000/environments/testing"
}
- Chef::Environment.stub(:list).and_return @environments
+ allow(Chef::Environment).to receive(:list).and_return @environments
end
it "should make an api call to list the environments" do
- Chef::Environment.should_receive(:list)
+ expect(Chef::Environment).to receive(:list)
@knife.run
end
it "should print the environment names in a sorted list" do
names = @environments.keys.sort { |a,b| a <=> b }
- @knife.should_receive(:output).with(names)
+ expect(@knife).to receive(:output).with(names)
@knife.run
end
describe "with --with-uri" do
it "should print and unsorted list of the environments and their URIs" do
@knife.config[:with_uri] = true
- @knife.should_receive(:output).with(@environments)
+ expect(@knife).to receive(:output).with(@environments)
@knife.run
end
end
diff --git a/spec/unit/knife/environment_show_spec.rb b/spec/unit/knife/environment_show_spec.rb
index c7b0c21657..caac958f8e 100644
--- a/spec/unit/knife/environment_show_spec.rb
+++ b/spec/unit/knife/environment_show_spec.rb
@@ -21,32 +21,32 @@ require 'spec_helper'
describe Chef::Knife::EnvironmentShow do
before(:each) do
@knife = Chef::Knife::EnvironmentShow.new
- @knife.stub(:msg).and_return true
- @knife.stub(:output).and_return true
- @knife.stub(:show_usage).and_return true
+ allow(@knife).to receive(:msg).and_return true
+ allow(@knife).to receive(:output).and_return true
+ allow(@knife).to receive(:show_usage).and_return true
@knife.name_args = [ "production" ]
@environment = Chef::Environment.new
@environment.name("production")
@environment.description("Look at me!")
- Chef::Environment.stub(:load).and_return @environment
+ allow(Chef::Environment).to receive(:load).and_return @environment
end
it "should load the environment" do
- Chef::Environment.should_receive(:load).with("production")
+ expect(Chef::Environment).to receive(:load).with("production")
@knife.run
end
it "should pretty print the environment, formatted for display" do
- @knife.should_receive(:format_for_display).with(@environment)
- @knife.should_receive(:output)
+ expect(@knife).to receive(:format_for_display).with(@environment)
+ expect(@knife).to receive(:output)
@knife.run
end
it "should show usage and exit when no environment name is provided" do
@knife.name_args = []
- @knife.ui.should_receive(:fatal)
- @knife.should_receive(:show_usage)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:fatal)
+ expect(@knife).to receive(:show_usage)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/index_rebuild_spec.rb b/spec/unit/knife/index_rebuild_spec.rb
index 3a8ec00651..6c3b60bd88 100644
--- a/spec/unit/knife/index_rebuild_spec.rb
+++ b/spec/unit/knife/index_rebuild_spec.rb
@@ -24,18 +24,18 @@ describe Chef::Knife::IndexRebuild do
let(:rest_client){double(Chef::REST)}
let(:stub_rest!) do
- knife.should_receive(:rest).and_return(rest_client)
+ expect(knife).to receive(:rest).and_return(rest_client)
end
before :each do
# This keeps the test output clean
- knife.ui.stub(:stdout).and_return(StringIO.new)
+ allow(knife.ui).to receive(:stdout).and_return(StringIO.new)
end
context "#grab_api_info" do
let(:http_not_found_response) do
e = Net::HTTPNotFound.new("1.1", 404, "blah")
- e.stub(:[]).with("x-ops-api-info").and_return(api_header_value)
+ allow(e).to receive(:[]).with("x-ops-api-info").and_return(api_header_value)
e
end
@@ -45,20 +45,20 @@ describe Chef::Knife::IndexRebuild do
before(:each) do
stub_rest!
- rest_client.stub(:get_rest).and_raise(http_server_exception)
+ allow(rest_client).to receive(:get_rest).and_raise(http_server_exception)
end
context "against a Chef 11 server" do
let(:api_header_value){"flavor=osc;version=11.0.0;erchef=1.2.3"}
it "retrieves API information" do
- knife.grab_api_info.should == {"flavor" => "osc", "version" => "11.0.0", "erchef" => "1.2.3"}
+ expect(knife.grab_api_info).to eq({"flavor" => "osc", "version" => "11.0.0", "erchef" => "1.2.3"})
end
end # Chef 11
context "against a Chef 10 server" do
let(:api_header_value){nil}
it "finds no API information" do
- knife.grab_api_info.should == {}
+ expect(knife.grab_api_info).to eq({})
end
end # Chef 10
end # grab_api_info
@@ -66,18 +66,18 @@ describe Chef::Knife::IndexRebuild do
context "#unsupported_version?" do
context "with Chef 11 API metadata" do
it "is unsupported" do
- knife.unsupported_version?({"version" => "11.0.0", "flavor" => "osc", "erchef" => "1.2.3"}).should be_true
+ expect(knife.unsupported_version?({"version" => "11.0.0", "flavor" => "osc", "erchef" => "1.2.3"})).to be_truthy
end
it "only truly relies on the version being non-nil" do
- knife.unsupported_version?({"version" => "1", "flavor" => "osc", "erchef" => "1.2.3"}).should be_true
+ expect(knife.unsupported_version?({"version" => "1", "flavor" => "osc", "erchef" => "1.2.3"})).to be_truthy
end
end
context "with Chef 10 API metadata" do
it "is supported" do
# Chef 10 will have no metadata
- knife.unsupported_version?({}).should be_false
+ expect(knife.unsupported_version?({})).to be_falsey
end
end
end # unsupported_version?
@@ -85,7 +85,7 @@ describe Chef::Knife::IndexRebuild do
context "Simulating a 'knife index rebuild' run" do
before :each do
- knife.should_receive(:grab_api_info).and_return(api_info)
+ expect(knife).to receive(:grab_api_info).and_return(api_info)
server_specific_stubs!
end
@@ -97,8 +97,8 @@ describe Chef::Knife::IndexRebuild do
}
end
let(:server_specific_stubs!) do
- knife.should_receive(:unsupported_server_message).with(api_info)
- knife.should_receive(:exit).with(1)
+ expect(knife).to receive(:unsupported_server_message).with(api_info)
+ expect(knife).to receive(:exit).with(1)
end
it "should not be allowed" do
@@ -110,11 +110,11 @@ describe Chef::Knife::IndexRebuild do
let(:api_info){ {} }
let(:server_specific_stubs!) do
stub_rest!
- rest_client.should_receive(:post_rest).with("/search/reindex", {}).and_return("representative output")
- knife.should_not_receive(:unsupported_server_message)
- knife.should_receive(:deprecated_server_message)
- knife.should_receive(:nag)
- knife.should_receive(:output).with("representative output")
+ expect(rest_client).to receive(:post_rest).with("/search/reindex", {}).and_return("representative output")
+ expect(knife).not_to receive(:unsupported_server_message)
+ expect(knife).to receive(:deprecated_server_message)
+ expect(knife).to receive(:nag)
+ expect(knife).to receive(:output).with("representative output")
end
it "should be allowed" do
knife.run
diff --git a/spec/unit/knife/knife_help.rb b/spec/unit/knife/knife_help.rb
index e66a44801b..293bae17f4 100644
--- a/spec/unit/knife/knife_help.rb
+++ b/spec/unit/knife/knife_help.rb
@@ -26,66 +26,66 @@ describe Chef::Knife::Help do
end
it "should return a list of help topics" do
- @knife.help_topics.should include("knife-status")
+ expect(@knife.help_topics).to include("knife-status")
end
it "should run man for you" do
@knife.name_args = [ "shell" ]
- @knife.should_receive(:exec).with(/^man \/.*\/shell.1$/)
+ expect(@knife).to receive(:exec).with(/^man \/.*\/shell.1$/)
@knife.run
end
it "should suggest topics" do
@knife.name_args = [ "list" ]
- @knife.ui.stub(:msg)
- @knife.ui.should_receive(:info).with("Available help topics are: ")
- @knife.ui.should_receive(:msg).with(/knife/)
- @knife.stub(:exec)
- @knife.should_receive(:exit).with(1)
+ allow(@knife.ui).to receive(:msg)
+ expect(@knife.ui).to receive(:info).with("Available help topics are: ")
+ expect(@knife.ui).to receive(:msg).with(/knife/)
+ allow(@knife).to receive(:exec)
+ expect(@knife).to receive(:exit).with(1)
@knife.run
end
describe "find_manpage_path" do
it "should find the man page in the gem" do
- @knife.find_manpage_path("shell").should =~ /distro\/common\/man\/man1\/chef-shell.1$/
+ expect(@knife.find_manpage_path("shell")).to match(/distro\/common\/man\/man1\/chef-shell.1$/)
end
it "should provide the man page name if not in the gem" do
- @knife.find_manpage_path("foo").should == "foo"
+ expect(@knife.find_manpage_path("foo")).to eq("foo")
end
end
describe "find_manpages_for_query" do
it "should error if it does not find a match" do
- @knife.ui.stub(:error)
- @knife.ui.stub(:info)
- @knife.ui.stub(:msg)
- @knife.should_receive(:exit).with(1)
- @knife.ui.should_receive(:error).with("No help found for 'chickens'")
- @knife.ui.should_receive(:msg).with(/knife/)
+ allow(@knife.ui).to receive(:error)
+ allow(@knife.ui).to receive(:info)
+ allow(@knife.ui).to receive(:msg)
+ expect(@knife).to receive(:exit).with(1)
+ expect(@knife.ui).to receive(:error).with("No help found for 'chickens'")
+ expect(@knife.ui).to receive(:msg).with(/knife/)
@knife.find_manpages_for_query("chickens")
end
end
describe "print_help_topics" do
it "should print the known help topics" do
- @knife.ui.stub(:msg)
- @knife.ui.stub(:info)
- @knife.ui.should_receive(:msg).with(/knife/)
+ allow(@knife.ui).to receive(:msg)
+ allow(@knife.ui).to receive(:info)
+ expect(@knife.ui).to receive(:msg).with(/knife/)
@knife.print_help_topics
end
it "should shorten topics prefixed by knife-" do
- @knife.ui.stub(:msg)
- @knife.ui.stub(:info)
- @knife.ui.should_receive(:msg).with(/node/)
+ allow(@knife.ui).to receive(:msg)
+ allow(@knife.ui).to receive(:info)
+ expect(@knife.ui).to receive(:msg).with(/node/)
@knife.print_help_topics
end
it "should not leave topics prefixed by knife-" do
- @knife.ui.stub(:msg)
- @knife.ui.stub(:info)
- @knife.ui.should_not_receive(:msg).with(/knife-node/)
+ allow(@knife.ui).to receive(:msg)
+ allow(@knife.ui).to receive(:info)
+ expect(@knife.ui).not_to receive(:msg).with(/knife-node/)
@knife.print_help_topics
end
end
diff --git a/spec/unit/knife/node_bulk_delete_spec.rb b/spec/unit/knife/node_bulk_delete_spec.rb
index 3faece5469..57a8d0bf64 100644
--- a/spec/unit/knife/node_bulk_delete_spec.rb
+++ b/spec/unit/knife/node_bulk_delete_spec.rb
@@ -26,8 +26,8 @@ describe Chef::Knife::NodeBulkDelete do
@knife = Chef::Knife::NodeBulkDelete.new
@knife.name_args = ["."]
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:confirm).and_return(true)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:confirm).and_return(true)
@nodes = Hash.new
%w{adam brent jacob}.each do |node_name|
@nodes[node_name] = "http://localhost:4000/nodes/#{node_name}"
@@ -40,11 +40,11 @@ describe Chef::Knife::NodeBulkDelete do
inflatedish[name] = Chef::Node.new.tap {|n| n.name(name)}
inflatedish
end
- Chef::Node.should_receive(:list).and_return(@nodes)
+ expect(Chef::Node).to receive(:list).and_return(@nodes)
# I hate not having == defined for anything :(
actual = @knife.all_nodes
- actual.keys.should =~ expected.keys
- actual.values.map {|n| n.name }.should =~ %w[adam brent jacob]
+ expect(actual.keys).to match_array(expected.keys)
+ expect(actual.values.map {|n| n.name }).to match_array(%w[adam brent jacob])
end
end
@@ -53,41 +53,41 @@ describe Chef::Knife::NodeBulkDelete do
@inflatedish_list = @nodes.keys.inject({}) do |nodes_by_name, name|
node = Chef::Node.new()
node.name(name)
- node.stub(:destroy).and_return(true)
+ allow(node).to receive(:destroy).and_return(true)
nodes_by_name[name] = node
nodes_by_name
end
- @knife.stub(:all_nodes).and_return(@inflatedish_list)
+ allow(@knife).to receive(:all_nodes).and_return(@inflatedish_list)
end
it "should print the nodes you are about to delete" do
@knife.run
- @stdout.string.should match(/#{@knife.ui.list(@nodes.keys.sort, :columns_down)}/)
+ expect(@stdout.string).to match(/#{@knife.ui.list(@nodes.keys.sort, :columns_down)}/)
end
it "should confirm you really want to delete them" do
- @knife.ui.should_receive(:confirm)
+ expect(@knife.ui).to receive(:confirm)
@knife.run
end
it "should delete each node" do
@inflatedish_list.each_value do |n|
- n.should_receive(:destroy)
+ expect(n).to receive(:destroy)
end
@knife.run
end
it "should only delete nodes that match the regex" do
@knife.name_args = ['adam']
- @inflatedish_list['adam'].should_receive(:destroy)
- @inflatedish_list['brent'].should_not_receive(:destroy)
- @inflatedish_list['jacob'].should_not_receive(:destroy)
+ expect(@inflatedish_list['adam']).to receive(:destroy)
+ expect(@inflatedish_list['brent']).not_to receive(:destroy)
+ expect(@inflatedish_list['jacob']).not_to receive(:destroy)
@knife.run
end
it "should exit if the regex is not provided" do
@knife.name_args = []
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/node_delete_spec.rb b/spec/unit/knife/node_delete_spec.rb
index 04eca389c6..0941d850e5 100644
--- a/spec/unit/knife/node_delete_spec.rb
+++ b/spec/unit/knife/node_delete_spec.rb
@@ -26,41 +26,41 @@ describe Chef::Knife::NodeDelete do
:print_after => nil
}
@knife.name_args = [ "adam" ]
- @knife.stub(:output).and_return(true)
- @knife.stub(:confirm).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
+ allow(@knife).to receive(:confirm).and_return(true)
@node = Chef::Node.new()
- @node.stub(:destroy).and_return(true)
- Chef::Node.stub(:load).and_return(@node)
+ allow(@node).to receive(:destroy).and_return(true)
+ allow(Chef::Node).to receive(:load).and_return(@node)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe "run" do
it "should confirm that you want to delete" do
- @knife.should_receive(:confirm)
+ expect(@knife).to receive(:confirm)
@knife.run
end
it "should load the node" do
- Chef::Node.should_receive(:load).with("adam").and_return(@node)
+ expect(Chef::Node).to receive(:load).with("adam").and_return(@node)
@knife.run
end
it "should delete the node" do
- @node.should_receive(:destroy).and_return(@node)
+ expect(@node).to receive(:destroy).and_return(@node)
@knife.run
end
it "should not print the node" do
- @knife.should_not_receive(:output).with("poop")
+ expect(@knife).not_to receive(:output).with("poop")
@knife.run
end
describe "with -p or --print-after" do
it "should pretty print the node, formatted for display" do
@knife.config[:print_after] = true
- @knife.should_receive(:format_for_display).with(@node).and_return("poop")
- @knife.should_receive(:output).with("poop")
+ expect(@knife).to receive(:format_for_display).with(@node).and_return("poop")
+ expect(@knife).to receive(:output).with("poop")
@knife.run
end
end
diff --git a/spec/unit/knife/node_edit_spec.rb b/spec/unit/knife/node_edit_spec.rb
index 27db3416f4..58e2da2a1c 100644
--- a/spec/unit/knife/node_edit_spec.rb
+++ b/spec/unit/knife/node_edit_spec.rb
@@ -39,13 +39,13 @@ describe Chef::Knife::NodeEdit do
end
it "should load the node" do
- Chef::Node.should_receive(:load).with("adam").and_return(@node)
+ expect(Chef::Node).to receive(:load).with("adam").and_return(@node)
@knife.node
end
describe "after loading the node" do
before do
- @knife.stub(:node).and_return(@node)
+ allow(@knife).to receive(:node).and_return(@node)
@node.automatic_attrs = {:go => :away}
@node.default_attrs = {:hide => :me}
@node.override_attrs = {:dont => :show}
@@ -56,37 +56,37 @@ describe Chef::Knife::NodeEdit do
it "creates a view of the node without attributes from roles or ohai" do
actual = deserialized_json_view
- actual.should_not have_key("automatic")
- actual.should_not have_key("override")
- actual.should_not have_key("default")
- actual["normal"].should == {"do_show" => "these"}
- actual["run_list"].should == ["recipe[foo]"]
- actual["chef_environment"].should == "prod"
+ expect(actual).not_to have_key("automatic")
+ expect(actual).not_to have_key("override")
+ expect(actual).not_to have_key("default")
+ expect(actual["normal"]).to eq({"do_show" => "these"})
+ expect(actual["run_list"]).to eq(["recipe[foo]"])
+ expect(actual["chef_environment"]).to eq("prod")
end
it "shows the extra attributes when given the --all option" do
@knife.config[:all_attributes] = true
actual = deserialized_json_view
- actual["automatic"].should == {"go" => "away"}
- actual["override"].should == {"dont" => "show"}
- actual["default"].should == {"hide" => "me"}
- actual["normal"].should == {"do_show" => "these"}
- actual["run_list"].should == ["recipe[foo]"]
- actual["chef_environment"].should == "prod"
+ expect(actual["automatic"]).to eq({"go" => "away"})
+ expect(actual["override"]).to eq({"dont" => "show"})
+ expect(actual["default"]).to eq({"hide" => "me"})
+ expect(actual["normal"]).to eq({"do_show" => "these"})
+ expect(actual["run_list"]).to eq(["recipe[foo]"])
+ expect(actual["chef_environment"]).to eq("prod")
end
it "does not consider unedited data updated" do
view = deserialized_json_view
@knife.node_editor.send(:apply_updates, view)
- @knife.node_editor.should_not be_updated
+ expect(@knife.node_editor).not_to be_updated
end
it "considers edited data updated" do
view = deserialized_json_view
view["run_list"] << "role[fuuu]"
@knife.node_editor.send(:apply_updates, view)
- @knife.node_editor.should be_updated
+ expect(@knife.node_editor).to be_updated
end
end
@@ -94,7 +94,7 @@ describe Chef::Knife::NodeEdit do
describe "edit_node" do
before do
- @knife.stub(:node).and_return(@node)
+ allow(@knife).to receive(:node).and_return(@node)
end
let(:subject) { @knife.node_editor.edit_node }
diff --git a/spec/unit/knife/node_environment_set_spec.rb b/spec/unit/knife/node_environment_set_spec.rb
index 46ee1fea18..10267915d7 100644
--- a/spec/unit/knife/node_environment_set_spec.rb
+++ b/spec/unit/knife/node_environment_set_spec.rb
@@ -23,32 +23,32 @@ describe Chef::Knife::NodeEnvironmentSet do
Chef::Config[:node_name] = "webmonkey.example.com"
@knife = Chef::Knife::NodeEnvironmentSet.new
@knife.name_args = [ "adam", "bar" ]
- @knife.stub(:output).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
@node = Chef::Node.new()
@node.name("knifetest-node")
@node.chef_environment << "foo"
- @node.stub(:save).and_return(true)
- Chef::Node.stub(:load).and_return(@node)
+ allow(@node).to receive(:save).and_return(true)
+ allow(Chef::Node).to receive(:load).and_return(@node)
end
describe "run" do
it "should load the node" do
- Chef::Node.should_receive(:load).with("adam")
+ expect(Chef::Node).to receive(:load).with("adam")
@knife.run
end
it "should update the environment" do
@knife.run
- @node.chef_environment.should == 'bar'
+ expect(@node.chef_environment).to eq('bar')
end
it "should save the node" do
- @node.should_receive(:save)
+ expect(@node).to receive(:save)
@knife.run
end
it "should print the environment" do
- @knife.should_receive(:output).and_return(true)
+ expect(@knife).to receive(:output).and_return(true)
@knife.run
end
@@ -58,13 +58,13 @@ describe Chef::Knife::NodeEnvironmentSet do
@stdout = StringIO.new
@stderr = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
it "should exit" do
@knife.name_args = [ "adam" ]
- lambda { @knife.run }.should raise_error SystemExit
+ expect { @knife.run }.to raise_error SystemExit
end
it "should show the user the usage and an error" do
@@ -72,8 +72,8 @@ describe Chef::Knife::NodeEnvironmentSet do
begin ; @knife.run ; rescue SystemExit ; end
- @stdout.string.should eq "USAGE: knife node environment set NODE ENVIRONMENT\n"
- @stderr.string.should eq "FATAL: You must specify a node name and an environment.\n"
+ expect(@stdout.string).to eq "USAGE: knife node environment set NODE ENVIRONMENT\n"
+ expect(@stderr.string).to eq "FATAL: You must specify a node name and an environment.\n"
end
end
end
diff --git a/spec/unit/knife/node_from_file_spec.rb b/spec/unit/knife/node_from_file_spec.rb
index 56a2a08b68..623904753e 100644
--- a/spec/unit/knife/node_from_file_spec.rb
+++ b/spec/unit/knife/node_from_file_spec.rb
@@ -28,30 +28,30 @@ describe Chef::Knife::NodeFromFile do
:print_after => nil
}
@knife.name_args = [ "adam.rb" ]
- @knife.stub(:output).and_return(true)
- @knife.stub(:confirm).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
+ allow(@knife).to receive(:confirm).and_return(true)
@node = Chef::Node.new()
- @node.stub(:save)
- @knife.loader.stub(:load_from).and_return(@node)
+ allow(@node).to receive(:save)
+ allow(@knife.loader).to receive(:load_from).and_return(@node)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe "run" do
it "should load from a file" do
- @knife.loader.should_receive(:load_from).with('nodes', 'adam.rb').and_return(@node)
+ expect(@knife.loader).to receive(:load_from).with('nodes', 'adam.rb').and_return(@node)
@knife.run
end
it "should not print the Node" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
describe "with -p or --print-after" do
it "should print the Node" do
@knife.config[:print_after] = true
- @knife.should_receive(:output)
+ expect(@knife).to receive(:output)
@knife.run
end
end
diff --git a/spec/unit/knife/node_list_spec.rb b/spec/unit/knife/node_list_spec.rb
index cad2d6482d..71edea78f7 100644
--- a/spec/unit/knife/node_list_spec.rb
+++ b/spec/unit/knife/node_list_spec.rb
@@ -23,38 +23,38 @@ describe Chef::Knife::NodeList do
Chef::Config[:node_name] = "webmonkey.example.com"
Chef::Config[:environment] = nil # reset this value each time, as it is not reloaded
@knife = Chef::Knife::NodeList.new
- @knife.stub(:output).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
@list = {
"foo" => "http://example.com/foo",
"bar" => "http://example.com/foo"
}
- Chef::Node.stub(:list).and_return(@list)
- Chef::Node.stub(:list_by_environment).and_return(@list)
+ allow(Chef::Node).to receive(:list).and_return(@list)
+ allow(Chef::Node).to receive(:list_by_environment).and_return(@list)
end
describe "run" do
it "should list all of the nodes if -E is not specified" do
- Chef::Node.should_receive(:list).and_return(@list)
+ expect(Chef::Node).to receive(:list).and_return(@list)
@knife.run
end
it "should pretty print the list" do
- Chef::Node.should_receive(:list).and_return(@list)
- @knife.should_receive(:output).with([ "bar", "foo" ])
+ expect(Chef::Node).to receive(:list).and_return(@list)
+ expect(@knife).to receive(:output).with([ "bar", "foo" ])
@knife.run
end
it "should list nodes in the specific environment if -E ENVIRONMENT is specified" do
Chef::Config[:environment] = "prod"
- Chef::Node.should_receive(:list_by_environment).with("prod").and_return(@list)
+ expect(Chef::Node).to receive(:list_by_environment).with("prod").and_return(@list)
@knife.run
end
describe "with -w or --with-uri" do
it "should pretty print the hash" do
@knife.config[:with_uri] = true
- Chef::Node.should_receive(:list).and_return(@list)
- @knife.should_receive(:output).with(@list)
+ expect(Chef::Node).to receive(:list).and_return(@list)
+ expect(@knife).to receive(:output).with(@list)
@knife.run
end
end
diff --git a/spec/unit/knife/node_run_list_add_spec.rb b/spec/unit/knife/node_run_list_add_spec.rb
index bd33a359a2..92fbfd23fe 100644
--- a/spec/unit/knife/node_run_list_add_spec.rb
+++ b/spec/unit/knife/node_run_list_add_spec.rb
@@ -26,30 +26,30 @@ describe Chef::Knife::NodeRunListAdd do
:after => nil
}
@knife.name_args = [ "adam", "role[monkey]" ]
- @knife.stub(:output).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
@node = Chef::Node.new()
- @node.stub(:save).and_return(true)
- Chef::Node.stub(:load).and_return(@node)
+ allow(@node).to receive(:save).and_return(true)
+ allow(Chef::Node).to receive(:load).and_return(@node)
end
describe "run" do
it "should load the node" do
- Chef::Node.should_receive(:load).with("adam")
+ expect(Chef::Node).to receive(:load).with("adam")
@knife.run
end
it "should add to the run list" do
@knife.run
- @node.run_list[0].should == 'role[monkey]'
+ expect(@node.run_list[0]).to eq('role[monkey]')
end
it "should save the node" do
- @node.should_receive(:save)
+ expect(@node).to receive(:save)
@knife.run
end
it "should print the run list" do
- @knife.should_receive(:output).and_return(true)
+ expect(@knife).to receive(:output).and_return(true)
@knife.run
end
@@ -59,9 +59,9 @@ describe Chef::Knife::NodeRunListAdd do
@node.run_list << "role[barn]"
@knife.config[:after] = "role[acorns]"
@knife.run
- @node.run_list[0].should == "role[acorns]"
- @node.run_list[1].should == "role[monkey]"
- @node.run_list[2].should == "role[barn]"
+ expect(@node.run_list[0]).to eq("role[acorns]")
+ expect(@node.run_list[1]).to eq("role[monkey]")
+ expect(@node.run_list[2]).to eq("role[barn]")
end
end
@@ -71,9 +71,9 @@ describe Chef::Knife::NodeRunListAdd do
@node.run_list << "role[barn]"
@knife.config[:before] = "role[acorns]"
@knife.run
- @node.run_list[0].should == "role[monkey]"
- @node.run_list[1].should == "role[acorns]"
- @node.run_list[2].should == "role[barn]"
+ expect(@node.run_list[0]).to eq("role[monkey]")
+ expect(@node.run_list[1]).to eq("role[acorns]")
+ expect(@node.run_list[2]).to eq("role[barn]")
end
end
@@ -83,8 +83,8 @@ describe Chef::Knife::NodeRunListAdd do
@node.run_list << "role[barn]"
@knife.config[:before] = "role[acorns]"
@knife.config[:after] = "role[acorns]"
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
@@ -93,9 +93,9 @@ describe Chef::Knife::NodeRunListAdd do
@knife.name_args = [ "adam", "role[monkey],role[duck]" ]
@node.run_list << "role[acorns]"
@knife.run
- @node.run_list[0].should == "role[acorns]"
- @node.run_list[1].should == "role[monkey]"
- @node.run_list[2].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[acorns]")
+ expect(@node.run_list[1]).to eq("role[monkey]")
+ expect(@node.run_list[2]).to eq("role[duck]")
end
end
@@ -104,9 +104,9 @@ describe Chef::Knife::NodeRunListAdd do
@knife.name_args = [ "adam", "role[monkey], role[duck]" ]
@node.run_list << "role[acorns]"
@knife.run
- @node.run_list[0].should == "role[acorns]"
- @node.run_list[1].should == "role[monkey]"
- @node.run_list[2].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[acorns]")
+ expect(@node.run_list[1]).to eq("role[monkey]")
+ expect(@node.run_list[2]).to eq("role[duck]")
end
end
@@ -115,9 +115,9 @@ describe Chef::Knife::NodeRunListAdd do
@knife.name_args = [ "adam", "role[monkey]", "role[duck]" ]
@node.run_list << "role[acorns]"
@knife.run
- @node.run_list[0].should == "role[acorns]"
- @node.run_list[1].should == "role[monkey]"
- @node.run_list[2].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[acorns]")
+ expect(@node.run_list[1]).to eq("role[monkey]")
+ expect(@node.run_list[2]).to eq("role[duck]")
end
end
@@ -126,9 +126,9 @@ describe Chef::Knife::NodeRunListAdd do
@knife.name_args = [ "adam", "role[monkey]", "role[duck],recipe[bird::fly]" ]
@node.run_list << "role[acorns]"
@knife.run
- @node.run_list[0].should == "role[acorns]"
- @node.run_list[1].should == "role[monkey]"
- @node.run_list[2].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[acorns]")
+ expect(@node.run_list[1]).to eq("role[monkey]")
+ expect(@node.run_list[2]).to eq("role[duck]")
end
end
@@ -137,8 +137,8 @@ describe Chef::Knife::NodeRunListAdd do
@knife.name_args = [ "adam", "role[monkey]," ]
@node.run_list << "role[acorns]"
@knife.run
- @node.run_list[0].should == "role[acorns]"
- @node.run_list[1].should == "role[monkey]"
+ expect(@node.run_list[0]).to eq("role[acorns]")
+ expect(@node.run_list[1]).to eq("role[monkey]")
end
end
end
diff --git a/spec/unit/knife/node_run_list_remove_spec.rb b/spec/unit/knife/node_run_list_remove_spec.rb
index 7c0627f091..2c3d29ae73 100644
--- a/spec/unit/knife/node_run_list_remove_spec.rb
+++ b/spec/unit/knife/node_run_list_remove_spec.rb
@@ -27,33 +27,33 @@ describe Chef::Knife::NodeRunListRemove do
@node = Chef::Node.new()
@node.name("knifetest-node")
@node.run_list << "role[monkey]"
- @node.stub(:save).and_return(true)
+ allow(@node).to receive(:save).and_return(true)
- @knife.ui.stub(:output).and_return(true)
- @knife.ui.stub(:confirm).and_return(true)
+ allow(@knife.ui).to receive(:output).and_return(true)
+ allow(@knife.ui).to receive(:confirm).and_return(true)
- Chef::Node.stub(:load).and_return(@node)
+ allow(Chef::Node).to receive(:load).and_return(@node)
end
describe "run" do
it "should load the node" do
- Chef::Node.should_receive(:load).with("adam").and_return(@node)
+ expect(Chef::Node).to receive(:load).with("adam").and_return(@node)
@knife.run
end
it "should remove the item from the run list" do
@knife.run
- @node.run_list[0].should_not == 'role[monkey]'
+ expect(@node.run_list[0]).not_to eq('role[monkey]')
end
it "should save the node" do
- @node.should_receive(:save).and_return(true)
+ expect(@node).to receive(:save).and_return(true)
@knife.run
end
it "should print the run list" do
@knife.config[:print_after] = true
- @knife.ui.should_receive(:output).with({ "knifetest-node" => { 'run_list' => [] } })
+ expect(@knife.ui).to receive(:output).with({ "knifetest-node" => { 'run_list' => [] } })
@knife.run
end
@@ -63,8 +63,8 @@ describe Chef::Knife::NodeRunListRemove do
@node.run_list << 'recipe[duck::type]'
@knife.name_args = [ 'adam', 'role[monkey],recipe[duck::type]' ]
@knife.run
- @node.run_list.should_not include('role[monkey]')
- @node.run_list.should_not include('recipe[duck::type]')
+ expect(@node.run_list).not_to include('role[monkey]')
+ expect(@node.run_list).not_to include('recipe[duck::type]')
end
it "should remove the items from the run list when name args contains whitespace" do
diff --git a/spec/unit/knife/node_run_list_set_spec.rb b/spec/unit/knife/node_run_list_set_spec.rb
index 02281f8385..68daaafd70 100644
--- a/spec/unit/knife/node_run_list_set_spec.rb
+++ b/spec/unit/knife/node_run_list_set_spec.rb
@@ -24,30 +24,30 @@ describe Chef::Knife::NodeRunListSet do
@knife = Chef::Knife::NodeRunListSet.new
@knife.config = {}
@knife.name_args = [ "adam", "role[monkey]" ]
- @knife.stub(:output).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
@node = Chef::Node.new()
- @node.stub(:save).and_return(true)
- Chef::Node.stub(:load).and_return(@node)
+ allow(@node).to receive(:save).and_return(true)
+ allow(Chef::Node).to receive(:load).and_return(@node)
end
describe "run" do
it "should load the node" do
- Chef::Node.should_receive(:load).with("adam")
+ expect(Chef::Node).to receive(:load).with("adam")
@knife.run
end
it "should set the run list" do
@knife.run
- @node.run_list[0].should == 'role[monkey]'
+ expect(@node.run_list[0]).to eq('role[monkey]')
end
it "should save the node" do
- @node.should_receive(:save)
+ expect(@node).to receive(:save)
@knife.run
end
it "should print the run list" do
- @knife.should_receive(:output).and_return(true)
+ expect(@knife).to receive(:output).and_return(true)
@knife.run
end
@@ -55,8 +55,8 @@ describe Chef::Knife::NodeRunListSet do
it "should set the run list to all the entries" do
@knife.name_args = [ "adam", "role[monkey],role[duck]" ]
@knife.run
- @node.run_list[0].should == "role[monkey]"
- @node.run_list[1].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[monkey]")
+ expect(@node.run_list[1]).to eq("role[duck]")
end
end
@@ -64,8 +64,8 @@ describe Chef::Knife::NodeRunListSet do
it "should set the run list to all the entries" do
@knife.name_args = [ "adam", "role[monkey], role[duck]" ]
@knife.run
- @node.run_list[0].should == "role[monkey]"
- @node.run_list[1].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[monkey]")
+ expect(@node.run_list[1]).to eq("role[duck]")
end
end
@@ -73,8 +73,8 @@ describe Chef::Knife::NodeRunListSet do
it "should set the run list to all the entries" do
@knife.name_args = [ "adam", "role[monkey]", "role[duck]" ]
@knife.run
- @node.run_list[0].should == "role[monkey]"
- @node.run_list[1].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[monkey]")
+ expect(@node.run_list[1]).to eq("role[duck]")
end
end
@@ -82,8 +82,8 @@ describe Chef::Knife::NodeRunListSet do
it "should add to the run list all the entries" do
@knife.name_args = [ "adam", "role[monkey]", "role[duck],recipe[bird::fly]" ]
@knife.run
- @node.run_list[0].should == "role[monkey]"
- @node.run_list[1].should == "role[duck]"
+ expect(@node.run_list[0]).to eq("role[monkey]")
+ expect(@node.run_list[1]).to eq("role[duck]")
end
end
@@ -91,7 +91,7 @@ describe Chef::Knife::NodeRunListSet do
it "should add to the run list one item" do
@knife.name_args = [ "adam", "role[monkey]," ]
@knife.run
- @node.run_list[0].should == "role[monkey]"
+ expect(@node.run_list[0]).to eq("role[monkey]")
end
end
@@ -99,15 +99,15 @@ describe Chef::Knife::NodeRunListSet do
it "should overwrite any existing run list items" do
@node.run_list << "role[acorns]"
@node.run_list << "role[zebras]"
- @node.run_list[0].should == "role[acorns]"
- @node.run_list[1].should == "role[zebras]"
- @node.run_list.run_list_items.size.should == 2
+ expect(@node.run_list[0]).to eq("role[acorns]")
+ expect(@node.run_list[1]).to eq("role[zebras]")
+ expect(@node.run_list.run_list_items.size).to eq(2)
@knife.name_args = [ "adam", "role[monkey]", "role[duck]" ]
@knife.run
- @node.run_list[0].should == "role[monkey]"
- @node.run_list[1].should == "role[duck]"
- @node.run_list.run_list_items.size.should == 2
+ expect(@node.run_list[0]).to eq("role[monkey]")
+ expect(@node.run_list[1]).to eq("role[duck]")
+ expect(@node.run_list.run_list_items.size).to eq(2)
end
end
@@ -117,13 +117,13 @@ describe Chef::Knife::NodeRunListSet do
@stdout = StringIO.new
@stderr = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
it "should exit" do
@knife.name_args = [ "adam" ]
- lambda { @knife.run }.should raise_error SystemExit
+ expect { @knife.run }.to raise_error SystemExit
end
it "should show the user" do
@@ -131,8 +131,8 @@ describe Chef::Knife::NodeRunListSet do
begin ; @knife.run ; rescue SystemExit ; end
- @stdout.string.should eq "USAGE: knife node run_list set NODE ENTRIES (options)\n"
- @stderr.string.should eq "FATAL: You must supply both a node name and a run list.\n"
+ expect(@stdout.string).to eq "USAGE: knife node run_list set NODE ENTRIES (options)\n"
+ expect(@stderr.string).to eq "FATAL: You must supply both a node name and a run list.\n"
end
end
diff --git a/spec/unit/knife/role_bulk_delete_spec.rb b/spec/unit/knife/role_bulk_delete_spec.rb
index eb1d3b4cff..5b79e52a04 100644
--- a/spec/unit/knife/role_bulk_delete_spec.rb
+++ b/spec/unit/knife/role_bulk_delete_spec.rb
@@ -27,53 +27,53 @@ describe Chef::Knife::RoleBulkDelete do
}
@knife.name_args = ["."]
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:confirm).and_return(true)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:confirm).and_return(true)
@roles = Hash.new
%w{dev staging production}.each do |role_name|
role = Chef::Role.new()
role.name(role_name)
- role.stub(:destroy).and_return(true)
+ allow(role).to receive(:destroy).and_return(true)
@roles[role_name] = role
end
- Chef::Role.stub(:list).and_return(@roles)
+ allow(Chef::Role).to receive(:list).and_return(@roles)
end
describe "run" do
it "should get the list of the roles" do
- Chef::Role.should_receive(:list).and_return(@roles)
+ expect(Chef::Role).to receive(:list).and_return(@roles)
@knife.run
end
it "should print the roles you are about to delete" do
@knife.run
- @stdout.string.should match(/#{@knife.ui.list(@roles.keys.sort, :columns_down)}/)
+ expect(@stdout.string).to match(/#{@knife.ui.list(@roles.keys.sort, :columns_down)}/)
end
it "should confirm you really want to delete them" do
- @knife.ui.should_receive(:confirm)
+ expect(@knife.ui).to receive(:confirm)
@knife.run
end
it "should delete each role" do
@roles.each_value do |r|
- r.should_receive(:destroy)
+ expect(r).to receive(:destroy)
end
@knife.run
end
it "should only delete roles that match the regex" do
@knife.name_args = ["dev"]
- @roles["dev"].should_receive(:destroy)
- @roles["staging"].should_not_receive(:destroy)
- @roles["production"].should_not_receive(:destroy)
+ expect(@roles["dev"]).to receive(:destroy)
+ expect(@roles["staging"]).not_to receive(:destroy)
+ expect(@roles["production"]).not_to receive(:destroy)
@knife.run
end
it "should exit if the regex is not provided" do
@knife.name_args = []
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/role_create_spec.rb b/spec/unit/knife/role_create_spec.rb
index a4d7392b68..fb748c51f6 100644
--- a/spec/unit/knife/role_create_spec.rb
+++ b/spec/unit/knife/role_create_spec.rb
@@ -26,45 +26,45 @@ describe Chef::Knife::RoleCreate do
:description => nil
}
@knife.name_args = [ "adam" ]
- @knife.stub(:output).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
@role = Chef::Role.new()
- @role.stub(:save)
- Chef::Role.stub(:new).and_return(@role)
- @knife.stub(:edit_data).and_return(@role)
+ allow(@role).to receive(:save)
+ allow(Chef::Role).to receive(:new).and_return(@role)
+ allow(@knife).to receive(:edit_data).and_return(@role)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe "run" do
it "should create a new role" do
- Chef::Role.should_receive(:new).and_return(@role)
+ expect(Chef::Role).to receive(:new).and_return(@role)
@knife.run
end
it "should set the role name" do
- @role.should_receive(:name).with("adam")
+ expect(@role).to receive(:name).with("adam")
@knife.run
end
it "should not print the role" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
it "should allow you to edit the data" do
- @knife.should_receive(:edit_data).with(@role)
+ expect(@knife).to receive(:edit_data).with(@role)
@knife.run
end
it "should save the role" do
- @role.should_receive(:save)
+ expect(@role).to receive(:save)
@knife.run
end
describe "with -d or --description" do
it "should set the description" do
@knife.config[:description] = "All is bob"
- @role.should_receive(:description).with("All is bob")
+ expect(@role).to receive(:description).with("All is bob")
@knife.run
end
end
@@ -72,7 +72,7 @@ describe Chef::Knife::RoleCreate do
describe "with -p or --print-after" do
it "should pretty print the node, formatted for display" do
@knife.config[:print_after] = true
- @knife.should_receive(:output).with(@role)
+ expect(@knife).to receive(:output).with(@role)
@knife.run
end
end
diff --git a/spec/unit/knife/role_delete_spec.rb b/spec/unit/knife/role_delete_spec.rb
index 0771446d49..b1a0d90410 100644
--- a/spec/unit/knife/role_delete_spec.rb
+++ b/spec/unit/knife/role_delete_spec.rb
@@ -26,40 +26,40 @@ describe Chef::Knife::RoleDelete do
:print_after => nil
}
@knife.name_args = [ "adam" ]
- @knife.stub(:output).and_return(true)
- @knife.stub(:confirm).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
+ allow(@knife).to receive(:confirm).and_return(true)
@role = Chef::Role.new()
- @role.stub(:destroy).and_return(true)
- Chef::Role.stub(:load).and_return(@role)
+ allow(@role).to receive(:destroy).and_return(true)
+ allow(Chef::Role).to receive(:load).and_return(@role)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe "run" do
it "should confirm that you want to delete" do
- @knife.should_receive(:confirm)
+ expect(@knife).to receive(:confirm)
@knife.run
end
it "should load the Role" do
- Chef::Role.should_receive(:load).with("adam").and_return(@role)
+ expect(Chef::Role).to receive(:load).with("adam").and_return(@role)
@knife.run
end
it "should delete the Role" do
- @role.should_receive(:destroy).and_return(@role)
+ expect(@role).to receive(:destroy).and_return(@role)
@knife.run
end
it "should not print the Role" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
describe "with -p or --print-after" do
it "should pretty print the Role, formatted for display" do
@knife.config[:print_after] = true
- @knife.should_receive(:output)
+ expect(@knife).to receive(:output)
@knife.run
end
end
diff --git a/spec/unit/knife/role_edit_spec.rb b/spec/unit/knife/role_edit_spec.rb
index f6d3b41d98..0975c6458d 100644
--- a/spec/unit/knife/role_edit_spec.rb
+++ b/spec/unit/knife/role_edit_spec.rb
@@ -24,22 +24,22 @@ describe Chef::Knife::RoleEdit do
@knife = Chef::Knife::RoleEdit.new
@knife.config[:print_after] = nil
@knife.name_args = [ "adam" ]
- @knife.ui.stub(:output).and_return(true)
+ allow(@knife.ui).to receive(:output).and_return(true)
@role = Chef::Role.new()
- @role.stub(:save)
- Chef::Role.stub(:load).and_return(@role)
- @knife.ui.stub(:edit_data).and_return(@role)
- @knife.ui.stub(:msg)
+ allow(@role).to receive(:save)
+ allow(Chef::Role).to receive(:load).and_return(@role)
+ allow(@knife.ui).to receive(:edit_data).and_return(@role)
+ allow(@knife.ui).to receive(:msg)
end
describe "run" do
it "should load the role" do
- Chef::Role.should_receive(:load).with("adam").and_return(@role)
+ expect(Chef::Role).to receive(:load).with("adam").and_return(@role)
@knife.run
end
it "should edit the role data" do
- @knife.ui.should_receive(:edit_data).with(@role)
+ expect(@knife.ui).to receive(:edit_data).with(@role)
@knife.run
end
@@ -47,29 +47,29 @@ describe Chef::Knife::RoleEdit do
pansy = Chef::Role.new
@role.name("new_role_name")
- @knife.ui.should_receive(:edit_data).with(@role).and_return(pansy)
- pansy.should_receive(:save)
+ expect(@knife.ui).to receive(:edit_data).with(@role).and_return(pansy)
+ expect(pansy).to receive(:save)
@knife.run
end
it "should not save the unedited role data" do
pansy = Chef::Role.new
- @knife.ui.should_receive(:edit_data).with(@role).and_return(pansy)
- pansy.should_not_receive(:save)
+ expect(@knife.ui).to receive(:edit_data).with(@role).and_return(pansy)
+ expect(pansy).not_to receive(:save)
@knife.run
end
it "should not print the role" do
- @knife.ui.should_not_receive(:output)
+ expect(@knife.ui).not_to receive(:output)
@knife.run
end
describe "with -p or --print-after" do
it "should pretty print the role, formatted for display" do
@knife.config[:print_after] = true
- @knife.ui.should_receive(:output).with(@role)
+ expect(@knife.ui).to receive(:output).with(@role)
@knife.run
end
end
diff --git a/spec/unit/knife/role_from_file_spec.rb b/spec/unit/knife/role_from_file_spec.rb
index 986414647c..9379f08de3 100644
--- a/spec/unit/knife/role_from_file_spec.rb
+++ b/spec/unit/knife/role_from_file_spec.rb
@@ -28,30 +28,30 @@ describe Chef::Knife::RoleFromFile do
:print_after => nil
}
@knife.name_args = [ "adam.rb" ]
- @knife.stub(:output).and_return(true)
- @knife.stub(:confirm).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
+ allow(@knife).to receive(:confirm).and_return(true)
@role = Chef::Role.new()
- @role.stub(:save)
- @knife.loader.stub(:load_from).and_return(@role)
+ allow(@role).to receive(:save)
+ allow(@knife.loader).to receive(:load_from).and_return(@role)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe "run" do
it "should load from a file" do
- @knife.loader.should_receive(:load_from).with('roles', 'adam.rb').and_return(@role)
+ expect(@knife.loader).to receive(:load_from).with('roles', 'adam.rb').and_return(@role)
@knife.run
end
it "should not print the role" do
- @knife.should_not_receive(:output)
+ expect(@knife).not_to receive(:output)
@knife.run
end
describe "with -p or --print-after" do
it "should print the role" do
@knife.config[:print_after] = true
- @knife.should_receive(:output)
+ expect(@knife).to receive(:output)
@knife.run
end
end
@@ -60,8 +60,8 @@ describe Chef::Knife::RoleFromFile do
describe "run with multiple arguments" do
it "should load each file" do
@knife.name_args = [ "adam.rb", "caleb.rb" ]
- @knife.loader.should_receive(:load_from).with('roles', 'adam.rb').and_return(@role)
- @knife.loader.should_receive(:load_from).with('roles', 'caleb.rb').and_return(@role)
+ expect(@knife.loader).to receive(:load_from).with('roles', 'adam.rb').and_return(@role)
+ expect(@knife.loader).to receive(:load_from).with('roles', 'caleb.rb').and_return(@role)
@knife.run
end
end
diff --git a/spec/unit/knife/role_list_spec.rb b/spec/unit/knife/role_list_spec.rb
index ef9642c04c..808a04d204 100644
--- a/spec/unit/knife/role_list_spec.rb
+++ b/spec/unit/knife/role_list_spec.rb
@@ -22,31 +22,31 @@ describe Chef::Knife::RoleList do
before(:each) do
Chef::Config[:node_name] = "webmonkey.example.com"
@knife = Chef::Knife::RoleList.new
- @knife.stub(:output).and_return(true)
+ allow(@knife).to receive(:output).and_return(true)
@list = {
"foo" => "http://example.com/foo",
"bar" => "http://example.com/foo"
}
- Chef::Role.stub(:list).and_return(@list)
+ allow(Chef::Role).to receive(:list).and_return(@list)
end
describe "run" do
it "should list the roles" do
- Chef::Role.should_receive(:list).and_return(@list)
+ expect(Chef::Role).to receive(:list).and_return(@list)
@knife.run
end
it "should pretty print the list" do
- Chef::Role.should_receive(:list).and_return(@list)
- @knife.should_receive(:output).with([ "bar", "foo" ])
+ expect(Chef::Role).to receive(:list).and_return(@list)
+ expect(@knife).to receive(:output).with([ "bar", "foo" ])
@knife.run
end
describe "with -w or --with-uri" do
it "should pretty print the hash" do
@knife.config[:with_uri] = true
- Chef::Role.should_receive(:list).and_return(@list)
- @knife.should_receive(:output).with(@list)
+ expect(Chef::Role).to receive(:list).and_return(@list)
+ expect(@knife).to receive(:output).with(@list)
@knife.run
end
end
diff --git a/spec/unit/knife/ssh_spec.rb b/spec/unit/knife/ssh_spec.rb
index 10d63c9c74..501b02c933 100644
--- a/spec/unit/knife/ssh_spec.rb
+++ b/spec/unit/knife/ssh_spec.rb
@@ -45,8 +45,8 @@ describe Chef::Knife::Ssh do
end
def configure_query(node_array)
- @query.stub(:search).and_return([node_array])
- Chef::Search::Query.stub(:new).and_return(@query)
+ allow(@query).to receive(:search).and_return([node_array])
+ allow(Chef::Search::Query).to receive(:new).and_return(@query)
end
def self.should_return_specified_attributes
@@ -54,7 +54,7 @@ describe Chef::Knife::Ssh do
@knife.config[:attribute] = "ipaddress"
@knife.config[:attribute_from_cli] = "ipaddress"
configure_query([@node_foo, @node_bar])
- @knife.should_receive(:session_from_list).with([['10.0.0.1', nil], ['10.0.0.2', nil]])
+ expect(@knife).to receive(:session_from_list).with([['10.0.0.1', nil], ['10.0.0.2', nil]])
@knife.configure_session
end
@@ -62,14 +62,14 @@ describe Chef::Knife::Ssh do
@knife.config[:attribute] = "config_file" # this value will be the config file
@knife.config[:attribute_from_cli] = "ipaddress" # this is the value of the command line via #configure_attribute
configure_query([@node_foo, @node_bar])
- @knife.should_receive(:session_from_list).with([['10.0.0.1', nil], ['10.0.0.2', nil]])
+ expect(@knife).to receive(:session_from_list).with([['10.0.0.1', nil], ['10.0.0.2', nil]])
@knife.configure_session
end
end
it "searchs for and returns an array of fqdns" do
configure_query([@node_foo, @node_bar])
- @knife.should_receive(:session_from_list).with([
+ expect(@knife).to receive(:session_from_list).with([
['foo.example.org', nil],
['bar.example.org', nil]
])
@@ -86,7 +86,7 @@ describe Chef::Knife::Ssh do
it "returns an array of cloud public hostnames" do
configure_query([@node_foo, @node_bar])
- @knife.should_receive(:session_from_list).with([
+ expect(@knife).to receive(:session_from_list).with([
['ec2-10-0-0-1.compute-1.amazonaws.com', nil],
['ec2-10-0-0-2.compute-1.amazonaws.com', nil]
])
@@ -98,22 +98,22 @@ describe Chef::Knife::Ssh do
it "should raise an error if no host are found" do
configure_query([ ])
- @knife.ui.should_receive(:fatal)
- @knife.should_receive(:exit).with(10)
+ expect(@knife.ui).to receive(:fatal)
+ expect(@knife).to receive(:exit).with(10)
@knife.configure_session
end
context "when there are some hosts found but they do not have an attribute to connect with" do
before do
- @query.stub(:search).and_return([[@node_foo, @node_bar]])
+ allow(@query).to receive(:search).and_return([[@node_foo, @node_bar]])
@node_foo.automatic_attrs[:fqdn] = nil
@node_bar.automatic_attrs[:fqdn] = nil
- Chef::Search::Query.stub(:new).and_return(@query)
+ allow(Chef::Search::Query).to receive(:new).and_return(@query)
end
it "should raise a specific error (CHEF-3402)" do
- @knife.ui.should_receive(:fatal).with(/^2 nodes found/)
- @knife.should_receive(:exit).with(10)
+ expect(@knife.ui).to receive(:fatal).with(/^2 nodes found/)
+ expect(@knife).to receive(:exit).with(10)
@knife.configure_session
end
end
@@ -126,7 +126,7 @@ describe Chef::Knife::Ssh do
it "returns an array of provided values" do
@knife.instance_variable_set(:@name_args, ["foo.example.org bar.example.org"])
- @knife.should_receive(:session_from_list).with(['foo.example.org', 'bar.example.org'])
+ expect(@knife).to receive(:session_from_list).with(['foo.example.org', 'bar.example.org'])
@knife.configure_session
end
end
@@ -140,34 +140,34 @@ describe Chef::Knife::Ssh do
it "should return fqdn by default" do
@knife.configure_attribute
- @knife.config[:attribute].should == "fqdn"
+ expect(@knife.config[:attribute]).to eq("fqdn")
end
it "should return the value set in the configuration file" do
Chef::Config[:knife][:ssh_attribute] = "config_file"
@knife.configure_attribute
- @knife.config[:attribute].should == "config_file"
+ expect(@knife.config[:attribute]).to eq("config_file")
end
it "should return the value set on the command line" do
@knife.config[:attribute] = "command_line"
@knife.configure_attribute
- @knife.config[:attribute].should == "command_line"
+ expect(@knife.config[:attribute]).to eq("command_line")
end
it "should set attribute_from_cli to the value of attribute from the command line" do
@knife.config[:attribute] = "command_line"
@knife.configure_attribute
- @knife.config[:attribute].should == "command_line"
- @knife.config[:attribute_from_cli].should == "command_line"
+ expect(@knife.config[:attribute]).to eq("command_line")
+ expect(@knife.config[:attribute_from_cli]).to eq("command_line")
end
it "should prefer the command line over the config file for the value of attribute_from_cli" do
Chef::Config[:knife][:ssh_attribute] = "config_file"
@knife.config[:attribute] = "command_line"
@knife.configure_attribute
- @knife.config[:attribute].should == "command_line"
- @knife.config[:attribute_from_cli].should == "command_line"
+ expect(@knife.config[:attribute]).to eq("command_line")
+ expect(@knife.config[:attribute_from_cli]).to eq("command_line")
end
end
@@ -175,22 +175,22 @@ describe Chef::Knife::Ssh do
before :each do
@knife.instance_variable_set(:@longest, 0)
ssh_config = {:timeout => 50, :user => "locutus", :port => 23 }
- Net::SSH.stub(:configuration_for).with('the.b.org').and_return(ssh_config)
+ allow(Net::SSH).to receive(:configuration_for).with('the.b.org').and_return(ssh_config)
end
it "uses the port from an ssh config file" do
@knife.session_from_list([['the.b.org', nil]])
- @knife.session.servers[0].port.should == 23
+ expect(@knife.session.servers[0].port).to eq(23)
end
it "uses the port from a cloud attr" do
@knife.session_from_list([['the.b.org', 123]])
- @knife.session.servers[0].port.should == 123
+ expect(@knife.session.servers[0].port).to eq(123)
end
it "uses the user from an ssh config file" do
@knife.session_from_list([['the.b.org', 123]])
- @knife.session.servers[0].user.should == "locutus"
+ expect(@knife.session.servers[0].user).to eq("locutus")
end
end
@@ -206,26 +206,26 @@ describe Chef::Knife::Ssh do
let(:command) { "false" }
before do
- execution_channel.
- should_receive(:on_request).
+ expect(execution_channel).
+ to receive(:on_request).
and_yield(nil, double(:data_stream, :read_long => exit_status))
- session_channel.
- should_receive(:exec).
+ expect(session_channel).
+ to receive(:exec).
with(command).
and_yield(execution_channel, true)
- execution_channel2.
- should_receive(:on_request).
+ expect(execution_channel2).
+ to receive(:on_request).
and_yield(nil, double(:data_stream, :read_long => exit_status2))
- session_channel2.
- should_receive(:exec).
+ expect(session_channel2).
+ to receive(:exec).
with(command).
and_yield(execution_channel2, true)
- session.
- should_receive(:open_channel).
+ expect(session).
+ to receive(:open_channel).
and_yield(session_channel).
and_yield(session_channel2)
end
@@ -235,7 +235,7 @@ describe Chef::Knife::Ssh do
let(:exit_status2) { 0 }
it "returns a 0 exit code" do
- @knife.ssh_command(command, session).should == 0
+ expect(@knife.ssh_command(command, session)).to eq(0)
end
end
@@ -244,7 +244,7 @@ describe Chef::Knife::Ssh do
let(:exit_status2) { 0 }
it "returns a non-zero exit code" do
- @knife.ssh_command(command, session).should == 1
+ expect(@knife.ssh_command(command, session)).to eq(1)
end
end
@@ -253,7 +253,7 @@ describe Chef::Knife::Ssh do
let(:exit_status2) { 2 }
it "returns a non-zero exit code" do
- @knife.ssh_command(command, session).should == 2
+ expect(@knife.ssh_command(command, session)).to eq(2)
end
end
end
@@ -261,9 +261,9 @@ describe Chef::Knife::Ssh do
describe "#run" do
before do
@query = Chef::Search::Query.new
- @query.should_receive(:search).and_return([[@node_foo]])
- Chef::Search::Query.stub(:new).and_return(@query)
- @knife.stub(:ssh_command).and_return(exit_code)
+ expect(@query).to receive(:search).and_return([[@node_foo]])
+ allow(Chef::Search::Query).to receive(:new).and_return(@query)
+ allow(@knife).to receive(:ssh_command).and_return(exit_code)
@knife.name_args = ['*:*', 'false']
end
@@ -271,7 +271,7 @@ describe Chef::Knife::Ssh do
let(:exit_code) { 1 }
it "should exit with a non-zero exit code" do
- @knife.should_receive(:exit).with(exit_code)
+ expect(@knife).to receive(:exit).with(exit_code)
@knife.run
end
end
@@ -280,7 +280,7 @@ describe Chef::Knife::Ssh do
let(:exit_code) { 0 }
it "should not exit" do
- @knife.should_not_receive(:exit)
+ expect(@knife).not_to receive(:exit)
@knife.run
end
end
@@ -296,23 +296,23 @@ describe Chef::Knife::Ssh do
# in this case ssh_password_ng exists, but ssh_password does not
it "should prompt for a password when ssh_passsword_ng is nil" do
@knife.config[:ssh_password_ng] = nil
- @knife.should_receive(:get_password).and_return("mysekretpassw0rd")
+ expect(@knife).to receive(:get_password).and_return("mysekretpassw0rd")
@knife.configure_password
- @knife.config[:ssh_password].should == "mysekretpassw0rd"
+ expect(@knife.config[:ssh_password]).to eq("mysekretpassw0rd")
end
it "should set ssh_password to false if ssh_password_ng is false" do
@knife.config[:ssh_password_ng] = false
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should be_false
+ expect(@knife.config[:ssh_password]).to be_falsey
end
it "should set ssh_password to ssh_password_ng if we set a password" do
@knife.config[:ssh_password_ng] = "mysekretpassw0rd"
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should == "mysekretpassw0rd"
+ expect(@knife.config[:ssh_password]).to eq("mysekretpassw0rd")
end
end
@@ -320,23 +320,23 @@ describe Chef::Knife::Ssh do
# in this case ssh_password exists, but ssh_password_ng does not
it "should set ssh_password to nil when ssh_password is nil" do
@knife.config[:ssh_password] = nil
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should be_nil
+ expect(@knife.config[:ssh_password]).to be_nil
end
it "should set ssh_password to false when ssh_password is false" do
@knife.config[:ssh_password] = false
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should be_false
+ expect(@knife.config[:ssh_password]).to be_falsey
end
it "should set ssh_password to ssh_password if we set a password" do
@knife.config[:ssh_password] = "mysekretpassw0rd"
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should == "mysekretpassw0rd"
+ expect(@knife.config[:ssh_password]).to eq("mysekretpassw0rd")
end
end
context "when setting ssh_password in the config variable" do
@@ -347,23 +347,23 @@ describe Chef::Knife::Ssh do
# in this case ssh_password_ng exists, but ssh_password does not
it "should prompt for a password when ssh_passsword_ng is nil" do
@knife.config[:ssh_password_ng] = nil
- @knife.should_receive(:get_password).and_return("mysekretpassw0rd")
+ expect(@knife).to receive(:get_password).and_return("mysekretpassw0rd")
@knife.configure_password
- @knife.config[:ssh_password].should == "mysekretpassw0rd"
+ expect(@knife.config[:ssh_password]).to eq("mysekretpassw0rd")
end
it "should set ssh_password to the configured knife.rb value if ssh_password_ng is false" do
@knife.config[:ssh_password_ng] = false
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should == "my_knife_passw0rd"
+ expect(@knife.config[:ssh_password]).to eq("my_knife_passw0rd")
end
it "should set ssh_password to ssh_password_ng if we set a password" do
@knife.config[:ssh_password_ng] = "mysekretpassw0rd"
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should == "mysekretpassw0rd"
+ expect(@knife.config[:ssh_password]).to eq("mysekretpassw0rd")
end
end
@@ -371,23 +371,23 @@ describe Chef::Knife::Ssh do
# in this case ssh_password exists, but ssh_password_ng does not
it "should set ssh_password to the configured knife.rb value when ssh_password is nil" do
@knife.config[:ssh_password] = nil
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should == "my_knife_passw0rd"
+ expect(@knife.config[:ssh_password]).to eq("my_knife_passw0rd")
end
it "should set ssh_password to the configured knife.rb value when ssh_password is false" do
@knife.config[:ssh_password] = false
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should == "my_knife_passw0rd"
+ expect(@knife.config[:ssh_password]).to eq("my_knife_passw0rd")
end
it "should set ssh_password to ssh_password if we set a password" do
@knife.config[:ssh_password] = "mysekretpassw0rd"
- @knife.should_not_receive(:get_password)
+ expect(@knife).not_to receive(:get_password)
@knife.configure_password
- @knife.config[:ssh_password].should == "mysekretpassw0rd"
+ expect(@knife.config[:ssh_password]).to eq("mysekretpassw0rd")
end
end
end
diff --git a/spec/unit/knife/ssl_check_spec.rb b/spec/unit/knife/ssl_check_spec.rb
index bb803ce2ca..8eda555108 100644
--- a/spec/unit/knife/ssl_check_spec.rb
+++ b/spec/unit/knife/ssl_check_spec.rb
@@ -35,8 +35,8 @@ describe Chef::Knife::SslCheck do
subject(:ssl_check) do
s = Chef::Knife::SslCheck.new
- s.ui.stub(:stdout).and_return(stdout_io)
- s.ui.stub(:stderr).and_return(stderr_io)
+ allow(s.ui).to receive(:stdout).and_return(stdout_io)
+ allow(s.ui).to receive(:stderr).and_return(stderr_io)
s.name_args = name_args
s
end
@@ -106,17 +106,17 @@ E
before do
Chef::Config[:trusted_certs_dir] = trusted_certs_dir
- ssl_check.stub(:trusted_certificates).and_return([trusted_cert_file])
- store.stub(:add_cert).with(certificate)
- OpenSSL::X509::Store.stub(:new).and_return(store)
- OpenSSL::X509::Certificate.stub(:new).with(IO.read(trusted_cert_file)).and_return(certificate)
- ssl_check.stub(:verify_cert).and_return(true)
- ssl_check.stub(:verify_cert_host).and_return(true)
+ allow(ssl_check).to receive(:trusted_certificates).and_return([trusted_cert_file])
+ allow(store).to receive(:add_cert).with(certificate)
+ allow(OpenSSL::X509::Store).to receive(:new).and_return(store)
+ allow(OpenSSL::X509::Certificate).to receive(:new).with(IO.read(trusted_cert_file)).and_return(certificate)
+ allow(ssl_check).to receive(:verify_cert).and_return(true)
+ allow(ssl_check).to receive(:verify_cert_host).and_return(true)
end
context "when the trusted certificates have valid X509 properties" do
before do
- store.stub(:verify).with(certificate).and_return(true)
+ allow(store).to receive(:verify).with(certificate).and_return(true)
end
it "does not generate any X509 warnings" do
@@ -127,8 +127,8 @@ E
context "when the trusted certificates have invalid X509 properties" do
before do
- store.stub(:verify).with(certificate).and_return(false)
- store.stub(:error_string).and_return("unable to get local issuer certificate")
+ allow(store).to receive(:verify).with(certificate).and_return(false)
+ allow(store).to receive(:error_string).and_return("unable to get local issuer certificate")
end
it "generates a warning message with invalid certificate file names" do
@@ -145,8 +145,8 @@ E
let(:ssl_socket) { double(OpenSSL::SSL::SSLSocket) }
before do
- TCPSocket.should_receive(:new).with("foo.example.com", 8443).and_return(tcp_socket)
- OpenSSL::SSL::SSLSocket.should_receive(:new).with(tcp_socket, ssl_check.verify_peer_ssl_context).and_return(ssl_socket)
+ expect(TCPSocket).to receive(:new).with("foo.example.com", 8443).and_return(tcp_socket)
+ expect(OpenSSL::SSL::SSLSocket).to receive(:new).with(tcp_socket, ssl_check.verify_peer_ssl_context).and_return(ssl_socket)
end
def run
@@ -160,9 +160,9 @@ E
context "when the remote host's certificate is valid" do
before do
- ssl_check.should_receive(:verify_X509).and_return(true) # X509 valid certs (no warn)
- ssl_socket.should_receive(:connect) # no error
- ssl_socket.should_receive(:post_connection_check).with("foo.example.com") # no error
+ expect(ssl_check).to receive(:verify_X509).and_return(true) # X509 valid certs (no warn)
+ expect(ssl_socket).to receive(:connect) # no error
+ expect(ssl_socket).to receive(:post_connection_check).with("foo.example.com") # no error
end
it "prints a success message" do
@@ -182,23 +182,23 @@ E
before do
trap(:INT, "DEFAULT")
- TCPSocket.should_receive(:new).
+ expect(TCPSocket).to receive(:new).
with("foo.example.com", 8443).
and_return(tcp_socket_for_debug)
- OpenSSL::SSL::SSLSocket.should_receive(:new).
+ expect(OpenSSL::SSL::SSLSocket).to receive(:new).
with(tcp_socket_for_debug, ssl_check.noverify_peer_ssl_context).
and_return(ssl_socket_for_debug)
end
context "when the certificate's CN does not match the hostname" do
before do
- ssl_check.should_receive(:verify_X509).and_return(true) # X509 valid certs
- ssl_socket.should_receive(:connect) # no error
- ssl_socket.should_receive(:post_connection_check).
+ expect(ssl_check).to receive(:verify_X509).and_return(true) # X509 valid certs
+ expect(ssl_socket).to receive(:connect) # no error
+ expect(ssl_socket).to receive(:post_connection_check).
with("foo.example.com").
and_raise(OpenSSL::SSL::SSLError)
- ssl_socket_for_debug.should_receive(:connect)
- ssl_socket_for_debug.should_receive(:peer_cert).and_return(self_signed_crt)
+ expect(ssl_socket_for_debug).to receive(:connect)
+ expect(ssl_socket_for_debug).to receive(:peer_cert).and_return(self_signed_crt)
end
it "shows the CN used by the certificate and prints an error" do
@@ -212,11 +212,11 @@ E
context "when the cert is not signed by any trusted authority" do
before do
- ssl_check.should_receive(:verify_X509).and_return(true) # X509 valid certs
- ssl_socket.should_receive(:connect).
+ expect(ssl_check).to receive(:verify_X509).and_return(true) # X509 valid certs
+ expect(ssl_socket).to receive(:connect).
and_raise(OpenSSL::SSL::SSLError)
- ssl_socket_for_debug.should_receive(:connect)
- ssl_socket_for_debug.should_receive(:peer_cert).and_return(self_signed_crt)
+ expect(ssl_socket_for_debug).to receive(:connect)
+ expect(ssl_socket_for_debug).to receive(:peer_cert).and_return(self_signed_crt)
end
it "shows the CN used by the certificate and prints an error" do
diff --git a/spec/unit/knife/ssl_fetch_spec.rb b/spec/unit/knife/ssl_fetch_spec.rb
index 0d3c8913f7..24101dbe7a 100644
--- a/spec/unit/knife/ssl_fetch_spec.rb
+++ b/spec/unit/knife/ssl_fetch_spec.rb
@@ -36,8 +36,8 @@ describe Chef::Knife::SslFetch do
subject(:ssl_fetch) do
s = Chef::Knife::SslFetch.new
s.name_args = name_args
- s.ui.stub(:stdout).and_return(stdout_io)
- s.ui.stub(:stderr).and_return(stderr_io)
+ allow(s.ui).to receive(:stdout).and_return(stdout_io)
+ allow(s.ui).to receive(:stderr).and_return(stderr_io)
s
end
@@ -131,10 +131,10 @@ E
before do
Chef::Config.trusted_certs_dir = trusted_certs_dir
- TCPSocket.should_receive(:new).with("foo.example.com", 8443).and_return(tcp_socket)
- OpenSSL::SSL::SSLSocket.should_receive(:new).with(tcp_socket, ssl_fetch.noverify_peer_ssl_context).and_return(ssl_socket)
- ssl_socket.should_receive(:connect)
- ssl_socket.should_receive(:peer_cert_chain).and_return([self_signed_crt])
+ expect(TCPSocket).to receive(:new).with("foo.example.com", 8443).and_return(tcp_socket)
+ expect(OpenSSL::SSL::SSLSocket).to receive(:new).with(tcp_socket, ssl_fetch.noverify_peer_ssl_context).and_return(ssl_socket)
+ expect(ssl_socket).to receive(:connect)
+ expect(ssl_socket).to receive(:peer_cert_chain).and_return([self_signed_crt])
end
after do
diff --git a/spec/unit/knife/status_spec.rb b/spec/unit/knife/status_spec.rb
index bb43dd25e5..2522bc61b1 100644
--- a/spec/unit/knife/status_spec.rb
+++ b/spec/unit/knife/status_spec.rb
@@ -25,18 +25,18 @@ describe Chef::Knife::Status do
n.automatic_attrs["ohai_time"] = 1343845969
end
query = double("Chef::Search::Query")
- query.stub(:search).and_yield(node)
- Chef::Search::Query.stub(:new).and_return(query)
+ allow(query).to receive(:search).and_yield(node)
+ allow(Chef::Search::Query).to receive(:new).and_return(query)
@knife = Chef::Knife::Status.new
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
describe "run" do
it "should not colorize output unless it's writing to a tty" do
@knife.run
- @stdout.string.match(/foobar/).should_not be_nil
- @stdout.string.match(/\e.*ago/).should be_nil
+ expect(@stdout.string.match(/foobar/)).not_to be_nil
+ expect(@stdout.string.match(/\e.*ago/)).to be_nil
end
end
end
diff --git a/spec/unit/knife/tag_create_spec.rb b/spec/unit/knife/tag_create_spec.rb
index bafea8d268..586ec118bd 100644
--- a/spec/unit/knife/tag_create_spec.rb
+++ b/spec/unit/knife/tag_create_spec.rb
@@ -7,17 +7,17 @@ describe Chef::Knife::TagCreate do
@knife.name_args = [ Chef::Config[:node_name], "happytag" ]
@node = Chef::Node.new
- @node.stub :save
- Chef::Node.stub(:load).and_return @node
+ allow(@node).to receive :save
+ allow(Chef::Node).to receive(:load).and_return @node
@stderr = StringIO.new
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
describe "run" do
it "can create tags on a node" do
@knife.run
- @node.tags.should == ["happytag"]
- @stderr.string.should match /created tags happytag.+node webmonkey.example.com/i
+ expect(@node.tags).to eq(["happytag"])
+ expect(@stderr.string).to match /created tags happytag.+node webmonkey.example.com/i
end
end
end
diff --git a/spec/unit/knife/tag_delete_spec.rb b/spec/unit/knife/tag_delete_spec.rb
index 514228f0a2..e7fa108947 100644
--- a/spec/unit/knife/tag_delete_spec.rb
+++ b/spec/unit/knife/tag_delete_spec.rb
@@ -7,19 +7,19 @@ describe Chef::Knife::TagDelete do
@knife.name_args = [ Chef::Config[:node_name], "sadtag" ]
@node = Chef::Node.new
- @node.stub :save
+ allow(@node).to receive :save
@node.tags << "sadtag" << "happytag"
- Chef::Node.stub(:load).and_return @node
+ allow(Chef::Node).to receive(:load).and_return @node
@stderr = StringIO.new
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
end
describe "run" do
it "can delete tags on a node" do
- @node.tags.should == ["sadtag", "happytag"]
+ expect(@node.tags).to eq(["sadtag", "happytag"])
@knife.run
- @node.tags.should == ["happytag"]
- @stderr.string.should match /deleted.+sadtag/i
+ expect(@node.tags).to eq(["happytag"])
+ expect(@stderr.string).to match /deleted.+sadtag/i
end
end
end
diff --git a/spec/unit/knife/tag_list_spec.rb b/spec/unit/knife/tag_list_spec.rb
index 3724a5c0b7..9c71d22f06 100644
--- a/spec/unit/knife/tag_list_spec.rb
+++ b/spec/unit/knife/tag_list_spec.rb
@@ -7,16 +7,16 @@ describe Chef::Knife::TagList do
@knife.name_args = [ Chef::Config[:node_name], "sadtag" ]
@node = Chef::Node.new
- @node.stub :save
+ allow(@node).to receive :save
@node.tags << "sadtag" << "happytag"
- Chef::Node.stub(:load).and_return @node
+ allow(Chef::Node).to receive(:load).and_return @node
end
describe "run" do
it "can list tags on a node" do
expected = %w(sadtag happytag)
- @node.tags.should == expected
- @knife.should_receive(:output).with(expected)
+ expect(@node.tags).to eq(expected)
+ expect(@knife).to receive(:output).with(expected)
@knife.run
end
end
diff --git a/spec/unit/knife/user_create_spec.rb b/spec/unit/knife/user_create_spec.rb
index 58ef868053..ad8821cd0e 100644
--- a/spec/unit/knife/user_create_spec.rb
+++ b/spec/unit/knife/user_create_spec.rb
@@ -26,8 +26,8 @@ describe Chef::Knife::UserCreate do
@stdout = StringIO.new
@stderr = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
- @knife.ui.stub(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
@knife.name_args = [ 'a_user' ]
@knife.config[:user_password] = "foobar"
@@ -36,53 +36,53 @@ describe Chef::Knife::UserCreate do
@user_with_private_key = Chef::User.new
@user_with_private_key.name "a_user"
@user_with_private_key.private_key 'private_key'
- @user.stub(:create).and_return(@user_with_private_key)
- Chef::User.stub(:new).and_return(@user)
- Chef::User.stub(:from_hash).and_return(@user)
- @knife.stub(:edit_data).and_return(@user.to_hash)
+ allow(@user).to receive(:create).and_return(@user_with_private_key)
+ allow(Chef::User).to receive(:new).and_return(@user)
+ allow(Chef::User).to receive(:from_hash).and_return(@user)
+ allow(@knife).to receive(:edit_data).and_return(@user.to_hash)
end
it "creates a new user" do
- Chef::User.should_receive(:new).and_return(@user)
- @user.should_receive(:create)
+ expect(Chef::User).to receive(:new).and_return(@user)
+ expect(@user).to receive(:create)
@knife.run
- @stderr.string.should match /created user.+a_user/i
+ expect(@stderr.string).to match /created user.+a_user/i
end
it "sets the password" do
@knife.config[:user_password] = "a_password"
- @user.should_receive(:password).with("a_password")
+ expect(@user).to receive(:password).with("a_password")
@knife.run
end
it "exits with an error if password is blank" do
@knife.config[:user_password] = ''
- lambda { @knife.run }.should raise_error SystemExit
- @stderr.string.should match /You must specify a non-blank password/
+ expect { @knife.run }.to raise_error SystemExit
+ expect(@stderr.string).to match /You must specify a non-blank password/
end
it "sets the user name" do
- @user.should_receive(:name).with("a_user")
+ expect(@user).to receive(:name).with("a_user")
@knife.run
end
it "sets the public key if given" do
@knife.config[:user_key] = "/a/filename"
- File.stub(:read).with(File.expand_path("/a/filename")).and_return("a_key")
- @user.should_receive(:public_key).with("a_key")
+ allow(File).to receive(:read).with(File.expand_path("/a/filename")).and_return("a_key")
+ expect(@user).to receive(:public_key).with("a_key")
@knife.run
end
it "allows you to edit the data" do
- @knife.should_receive(:edit_data).with(@user)
+ expect(@knife).to receive(:edit_data).with(@user)
@knife.run
end
it "writes the private key to a file when --file is specified" do
@knife.config[:file] = "/tmp/a_file"
filehandle = double("filehandle")
- filehandle.should_receive(:print).with('private_key')
- File.should_receive(:open).with("/tmp/a_file", "w").and_yield(filehandle)
+ expect(filehandle).to receive(:print).with('private_key')
+ expect(File).to receive(:open).with("/tmp/a_file", "w").and_yield(filehandle)
@knife.run
end
end
diff --git a/spec/unit/knife/user_delete_spec.rb b/spec/unit/knife/user_delete_spec.rb
index be027e5128..94cfbf3db1 100644
--- a/spec/unit/knife/user_delete_spec.rb
+++ b/spec/unit/knife/user_delete_spec.rb
@@ -26,14 +26,14 @@ describe Chef::Knife::UserDelete do
end
it 'deletes the user' do
- @knife.should_receive(:delete_object).with(Chef::User, 'my_user')
+ expect(@knife).to receive(:delete_object).with(Chef::User, 'my_user')
@knife.run
end
it 'prints usage and exits when a user name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/user_edit_spec.rb b/spec/unit/knife/user_edit_spec.rb
index 20a4c0d9e9..0eb75cfa9b 100644
--- a/spec/unit/knife/user_edit_spec.rb
+++ b/spec/unit/knife/user_edit_spec.rb
@@ -25,23 +25,23 @@ describe Chef::Knife::UserEdit do
Chef::Knife::UserEdit.load_deps
@knife = Chef::Knife::UserEdit.new
- @knife.ui.stub(:stderr).and_return(@stderr)
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stderr).and_return(@stderr)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
@knife.name_args = [ 'my_user' ]
@knife.config[:disable_editing] = true
end
it 'loads and edits the user' do
data = { :name => "my_user" }
- Chef::User.stub(:load).with("my_user").and_return(data)
- @knife.should_receive(:edit_data).with(data).and_return(data)
+ allow(Chef::User).to receive(:load).with("my_user").and_return(data)
+ expect(@knife).to receive(:edit_data).with(data).and_return(data)
@knife.run
end
it 'prints usage and exits when a user name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife/user_list_spec.rb b/spec/unit/knife/user_list_spec.rb
index 7a47f9ddba..db097a5c16 100644
--- a/spec/unit/knife/user_list_spec.rb
+++ b/spec/unit/knife/user_list_spec.rb
@@ -25,8 +25,8 @@ describe Chef::Knife::UserList do
end
it 'lists the users' do
- Chef::User.should_receive(:list)
- @knife.should_receive(:format_list_for_display)
+ expect(Chef::User).to receive(:list)
+ expect(@knife).to receive(:format_list_for_display)
@knife.run
end
end
diff --git a/spec/unit/knife/user_reregister_spec.rb b/spec/unit/knife/user_reregister_spec.rb
index 1cbbdb47d2..1268716f40 100644
--- a/spec/unit/knife/user_reregister_spec.rb
+++ b/spec/unit/knife/user_reregister_spec.rb
@@ -24,30 +24,30 @@ describe Chef::Knife::UserReregister do
@knife = Chef::Knife::UserReregister.new
@knife.name_args = [ 'a_user' ]
@user_mock = double('user_mock', :private_key => "private_key")
- Chef::User.stub(:load).and_return(@user_mock)
+ allow(Chef::User).to receive(:load).and_return(@user_mock)
@stdout = StringIO.new
- @knife.ui.stub(:stdout).and_return(@stdout)
+ allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
it 'prints usage and exits when a user name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
it 'reregisters the user and prints the key' do
- @user_mock.should_receive(:reregister).and_return(@user_mock)
+ expect(@user_mock).to receive(:reregister).and_return(@user_mock)
@knife.run
- @stdout.string.should match( /private_key/ )
+ expect(@stdout.string).to match( /private_key/ )
end
it 'writes the private key to a file when --file is specified' do
- @user_mock.should_receive(:reregister).and_return(@user_mock)
+ expect(@user_mock).to receive(:reregister).and_return(@user_mock)
@knife.config[:file] = '/tmp/a_file'
filehandle = StringIO.new
- File.should_receive(:open).with('/tmp/a_file', 'w').and_yield(filehandle)
+ expect(File).to receive(:open).with('/tmp/a_file', 'w').and_yield(filehandle)
@knife.run
- filehandle.string.should == "private_key"
+ expect(filehandle.string).to eq("private_key")
end
end
diff --git a/spec/unit/knife/user_show_spec.rb b/spec/unit/knife/user_show_spec.rb
index af8485ad7d..f97cbc3f13 100644
--- a/spec/unit/knife/user_show_spec.rb
+++ b/spec/unit/knife/user_show_spec.rb
@@ -27,15 +27,15 @@ describe Chef::Knife::UserShow do
end
it 'loads and displays the user' do
- Chef::User.should_receive(:load).with('my_user').and_return(@user_mock)
- @knife.should_receive(:format_for_display).with(@user_mock)
+ expect(Chef::User).to receive(:load).with('my_user').and_return(@user_mock)
+ expect(@knife).to receive(:format_for_display).with(@user_mock)
@knife.run
end
it 'prints usage and exits when a user name is not provided' do
@knife.name_args = []
- @knife.should_receive(:show_usage)
- @knife.ui.should_receive(:fatal)
- lambda { @knife.run }.should raise_error(SystemExit)
+ expect(@knife).to receive(:show_usage)
+ expect(@knife.ui).to receive(:fatal)
+ expect { @knife.run }.to raise_error(SystemExit)
end
end
diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb
index 6d4763e087..d35ba4fa5f 100644
--- a/spec/unit/knife_spec.rb
+++ b/spec/unit/knife_spec.rb
@@ -31,16 +31,16 @@ describe Chef::Knife do
Chef::Config[:node_name] = "webmonkey.example.com"
# Prevent gratuitous code reloading:
- Chef::Knife.stub(:load_commands)
+ allow(Chef::Knife).to receive(:load_commands)
@knife = Chef::Knife.new
- @knife.ui.stub(:puts)
- @knife.ui.stub(:print)
- Chef::Log.stub(:init)
- Chef::Log.stub(:level)
+ allow(@knife.ui).to receive(:puts)
+ allow(@knife.ui).to receive(:print)
+ allow(Chef::Log).to receive(:init)
+ allow(Chef::Log).to receive(:level)
[:debug, :info, :warn, :error, :crit].each do |level_sym|
- Chef::Log.stub(level_sym)
+ allow(Chef::Log).to receive(level_sym)
end
- Chef::Knife.stub(:puts)
+ allow(Chef::Knife).to receive(:puts)
@stderr = StringIO.new
end
@@ -61,27 +61,27 @@ describe Chef::Knife do
end
it "has a category based on its name" do
- KnifeSpecs::TestNameMapping.subcommand_category.should == 'test'
+ expect(KnifeSpecs::TestNameMapping.subcommand_category).to eq('test')
end
it "has an explictly defined category if set" do
- KnifeSpecs::TestExplicitCategory.subcommand_category.should == 'cookbook site'
+ expect(KnifeSpecs::TestExplicitCategory.subcommand_category).to eq('cookbook site')
end
it "can reference the subcommand by its snake cased name" do
- Chef::Knife.subcommands['test_name_mapping'].should equal(KnifeSpecs::TestNameMapping)
+ expect(Chef::Knife.subcommands['test_name_mapping']).to equal(KnifeSpecs::TestNameMapping)
end
it "lists subcommands by category" do
- Chef::Knife.subcommands_by_category['test'].should include('test_name_mapping')
+ expect(Chef::Knife.subcommands_by_category['test']).to include('test_name_mapping')
end
it "lists subcommands by category when the subcommands have explicit categories" do
- Chef::Knife.subcommands_by_category['cookbook site'].should include('test_explicit_category')
+ expect(Chef::Knife.subcommands_by_category['cookbook site']).to include('test_explicit_category')
end
it "has empty dependency_loader list by default" do
- KnifeSpecs::TestNameMapping.dependency_loaders.should be_empty
+ expect(KnifeSpecs::TestNameMapping.dependency_loaders).to be_empty
end
end
@@ -97,22 +97,22 @@ describe Chef::Knife do
Chef::Knife.load_commands
- Chef::Knife.subcommands.should have_key("super_awesome_command")
- Chef::Knife.subcommands["super_awesome_command"].should == SuperAwesomeCommand
+ expect(Chef::Knife.subcommands).to have_key("super_awesome_command")
+ expect(Chef::Knife.subcommands["super_awesome_command"]).to eq(SuperAwesomeCommand)
end
it "guesses a category from a given ARGV" do
Chef::Knife.subcommands_by_category["cookbook"] << :cookbook
Chef::Knife.subcommands_by_category["cookbook site"] << :cookbook_site
- Chef::Knife.guess_category(%w{cookbook foo bar baz}).should == 'cookbook'
- Chef::Knife.guess_category(%w{cookbook site foo bar baz}).should == 'cookbook site'
- Chef::Knife.guess_category(%w{cookbook site --help}).should == 'cookbook site'
+ expect(Chef::Knife.guess_category(%w{cookbook foo bar baz})).to eq('cookbook')
+ expect(Chef::Knife.guess_category(%w{cookbook site foo bar baz})).to eq('cookbook site')
+ expect(Chef::Knife.guess_category(%w{cookbook site --help})).to eq('cookbook site')
end
it "finds a subcommand class based on ARGV" do
Chef::Knife.subcommands["cookbook_site_vendor"] = :CookbookSiteVendor
Chef::Knife.subcommands["cookbook"] = :Cookbook
- Chef::Knife.subcommand_class_from(%w{cookbook site vendor --help foo bar baz}).should == :CookbookSiteVendor
+ expect(Chef::Knife.subcommand_class_from(%w{cookbook site vendor --help foo bar baz})).to eq(:CookbookSiteVendor)
end
end
@@ -130,9 +130,9 @@ describe Chef::Knife do
let(:request_mock) { {} }
let(:rest) do
- Net::HTTP.stub(:new).and_return(http_client)
- Chef::RequestID.instance.stub(:request_id).and_return(request_id)
- Chef::Config.stub(:chef_server_url).and_return("https://api.opscode.piab")
+ allow(Net::HTTP).to receive(:new).and_return(http_client)
+ allow(Chef::RequestID.instance).to receive(:request_id).and_return(request_id)
+ allow(Chef::Config).to receive(:chef_server_url).and_return("https://api.opscode.piab")
command = Chef::Knife.run(%w{test yourself})
rest = command.noauth_rest
rest
@@ -140,7 +140,7 @@ describe Chef::Knife do
let!(:http_client) do
http_client = Net::HTTP.new(url.host, url.port)
- http_client.stub(:request).and_yield(http_response).and_return(http_response)
+ allow(http_client).to receive(:request).and_yield(http_response).and_return(http_response)
http_client
end
@@ -148,8 +148,8 @@ describe Chef::Knife do
let(:http_response) do
http_response = Net::HTTPSuccess.new("1.1", "200", "successful rest req")
- http_response.stub(:read_body)
- http_response.stub(:body).and_return(body)
+ allow(http_response).to receive(:read_body)
+ allow(http_response).to receive(:body).and_return(body)
http_response["Content-Length"] = body.bytesize.to_s
http_response
end
@@ -166,7 +166,7 @@ describe Chef::Knife do
end
it "confirms that the headers include X-Remote-Request-Id" do
- Net::HTTP::Get.should_receive(:new).with("/monkey", headers).and_return(request_mock)
+ expect(Net::HTTP::Get).to receive(:new).with("/monkey", headers).and_return(request_mock)
rest.get_rest("monkey")
end
end
@@ -190,37 +190,37 @@ describe Chef::Knife do
# there is special hackery to return the subcommand instance going on here.
command = Chef::Knife.run(%w{test yourself}, extra_opts)
editor_opts = command.options[:editor]
- editor_opts[:long].should == "--editor EDITOR"
- editor_opts[:description].should == "Set the editor to use for interactive commands"
- editor_opts[:short].should == "-e EDITOR"
- editor_opts[:default].should == "/usr/bin/vim"
+ expect(editor_opts[:long]).to eq("--editor EDITOR")
+ expect(editor_opts[:description]).to eq("Set the editor to use for interactive commands")
+ expect(editor_opts[:short]).to eq("-e EDITOR")
+ expect(editor_opts[:default]).to eq("/usr/bin/vim")
end
it "creates an instance of the subcommand and runs it" do
command = Chef::Knife.run(%w{test yourself})
- command.should be_an_instance_of(KnifeSpecs::TestYourself)
- command.ran.should be_true
+ expect(command).to be_an_instance_of(KnifeSpecs::TestYourself)
+ expect(command.ran).to be_truthy
end
it "passes the command specific args to the subcommand" do
command = Chef::Knife.run(%w{test yourself with some args})
- command.name_args.should == %w{with some args}
+ expect(command.name_args).to eq(%w{with some args})
end
it "excludes the command name from the name args when parts are joined with underscores" do
command = Chef::Knife.run(%w{test_yourself with some args})
- command.name_args.should == %w{with some args}
+ expect(command.name_args).to eq(%w{with some args})
end
it "exits if no subcommand matches the CLI args" do
- Chef::Knife.ui.stub(:stderr).and_return(@stderr)
- Chef::Knife.ui.should_receive(:fatal)
- lambda {Chef::Knife.run(%w{fuuu uuuu fuuuu})}.should raise_error(SystemExit) { |e| e.status.should_not == 0 }
+ allow(Chef::Knife.ui).to receive(:stderr).and_return(@stderr)
+ expect(Chef::Knife.ui).to receive(:fatal)
+ expect {Chef::Knife.run(%w{fuuu uuuu fuuuu})}.to raise_error(SystemExit) { |e| expect(e.status).not_to eq(0) }
end
it "loads lazy dependencies" do
Chef::Knife.run(%w{test yourself})
- KnifeSpecs::TestYourself.test_deps_loaded.should be_true
+ expect(KnifeSpecs::TestYourself.test_deps_loaded).to be_truthy
end
it "loads lazy dependencies from multiple deps calls" do
@@ -230,8 +230,8 @@ describe Chef::Knife do
end
Chef::Knife.run(%w{test yourself})
- KnifeSpecs::TestYourself.test_deps_loaded.should be_true
- other_deps_loaded.should be_true
+ expect(KnifeSpecs::TestYourself.test_deps_loaded).to be_truthy
+ expect(other_deps_loaded).to be_truthy
end
describe "merging configuration options" do
@@ -244,21 +244,21 @@ describe Chef::Knife do
it "prefers the default value if no config or command line value is present" do
knife_command = KnifeSpecs::TestYourself.new([]) #empty argv
knife_command.configure_chef
- knife_command.config[:opt_with_default].should == "default-value"
+ expect(knife_command.config[:opt_with_default]).to eq("default-value")
end
it "prefers a value in Chef::Config[:knife] to the default" do
Chef::Config[:knife][:opt_with_default] = "from-knife-config"
knife_command = KnifeSpecs::TestYourself.new([]) #empty argv
knife_command.configure_chef
- knife_command.config[:opt_with_default].should == "from-knife-config"
+ expect(knife_command.config[:opt_with_default]).to eq("from-knife-config")
end
it "prefers a value from command line over Chef::Config and the default" do
Chef::Config[:knife][:opt_with_default] = "from-knife-config"
knife_command = KnifeSpecs::TestYourself.new(["-D", "from-cli"])
knife_command.configure_chef
- knife_command.config[:opt_with_default].should == "from-cli"
+ expect(knife_command.config[:opt_with_default]).to eq("from-cli")
end
context "verbosity is greater than zero" do
@@ -290,15 +290,15 @@ describe Chef::Knife do
end
it "it parses the options passed to it" do
- @knife.config[:scro].should == 'scrogramming'
+ expect(@knife.config[:scro]).to eq('scrogramming')
end
it "extracts its command specific args from the full arg list" do
- @knife.name_args.should == %w{with some args}
+ expect(@knife.name_args).to eq(%w{with some args})
end
it "does not have lazy dependencies loaded" do
- @knife.class.test_deps_loaded.should_not be_true
+ expect(@knife.class.test_deps_loaded).not_to be_truthy
end
end
@@ -306,114 +306,114 @@ describe Chef::Knife do
before do
@stdout, @stderr, @stdin = StringIO.new, StringIO.new, StringIO.new
@knife.ui = Chef::Knife::UI.new(@stdout, @stderr, @stdin, {})
- @knife.should_receive(:exit).with(100)
+ expect(@knife).to receive(:exit).with(100)
end
it "formats 401s nicely" do
response = Net::HTTPUnauthorized.new("1.1", "401", "Unauthorized")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no syncronize your clock?"))
- @knife.stub(:run).and_raise(Net::HTTPServerException.new("401 Unauthorized", response))
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no syncronize your clock?"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPServerException.new("401 Unauthorized", response))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(/ERROR: Failed to authenticate to/)
- @stderr.string.should match(/Response: y u no syncronize your clock\?/)
+ expect(@stderr.string).to match(/ERROR: Failed to authenticate to/)
+ expect(@stderr.string).to match(/Response: y u no syncronize your clock\?/)
end
it "formats 403s nicely" do
response = Net::HTTPForbidden.new("1.1", "403", "Forbidden")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no administrator"))
- @knife.stub(:run).and_raise(Net::HTTPServerException.new("403 Forbidden", response))
- @knife.stub(:username).and_return("sadpanda")
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "y u no administrator"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPServerException.new("403 Forbidden", response))
+ allow(@knife).to receive(:username).and_return("sadpanda")
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action])
- @stderr.string.should match(%r[Response: y u no administrator])
+ expect(@stderr.string).to match(%r[ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action])
+ expect(@stderr.string).to match(%r[Response: y u no administrator])
end
it "formats 400s nicely" do
response = Net::HTTPBadRequest.new("1.1", "400", "Bad Request")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "y u search wrong"))
- @knife.stub(:run).and_raise(Net::HTTPServerException.new("400 Bad Request", response))
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "y u search wrong"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPServerException.new("400 Bad Request", response))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: The data in your request was invalid])
- @stderr.string.should match(%r[Response: y u search wrong])
+ expect(@stderr.string).to match(%r[ERROR: The data in your request was invalid])
+ expect(@stderr.string).to match(%r[Response: y u search wrong])
end
it "formats 404s nicely" do
response = Net::HTTPNotFound.new("1.1", "404", "Not Found")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "nothing to see here"))
- @knife.stub(:run).and_raise(Net::HTTPServerException.new("404 Not Found", response))
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "nothing to see here"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPServerException.new("404 Not Found", response))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: The object you are looking for could not be found])
- @stderr.string.should match(%r[Response: nothing to see here])
+ expect(@stderr.string).to match(%r[ERROR: The object you are looking for could not be found])
+ expect(@stderr.string).to match(%r[Response: nothing to see here])
end
it "formats 500s nicely" do
response = Net::HTTPInternalServerError.new("1.1", "500", "Internal Server Error")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "sad trombone"))
- @knife.stub(:run).and_raise(Net::HTTPFatalError.new("500 Internal Server Error", response))
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "sad trombone"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPFatalError.new("500 Internal Server Error", response))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: internal server error])
- @stderr.string.should match(%r[Response: sad trombone])
+ expect(@stderr.string).to match(%r[ERROR: internal server error])
+ expect(@stderr.string).to match(%r[Response: sad trombone])
end
it "formats 502s nicely" do
response = Net::HTTPBadGateway.new("1.1", "502", "Bad Gateway")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "sadder trombone"))
- @knife.stub(:run).and_raise(Net::HTTPFatalError.new("502 Bad Gateway", response))
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "sadder trombone"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPFatalError.new("502 Bad Gateway", response))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: bad gateway])
- @stderr.string.should match(%r[Response: sadder trombone])
+ expect(@stderr.string).to match(%r[ERROR: bad gateway])
+ expect(@stderr.string).to match(%r[Response: sadder trombone])
end
it "formats 503s nicely" do
response = Net::HTTPServiceUnavailable.new("1.1", "503", "Service Unavailable")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "saddest trombone"))
- @knife.stub(:run).and_raise(Net::HTTPFatalError.new("503 Service Unavailable", response))
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "saddest trombone"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPFatalError.new("503 Service Unavailable", response))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: Service temporarily unavailable])
- @stderr.string.should match(%r[Response: saddest trombone])
+ expect(@stderr.string).to match(%r[ERROR: Service temporarily unavailable])
+ expect(@stderr.string).to match(%r[Response: saddest trombone])
end
it "formats other HTTP errors nicely" do
response = Net::HTTPPaymentRequired.new("1.1", "402", "Payment Required")
response.instance_variable_set(:@read, true) # I hate you, net/http.
- response.stub(:body).and_return(Chef::JSONCompat.to_json(:error => "nobugfixtillyoubuy"))
- @knife.stub(:run).and_raise(Net::HTTPServerException.new("402 Payment Required", response))
+ allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(:error => "nobugfixtillyoubuy"))
+ allow(@knife).to receive(:run).and_raise(Net::HTTPServerException.new("402 Payment Required", response))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: Payment Required])
- @stderr.string.should match(%r[Response: nobugfixtillyoubuy])
+ expect(@stderr.string).to match(%r[ERROR: Payment Required])
+ expect(@stderr.string).to match(%r[Response: nobugfixtillyoubuy])
end
it "formats NameError and NoMethodError nicely" do
- @knife.stub(:run).and_raise(NameError.new("Undefined constant FUUU"))
+ allow(@knife).to receive(:run).and_raise(NameError.new("Undefined constant FUUU"))
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: knife encountered an unexpected error])
- @stderr.string.should match(%r[This may be a bug in the 'knife' knife command or plugin])
- @stderr.string.should match(%r[Exception: NameError: Undefined constant FUUU])
+ expect(@stderr.string).to match(%r[ERROR: knife encountered an unexpected error])
+ expect(@stderr.string).to match(%r[This may be a bug in the 'knife' knife command or plugin])
+ expect(@stderr.string).to match(%r[Exception: NameError: Undefined constant FUUU])
end
it "formats missing private key errors nicely" do
- @knife.stub(:run).and_raise(Chef::Exceptions::PrivateKeyMissing.new('key not there'))
- @knife.stub(:api_key).and_return("/home/root/.chef/no-key-here.pem")
+ allow(@knife).to receive(:run).and_raise(Chef::Exceptions::PrivateKeyMissing.new('key not there'))
+ allow(@knife).to receive(:api_key).and_return("/home/root/.chef/no-key-here.pem")
@knife.run_with_pretty_exceptions
- @stderr.string.should match(%r[ERROR: Your private key could not be loaded from /home/root/.chef/no-key-here.pem])
- @stderr.string.should match(%r[Check your configuration file and ensure that your private key is readable])
+ expect(@stderr.string).to match(%r[ERROR: Your private key could not be loaded from /home/root/.chef/no-key-here.pem])
+ expect(@stderr.string).to match(%r[Check your configuration file and ensure that your private key is readable])
end
it "formats connection refused errors nicely" do
- @knife.stub(:run).and_raise(Errno::ECONNREFUSED.new('y u no shut up'))
+ allow(@knife).to receive(:run).and_raise(Errno::ECONNREFUSED.new('y u no shut up'))
@knife.run_with_pretty_exceptions
# Errno::ECONNREFUSED message differs by platform
# *nix = Errno::ECONNREFUSED: Connection refused
# win32: Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it.
- @stderr.string.should match(%r[ERROR: Network Error: .* - y u no shut up])
- @stderr.string.should match(%r[Check your knife configuration and network settings])
+ expect(@stderr.string).to match(%r[ERROR: Network Error: .* - y u no shut up])
+ expect(@stderr.string).to match(%r[Check your knife configuration and network settings])
end
end
diff --git a/spec/unit/lwrp_spec.rb b/spec/unit/lwrp_spec.rb
index 452e1da2a4..0fb0ea7cab 100644
--- a/spec/unit/lwrp_spec.rb
+++ b/spec/unit/lwrp_spec.rb
@@ -33,7 +33,7 @@ describe "LWRP" do
describe "when overriding an existing class" do
before :each do
- $stderr.stub(:write)
+ allow($stderr).to receive(:write)
end
it "should log if attempting to load resource of same name" do
@@ -42,8 +42,8 @@ describe "LWRP" do
end
Dir[File.expand_path( "lwrp/resources/*", CHEF_SPEC_DATA)].each do |file|
- Chef::Log.should_receive(:info).with(/Skipping/)
- Chef::Log.should_receive(:debug).with(/anymore/)
+ expect(Chef::Log).to receive(:info).with(/Skipping/)
+ expect(Chef::Log).to receive(:debug).with(/anymore/)
Chef::Resource::LWRPBase.build_from_file("lwrp", file, nil)
end
end
@@ -54,8 +54,8 @@ describe "LWRP" do
end
Dir[File.expand_path( "lwrp/providers/*", CHEF_SPEC_DATA)].each do |file|
- Chef::Log.should_receive(:info).with(/Skipping/)
- Chef::Log.should_receive(:debug).with(/anymore/)
+ expect(Chef::Log).to receive(:info).with(/Skipping/)
+ expect(Chef::Log).to receive(:debug).with(/anymore/)
Chef::Provider::LWRPBase.build_from_file("lwrp", file, nil)
end
end
@@ -67,11 +67,11 @@ describe "LWRP" do
Chef::Resource::LWRPBase.build_from_file("lwrp", file, nil)
end
first_lwr_foo_class = Chef::Resource::LwrpFoo
- Chef::Resource.resource_classes.should include(first_lwr_foo_class)
+ expect(Chef::Resource.resource_classes).to include(first_lwr_foo_class)
Dir[File.expand_path( "lwrp/resources/*", CHEF_SPEC_DATA)].each do |file|
Chef::Resource::LWRPBase.build_from_file("lwrp", file, nil)
end
- Chef::Resource.resource_classes.should include(first_lwr_foo_class)
+ expect(Chef::Resource.resource_classes).to include(first_lwr_foo_class)
end
it "does not attempt to remove classes from higher up namespaces [CHEF-4117]" do
@@ -95,27 +95,27 @@ describe "LWRP" do
end
it "should load the resource into a properly-named class" do
- Chef::Resource.const_get("LwrpFoo").should be_kind_of(Class)
+ expect(Chef::Resource.const_get("LwrpFoo")).to be_kind_of(Class)
end
it "should set resource_name" do
- Chef::Resource::LwrpFoo.new("blah").resource_name.should eql(:lwrp_foo)
+ expect(Chef::Resource::LwrpFoo.new("blah").resource_name).to eql(:lwrp_foo)
end
it "should add the specified actions to the allowed_actions array" do
- Chef::Resource::LwrpFoo.new("blah").allowed_actions.should include(:pass_buck, :twiddle_thumbs)
+ expect(Chef::Resource::LwrpFoo.new("blah").allowed_actions).to include(:pass_buck, :twiddle_thumbs)
end
it "should set the specified action as the default action" do
- Chef::Resource::LwrpFoo.new("blah").action.should == :pass_buck
+ expect(Chef::Resource::LwrpFoo.new("blah").action).to eq(:pass_buck)
end
it "should create a method for each attribute" do
- Chef::Resource::LwrpFoo.new("blah").methods.map{ |m| m.to_sym}.should include(:monkey)
+ expect(Chef::Resource::LwrpFoo.new("blah").methods.map{ |m| m.to_sym}).to include(:monkey)
end
it "should build attribute methods that respect validation rules" do
- lambda { Chef::Resource::LwrpFoo.new("blah").monkey(42) }.should raise_error(ArgumentError)
+ expect { Chef::Resource::LwrpFoo.new("blah").monkey(42) }.to raise_error(ArgumentError)
end
it "should have access to the run context and node during class definition" do
@@ -128,9 +128,9 @@ describe "LWRP" do
end
cls = Chef::Resource.const_get("LwrpNodeattr")
- cls.node.should be_kind_of(Chef::Node)
- cls.run_context.should be_kind_of(Chef::RunContext)
- cls.node[:penguin_name].should eql("jackass")
+ expect(cls.node).to be_kind_of(Chef::Node)
+ expect(cls.run_context).to be_kind_of(Chef::RunContext)
+ expect(cls.node[:penguin_name]).to eql("jackass")
end
context "resource_name" do
@@ -296,13 +296,13 @@ describe "LWRP" do
end
it "should load the provider into a properly-named class" do
- Chef::Provider.const_get("LwrpBuckPasser").should be_kind_of(Class)
+ expect(Chef::Provider.const_get("LwrpBuckPasser")).to be_kind_of(Class)
end
it "should create a method for each attribute" do
new_resource = double("new resource").as_null_object
- Chef::Provider::LwrpBuckPasser.new(nil, new_resource).methods.map{|m|m.to_sym}.should include(:action_pass_buck)
- Chef::Provider::LwrpThumbTwiddler.new(nil, new_resource).methods.map{|m|m.to_sym}.should include(:action_twiddle_thumbs)
+ expect(Chef::Provider::LwrpBuckPasser.new(nil, new_resource).methods.map{|m|m.to_sym}).to include(:action_pass_buck)
+ expect(Chef::Provider::LwrpThumbTwiddler.new(nil, new_resource).methods.map{|m|m.to_sym}).to include(:action_twiddle_thumbs)
end
it "should insert resources embedded in the provider into the middle of the resource collection" do
@@ -316,10 +316,10 @@ describe "LWRP" do
Chef::Runner.new(@run_context).converge
- @run_context.resource_collection[0].should eql(injector)
- @run_context.resource_collection[1].name.should eql(:prepared_thumbs)
- @run_context.resource_collection[2].name.should eql(:twiddled_thumbs)
- @run_context.resource_collection[3].should eql(dummy)
+ expect(@run_context.resource_collection[0]).to eql(injector)
+ expect(@run_context.resource_collection[1].name).to eql(:prepared_thumbs)
+ expect(@run_context.resource_collection[2].name).to eql(:twiddled_thumbs)
+ expect(@run_context.resource_collection[3]).to eql(dummy)
end
it "should insert embedded resources from multiple providers, including from the last position, properly into the resource collection" do
@@ -340,13 +340,13 @@ describe "LWRP" do
Chef::Runner.new(@run_context).converge
- @run_context.resource_collection[0].should eql(injector)
- @run_context.resource_collection[1].name.should eql(:prepared_thumbs)
- @run_context.resource_collection[2].name.should eql(:twiddled_thumbs)
- @run_context.resource_collection[3].should eql(dummy)
- @run_context.resource_collection[4].should eql(injector2)
- @run_context.resource_collection[5].name.should eql(:prepared_eyes)
- @run_context.resource_collection[6].name.should eql(:dried_paint_watched)
+ expect(@run_context.resource_collection[0]).to eql(injector)
+ expect(@run_context.resource_collection[1].name).to eql(:prepared_thumbs)
+ expect(@run_context.resource_collection[2].name).to eql(:twiddled_thumbs)
+ expect(@run_context.resource_collection[3]).to eql(dummy)
+ expect(@run_context.resource_collection[4]).to eql(injector2)
+ expect(@run_context.resource_collection[5].name).to eql(:prepared_eyes)
+ expect(@run_context.resource_collection[6].name).to eql(:dried_paint_watched)
end
it "should properly handle a new_resource reference" do
@@ -357,7 +357,7 @@ describe "LWRP" do
provider = Chef::Platform.provider_for_resource(resource, :twiddle_thumbs)
provider.action_twiddle_thumbs
- provider.monkey_name.should == "my monkey's name is 'bob'"
+ expect(provider.monkey_name).to eq("my monkey's name is 'bob'")
end
it "should properly handle an embedded Resource accessing the enclosing Provider's scope" do
@@ -369,7 +369,7 @@ describe "LWRP" do
#provider = @runner.build_provider(resource)
provider.action_twiddle_thumbs
- provider.enclosed_resource.monkey.should == 'bob, the monkey'
+ expect(provider.enclosed_resource.monkey).to eq('bob, the monkey')
end
describe "when using inline compilation" do
@@ -388,27 +388,27 @@ describe "LWRP" do
it "does not add interior resources to the exterior resource collection" do
@resource.run_action(:test)
- @run_context.resource_collection.should be_empty
+ expect(@run_context.resource_collection).to be_empty
end
context "when interior resources are updated" do
it "processes notifications within the LWRP provider's action" do
@resource.run_action(:test)
- $interior_ruby_block_2.should == "executed"
+ expect($interior_ruby_block_2).to eq("executed")
end
it "marks the parent resource updated" do
@resource.run_action(:test)
- @resource.should be_updated
- @resource.should be_updated_by_last_action
+ expect(@resource).to be_updated
+ expect(@resource).to be_updated_by_last_action
end
end
context "when interior resources are not updated" do
it "does not mark the parent resource updated" do
@resource.run_action(:no_updates)
- @resource.should_not be_updated
- @resource.should_not be_updated_by_last_action
+ expect(@resource).not_to be_updated
+ expect(@resource).not_to be_updated_by_last_action
end
end
diff --git a/spec/unit/mash_spec.rb b/spec/unit/mash_spec.rb
index 7358781e60..b8f4c2d5aa 100644
--- a/spec/unit/mash_spec.rb
+++ b/spec/unit/mash_spec.rb
@@ -24,27 +24,27 @@ describe Mash do
data = {:x=>"one", :y=>"two", :z=>"three"}
@orig = Mash.new(data)
@copy = @orig.dup
- @copy.to_hash.should == Mash.new(data).to_hash
+ expect(@copy.to_hash).to eq(Mash.new(data).to_hash)
@copy[:x] = "four"
- @orig[:x].should == "one"
+ expect(@orig[:x]).to eq("one")
end
it "should duplicate a mash with an array to a new mash" do
data = {:x=>"one", :y=>"two", :z=>[1,2,3]}
@orig = Mash.new(data)
@copy = @orig.dup
- @copy.to_hash.should == Mash.new(data).to_hash
+ expect(@copy.to_hash).to eq(Mash.new(data).to_hash)
@copy[:z] << 4
- @orig[:z].should == [1,2,3]
+ expect(@orig[:z]).to eq([1,2,3])
end
it "should duplicate a nested mash to a new mash" do
data = {:x=>"one", :y=>"two", :z=>Mash.new({:a=>[1,2,3]})}
@orig = Mash.new(data)
@copy = @orig.dup
- @copy.to_hash.should == Mash.new(data).to_hash
+ expect(@copy.to_hash).to eq(Mash.new(data).to_hash)
@copy[:z][:a] << 4
- @orig[:z][:a].should == [1,2,3]
+ expect(@orig[:z][:a]).to eq([1,2,3])
end
# add more!
diff --git a/spec/unit/mixin/checksum_spec.rb b/spec/unit/mixin/checksum_spec.rb
index 54689c9992..864b15f2bc 100644
--- a/spec/unit/mixin/checksum_spec.rb
+++ b/spec/unit/mixin/checksum_spec.rb
@@ -30,11 +30,11 @@ describe Chef::Mixin::Checksum do
@cache = Chef::Digester.instance
@file = CHEF_SPEC_DATA + "/checksum/random.txt"
@stat = double("File::Stat", { :mtime => Time.at(0) })
- File.stub(:stat).and_return(@stat)
+ allow(File).to receive(:stat).and_return(@stat)
end
it "gets the checksum of a file" do
- @checksum_user.checksum(@file).should == "09ee9c8cc70501763563bcf9c218d71b2fbf4186bf8e1e0da07f0f42c80a3394"
+ expect(@checksum_user.checksum(@file)).to eq("09ee9c8cc70501763563bcf9c218d71b2fbf4186bf8e1e0da07f0f42c80a3394")
end
end
diff --git a/spec/unit/mixin/command_spec.rb b/spec/unit/mixin/command_spec.rb
index 96660be436..e198e3addd 100644
--- a/spec/unit/mixin/command_spec.rb
+++ b/spec/unit/mixin/command_spec.rb
@@ -31,41 +31,41 @@ describe Chef::Mixin::Command, :volatile do
it "should be possible to read the child process's stdout and stderr" do
popen4("sh -c 'echo hello && echo world >&2'") do |pid, stdin, stdout, stderr|
- stdout.read.should == "hello\n"
- stderr.read.should == "world\n"
+ expect(stdout.read).to eq("hello\n")
+ expect(stderr.read).to eq("world\n")
end
end
it "should default all commands to be run in the POSIX standard C locale" do
popen4("echo $LC_ALL") do |pid, stdin, stdout, stderr|
- stdout.read.strip.should == "C"
+ expect(stdout.read.strip).to eq("C")
end
end
it "should respect locale when specified explicitly" do
popen4("echo $LC_ALL", :environment => {"LC_ALL" => "es"}) do |pid, stdin, stdout, stderr|
- stdout.read.strip.should == "es"
+ expect(stdout.read.strip).to eq("es")
end
end
it "should end when the child process reads from STDIN and a block is given" do
- lambda {Timeout.timeout(10) do
+ expect {Timeout.timeout(10) do
popen4("ruby -e 'while gets; end'", :waitlast => true) do |pid, stdin, stdout, stderr|
(1..5).each { |i| stdin.puts "#{i}" }
end
end
- }.should_not raise_error
+ }.not_to raise_error
end
describe "when a process detaches but doesn't close STDOUT and STDERR [CHEF-584]" do
it "returns immediately after the first child process exits" do
- lambda {Timeout.timeout(10) do
+ expect {Timeout.timeout(10) do
pid, stdin,stdout,stderr = nil,nil,nil,nil
evil_forker="exit if fork; 10.times { sleep 1}"
popen4("ruby -e '#{evil_forker}'") do |pid,stdin,stdout,stderr|
end
- end}.should_not raise_error
+ end}.not_to raise_error
end
end
@@ -76,13 +76,13 @@ describe Chef::Mixin::Command, :volatile do
include Chef::Mixin::Command
it "logs the command's stderr and stdout output if the command failed" do
- Chef::Log.stub(:level).and_return(:debug)
+ allow(Chef::Log).to receive(:level).and_return(:debug)
begin
run_command(:command => "sh -c 'echo hello; echo world >&2; false'")
violated "Exception expected, but nothing raised."
rescue => e
- e.message.should =~ /STDOUT: hello/
- e.message.should =~ /STDERR: world/
+ expect(e.message).to match(/STDOUT: hello/)
+ expect(e.message).to match(/STDERR: world/)
end
end
@@ -93,10 +93,10 @@ describe Chef::Mixin::Command, :volatile do
# btm
# Serdar - During Solaris tests, we've seen that processes
# are taking a long time to exit. Bumping timeout now to 10.
- lambda {Timeout.timeout(10) do
+ expect {Timeout.timeout(10) do
evil_forker="exit if fork; 10.times { sleep 1}"
run_command(:command => "ruby -e '#{evil_forker}'")
- end}.should_not raise_error
+ end}.not_to raise_error
end
end
diff --git a/spec/unit/mixin/convert_to_class_name_spec.rb b/spec/unit/mixin/convert_to_class_name_spec.rb
index 0276a55fd7..4cf6728d64 100644
--- a/spec/unit/mixin/convert_to_class_name_spec.rb
+++ b/spec/unit/mixin/convert_to_class_name_spec.rb
@@ -29,26 +29,26 @@ describe Chef::Mixin::ConvertToClassName do
end
it "converts a_snake_case_word to a CamelCaseWord" do
- @convert.convert_to_class_name("now_camelized").should == "NowCamelized"
+ expect(@convert.convert_to_class_name("now_camelized")).to eq("NowCamelized")
end
it "converts a CamelCaseWord to a snake_case_word" do
- @convert.convert_to_snake_case("NowImASnake").should == "now_im_a_snake"
+ expect(@convert.convert_to_snake_case("NowImASnake")).to eq("now_im_a_snake")
end
it "removes the base classes before snake casing" do
- @convert.convert_to_snake_case("NameSpaced::Class::ThisIsWin", "NameSpaced::Class").should == "this_is_win"
+ expect(@convert.convert_to_snake_case("NameSpaced::Class::ThisIsWin", "NameSpaced::Class")).to eq("this_is_win")
end
it "removes the base classes without explicitly naming them and returns snake case" do
- @convert.snake_case_basename("NameSpaced::Class::ExtraWin").should == "extra_win"
+ expect(@convert.snake_case_basename("NameSpaced::Class::ExtraWin")).to eq("extra_win")
end
it "interprets non-alphanumeric characters in snake case as word boundaries" do
- @convert.convert_to_class_name("now_camelized_without-hyphen").should == "NowCamelizedWithoutHyphen"
+ expect(@convert.convert_to_class_name("now_camelized_without-hyphen")).to eq("NowCamelizedWithoutHyphen")
end
it "interprets underscore" do
- @convert.convert_to_class_name("_remove_leading_underscore").should == "RemoveLeadingUnderscore"
+ expect(@convert.convert_to_class_name("_remove_leading_underscore")).to eq("RemoveLeadingUnderscore")
end
end
diff --git a/spec/unit/mixin/deep_merge_spec.rb b/spec/unit/mixin/deep_merge_spec.rb
index dbc49e68f2..d107323f32 100644
--- a/spec/unit/mixin/deep_merge_spec.rb
+++ b/spec/unit/mixin/deep_merge_spec.rb
@@ -37,175 +37,175 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
hash_src = {'id' => '2'}
hash_dst = {}
@dm.deep_merge!(hash_src.dup, hash_dst)
- hash_dst.should == hash_src
+ expect(hash_dst).to eq(hash_src)
end
it "tests merging an hash w/array into blank hash" do
hash_src = {'region' => {'id' => ['227', '2']}}
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == hash_src
+ expect(hash_dst).to eq(hash_src)
end
it "tests merge from empty hash" do
hash_src = {}
hash_dst = {"property" => ["2","4"]}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => ["2","4"]}
+ expect(hash_dst).to eq({"property" => ["2","4"]})
end
it "tests merge to empty hash" do
hash_src = {"property" => ["2","4"]}
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => ["2","4"]}
+ expect(hash_dst).to eq({"property" => ["2","4"]})
end
it "tests simple string overwrite" do
hash_src = {"name" => "value"}
hash_dst = {"name" => "value1"}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"name" => "value"}
+ expect(hash_dst).to eq({"name" => "value"})
end
it "tests simple string overwrite of empty hash" do
hash_src = {"name" => "value"}
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == hash_src
+ expect(hash_dst).to eq(hash_src)
end
it "tests hashes holding array" do
hash_src = {"property" => ["1","3"]}
hash_dst = {"property" => ["2","4"]}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => ["2","4","1","3"]}
+ expect(hash_dst).to eq({"property" => ["2","4","1","3"]})
end
it "tests hashes holding hashes holding arrays (array with duplicate elements is merged with dest then src" do
hash_src = {"property" => {"bedroom_count" => ["1", "2"], "bathroom_count" => ["1", "4+"]}}
hash_dst = {"property" => {"bedroom_count" => ["3", "2"], "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => ["3","2","1"], "bathroom_count" => ["2", "1", "4+"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => ["3","2","1"], "bathroom_count" => ["2", "1", "4+"]}})
end
it "tests hash holding hash holding array v string (string is overwritten by array)" do
hash_src = {"property" => {"bedroom_count" => ["1", "2"], "bathroom_count" => ["1", "4+"]}}
hash_dst = {"property" => {"bedroom_count" => "3", "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => ["1", "2"], "bathroom_count" => ["2","1","4+"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => ["1", "2"], "bathroom_count" => ["2","1","4+"]}})
end
it "tests hash holding hash holding string v array (array is overwritten by string)" do
hash_src = {"property" => {"bedroom_count" => "3", "bathroom_count" => ["1", "4+"]}}
hash_dst = {"property" => {"bedroom_count" => ["1", "2"], "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => "3", "bathroom_count" => ["2","1","4+"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => "3", "bathroom_count" => ["2","1","4+"]}})
end
it "tests hash holding hash holding hash v array (array is overwritten by hash)" do
hash_src = {"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => 1}, "bathroom_count" => ["1", "4+"]}}
hash_dst = {"property" => {"bedroom_count" => ["1", "2"], "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => 1}, "bathroom_count" => ["2","1","4+"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => 1}, "bathroom_count" => ["2","1","4+"]}})
end
it "tests 3 hash layers holding integers (integers are overwritten by source)" do
hash_src = {"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => 1}, "bathroom_count" => ["1", "4+"]}}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => 2, "queen_bed" => 4}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => 1}, "bathroom_count" => ["2","1","4+"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => 1}, "bathroom_count" => ["2","1","4+"]}})
end
it "tests 3 hash layers holding arrays of int (arrays are merged)" do
hash_src = {"property" => {"bedroom_count" => {"king_bed" => [3], "queen_bed" => [1]}, "bathroom_count" => ["1", "4+"]}}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {"king_bed" => [2,3], "queen_bed" => [4,1]}, "bathroom_count" => ["2","1","4+"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {"king_bed" => [2,3], "queen_bed" => [4,1]}, "bathroom_count" => ["2","1","4+"]}})
end
it "tests 1 hash overwriting 3 hash layers holding arrays of int" do
hash_src = {"property" => "1"}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => "1"}
+ expect(hash_dst).to eq({"property" => "1"})
end
it "tests 3 hash layers holding arrays of int (arrays are merged) but second hash's array is overwritten" do
hash_src = {"property" => {"bedroom_count" => {"king_bed" => [3], "queen_bed" => [1]}, "bathroom_count" => "1"}}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {"king_bed" => [2,3], "queen_bed" => [4,1]}, "bathroom_count" => "1"}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {"king_bed" => [2,3], "queen_bed" => [4,1]}, "bathroom_count" => "1"}})
end
it "tests 3 hash layers holding arrays of int, but one holds int. This one overwrites, but the rest merge" do
hash_src = {"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => [1]}, "bathroom_count" => ["1"]}}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => [4,1]}, "bathroom_count" => ["2","1"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {"king_bed" => 3, "queen_bed" => [4,1]}, "bathroom_count" => ["2","1"]}})
end
it "tests 3 hash layers holding arrays of int, but source is incomplete." do
hash_src = {"property" => {"bedroom_count" => {"king_bed" => [3]}, "bathroom_count" => ["1"]}}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {"king_bed" => [2,3], "queen_bed" => [4]}, "bathroom_count" => ["2","1"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {"king_bed" => [2,3], "queen_bed" => [4]}, "bathroom_count" => ["2","1"]}})
end
it "tests 3 hash layers holding arrays of int, but source is shorter and has new 2nd level ints." do
hash_src = {"property" => {"bedroom_count" => {2=>3, "king_bed" => [3]}, "bathroom_count" => ["1"]}}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {2=>3, "king_bed" => [2,3], "queen_bed" => [4]}, "bathroom_count" => ["2","1"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {2=>3, "king_bed" => [2,3], "queen_bed" => [4]}, "bathroom_count" => ["2","1"]}})
end
it "tests 3 hash layers holding arrays of int, but source is empty" do
hash_src = {}
hash_dst = {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {"king_bed" => [2], "queen_bed" => [4]}, "bathroom_count" => ["2"]}})
end
it "tests 3 hash layers holding arrays of int, but dest is empty" do
hash_src = {"property" => {"bedroom_count" => {2=>3, "king_bed" => [3]}, "bathroom_count" => ["1"]}}
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"property" => {"bedroom_count" => {2=>3, "king_bed" => [3]}, "bathroom_count" => ["1"]}}
+ expect(hash_dst).to eq({"property" => {"bedroom_count" => {2=>3, "king_bed" => [3]}, "bathroom_count" => ["1"]}})
end
it "tests hash holding arrays of arrays" do
hash_src = {["1", "2", "3"] => ["1", "2"]}
hash_dst = {["4", "5"] => ["3"]}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {["1","2","3"] => ["1", "2"], ["4", "5"] => ["3"]}
+ expect(hash_dst).to eq({["1","2","3"] => ["1", "2"], ["4", "5"] => ["3"]})
end
it "tests merging of hash with blank hash, and make sure that source array split does not function when turned off" do
hash_src = {'property' => {'bedroom_count' => ["1","2,3"]}}
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {'property' => {'bedroom_count' => ["1","2,3"]}}
+ expect(hash_dst).to eq({'property' => {'bedroom_count' => ["1","2,3"]}})
end
it "tests merging into a blank hash" do
hash_src = {"action"=>"browse", "controller"=>"results"}
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == hash_src
+ expect(hash_dst).to eq(hash_src)
end
it "tests are unmerged hashes passed unmodified w/out :unpack_arrays?" do
hash_src = {"amenity"=>{"id"=>["26,27"]}}
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"amenity"=>{"id"=>["26,27"]}}
+ expect(hash_dst).to eq({"amenity"=>{"id"=>["26,27"]}})
end
it "tests hash of array of hashes" do
hash_src = {"item" => [{"1" => "3"}, {"2" => "4"}]}
hash_dst = {"item" => [{"3" => "5"}]}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"item" => [{"3" => "5"}, {"1" => "3"}, {"2" => "4"}]}
+ expect(hash_dst).to eq({"item" => [{"3" => "5"}, {"1" => "3"}, {"2" => "4"}]})
end
# Additions since import
@@ -213,42 +213,28 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
hash_src = {"valid" => false}
hash_dst = {"valid" => true}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"valid" => false}
+ expect(hash_dst).to eq({"valid" => false})
end
it "should overwrite false with true when merging boolean values" do
hash_src = {"valid" => true}
hash_dst = {"valid" => false}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"valid" => true}
+ expect(hash_dst).to eq({"valid" => true})
end
it "should overwrite a string with an empty string when merging string values" do
hash_src = {"item" => " "}
hash_dst = {"item" => "orange"}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"item" => " "}
+ expect(hash_dst).to eq({"item" => " "})
end
it "should overwrite an empty string with a string when merging string values" do
hash_src = {"item" => "orange"}
hash_dst = {"item" => " "}
@dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"item" => "orange"}
- end
-
- it 'should overwrite hashes with nil' do
- hash_src = {"item" => { "1" => "2"}, "other" => true }
- hash_dst = {"item" => nil }
- @dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"item" => nil, "other" => true }
- end
-
- it 'should overwrite strings with nil' do
- hash_src = {"item" => "to_overwrite", "other" => false }
- hash_dst = {"item" => nil }
- @dm.deep_merge!(hash_src, hash_dst)
- hash_dst.should == {"item" => nil, "other" => false }
+ expect(hash_dst).to eq({"item" => "orange"})
end
end # deep_merge!
@@ -262,40 +248,40 @@ describe Chef::Mixin::DeepMerge do
it "should merge a hash into an empty hash" do
hash_dst = {}
hash_src = {'id' => '2'}
- @dm.merge(hash_dst, hash_src).should == hash_src
+ expect(@dm.merge(hash_dst, hash_src)).to eq(hash_src)
end
it "should merge a nested hash into an empty hash" do
hash_dst = {}
hash_src = {'region' => {'id' => ['227', '2']}}
- @dm.merge(hash_dst, hash_src).should == hash_src
+ expect(@dm.merge(hash_dst, hash_src)).to eq(hash_src)
end
it "should overwrite as string value when merging hashes" do
hash_dst = {"name" => "value1"}
hash_src = {"name" => "value"}
- @dm.merge(hash_dst, hash_src).should == {"name" => "value"}
+ expect(@dm.merge(hash_dst, hash_src)).to eq({"name" => "value"})
end
it "should merge arrays within hashes" do
hash_dst = {"property" => ["2","4"]}
hash_src = {"property" => ["1","3"]}
- @dm.merge(hash_dst, hash_src).should == {"property" => ["2","4","1","3"]}
+ expect(@dm.merge(hash_dst, hash_src)).to eq({"property" => ["2","4","1","3"]})
end
it "should merge deeply nested hashes" do
hash_dst = {"property" => {"values" => {"are" => "falling", "can" => "change"}}}
hash_src = {"property" => {"values" => {"are" => "stable", "may" => "rise"}}}
- @dm.merge(hash_dst, hash_src).should == {"property" => {"values" => {"are" => "stable", "can" => "change", "may" => "rise"}}}
+ expect(@dm.merge(hash_dst, hash_src)).to eq({"property" => {"values" => {"are" => "stable", "can" => "change", "may" => "rise"}}})
end
it "should not modify the source or destination during the merge" do
hash_dst = {"property" => ["1","2","3"]}
hash_src = {"property" => ["4","5","6"]}
ret = @dm.merge(hash_dst, hash_src)
- hash_dst.should == {"property" => ["1","2","3"]}
- hash_src.should == {"property" => ["4","5","6"]}
- ret.should == {"property" => ["1","2","3","4","5","6"]}
+ expect(hash_dst).to eq({"property" => ["1","2","3"]})
+ expect(hash_src).to eq({"property" => ["4","5","6"]})
+ expect(ret).to eq({"property" => ["1","2","3","4","5","6"]})
end
it "should not error merging un-dupable objects" do
@@ -304,32 +290,6 @@ describe Chef::Mixin::DeepMerge do
end
- describe "role_merge" do
- it "errors out if knockout merge use is detected in an array" do
- hash_dst = {"property" => ["2","4"]}
- hash_src = {"property" => ["1","!merge:4"]}
- lambda {@dm.role_merge(hash_dst, hash_src)}.should raise_error(Chef::Mixin::DeepMerge::InvalidSubtractiveMerge)
- end
-
- it "errors out if knockout merge use is detected in an array (reversed merge order)" do
- hash_dst = {"property" => ["1","!merge:4"]}
- hash_src = {"property" => ["2","4"]}
- lambda {@dm.role_merge(hash_dst, hash_src)}.should raise_error(Chef::Mixin::DeepMerge::InvalidSubtractiveMerge)
- end
-
- it "errors out if knockout merge use is detected in a string" do
- hash_dst = {"property" => ["2","4"]}
- hash_src = {"property" => "!merge"}
- lambda {@dm.role_merge(hash_dst, hash_src)}.should raise_error(Chef::Mixin::DeepMerge::InvalidSubtractiveMerge)
- end
-
- it "errors out if knockout merge use is detected in a string (reversed merge order)" do
- hash_dst = {"property" => "!merge"}
- hash_src= {"property" => ["2","4"]}
- lambda {@dm.role_merge(hash_dst, hash_src)}.should raise_error(Chef::Mixin::DeepMerge::InvalidSubtractiveMerge)
- end
- end
-
describe "hash-only merging" do
it "merges Hashes like normal deep merge" do
merge_ee_hash = {"top_level_a" => {"1_deep_a" => "1-a-merge-ee", "1_deep_b" => "1-deep-b-merge-ee"}, "top_level_b" => "top-level-b-merge-ee"}
@@ -337,10 +297,10 @@ describe Chef::Mixin::DeepMerge do
merged_result = @dm.hash_only_merge(merge_ee_hash, merge_with_hash)
- merged_result["top_level_b"].should == "top-level-b-merged-onto"
- merged_result["top_level_a"]["1_deep_a"].should == "1-a-merge-ee"
- merged_result["top_level_a"]["1_deep_b"].should == "1-deep-b-merged-onto"
- merged_result["top_level_a"]["1_deep_c"].should == "1-deep-c-merged-onto"
+ expect(merged_result["top_level_b"]).to eq("top-level-b-merged-onto")
+ expect(merged_result["top_level_a"]["1_deep_a"]).to eq("1-a-merge-ee")
+ expect(merged_result["top_level_a"]["1_deep_b"]).to eq("1-deep-b-merged-onto")
+ expect(merged_result["top_level_a"]["1_deep_c"]).to eq("1-deep-c-merged-onto")
end
it "replaces arrays rather than merging them" do
@@ -349,9 +309,9 @@ describe Chef::Mixin::DeepMerge do
merged_result = @dm.hash_only_merge(merge_ee_hash, merge_with_hash)
- merged_result["top_level_b"].should == "top-level-b-merged-onto"
- merged_result["top_level_a"]["1_deep_a"].should == "1-a-merge-ee"
- merged_result["top_level_a"]["1_deep_b"].should == %w[B B B]
+ expect(merged_result["top_level_b"]).to eq("top-level-b-merged-onto")
+ expect(merged_result["top_level_a"]["1_deep_a"]).to eq("1-a-merge-ee")
+ expect(merged_result["top_level_a"]["1_deep_b"]).to eq(%w[B B B])
end
it "replaces non-hash items with hashes when there's a conflict" do
@@ -360,17 +320,17 @@ describe Chef::Mixin::DeepMerge do
merged_result = @dm.hash_only_merge(merge_ee_hash, merge_with_hash)
- merged_result["top_level_a"].should be_a(Hash)
- merged_result["top_level_a"]["1_deep_a"].should be_nil
- merged_result["top_level_a"]["1_deep_b"].should == %w[B B B]
+ expect(merged_result["top_level_a"]).to be_a(Hash)
+ expect(merged_result["top_level_a"]["1_deep_a"]).to be_nil
+ expect(merged_result["top_level_a"]["1_deep_b"]).to eq(%w[B B B])
end
it "does not mutate deeply-nested original hashes by default" do
merge_ee_hash = {"top_level_a" => {"1_deep_a" => { "2_deep_a" => { "3_deep_a" => "foo" }}}}
merge_with_hash = {"top_level_a" => {"1_deep_a" => { "2_deep_a" => { "3_deep_b" => "bar" }}}}
@dm.hash_only_merge(merge_ee_hash, merge_with_hash)
- merge_ee_hash.should == {"top_level_a" => {"1_deep_a" => { "2_deep_a" => { "3_deep_a" => "foo" }}}}
- merge_with_hash.should == {"top_level_a" => {"1_deep_a" => { "2_deep_a" => { "3_deep_b" => "bar" }}}}
+ expect(merge_ee_hash).to eq({"top_level_a" => {"1_deep_a" => { "2_deep_a" => { "3_deep_a" => "foo" }}}})
+ expect(merge_with_hash).to eq({"top_level_a" => {"1_deep_a" => { "2_deep_a" => { "3_deep_b" => "bar" }}}})
end
it "does not error merging un-dupable items" do
diff --git a/spec/unit/mixin/deprecation_spec.rb b/spec/unit/mixin/deprecation_spec.rb
index 3ebf06e830..6d9f39af9f 100644
--- a/spec/unit/mixin/deprecation_spec.rb
+++ b/spec/unit/mixin/deprecation_spec.rb
@@ -28,16 +28,16 @@ describe Chef::Mixin do
end
it "has a list of deprecated constants" do
- Chef::Mixin.deprecated_constants.should have_key(:DeprecatedClass)
+ expect(Chef::Mixin.deprecated_constants).to have_key(:DeprecatedClass)
end
it "returns the replacement when accessing the deprecated constant" do
- Chef::Mixin::DeprecatedClass.should == Chef::Node
+ expect(Chef::Mixin::DeprecatedClass).to eq(Chef::Node)
end
it "warns when accessing the deprecated constant" do
Chef::Mixin::DeprecatedClass
- @log_io.string.should include("This is a test deprecation")
+ expect(@log_io.string).to include("This is a test deprecation")
end
end
end
@@ -50,8 +50,8 @@ describe Chef::Mixin::Deprecation::DeprecatedInstanceVariable do
end
it "forward method calls to the target object" do
- @deprecated_ivar.length.should == 5
- @deprecated_ivar.to_sym.should == :value
+ expect(@deprecated_ivar.length).to eq(5)
+ expect(@deprecated_ivar.to_sym).to eq(:value)
end
end
diff --git a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb
index fe72d53de5..aeef175ff9 100644
--- a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb
+++ b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb
@@ -40,15 +40,15 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do
end
it "should call set_all on the file access control object" do
- Chef::FileAccessControl.any_instance.should_receive(:set_all)
+ expect_any_instance_of(Chef::FileAccessControl).to receive(:set_all)
@provider.enforce_ownership_and_permissions
end
context "when nothing was updated" do
before do
- Chef::FileAccessControl.any_instance.stub(:uid_from_resource).and_return(0)
- Chef::FileAccessControl.any_instance.stub(:requires_changes?).and_return(false)
- Chef::FileAccessControl.any_instance.stub(:define_resource_requirements)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:uid_from_resource).and_return(0)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:requires_changes?).and_return(false)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:define_resource_requirements)
passwd_struct = if windows?
Struct::Passwd.new("root", "x", 0, 0, "/root", "/bin/bash")
@@ -56,14 +56,14 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do
Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash")
end
group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0)
- Etc.stub(:getpwuid).and_return(passwd_struct)
- Etc.stub(:getgrgid).and_return(group_struct)
+ allow(Etc).to receive(:getpwuid).and_return(passwd_struct)
+ allow(Etc).to receive(:getgrgid).and_return(group_struct)
end
it "does not set updated_by_last_action on the new resource" do
- @provider.new_resource.should_not_receive(:updated_by_last_action)
+ expect(@provider.new_resource).not_to receive(:updated_by_last_action)
- Chef::FileAccessControl.any_instance.stub(:set_all)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:set_all)
@provider.run_action(:create)
end
@@ -71,8 +71,8 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do
context "when something was modified" do
before do
- Chef::FileAccessControl.any_instance.stub(:requires_changes?).and_return(true)
- Chef::FileAccessControl.any_instance.stub(:uid_from_resource).and_return(0)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:requires_changes?).and_return(true)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:uid_from_resource).and_return(0)
passwd_struct = if windows?
Struct::Passwd.new("root", "x", 0, 0, "/root", "/bin/bash")
@@ -80,15 +80,15 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do
Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash")
end
group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0)
- Etc.stub(:getpwuid).and_return(passwd_struct)
- Etc.stub(:getgrgid).and_return(group_struct)
+ allow(Etc).to receive(:getpwuid).and_return(passwd_struct)
+ allow(Etc).to receive(:getgrgid).and_return(group_struct)
end
it "sets updated_by_last_action on the new resource" do
@provider.new_resource.owner(0) # CHEF-3557 hack - Set these because we don't for windows
@provider.new_resource.group(0) # CHEF-3557 hack - Set these because we don't for windows
- @provider.new_resource.should_receive(:updated_by_last_action)
- Chef::FileAccessControl.any_instance.stub(:set_all)
+ expect(@provider.new_resource).to receive(:updated_by_last_action)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:set_all)
@provider.run_action(:create)
end
end
diff --git a/spec/unit/mixin/homebrew_user_spec.rb b/spec/unit/mixin/homebrew_user_spec.rb
index 4e30455765..57b89720dc 100644
--- a/spec/unit/mixin/homebrew_user_spec.rb
+++ b/spec/unit/mixin/homebrew_user_spec.rb
@@ -41,7 +41,7 @@ describe Chef::Mixin::HomebrewUser do
it 'returns the homebrew user without looking at the file when name is provided' do
expect(File).to receive(:exist?).exactly(0).times
- Etc.stub_chain(:getpwnam, :uid).and_return(uid)
+ allow(Etc).to receive_message_chain(:getpwnam, :uid).and_return(uid)
expect(homebrew_user.find_homebrew_uid(user)).to eq(uid)
end
@@ -71,7 +71,7 @@ describe Chef::Mixin::HomebrewUser do
it 'returns the owner of the brew executable when it is not at a default location' do
expect(File).to receive(:exist?).with(default_brew_path).and_return(false)
- homebrew_user.stub_chain(:shell_out, :stdout, :strip).and_return("/foo")
+ allow(homebrew_user).to receive_message_chain(:shell_out, :stdout, :strip).and_return("/foo")
expect(File).to receive(:stat).with("/foo").and_return(stat_double)
expect(homebrew_user.find_homebrew_uid(user)).to eq(brew_owner)
end
@@ -83,7 +83,7 @@ describe Chef::Mixin::HomebrewUser do
it 'raises an error if no executable is found' do
expect(File).to receive(:exist?).with(default_brew_path).and_return(false)
- homebrew_user.stub_chain(:shell_out, :stdout, :strip).and_return("")
+ allow(homebrew_user).to receive_message_chain(:shell_out, :stdout, :strip).and_return("")
expect { homebrew_user.find_homebrew_uid(user) }.to raise_error(Chef::Exceptions::CannotDetermineHomebrewOwner)
end
diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb
index cc2fe198ca..85e1c1abab 100644
--- a/spec/unit/mixin/params_validate_spec.rb
+++ b/spec/unit/mixin/params_validate_spec.rb
@@ -32,29 +32,29 @@ describe Chef::Mixin::ParamsValidate do
end
it "should allow a hash and a hash as arguments to validate" do
- lambda { @vo.validate({:one => "two"}, {}) }.should_not raise_error
+ expect { @vo.validate({:one => "two"}, {}) }.not_to raise_error
end
it "should raise an argument error if validate is called incorrectly" do
- lambda { @vo.validate("one", "two") }.should raise_error(ArgumentError)
+ expect { @vo.validate("one", "two") }.to raise_error(ArgumentError)
end
it "should require validation map keys to be symbols or strings" do
- lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error
- lambda { @vo.validate({:one => "two"}, { "one" => true }) }.should_not raise_error
- lambda { @vo.validate({:one => "two"}, { Hash.new => true }) }.should raise_error(ArgumentError)
+ expect { @vo.validate({:one => "two"}, { :one => true }) }.not_to raise_error
+ expect { @vo.validate({:one => "two"}, { "one" => true }) }.not_to raise_error
+ expect { @vo.validate({:one => "two"}, { Hash.new => true }) }.to raise_error(ArgumentError)
end
it "should allow options to be required with true" do
- lambda { @vo.validate({:one => "two"}, { :one => true }) }.should_not raise_error
+ expect { @vo.validate({:one => "two"}, { :one => true }) }.not_to raise_error
end
it "should allow options to be optional with false" do
- lambda { @vo.validate({}, {:one => false})}.should_not raise_error
+ expect { @vo.validate({}, {:one => false})}.not_to raise_error
end
it "should allow you to check what kind_of? thing an argument is with kind_of" do
- lambda {
+ expect {
@vo.validate(
{:one => "string"},
{
@@ -63,9 +63,9 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
+ }.not_to raise_error
- lambda {
+ expect {
@vo.validate(
{:one => "string"},
{
@@ -74,11 +74,11 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should allow you to specify an argument is required with required" do
- lambda {
+ expect {
@vo.validate(
{:one => "string"},
{
@@ -87,9 +87,9 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
+ }.not_to raise_error
- lambda {
+ expect {
@vo.validate(
{:two => "string"},
{
@@ -98,9 +98,9 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
- lambda {
+ expect {
@vo.validate(
{:two => "string"},
{
@@ -109,11 +109,11 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
+ }.not_to raise_error
end
it "should allow you to specify whether an object has a method with respond_to" do
- lambda {
+ expect {
@vo.validate(
{:one => @vo},
{
@@ -122,9 +122,9 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
+ }.not_to raise_error
- lambda {
+ expect {
@vo.validate(
{:one => @vo},
{
@@ -133,11 +133,11 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should allow you to specify whether an object has all the given methods with respond_to and an array" do
- lambda {
+ expect {
@vo.validate(
{:one => @vo},
{
@@ -146,9 +146,9 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
+ }.not_to raise_error
- lambda {
+ expect {
@vo.validate(
{:one => @vo},
{
@@ -157,7 +157,7 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should let you set a default value with default => value" do
@@ -167,11 +167,11 @@ describe Chef::Mixin::ParamsValidate do
:default => "is the loneliest number"
}
})
- arguments[:one].should == "is the loneliest number"
+ expect(arguments[:one]).to eq("is the loneliest number")
end
it "should let you check regular expressions" do
- lambda {
+ expect {
@vo.validate(
{ :one => "is good" },
{
@@ -180,9 +180,9 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
+ }.not_to raise_error
- lambda {
+ expect {
@vo.validate(
{ :one => "is good" },
{
@@ -191,11 +191,11 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should let you specify your own callbacks" do
- lambda {
+ expect {
@vo.validate(
{ :one => "is good" },
{
@@ -208,9 +208,9 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
+ }.not_to raise_error
- lambda {
+ expect {
@vo.validate(
{ :one => "is bad" },
{
@@ -223,12 +223,12 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should let you combine checks" do
args = { :one => "is good", :two => "is bad" }
- lambda {
+ expect {
@vo.validate(
args,
{
@@ -250,9 +250,9 @@ describe Chef::Mixin::ParamsValidate do
:three => { :default => "neato mosquito" }
}
)
- }.should_not raise_error
- args[:three].should == "neato mosquito"
- lambda {
+ }.not_to raise_error
+ expect(args[:three]).to eq("neato mosquito")
+ expect {
@vo.validate(
args,
{
@@ -274,11 +274,11 @@ describe Chef::Mixin::ParamsValidate do
:three => { :default => "neato mosquito" }
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should raise an ArgumentError if the validation map has an unknown check" do
- lambda { @vo.validate(
+ expect { @vo.validate(
{ :one => "two" },
{
:one => {
@@ -286,17 +286,17 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should accept keys that are strings in the options" do
- lambda {
+ expect {
@vo.validate({ "one" => "two" }, { :one => { :regex => /^two$/ }})
- }.should_not raise_error
+ }.not_to raise_error
end
it "should allow an array to kind_of" do
- lambda {
+ expect {
@vo.validate(
{:one => "string"},
{
@@ -305,8 +305,8 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
@vo.validate(
{:one => ["string"]},
{
@@ -315,8 +315,8 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
@vo.validate(
{:one => Hash.new},
{
@@ -325,48 +325,48 @@ describe Chef::Mixin::ParamsValidate do
}
}
)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "asserts that a value returns false from a predicate method" do
- lambda do
+ expect do
@vo.validate({:not_blank => "should pass"},
{:not_blank => {:cannot_be => :nil, :cannot_be => :empty}})
- end.should_not raise_error
- lambda do
+ end.not_to raise_error
+ expect do
@vo.validate({:not_blank => ""},
{:not_blank => {:cannot_be => :nil, :cannot_be => :empty}})
- end.should raise_error(Chef::Exceptions::ValidationFailed)
+ end.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "should set and return a value, then return the same value" do
value = "meow"
- @vo.set_or_return(:test, value, {}).object_id.should == value.object_id
- @vo.set_or_return(:test, nil, {}).object_id.should == value.object_id
+ expect(@vo.set_or_return(:test, value, {}).object_id).to eq(value.object_id)
+ expect(@vo.set_or_return(:test, nil, {}).object_id).to eq(value.object_id)
end
it "should set and return a default value when the argument is nil, then return the same value" do
value = "meow"
- @vo.set_or_return(:test, nil, { :default => value }).object_id.should == value.object_id
- @vo.set_or_return(:test, nil, {}).object_id.should == value.object_id
+ expect(@vo.set_or_return(:test, nil, { :default => value }).object_id).to eq(value.object_id)
+ expect(@vo.set_or_return(:test, nil, {}).object_id).to eq(value.object_id)
end
it "should raise an ArgumentError when argument is nil and required is true" do
- lambda {
+ expect {
@vo.set_or_return(:test, nil, { :required => true })
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should not raise an error when argument is nil and required is false" do
- lambda {
+ expect {
@vo.set_or_return(:test, nil, { :required => false })
- }.should_not raise_error
+ }.not_to raise_error
end
it "should set and return @name, then return @name for foo when argument is nil" do
value = "meow"
- @vo.set_or_return(:name, value, { }).object_id.should == value.object_id
- @vo.set_or_return(:foo, nil, { :name_attribute => true }).object_id.should == value.object_id
+ expect(@vo.set_or_return(:name, value, { }).object_id).to eq(value.object_id)
+ expect(@vo.set_or_return(:foo, nil, { :name_attribute => true }).object_id).to eq(value.object_id)
end
it "should allow DelayedEvaluator instance to be set for value regardless of restriction" do
@@ -377,31 +377,31 @@ describe Chef::Mixin::ParamsValidate do
it "should raise an error when delayed evaluated attribute is not valid" do
value = Chef::DelayedEvaluator.new{ 'test' }
@vo.set_or_return(:test, value, {:kind_of => Numeric})
- lambda do
+ expect do
@vo.set_or_return(:test, nil, {:kind_of => Numeric})
- end.should raise_error(Chef::Exceptions::ValidationFailed)
+ end.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "should create DelayedEvaluator instance when #lazy is used" do
@vo.set_or_return(:delayed, @vo.lazy{ 'test' }, {})
- @vo.instance_variable_get(:@delayed).should be_a(Chef::DelayedEvaluator)
+ expect(@vo.instance_variable_get(:@delayed)).to be_a(Chef::DelayedEvaluator)
end
it "should execute block on each call when DelayedEvaluator" do
value = 'fubar'
@vo.set_or_return(:test, @vo.lazy{ value }, {})
- @vo.set_or_return(:test, nil, {}).should == 'fubar'
+ expect(@vo.set_or_return(:test, nil, {})).to eq('fubar')
value = 'foobar'
- @vo.set_or_return(:test, nil, {}).should == 'foobar'
+ expect(@vo.set_or_return(:test, nil, {})).to eq('foobar')
value = 'fauxbar'
- @vo.set_or_return(:test, nil, {}).should == 'fauxbar'
+ expect(@vo.set_or_return(:test, nil, {})).to eq('fauxbar')
end
it "should not evaluate non DelayedEvaluator instances" do
value = lambda{ 'test' }
@vo.set_or_return(:test, value, {})
- @vo.set_or_return(:test, nil, {}).object_id.should == value.object_id
- @vo.set_or_return(:test, nil, {}).should be_a(Proc)
+ expect(@vo.set_or_return(:test, nil, {}).object_id).to eq(value.object_id)
+ expect(@vo.set_or_return(:test, nil, {})).to be_a(Proc)
end
end
diff --git a/spec/unit/mixin/path_sanity_spec.rb b/spec/unit/mixin/path_sanity_spec.rb
index 64c667b483..ec8e182e3d 100644
--- a/spec/unit/mixin/path_sanity_spec.rb
+++ b/spec/unit/mixin/path_sanity_spec.rb
@@ -33,54 +33,54 @@ describe Chef::Mixin::PathSanity do
Chef::Config[:enforce_path_sanity] = true
@ruby_bindir = '/some/ruby/bin'
@gem_bindir = '/some/gem/bin'
- Gem.stub(:bindir).and_return(@gem_bindir)
- RbConfig::CONFIG.stub(:[]).with('bindir').and_return(@ruby_bindir)
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Gem).to receive(:bindir).and_return(@gem_bindir)
+ allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return(@ruby_bindir)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
end
it "adds all useful PATHs even if environment is an empty hash" do
env={}
@sanity.enforce_path_sanity(env)
- env["PATH"].should == "#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ expect(env["PATH"]).to eq("#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
end
it "adds all useful PATHs that are not yet in PATH to PATH" do
env = {"PATH" => ""}
@sanity.enforce_path_sanity(env)
- env["PATH"].should == "#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ expect(env["PATH"]).to eq("#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
end
it "does not re-add paths that already exist in PATH" do
env = {"PATH" => "/usr/bin:/sbin:/bin"}
@sanity.enforce_path_sanity(env)
- env["PATH"].should == "/usr/bin:/sbin:/bin:#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin"
+ expect(env["PATH"]).to eq("/usr/bin:/sbin:/bin:#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin")
end
it "adds the current executing Ruby's bindir and Gem bindir to the PATH" do
env = {"PATH" => ""}
@sanity.enforce_path_sanity(env)
- env["PATH"].should == "#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ expect(env["PATH"]).to eq("#{@ruby_bindir}:#{@gem_bindir}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
end
it "does not create entries for Ruby/Gem bindirs if they exist in SANE_PATH or PATH" do
ruby_bindir = '/usr/bin'
gem_bindir = '/yo/gabba/gabba'
- Gem.stub(:bindir).and_return(gem_bindir)
- RbConfig::CONFIG.stub(:[]).with('bindir').and_return(ruby_bindir)
+ allow(Gem).to receive(:bindir).and_return(gem_bindir)
+ allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return(ruby_bindir)
env = {"PATH" => gem_bindir}
@sanity.enforce_path_sanity(env)
- env["PATH"].should == "/yo/gabba/gabba:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ expect(env["PATH"]).to eq("/yo/gabba/gabba:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
end
it "builds a valid windows path" do
ruby_bindir = 'C:\ruby\bin'
gem_bindir = 'C:\gems\bin'
- Gem.stub(:bindir).and_return(gem_bindir)
- RbConfig::CONFIG.stub(:[]).with('bindir').and_return(ruby_bindir)
- Chef::Platform.stub(:windows?).and_return(true)
+ allow(Gem).to receive(:bindir).and_return(gem_bindir)
+ allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return(ruby_bindir)
+ allow(Chef::Platform).to receive(:windows?).and_return(true)
env = {"PATH" => 'C:\Windows\system32;C:\mr\softie'}
@sanity.enforce_path_sanity(env)
- env["PATH"].should == "C:\\Windows\\system32;C:\\mr\\softie;#{ruby_bindir};#{gem_bindir}"
+ expect(env["PATH"]).to eq("C:\\Windows\\system32;C:\\mr\\softie;#{ruby_bindir};#{gem_bindir}")
end
end
end
diff --git a/spec/unit/mixin/securable_spec.rb b/spec/unit/mixin/securable_spec.rb
index 10954083d8..714d6dedae 100644
--- a/spec/unit/mixin/securable_spec.rb
+++ b/spec/unit/mixin/securable_spec.rb
@@ -28,19 +28,19 @@ describe Chef::Mixin::Securable do
end
it "should accept a group name or id for group" do
- lambda { @securable.group "root" }.should_not raise_error
- lambda { @securable.group 123 }.should_not raise_error
- lambda { @securable.group "+bad:group" }.should raise_error(ArgumentError)
+ expect { @securable.group "root" }.not_to raise_error
+ expect { @securable.group 123 }.not_to raise_error
+ expect { @securable.group "+bad:group" }.to raise_error(ArgumentError)
end
it "should accept a user name or id for owner" do
- lambda { @securable.owner "root" }.should_not raise_error
- lambda { @securable.owner 123 }.should_not raise_error
- lambda { @securable.owner "+bad:owner" }.should raise_error(ArgumentError)
+ expect { @securable.owner "root" }.not_to raise_error
+ expect { @securable.owner 123 }.not_to raise_error
+ expect { @securable.owner "+bad:owner" }.to raise_error(ArgumentError)
end
it "allows the owner to be specified as #user" do
- @securable.should respond_to(:user)
+ expect(@securable).to respond_to(:user)
end
describe "unix-specific behavior" do
@@ -54,69 +54,69 @@ describe Chef::Mixin::Securable do
end
it "should accept group/owner names with spaces and backslashes" do
- lambda { @securable.group 'test\ group' }.should_not raise_error
- lambda { @securable.owner 'test\ group' }.should_not raise_error
+ expect { @securable.group 'test\ group' }.not_to raise_error
+ expect { @securable.owner 'test\ group' }.not_to raise_error
end
it "should accept group/owner names that are a single character or digit" do
- lambda { @securable.group 'v' }.should_not raise_error
- lambda { @securable.group '1' }.should_not raise_error
- lambda { @securable.owner 'v' }.should_not raise_error
- lambda { @securable.owner '1' }.should_not raise_error
+ expect { @securable.group 'v' }.not_to raise_error
+ expect { @securable.group '1' }.not_to raise_error
+ expect { @securable.owner 'v' }.not_to raise_error
+ expect { @securable.owner '1' }.not_to raise_error
end
it "should not accept group/owner names starting with '-', '+', or '~'" do
- lambda { @securable.group '-test' }.should raise_error(ArgumentError)
- lambda { @securable.group '+test' }.should raise_error(ArgumentError)
- lambda { @securable.group '~test' }.should raise_error(ArgumentError)
- lambda { @securable.group 'te-st' }.should_not raise_error
- lambda { @securable.group 'te+st' }.should_not raise_error
- lambda { @securable.group 'te~st' }.should_not raise_error
- lambda { @securable.owner '-test' }.should raise_error(ArgumentError)
- lambda { @securable.owner '+test' }.should raise_error(ArgumentError)
- lambda { @securable.owner '~test' }.should raise_error(ArgumentError)
- lambda { @securable.owner 'te-st' }.should_not raise_error
- lambda { @securable.owner 'te+st' }.should_not raise_error
- lambda { @securable.owner 'te~st' }.should_not raise_error
+ expect { @securable.group '-test' }.to raise_error(ArgumentError)
+ expect { @securable.group '+test' }.to raise_error(ArgumentError)
+ expect { @securable.group '~test' }.to raise_error(ArgumentError)
+ expect { @securable.group 'te-st' }.not_to raise_error
+ expect { @securable.group 'te+st' }.not_to raise_error
+ expect { @securable.group 'te~st' }.not_to raise_error
+ expect { @securable.owner '-test' }.to raise_error(ArgumentError)
+ expect { @securable.owner '+test' }.to raise_error(ArgumentError)
+ expect { @securable.owner '~test' }.to raise_error(ArgumentError)
+ expect { @securable.owner 'te-st' }.not_to raise_error
+ expect { @securable.owner 'te+st' }.not_to raise_error
+ expect { @securable.owner 'te~st' }.not_to raise_error
end
it "should not accept group/owner names containing ':', ',' or non-space whitespace" do
- lambda { @securable.group ':test' }.should raise_error(ArgumentError)
- lambda { @securable.group 'te:st' }.should raise_error(ArgumentError)
- lambda { @securable.group ',test' }.should raise_error(ArgumentError)
- lambda { @securable.group 'te,st' }.should raise_error(ArgumentError)
- lambda { @securable.group "\ttest" }.should raise_error(ArgumentError)
- lambda { @securable.group "te\tst" }.should raise_error(ArgumentError)
- lambda { @securable.group "\rtest" }.should raise_error(ArgumentError)
- lambda { @securable.group "te\rst" }.should raise_error(ArgumentError)
- lambda { @securable.group "\ftest" }.should raise_error(ArgumentError)
- lambda { @securable.group "te\fst" }.should raise_error(ArgumentError)
- lambda { @securable.group "\0test" }.should raise_error(ArgumentError)
- lambda { @securable.group "te\0st" }.should raise_error(ArgumentError)
- lambda { @securable.owner ':test' }.should raise_error(ArgumentError)
- lambda { @securable.owner 'te:st' }.should raise_error(ArgumentError)
- lambda { @securable.owner ',test' }.should raise_error(ArgumentError)
- lambda { @securable.owner 'te,st' }.should raise_error(ArgumentError)
- lambda { @securable.owner "\ttest" }.should raise_error(ArgumentError)
- lambda { @securable.owner "te\tst" }.should raise_error(ArgumentError)
- lambda { @securable.owner "\rtest" }.should raise_error(ArgumentError)
- lambda { @securable.owner "te\rst" }.should raise_error(ArgumentError)
- lambda { @securable.owner "\ftest" }.should raise_error(ArgumentError)
- lambda { @securable.owner "te\fst" }.should raise_error(ArgumentError)
- lambda { @securable.owner "\0test" }.should raise_error(ArgumentError)
- lambda { @securable.owner "te\0st" }.should raise_error(ArgumentError)
+ expect { @securable.group ':test' }.to raise_error(ArgumentError)
+ expect { @securable.group 'te:st' }.to raise_error(ArgumentError)
+ expect { @securable.group ',test' }.to raise_error(ArgumentError)
+ expect { @securable.group 'te,st' }.to raise_error(ArgumentError)
+ expect { @securable.group "\ttest" }.to raise_error(ArgumentError)
+ expect { @securable.group "te\tst" }.to raise_error(ArgumentError)
+ expect { @securable.group "\rtest" }.to raise_error(ArgumentError)
+ expect { @securable.group "te\rst" }.to raise_error(ArgumentError)
+ expect { @securable.group "\ftest" }.to raise_error(ArgumentError)
+ expect { @securable.group "te\fst" }.to raise_error(ArgumentError)
+ expect { @securable.group "\0test" }.to raise_error(ArgumentError)
+ expect { @securable.group "te\0st" }.to raise_error(ArgumentError)
+ expect { @securable.owner ':test' }.to raise_error(ArgumentError)
+ expect { @securable.owner 'te:st' }.to raise_error(ArgumentError)
+ expect { @securable.owner ',test' }.to raise_error(ArgumentError)
+ expect { @securable.owner 'te,st' }.to raise_error(ArgumentError)
+ expect { @securable.owner "\ttest" }.to raise_error(ArgumentError)
+ expect { @securable.owner "te\tst" }.to raise_error(ArgumentError)
+ expect { @securable.owner "\rtest" }.to raise_error(ArgumentError)
+ expect { @securable.owner "te\rst" }.to raise_error(ArgumentError)
+ expect { @securable.owner "\ftest" }.to raise_error(ArgumentError)
+ expect { @securable.owner "te\fst" }.to raise_error(ArgumentError)
+ expect { @securable.owner "\0test" }.to raise_error(ArgumentError)
+ expect { @securable.owner "te\0st" }.to raise_error(ArgumentError)
end
it "should accept Active Directory-style domain names pulled in via LDAP (on unix hosts)" do
- lambda { @securable.owner "domain\@user" }.should_not raise_error
- lambda { @securable.owner "domain\\user" }.should_not raise_error
- lambda { @securable.group "domain\@group" }.should_not raise_error
- lambda { @securable.group "domain\\group" }.should_not raise_error
- lambda { @securable.group "domain\\group^name" }.should_not raise_error
+ expect { @securable.owner "domain\@user" }.not_to raise_error
+ expect { @securable.owner "domain\\user" }.not_to raise_error
+ expect { @securable.group "domain\@group" }.not_to raise_error
+ expect { @securable.group "domain\\group" }.not_to raise_error
+ expect { @securable.group "domain\\group^name" }.not_to raise_error
end
it "should not accept group/owner names containing embedded carriage returns" do
- pending "XXX: params_validate needs to be extended to support multi-line regex"
+ skip "XXX: params_validate needs to be extended to support multi-line regex"
#lambda { @securable.group "\ntest" }.should raise_error(ArgumentError)
#lambda { @securable.group "te\nst" }.should raise_error(ArgumentError)
#lambda { @securable.owner "\ntest" }.should raise_error(ArgumentError)
@@ -124,53 +124,53 @@ describe Chef::Mixin::Securable do
end
it "should accept group/owner names in UTF-8" do
- lambda { @securable.group 'tëst' }.should_not raise_error
- lambda { @securable.group 'ë' }.should_not raise_error
- lambda { @securable.owner 'tëst' }.should_not raise_error
- lambda { @securable.owner 'ë' }.should_not raise_error
+ expect { @securable.group 'tëst' }.not_to raise_error
+ expect { @securable.group 'ë' }.not_to raise_error
+ expect { @securable.owner 'tëst' }.not_to raise_error
+ expect { @securable.owner 'ë' }.not_to raise_error
end
it "should accept a unix file mode in string form as an octal number" do
- lambda { @securable.mode "0" }.should_not raise_error
- lambda { @securable.mode "0000" }.should_not raise_error
- lambda { @securable.mode "0111" }.should_not raise_error
- lambda { @securable.mode "0444" }.should_not raise_error
-
- lambda { @securable.mode "111" }.should_not raise_error
- lambda { @securable.mode "444" }.should_not raise_error
- lambda { @securable.mode "7777" }.should_not raise_error
- lambda { @securable.mode "07777" }.should_not raise_error
-
- lambda { @securable.mode "-01" }.should raise_error(ArgumentError)
- lambda { @securable.mode "010000" }.should raise_error(ArgumentError)
- lambda { @securable.mode "-1" }.should raise_error(ArgumentError)
- lambda { @securable.mode "10000" }.should raise_error(ArgumentError)
-
- lambda { @securable.mode "07778" }.should raise_error(ArgumentError)
- lambda { @securable.mode "7778" }.should raise_error(ArgumentError)
- lambda { @securable.mode "4095" }.should raise_error(ArgumentError)
-
- lambda { @securable.mode "0foo1234" }.should raise_error(ArgumentError)
- lambda { @securable.mode "foo1234" }.should raise_error(ArgumentError)
+ expect { @securable.mode "0" }.not_to raise_error
+ expect { @securable.mode "0000" }.not_to raise_error
+ expect { @securable.mode "0111" }.not_to raise_error
+ expect { @securable.mode "0444" }.not_to raise_error
+
+ expect { @securable.mode "111" }.not_to raise_error
+ expect { @securable.mode "444" }.not_to raise_error
+ expect { @securable.mode "7777" }.not_to raise_error
+ expect { @securable.mode "07777" }.not_to raise_error
+
+ expect { @securable.mode "-01" }.to raise_error(ArgumentError)
+ expect { @securable.mode "010000" }.to raise_error(ArgumentError)
+ expect { @securable.mode "-1" }.to raise_error(ArgumentError)
+ expect { @securable.mode "10000" }.to raise_error(ArgumentError)
+
+ expect { @securable.mode "07778" }.to raise_error(ArgumentError)
+ expect { @securable.mode "7778" }.to raise_error(ArgumentError)
+ expect { @securable.mode "4095" }.to raise_error(ArgumentError)
+
+ expect { @securable.mode "0foo1234" }.to raise_error(ArgumentError)
+ expect { @securable.mode "foo1234" }.to raise_error(ArgumentError)
end
it "should accept a unix file mode in numeric form as a ruby-interpreted integer" do
- lambda { @securable.mode(0) }.should_not raise_error
- lambda { @securable.mode(0000) }.should_not raise_error
- lambda { @securable.mode(444) }.should_not raise_error
- lambda { @securable.mode(0444) }.should_not raise_error
- lambda { @securable.mode(07777) }.should_not raise_error
-
- lambda { @securable.mode(292) }.should_not raise_error
- lambda { @securable.mode(4095) }.should_not raise_error
-
- lambda { @securable.mode(0111) }.should_not raise_error
- lambda { @securable.mode(73) }.should_not raise_error
-
- lambda { @securable.mode(-01) }.should raise_error(ArgumentError)
- lambda { @securable.mode(010000) }.should raise_error(ArgumentError)
- lambda { @securable.mode(-1) }.should raise_error(ArgumentError)
- lambda { @securable.mode(4096) }.should raise_error(ArgumentError)
+ expect { @securable.mode(0) }.not_to raise_error
+ expect { @securable.mode(0000) }.not_to raise_error
+ expect { @securable.mode(444) }.not_to raise_error
+ expect { @securable.mode(0444) }.not_to raise_error
+ expect { @securable.mode(07777) }.not_to raise_error
+
+ expect { @securable.mode(292) }.not_to raise_error
+ expect { @securable.mode(4095) }.not_to raise_error
+
+ expect { @securable.mode(0111) }.not_to raise_error
+ expect { @securable.mode(73) }.not_to raise_error
+
+ expect { @securable.mode(-01) }.to raise_error(ArgumentError)
+ expect { @securable.mode(010000) }.to raise_error(ArgumentError)
+ expect { @securable.mode(-1) }.to raise_error(ArgumentError)
+ expect { @securable.mode(4096) }.to raise_error(ArgumentError)
end
end
@@ -187,94 +187,94 @@ describe Chef::Mixin::Securable do
end
it "should not accept a group name or id for group with spaces and multiple backslashes" do
- lambda { @securable.group 'test\ \group' }.should raise_error(ArgumentError)
+ expect { @securable.group 'test\ \group' }.to raise_error(ArgumentError)
end
it "should accept a unix file mode in string form as an octal number" do
- lambda { @securable.mode "0" }.should_not raise_error
- lambda { @securable.mode "0000" }.should_not raise_error
- lambda { @securable.mode "0111" }.should_not raise_error
- lambda { @securable.mode "0444" }.should_not raise_error
-
- lambda { @securable.mode "111" }.should_not raise_error
- lambda { @securable.mode "444" }.should_not raise_error
- lambda { @securable.mode "7777" }.should raise_error(ArgumentError)
- lambda { @securable.mode "07777" }.should raise_error(ArgumentError)
-
- lambda { @securable.mode "-01" }.should raise_error(ArgumentError)
- lambda { @securable.mode "010000" }.should raise_error(ArgumentError)
- lambda { @securable.mode "-1" }.should raise_error(ArgumentError)
- lambda { @securable.mode "10000" }.should raise_error(ArgumentError)
-
- lambda { @securable.mode "07778" }.should raise_error(ArgumentError)
- lambda { @securable.mode "7778" }.should raise_error(ArgumentError)
- lambda { @securable.mode "4095" }.should raise_error(ArgumentError)
-
- lambda { @securable.mode "0foo1234" }.should raise_error(ArgumentError)
- lambda { @securable.mode "foo1234" }.should raise_error(ArgumentError)
+ expect { @securable.mode "0" }.not_to raise_error
+ expect { @securable.mode "0000" }.not_to raise_error
+ expect { @securable.mode "0111" }.not_to raise_error
+ expect { @securable.mode "0444" }.not_to raise_error
+
+ expect { @securable.mode "111" }.not_to raise_error
+ expect { @securable.mode "444" }.not_to raise_error
+ expect { @securable.mode "7777" }.to raise_error(ArgumentError)
+ expect { @securable.mode "07777" }.to raise_error(ArgumentError)
+
+ expect { @securable.mode "-01" }.to raise_error(ArgumentError)
+ expect { @securable.mode "010000" }.to raise_error(ArgumentError)
+ expect { @securable.mode "-1" }.to raise_error(ArgumentError)
+ expect { @securable.mode "10000" }.to raise_error(ArgumentError)
+
+ expect { @securable.mode "07778" }.to raise_error(ArgumentError)
+ expect { @securable.mode "7778" }.to raise_error(ArgumentError)
+ expect { @securable.mode "4095" }.to raise_error(ArgumentError)
+
+ expect { @securable.mode "0foo1234" }.to raise_error(ArgumentError)
+ expect { @securable.mode "foo1234" }.to raise_error(ArgumentError)
end
it "should accept a unix file mode in numeric form as a ruby-interpreted integer" do
- lambda { @securable.mode 0 }.should_not raise_error
- lambda { @securable.mode 0000 }.should_not raise_error
- lambda { @securable.mode 444 }.should_not raise_error
- lambda { @securable.mode 0444 }.should_not raise_error
- lambda { @securable.mode 07777 }.should raise_error(ArgumentError)
-
- lambda { @securable.mode 292 }.should_not raise_error
- lambda { @securable.mode 4095 }.should raise_error(ArgumentError)
-
- lambda { @securable.mode 0111 }.should_not raise_error
- lambda { @securable.mode 73 }.should_not raise_error
-
- lambda { @securable.mode -01 }.should raise_error(ArgumentError)
- lambda { @securable.mode 010000 }.should raise_error(ArgumentError)
- lambda { @securable.mode -1 }.should raise_error(ArgumentError)
- lambda { @securable.mode 4096 }.should raise_error(ArgumentError)
+ expect { @securable.mode 0 }.not_to raise_error
+ expect { @securable.mode 0000 }.not_to raise_error
+ expect { @securable.mode 444 }.not_to raise_error
+ expect { @securable.mode 0444 }.not_to raise_error
+ expect { @securable.mode 07777 }.to raise_error(ArgumentError)
+
+ expect { @securable.mode 292 }.not_to raise_error
+ expect { @securable.mode 4095 }.to raise_error(ArgumentError)
+
+ expect { @securable.mode 0111 }.not_to raise_error
+ expect { @securable.mode 73 }.not_to raise_error
+
+ expect { @securable.mode -01 }.to raise_error(ArgumentError)
+ expect { @securable.mode 010000 }.to raise_error(ArgumentError)
+ expect { @securable.mode -1 }.to raise_error(ArgumentError)
+ expect { @securable.mode 4096 }.to raise_error(ArgumentError)
end
it "should allow you to specify :full_control, :modify, :read_execute, :read, and :write rights" do
- lambda { @securable.rights :full_control, "The Dude" }.should_not raise_error
- lambda { @securable.rights :modify, "The Dude" }.should_not raise_error
- lambda { @securable.rights :read_execute, "The Dude" }.should_not raise_error
- lambda { @securable.rights :read, "The Dude" }.should_not raise_error
- lambda { @securable.rights :write, "The Dude" }.should_not raise_error
- lambda { @securable.rights :to_party, "The Dude" }.should raise_error(ArgumentError)
+ expect { @securable.rights :full_control, "The Dude" }.not_to raise_error
+ expect { @securable.rights :modify, "The Dude" }.not_to raise_error
+ expect { @securable.rights :read_execute, "The Dude" }.not_to raise_error
+ expect { @securable.rights :read, "The Dude" }.not_to raise_error
+ expect { @securable.rights :write, "The Dude" }.not_to raise_error
+ expect { @securable.rights :to_party, "The Dude" }.to raise_error(ArgumentError)
end
it "should allow you to specify :full_control, :modify, :read_execute, :read, and :write deny_rights" do
- lambda { @securable.deny_rights :full_control, "The Dude" }.should_not raise_error
- lambda { @securable.deny_rights :modify, "The Dude" }.should_not raise_error
- lambda { @securable.deny_rights :read_execute, "The Dude" }.should_not raise_error
- lambda { @securable.deny_rights :read, "The Dude" }.should_not raise_error
- lambda { @securable.deny_rights :write, "The Dude" }.should_not raise_error
- lambda { @securable.deny_rights :to_party, "The Dude" }.should raise_error(ArgumentError)
+ expect { @securable.deny_rights :full_control, "The Dude" }.not_to raise_error
+ expect { @securable.deny_rights :modify, "The Dude" }.not_to raise_error
+ expect { @securable.deny_rights :read_execute, "The Dude" }.not_to raise_error
+ expect { @securable.deny_rights :read, "The Dude" }.not_to raise_error
+ expect { @securable.deny_rights :write, "The Dude" }.not_to raise_error
+ expect { @securable.deny_rights :to_party, "The Dude" }.to raise_error(ArgumentError)
end
it "should accept a principal as a string or an array" do
- lambda { @securable.rights :read, "The Dude" }.should_not raise_error
- lambda { @securable.rights :read, ["The Dude","Donny"] }.should_not raise_error
- lambda { @securable.rights :read, 3 }.should raise_error(ArgumentError)
+ expect { @securable.rights :read, "The Dude" }.not_to raise_error
+ expect { @securable.rights :read, ["The Dude","Donny"] }.not_to raise_error
+ expect { @securable.rights :read, 3 }.to raise_error(ArgumentError)
end
it "should allow you to specify whether the permissions applies_to_children with true/false/:containers_only/:objects_only" do
- lambda { @securable.rights :read, "The Dude", :applies_to_children => false }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => :containers_only }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => :objects_only }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => 'poop' }.should raise_error(ArgumentError)
+ expect { @securable.rights :read, "The Dude", :applies_to_children => false }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => :containers_only }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => :objects_only }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => 'poop' }.to raise_error(ArgumentError)
end
it "should allow you to specify whether the permissions applies_to_self with true/false" do
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_self => 'poop' }.should raise_error(ArgumentError)
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_self => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_self => 'poop' }.to raise_error(ArgumentError)
end
it "should allow you to specify whether the permissions applies one_level_deep with true/false" do
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => 'poop' }.should raise_error(ArgumentError)
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => 'poop' }.to raise_error(ArgumentError)
end
it "should allow multiple rights and deny_rights declarations" do
@@ -283,32 +283,32 @@ describe Chef::Mixin::Securable do
@securable.rights :full_control, "The Dude"
@securable.rights :write, "The Dude"
@securable.deny_rights :read, "The Dude"
- @securable.rights.size.should == 3
- @securable.deny_rights.size.should == 2
+ expect(@securable.rights.size).to eq(3)
+ expect(@securable.deny_rights.size).to eq(2)
end
it "should allow you to specify whether the permission applies_to_self only if you specified applies_to_children" do
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => false }.should raise_error(ArgumentError)
- lambda { @securable.rights :read, "The Dude", :applies_to_self => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_self => false }.should_not raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :applies_to_self => false }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => false, :applies_to_self => false }.to raise_error(ArgumentError)
+ expect { @securable.rights :read, "The Dude", :applies_to_self => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_self => false }.not_to raise_error
end
it "should allow you to specify whether the permission applies one_level_deep only if you specified applies_to_children" do
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => true }.should raise_error(ArgumentError)
- lambda { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => false }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :one_level_deep => true }.should_not raise_error
- lambda { @securable.rights :read, "The Dude", :one_level_deep => false }.should_not raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => true, :one_level_deep => false }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => true }.to raise_error(ArgumentError)
+ expect { @securable.rights :read, "The Dude", :applies_to_children => false, :one_level_deep => false }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :one_level_deep => true }.not_to raise_error
+ expect { @securable.rights :read, "The Dude", :one_level_deep => false }.not_to raise_error
end
it "should allow you to specify whether the permissions inherit with true/false" do
- lambda { @securable.inherits true }.should_not raise_error
- lambda { @securable.inherits false }.should_not raise_error
- lambda { @securable.inherits "monkey" }.should raise_error(ArgumentError)
+ expect { @securable.inherits true }.not_to raise_error
+ expect { @securable.inherits false }.not_to raise_error
+ expect { @securable.inherits "monkey" }.to raise_error(ArgumentError)
end
end
end
diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb
index 38a63a32ee..afce4dc826 100644
--- a/spec/unit/mixin/shell_out_spec.rb
+++ b/spec/unit/mixin/shell_out_spec.rb
@@ -38,7 +38,7 @@ describe Chef::Mixin::ShellOut do
let(:command_args) { [ cmd ] }
it 'should not edit command args' do
- should eql(command_args)
+ is_expected.to eql(command_args)
end
end
@@ -47,7 +47,7 @@ describe Chef::Mixin::ShellOut do
let(:environment) { { 'LC_ALL' => 'C' } }
it 'should not edit command args' do
- should eql(command_args)
+ is_expected.to eql(command_args)
end
end
@@ -66,7 +66,7 @@ describe Chef::Mixin::ShellOut do
let(:command_log_level) { :warn }
it 'should convert :command_log_level to :log_level' do
- should eql [ cmd, { :log_level => command_log_level } ]
+ is_expected.to eql [ cmd, { :log_level => command_log_level } ]
end
should_emit_deprecation_warning_about :command_log_level, :log_level
@@ -77,7 +77,7 @@ describe Chef::Mixin::ShellOut do
let(:command_log_prepend) { 'PROVIDER:' }
it 'should convert :command_log_prepend to :log_tag' do
- should eql [ cmd, { :log_tag => command_log_prepend } ]
+ is_expected.to eql [ cmd, { :log_tag => command_log_prepend } ]
end
should_emit_deprecation_warning_about :command_log_prepend, :log_tag
@@ -88,7 +88,7 @@ describe Chef::Mixin::ShellOut do
let(:command_log_level) { :warn }
it "should convert 'command_log_level' to :log_level" do
- should eql [ cmd, { :log_level => command_log_level } ]
+ is_expected.to eql [ cmd, { :log_level => command_log_level } ]
end
should_emit_deprecation_warning_about :command_log_level, :log_level
@@ -99,7 +99,7 @@ describe Chef::Mixin::ShellOut do
let(:command_log_prepend) { 'PROVIDER:' }
it "should convert 'command_log_prepend' to :log_tag" do
- should eql [ cmd, { :log_tag => command_log_prepend } ]
+ is_expected.to eql [ cmd, { :log_tag => command_log_prepend } ]
end
should_emit_deprecation_warning_about :command_log_prepend, :log_tag
diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb
index 63fa81782e..f02bd34b8f 100644
--- a/spec/unit/mixin/template_spec.rb
+++ b/spec/unit/mixin/template_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Mixin::Template, "render_template" do
it "should render the template evaluated in the given context" do
@context[:foo] = "bar"
output = @context.render_template_from_string("<%= @foo %>")
- output.should == "bar"
+ expect(output).to eq("bar")
end
template_contents = [ "Fancy\r\nTemplate\r\n\r\n",
@@ -39,14 +39,14 @@ describe Chef::Mixin::Template, "render_template" do
describe "when running on windows" do
before do
- Chef::Platform.stub(:windows?).and_return(true)
+ allow(Chef::Platform).to receive(:windows?).and_return(true)
end
it "should render the templates with windows line endings" do
template_contents.each do |template_content|
output = @context.render_template_from_string(template_content)
output.each_line do |line|
- line.should end_with("\r\n")
+ expect(line).to end_with("\r\n")
end
end
end
@@ -54,14 +54,14 @@ describe Chef::Mixin::Template, "render_template" do
describe "when running on unix" do
before do
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
end
it "should render the templates with unix line endings" do
template_contents.each do |template_content|
output = @context.render_template_from_string(template_content)
output.each_line do |line|
- line.should end_with("\n")
+ expect(line).to end_with("\n")
end
end
end
@@ -70,7 +70,7 @@ describe Chef::Mixin::Template, "render_template" do
it "should provide a node method to access @node" do
@context[:node] = "tehShizzle"
output = @context.render_template_from_string("<%= @node %>")
- output.should == "tehShizzle"
+ expect(output).to eq("tehShizzle")
end
describe "with a template resource" do
@@ -100,7 +100,7 @@ describe Chef::Mixin::Template, "render_template" do
it "should provide a render method" do
output = @template_context.render_template_from_string("before {<%= render('test.erb').strip -%>} after")
- output.should == "before {We could be diving for pearls!} after"
+ expect(output).to eq("before {We could be diving for pearls!} after")
end
it "should render local files" do
@@ -110,7 +110,7 @@ describe Chef::Mixin::Template, "render_template" do
tf.rewind
output = @template_context.render_template_from_string("before {<%= render '#{tf.path}', :local => true %>} after")
- output.should == "before {test} after"
+ expect(output).to eq("before {test} after")
ensure
tf.close
end
@@ -120,7 +120,7 @@ describe Chef::Mixin::Template, "render_template" do
@template_context[:template_finder] = Chef::Provider::TemplateFinder.new(@run_context, 'apache2', @node)
output = @template_context.render_template_from_string("before {<%= render('test.erb', :cookbook => 'openldap').strip %>} after")
- output.should == "before {We could be diving for pearls!} after"
+ expect(output).to eq("before {We could be diving for pearls!} after")
end
it "should render using the source argument if provided" do
@@ -130,7 +130,7 @@ describe Chef::Mixin::Template, "render_template" do
tf.rewind
output = @template_context.render_template_from_string("before {<%= render 'something', :local => true, :source => '#{tf.path}' %>} after")
- output.should == "before {test} after"
+ expect(output).to eq("before {test} after")
ensure
tf.close
end
@@ -140,7 +140,7 @@ describe Chef::Mixin::Template, "render_template" do
@node.normal[:slappiness] = "happiness"
output = @template_context.render_template_from_string("before {<%= render 'openldap_stuff.conf.erb' %>} after")
- output.should == "before {slappiness is happiness} after"
+ expect(output).to eq("before {slappiness is happiness} after")
end
it "should pass the original variables to partials" do
@@ -152,29 +152,29 @@ describe Chef::Mixin::Template, "render_template" do
it "should pass variables to partials" do
output = @template_context.render_template_from_string("before {<%= render 'openldap_variable_stuff.conf.erb', :variables => {:secret => 'whatever' } %>} after")
- output.should == "before {super secret is whatever} after"
+ expect(output).to eq("before {super secret is whatever} after")
end
it "should pass variables to partials even if they are named the same" do
@template_context[:secret] = 'one'
output = @template_context.render_template_from_string("before {<%= render 'openldap_variable_stuff.conf.erb', :variables => {:secret => 'two' } %>} after <%= @secret %>")
- output.should == "before {super secret is two} after one"
+ expect(output).to eq("before {super secret is two} after one")
end
it "should pass nil for missing variables in partials" do
output = @template_context.render_template_from_string("before {<%= render 'openldap_variable_stuff.conf.erb', :variables => {} %>} after")
- output.should == "before {super secret is } after"
+ expect(output).to eq("before {super secret is } after")
output = @template_context.render_template_from_string("before {<%= render 'openldap_variable_stuff.conf.erb' %>} after")
- output.should == "before {super secret is } after"
+ expect(output).to eq("before {super secret is } after")
end
it "should render nested partials" do
path = File.expand_path(File.join(CHEF_SPEC_DATA, "partial_one.erb"))
output = @template_context.render_template_from_string("before {<%= render('#{path}', :local => true).strip %>} after")
- output.should == "before {partial one We could be diving for pearls! calling home} after"
+ expect(output).to eq("before {partial one We could be diving for pearls! calling home} after")
end
describe "when customizing the template context" do
@@ -187,7 +187,7 @@ describe Chef::Mixin::Template, "render_template" do
end
@template_context._extend_modules([mod])
output = @template_context.render_template_from_string("<%=hello%>")
- output.should == "ohai"
+ expect(output).to eq("ohai")
end
it "emits a warning when overriding 'core' methods" do
@@ -202,7 +202,7 @@ describe Chef::Mixin::Template, "render_template" do
end
end
['node', 'render', 'render_template', 'render_template_from_string'].each do |method_name|
- Chef::Log.should_receive(:warn).with(/^Core template method `#{method_name}' overridden by extension module/)
+ expect(Chef::Log).to receive(:warn).with(/^Core template method `#{method_name}' overridden by extension module/)
end
@template_context._extend_modules([mod])
end
@@ -216,11 +216,11 @@ describe Chef::Mixin::Template, "render_template" do
end
it "should catch and re-raise the exception as a TemplateError" do
- lambda { do_raise }.should raise_error(Chef::Mixin::Template::TemplateError)
+ expect { do_raise }.to raise_error(Chef::Mixin::Template::TemplateError)
end
it "should raise an error if an attempt is made to access node but it is nil" do
- lambda {@context.render_template_from_string("<%= node %>") {|r| r}}.should raise_error(Chef::Mixin::Template::TemplateError)
+ expect {@context.render_template_from_string("<%= node %>") {|r| r}}.to raise_error(Chef::Mixin::Template::TemplateError)
end
describe "the raised TemplateError" do
@@ -233,35 +233,35 @@ describe Chef::Mixin::Template, "render_template" do
end
it "should have the original exception" do
- @exception.original_exception.should be
- @exception.original_exception.message.should =~ /undefined local variable or method `this_is_not_defined'/
+ expect(@exception.original_exception).to be
+ expect(@exception.original_exception.message).to match(/undefined local variable or method `this_is_not_defined'/)
end
it "should determine the line number of the exception" do
- @exception.line_number.should == 4
+ expect(@exception.line_number).to eq(4)
end
it "should provide a source listing of the template around the exception" do
- @exception.source_listing.should == " 2: bar\n 3: baz\n 4: <%= this_is_not_defined %>\n 5: quin\n 6: qunx"
+ expect(@exception.source_listing).to eq(" 2: bar\n 3: baz\n 4: <%= this_is_not_defined %>\n 5: quin\n 6: qunx")
end
it "should provide the evaluation context of the template" do
- @exception.context.should == @context
+ expect(@exception.context).to eq(@context)
end
it "should defer the message to the original exception" do
- @exception.message.should =~ /undefined local variable or method `this_is_not_defined'/
+ expect(@exception.message).to match(/undefined local variable or method `this_is_not_defined'/)
end
it "should provide a nice source location" do
- @exception.source_location.should == "on line #4"
+ expect(@exception.source_location).to eq("on line #4")
end
it "should create a pretty output for the terminal" do
- @exception.to_s.should =~ /Chef::Mixin::Template::TemplateError/
- @exception.to_s.should =~ /undefined local variable or method `this_is_not_defined'/
- @exception.to_s.should include(" 2: bar\n 3: baz\n 4: <%= this_is_not_defined %>\n 5: quin\n 6: qunx")
- @exception.to_s.should include(@exception.original_exception.backtrace.first)
+ expect(@exception.to_s).to match(/Chef::Mixin::Template::TemplateError/)
+ expect(@exception.to_s).to match(/undefined local variable or method `this_is_not_defined'/)
+ expect(@exception.to_s).to include(" 2: bar\n 3: baz\n 4: <%= this_is_not_defined %>\n 5: quin\n 6: qunx")
+ expect(@exception.to_s).to include(@exception.original_exception.backtrace.first)
end
end
end
diff --git a/spec/unit/mixin/windows_architecture_helper_spec.rb b/spec/unit/mixin/windows_architecture_helper_spec.rb
index f59602d716..3803d69371 100644
--- a/spec/unit/mixin/windows_architecture_helper_spec.rb
+++ b/spec/unit/mixin/windows_architecture_helper_spec.rb
@@ -35,13 +35,13 @@ describe Chef::Mixin::WindowsArchitectureHelper do
it "returns true when valid architectures are passed to valid_windows_architecture?" do
@valid_architectures.each do | architecture |
- valid_windows_architecture?(architecture).should == true
+ expect(valid_windows_architecture?(architecture)).to eq(true)
end
end
it "returns false when invalid architectures are passed to valid_windows_architecture?" do
@invalid_architectures.each do | architecture |
- valid_windows_architecture?(architecture).should == false
+ expect(valid_windows_architecture?(architecture)).to eq(false)
end
end
@@ -54,7 +54,7 @@ describe Chef::Mixin::WindowsArchitectureHelper do
it "raises an error if an invalid architecture is passed to assert_valid_windows_architecture!" do
@invalid_architectures.each do | architecture |
begin
- assert_valid_windows_architecture!(architecture).should raise_error Chef::Exceptions::Win32ArchitectureIncorrect
+ expect(assert_valid_windows_architecture!(architecture)).to raise_error Chef::Exceptions::Win32ArchitectureIncorrect
rescue Chef::Exceptions::Win32ArchitectureIncorrect
end
end
@@ -75,8 +75,8 @@ describe Chef::Mixin::WindowsArchitectureHelper do
new_node.default["kernel"][:machine] = node_architecture.to_s
@valid_architectures.each do | supported_architecture |
- node_supports_windows_architecture?(new_node, supported_architecture).should == true if only_valid_combinations && (supported_architecture != :x86_64 && node_architecture != :i386 )
- node_supports_windows_architecture?(new_node, supported_architecture).should == false if ! only_valid_combinations && (supported_architecture == :x86_64 && node_architecture == :i386 )
+ expect(node_supports_windows_architecture?(new_node, supported_architecture)).to eq(true) if only_valid_combinations && (supported_architecture != :x86_64 && node_architecture != :i386 )
+ expect(node_supports_windows_architecture?(new_node, supported_architecture)).to eq(false) if ! only_valid_combinations && (supported_architecture == :x86_64 && node_architecture == :i386 )
end
end
end
diff --git a/spec/unit/mixin/xml_escape_spec.rb b/spec/unit/mixin/xml_escape_spec.rb
index 83debb5907..c5156cfb7b 100644
--- a/spec/unit/mixin/xml_escape_spec.rb
+++ b/spec/unit/mixin/xml_escape_spec.rb
@@ -28,27 +28,27 @@ describe Chef::Mixin::XMLEscape do
end
it "escapes ampersands to '&amp;'" do
- @escaper.xml_escape("&").should == "&amp;"
+ expect(@escaper.xml_escape("&")).to eq("&amp;")
end
it "escapes angle brackets to &lt; or &gt;" do
- @escaper.xml_escape("<").should == "&lt;"
- @escaper.xml_escape(">").should == "&gt;"
+ expect(@escaper.xml_escape("<")).to eq("&lt;")
+ expect(@escaper.xml_escape(">")).to eq("&gt;")
end
it "does not modify ASCII strings" do
- @escaper.xml_escape('foobarbaz!@#$%^*()').should == 'foobarbaz!@#$%^*()'
+ expect(@escaper.xml_escape('foobarbaz!@#$%^*()')).to eq('foobarbaz!@#$%^*()')
end
it "converts invalid bytes to asterisks" do
- @escaper.xml_escape("\x00").should == "*"
+ expect(@escaper.xml_escape("\x00")).to eq("*")
end
it "converts UTF-8 correctly" do
- @escaper.xml_escape("\xC2\xA9").should == '&#169;'
+ expect(@escaper.xml_escape("\xC2\xA9")).to eq('&#169;')
end
it "converts win 1252 characters correctly" do
- @escaper.xml_escape("\x80").should == '&#8364;'
+ expect(@escaper.xml_escape("\x80")).to eq('&#8364;')
end
end
diff --git a/spec/unit/monkey_patches/string_spec.rb b/spec/unit/monkey_patches/string_spec.rb
index 8c6710b38e..74e3753229 100644
--- a/spec/unit/monkey_patches/string_spec.rb
+++ b/spec/unit/monkey_patches/string_spec.rb
@@ -27,8 +27,8 @@ describe String do
ch = num.chr
ch.force_encoding('ASCII-8BIT') if ch.respond_to? :force_encoding
- ch.ord.should be_a_kind_of(Fixnum)
- ch.ord.should == num
+ expect(ch.ord).to be_a_kind_of(Fixnum)
+ expect(ch.ord).to eq(num)
end
end
diff --git a/spec/unit/monkey_patches/uri_spec.rb b/spec/unit/monkey_patches/uri_spec.rb
index cff252ac3b..9aca1fc9f1 100644
--- a/spec/unit/monkey_patches/uri_spec.rb
+++ b/spec/unit/monkey_patches/uri_spec.rb
@@ -26,7 +26,7 @@ describe URI do
end
it "returns the hostname without brackets" do
- ipv6_uri.hostname.should == "2a00:1450:4009:809::1008"
+ expect(ipv6_uri.hostname).to eq("2a00:1450:4009:809::1008")
end
end
diff --git a/spec/unit/monologger_spec.rb b/spec/unit/monologger_spec.rb
index 3babc29218..8689ea0aaa 100644
--- a/spec/unit/monologger_spec.rb
+++ b/spec/unit/monologger_spec.rb
@@ -23,14 +23,14 @@ describe MonoLogger do
it "should disable buffering when passed an IO stream" do
STDOUT.sync = false
MonoLogger.new(STDOUT)
- STDOUT.sync.should == true
+ expect(STDOUT.sync).to eq(true)
end
describe "when given an object that responds to write and close e.g. IO" do
it "should use the object directly" do
stream = StringIO.new
MonoLogger.new(stream).fatal("Houston, we've had a problem.")
- stream.string.should =~ /Houston, we've had a problem./
+ expect(stream.string).to match(/Houston, we've had a problem./)
end
end
@@ -39,7 +39,7 @@ describe MonoLogger do
temp_file = Tempfile.new("rspec-monologger-log")
temp_file.close
MonoLogger.new(temp_file.path).fatal("Do, or do not. There is no try.")
- File.read(temp_file.path).should =~ /Do, or do not. There is no try./
+ expect(File.read(temp_file.path)).to match(/Do, or do not. There is no try./)
end
end
end
diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb
index 5325117d6c..c924ee2811 100644
--- a/spec/unit/node/attribute_spec.rb
+++ b/spec/unit/node/attribute_spec.rb
@@ -215,22 +215,22 @@ describe Chef::Node::Attribute do
describe "initialize" do
it "should return a Chef::Node::Attribute" do
- @attributes.should be_a_kind_of(Chef::Node::Attribute)
+ expect(@attributes).to be_a_kind_of(Chef::Node::Attribute)
end
it "should take an Automatioc, Normal, Default and Override hash" do
- lambda { Chef::Node::Attribute.new({}, {}, {}, {}) }.should_not raise_error
+ expect { Chef::Node::Attribute.new({}, {}, {}, {}) }.not_to raise_error
end
[ :normal, :default, :override, :automatic ].each do |accessor|
it "should set #{accessor}" do
na = Chef::Node::Attribute.new({ :normal => true }, { :default => true }, { :override => true }, { :automatic => true })
- na.send(accessor).should == { accessor.to_s => true }
+ expect(na.send(accessor)).to eq({ accessor.to_s => true })
end
end
it "should be enumerable" do
- @attributes.should be_is_a(Enumerable)
+ expect(@attributes).to be_is_a(Enumerable)
end
end
@@ -242,7 +242,7 @@ describe Chef::Node::Attribute do
# the "strict" conversion method that should only be implemented by
# things that are truly Array-like, so NoMethodError is the right choice.
# (cf. there is no Hash#to_ary).
- lambda { @attributes.default.to_ary }.should raise_error(NoMethodError)
+ expect { @attributes.default.to_ary }.to raise_error(NoMethodError)
end
end
@@ -274,7 +274,7 @@ describe Chef::Node::Attribute do
["force_override", "force_override"],
["automatic", "automatic"]
]
- @attributes.debug_value(:foo, :bar).should == expected
+ expect(@attributes.debug_value(:foo, :bar)).to eq(expected)
end
end
@@ -285,71 +285,71 @@ describe Chef::Node::Attribute do
end
it "prefers 'forced default' over any other default" do
- @attributes.default!["default"] = "force default"
+ @attributes.force_default["default"] = "force default"
@attributes.role_default["default"] = "role default"
@attributes.env_default["default"] = "environment default"
- @attributes["default"].should == "force default"
+ expect(@attributes["default"]).to eq("force default")
end
it "prefers role_default over environment or cookbook default" do
@attributes.role_default["default"] = "role default"
@attributes.env_default["default"] = "environment default"
- @attributes["default"].should == "role default"
+ expect(@attributes["default"]).to eq("role default")
end
it "prefers environment default over cookbook default" do
@attributes.env_default["default"] = "environment default"
- @attributes["default"].should == "environment default"
+ expect(@attributes["default"]).to eq("environment default")
end
it "returns the cookbook default when no other default values are present" do
- @attributes["default"].should == "cookbook default"
+ expect(@attributes["default"]).to eq("cookbook default")
end
it "prefers 'forced overrides' over role or cookbook overrides" do
- @attributes.override!["override"] = "force override"
+ @attributes.force_override["override"] = "force override"
@attributes.env_override["override"] = "environment override"
@attributes.role_override["override"] = "role override"
- @attributes["override"].should == "force override"
+ expect(@attributes["override"]).to eq("force override")
end
it "prefers environment overrides over role or cookbook overrides" do
@attributes.env_override["override"] = "environment override"
@attributes.role_override["override"] = "role override"
- @attributes["override"].should == "environment override"
+ expect(@attributes["override"]).to eq("environment override")
end
it "prefers role overrides over cookbook overrides" do
@attributes.role_override["override"] = "role override"
- @attributes["override"].should == "role override"
+ expect(@attributes["override"]).to eq("role override")
end
it "returns cookbook overrides when no other overrides are present" do
- @attributes["override"].should == "cookbook override"
+ expect(@attributes["override"]).to eq("cookbook override")
end
it "merges arrays within the default precedence" do
@attributes.role_default["array"] = %w{role}
@attributes.env_default["array"] = %w{env}
- @attributes["array"].should == %w{env role}
+ expect(@attributes["array"]).to eq(%w{env role})
end
it "merges arrays within the override precedence" do
@attributes.role_override["array"] = %w{role}
@attributes.env_override["array"] = %w{env}
- @attributes["array"].should == %w{role env}
+ expect(@attributes["array"]).to eq(%w{role env})
end
it "does not merge arrays between default and normal" do
@attributes.role_default["array"] = %w{role}
@attributes.normal["array"] = %w{normal}
- @attributes["array"].should == %w{normal}
+ expect(@attributes["array"]).to eq(%w{normal})
end
it "does not merge arrays between normal and override" do
@attributes.normal["array"] = %w{normal}
@attributes.role_override["array"] = %w{role}
- @attributes["array"].should == %w{role}
+ expect(@attributes["array"]).to eq(%w{role})
end
it "merges nested hashes between precedence levels" do
@@ -358,9 +358,9 @@ describe Chef::Node::Attribute do
@attributes.normal = {"a" => {"b" => {"normal" => "normal"}}}
@attributes.override = {"a" => {"override" => "role"}}
@attributes.automatic = {"a" => {"automatic" => "auto"}}
- @attributes["a"].should == {"b"=>{"default"=>"default", "normal"=>"normal"},
+ expect(@attributes["a"]).to eq({"b"=>{"default"=>"default", "normal"=>"normal"},
"override"=>"role",
- "automatic"=>"auto"}
+ "automatic"=>"auto"})
end
end
@@ -377,94 +377,94 @@ describe Chef::Node::Attribute do
end
it "merges all types of overrides into a combined override" do
- @attributes.combined_override["co"].should == "cookbook override"
- @attributes.combined_override["ro"].should == "role override"
- @attributes.combined_override["eo"].should == "env override"
- @attributes.combined_override["fo"].should == "force override"
+ expect(@attributes.combined_override["co"]).to eq("cookbook override")
+ expect(@attributes.combined_override["ro"]).to eq("role override")
+ expect(@attributes.combined_override["eo"]).to eq("env override")
+ expect(@attributes.combined_override["fo"]).to eq("force override")
end
it "merges all types of defaults into a combined default" do
- @attributes.combined_default["cd"].should == "cookbook default"
- @attributes.combined_default["rd"].should == "role default"
- @attributes.combined_default["ed"].should == "env default"
- @attributes.combined_default["fd"].should == "force default"
+ expect(@attributes.combined_default["cd"]).to eq("cookbook default")
+ expect(@attributes.combined_default["rd"]).to eq("role default")
+ expect(@attributes.combined_default["ed"]).to eq("env default")
+ expect(@attributes.combined_default["fd"]).to eq("force default")
end
end
describe "[]" do
it "should return override data if it exists" do
- @attributes["macaddress"].should == "00:00:00:00:00:00"
+ expect(@attributes["macaddress"]).to eq("00:00:00:00:00:00")
end
it "should return attribute data if it is not overridden" do
- @attributes["platform"].should == "mac_os_x"
+ expect(@attributes["platform"]).to eq("mac_os_x")
end
it "should return data that doesn't have corresponding keys in every hash" do
- @attributes["command"]["ps"].should == "ps -ef"
+ expect(@attributes["command"]["ps"]).to eq("ps -ef")
end
it "should return default data if it is not overriden or in attribute data" do
- @attributes["music"]["mastodon"].should == "rocks"
+ expect(@attributes["music"]["mastodon"]).to eq("rocks")
end
it "should prefer the override data over an available default" do
- @attributes["music"]["mars_volta"].should == "cicatriz"
+ expect(@attributes["music"]["mars_volta"]).to eq("cicatriz")
end
it "should prefer the attribute data over an available default" do
- @attributes["music"]["jimmy_eat_world"].should == "nice"
+ expect(@attributes["music"]["jimmy_eat_world"]).to eq("nice")
end
it "should prefer override data over default data if there is no attribute data" do
- @attributes["hot"]["day"].should == "sunday"
+ expect(@attributes["hot"]["day"]).to eq("sunday")
end
it "should return the merged hash if all three have values" do
result = @attributes["music"]
- result["mars_volta"].should == "cicatriz"
- result["jimmy_eat_world"].should == "nice"
- result["mastodon"].should == "rocks"
+ expect(result["mars_volta"]).to eq("cicatriz")
+ expect(result["jimmy_eat_world"]).to eq("nice")
+ expect(result["mastodon"]).to eq("rocks")
end
end
describe "[]=" do
it "should error out when the type of attribute to set has not been specified" do
@attributes.normal["the_ghost"] = { }
- lambda { @attributes["the_ghost"]["exterminate"] = false }.should raise_error(Chef::Exceptions::ImmutableAttributeModification)
+ expect { @attributes["the_ghost"]["exterminate"] = false }.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
end
it "should let you set an attribute value when another hash has an intermediate value" do
@attributes.normal["the_ghost"] = { "exterminate" => "the future" }
- lambda { @attributes.normal["the_ghost"]["eviscerate"]["tomorrow"] = false }.should_not raise_error
+ expect { @attributes.normal["the_ghost"]["eviscerate"]["tomorrow"] = false }.not_to raise_error
end
it "should set the attribute value" do
@attributes.normal["longboard"] = "surfing"
- @attributes.normal["longboard"].should == "surfing"
- @attributes.normal["longboard"].should == "surfing"
+ expect(@attributes.normal["longboard"]).to eq("surfing")
+ expect(@attributes.normal["longboard"]).to eq("surfing")
end
it "should set deeply nested attribute values when a precedence level is specified" do
@attributes.normal["deftones"]["hunters"]["nap"] = "surfing"
- @attributes.normal["deftones"]["hunters"]["nap"].should == "surfing"
+ expect(@attributes.normal["deftones"]["hunters"]["nap"]).to eq("surfing")
end
it "should die if you try and do nested attributes that do not exist without read vivification" do
- lambda { @attributes["foo"]["bar"] = :baz }.should raise_error
+ expect { @attributes["foo"]["bar"] = :baz }.to raise_error
end
it "should let you set attributes manually without vivification" do
@attributes.normal["foo"] = Mash.new
@attributes.normal["foo"]["bar"] = :baz
- @attributes.normal["foo"]["bar"].should == :baz
+ expect(@attributes.normal["foo"]["bar"]).to eq(:baz)
end
it "should optionally skip setting the value if one already exists" do
@attributes.set_unless_value_present = true
@attributes.normal["hostname"] = "bar"
- @attributes["hostname"].should == "latte"
+ expect(@attributes["hostname"]).to eq("latte")
end
it "does not support ||= when setting" do
@@ -472,19 +472,47 @@ describe Chef::Node::Attribute do
# Users who need this behavior can use set_unless and friends
@attributes.normal["foo"] = Mash.new
@attributes.normal["foo"]["bar"] ||= "stop the world"
- @attributes.normal["foo"]["bar"].should == {}
+ expect(@attributes.normal["foo"]["bar"]).to eq({})
end
end
describe "to_hash" do
it "should convert to a hash" do
- @attributes.to_hash.class.should == Hash
+ expect(@attributes.to_hash.class).to eq(Hash)
end
it "should convert to a hash based on current state" do
hash = @attributes["hot"].to_hash
- hash.class.should == Hash
- hash["day"].should == "sunday"
+ expect(hash.class).to eq(Hash)
+ expect(hash["day"]).to eq("sunday")
+ end
+
+ it "should create a deep copy of the node attribute" do
+ @attributes.default['foo']['bar']['baz'] = 'fizz'
+ hash = @attributes['foo'].to_hash
+ expect(hash).to eql({"bar"=>{"baz"=>"fizz"}})
+ hash['bar']['baz'] = 'buzz'
+ expect(hash).to eql({"bar"=>{"baz"=>"buzz"}})
+ expect(@attributes.default['foo']).to eql({"bar"=>{"baz"=>"fizz"}})
+ end
+
+ it "should create a deep copy of arrays in the node attribute" do
+ @attributes.default['foo']['bar'] = ['fizz']
+ hash = @attributes['foo'].to_hash
+ expect(hash).to eql({"bar"=>[ 'fizz' ]})
+ hash['bar'].push('buzz')
+ expect(hash).to eql({"bar"=>[ 'fizz', 'buzz' ]})
+ expect(@attributes.default['foo']).to eql({"bar"=>[ 'fizz' ]})
+ end
+
+ it "mutating strings should not mutate the attributes" do
+ pending "this is a bug that should be fixed"
+ @attributes.default['foo']['bar']['baz'] = 'fizz'
+ hash = @attributes['foo'].to_hash
+ expect(hash).to eql({"bar"=>{"baz"=>"fizz"}})
+ hash['bar']['baz'] << 'buzz'
+ expect(hash).to eql({"bar"=>{"baz"=>"fizzbuzz"}})
+ expect(@attributes.default['foo']).to eql({"bar"=>{"baz"=>"fizz"}})
end
end
@@ -497,65 +525,64 @@ describe Chef::Node::Attribute do
describe "has_key?" do
it "should return true if an attribute exists" do
- @attributes.has_key?("music").should == true
+ expect(@attributes.has_key?("music")).to eq(true)
end
it "should return false if an attribute does not exist" do
- @attributes.has_key?("ninja").should == false
+ expect(@attributes.has_key?("ninja")).to eq(false)
end
it "should return false if an attribute does not exist using dot notation" do
- @attributes.has_key?("does_not_exist_at_all").should == false
+ expect(@attributes.has_key?("does_not_exist_at_all")).to eq(false)
end
it "should return true if an attribute exists but is set to nil using dot notation" do
- @attributes.music.deeper.has_key?("gates_of_ishtar").should == true
+ expect(@attributes.music.deeper.has_key?("gates_of_ishtar")).to eq(true)
end
it "should return true if an attribute exists but is set to false" do
@attributes.has_key?("music")
- @attributes["music"].has_key?("apophis").should == true
+ expect(@attributes["music"].has_key?("apophis")).to eq(true)
end
it "does not find keys above the current nesting level" do
- @attributes["music"]["this"]["apparatus"].should_not have_key("this")
+ expect(@attributes["music"]["this"]["apparatus"]).not_to have_key("this")
end
it "does not find keys below the current nesting level" do
- @attributes["music"]["this"].should_not have_key("must")
+ expect(@attributes["music"]["this"]).not_to have_key("must")
end
[:include?, :key?, :member?].each do |method|
it "should alias the method #{method} to itself" do
- @attributes.should respond_to(method)
+ expect(@attributes).to respond_to(method)
end
it "#{method} should behave like has_key?" do
- @attributes.send(method, "music").should == true
+ expect(@attributes.send(method, "music")).to eq(true)
end
end
end
describe "attribute?" do
it "should return true if an attribute exists" do
- @attributes.attribute?("music").should == true
+ expect(@attributes.attribute?("music")).to eq(true)
end
it "should return false if an attribute does not exist" do
- @attributes.attribute?("ninja").should == false
+ expect(@attributes.attribute?("ninja")).to eq(false)
end
end
describe "method_missing" do
it "should behave like a [] lookup" do
- @attributes.music.mastodon.should == "rocks"
+ expect(@attributes.music.mastodon).to eq("rocks")
end
it "should allow the last method to set a value if it has an = sign on the end" do
@attributes.normal.music.mastodon = [ "dream", "still", "shining" ]
- @attributes.reset
- @attributes.normal.music.mastodon.should == [ "dream", "still", "shining" ]
+ expect(@attributes.normal.music.mastodon).to eq([ "dream", "still", "shining" ])
end
end
@@ -584,12 +611,12 @@ describe Chef::Node::Attribute do
@attributes.keys.each do |k|
collect << k
end
- collect.include?("one").should == true
- collect.include?("hut").should == true
- collect.include?("snakes").should == true
- collect.include?("snack").should == true
- collect.include?("place").should == true
- collect.length.should == 5
+ expect(collect.include?("one")).to eq(true)
+ expect(collect.include?("hut")).to eq(true)
+ expect(collect.include?("snakes")).to eq(true)
+ expect(collect.include?("snack")).to eq(true)
+ expect(collect.include?("place")).to eq(true)
+ expect(collect.length).to eq(5)
end
it "should yield lower if we go deeper" do
@@ -597,14 +624,14 @@ describe Chef::Node::Attribute do
@attributes.one.keys.each do |k|
collect << k
end
- collect.include?("two").should == true
- collect.include?("four").should == true
- collect.include?("six").should == true
- collect.length.should == 3
+ expect(collect.include?("two")).to eq(true)
+ expect(collect.include?("four")).to eq(true)
+ expect(collect.include?("six")).to eq(true)
+ expect(collect.length).to eq(3)
end
it "should not raise an exception if one of the hashes has a nil value on a deep lookup" do
- lambda { @attributes.place.keys { |k| } }.should_not raise_error
+ expect { @attributes.place.keys { |k| } }.not_to raise_error
end
end
@@ -633,15 +660,15 @@ describe Chef::Node::Attribute do
collect[k] = v
end
- collect["one"].should == "six"
- collect["hut"].should == "three"
- collect["snakes"].should == "on a plane"
- collect["snack"].should == "cookies"
+ expect(collect["one"]).to eq("six")
+ expect(collect["hut"]).to eq("three")
+ expect(collect["snakes"]).to eq("on a plane")
+ expect(collect["snack"]).to eq("cookies")
end
it "should yield as a two-element array" do
@attributes.each do |a|
- a.should be_an_instance_of(Array)
+ expect(a).to be_an_instance_of(Array)
end
end
end
@@ -666,7 +693,7 @@ describe Chef::Node::Attribute do
end
it "should respond to each_key" do
- @attributes.should respond_to(:each_key)
+ expect(@attributes).to respond_to(:each_key)
end
it "should yield each top level key, post merge rules" do
@@ -675,10 +702,10 @@ describe Chef::Node::Attribute do
collect << k
end
- collect.should include("one")
- collect.should include("snack")
- collect.should include("hut")
- collect.should include("snakes")
+ expect(collect).to include("one")
+ expect(collect).to include("snack")
+ expect(collect).to include("hut")
+ expect(collect).to include("snakes")
end
end
@@ -702,7 +729,7 @@ describe Chef::Node::Attribute do
end
it "should respond to each_pair" do
- @attributes.should respond_to(:each_pair)
+ expect(@attributes).to respond_to(:each_pair)
end
it "should yield each top level key and value pair, post merge rules" do
@@ -711,10 +738,10 @@ describe Chef::Node::Attribute do
collect[k] = v
end
- collect["one"].should == "six"
- collect["hut"].should == "three"
- collect["snakes"].should == "on a plane"
- collect["snack"].should == "cookies"
+ expect(collect["one"]).to eq("six")
+ expect(collect["hut"]).to eq("three")
+ expect(collect["snakes"]).to eq("on a plane")
+ expect(collect["snack"]).to eq("cookies")
end
end
@@ -738,7 +765,7 @@ describe Chef::Node::Attribute do
end
it "should respond to each_value" do
- @attributes.should respond_to(:each_value)
+ expect(@attributes).to respond_to(:each_value)
end
it "should yield each value, post merge rules" do
@@ -747,9 +774,9 @@ describe Chef::Node::Attribute do
collect << v
end
- collect.should include("cookies")
- collect.should include("three")
- collect.should include("on a plane")
+ expect(collect).to include("cookies")
+ expect(collect).to include("three")
+ expect(collect).to include("on a plane")
end
it "should yield four elements" do
@@ -758,7 +785,7 @@ describe Chef::Node::Attribute do
collect << v
end
- collect.length.should == 4
+ expect(collect.length).to eq(4)
end
end
@@ -783,15 +810,15 @@ describe Chef::Node::Attribute do
end
it "should respond to empty?" do
- @attributes.should respond_to(:empty?)
+ expect(@attributes).to respond_to(:empty?)
end
it "should return true when there are no keys" do
- @empty.empty?.should == true
+ expect(@empty.empty?).to eq(true)
end
it "should return false when there are keys" do
- @attributes.empty?.should == false
+ expect(@attributes.empty?).to eq(false)
end
end
@@ -816,7 +843,7 @@ describe Chef::Node::Attribute do
end
it "should respond to fetch" do
- @attributes.should respond_to(:fetch)
+ expect(@attributes).to respond_to(:fetch)
end
describe "when the key exists" do
@@ -827,7 +854,7 @@ describe Chef::Node::Attribute do
"snakes" => "on a plane",
"snack" => "cookies"
}.each do |k,v|
- @attributes.fetch(k).should == v
+ expect(@attributes.fetch(k)).to eq(v)
end
end
end
@@ -835,19 +862,19 @@ describe Chef::Node::Attribute do
describe "when the key does not exist" do
describe "and no args are passed" do
it "should raise an indexerror" do
- lambda { @attributes.fetch("lololol") }.should raise_error(IndexError)
+ expect { @attributes.fetch("lololol") }.to raise_error(IndexError)
end
end
describe "and a default arg is passed" do
it "should return the value of the default arg" do
- @attributes.fetch("lol", "blah").should == "blah"
+ expect(@attributes.fetch("lol", "blah")).to eq("blah")
end
end
describe "and a block is passed" do
it "should run the block and return its value" do
- @attributes.fetch("lol") { |x| "#{x}, blah" }.should == "lol, blah"
+ expect(@attributes.fetch("lol") { |x| "#{x}, blah" }).to eq("lol, blah")
end
end
end
@@ -873,19 +900,19 @@ describe Chef::Node::Attribute do
end
it "should respond to has_value?" do
- @attributes.should respond_to(:has_value?)
+ expect(@attributes).to respond_to(:has_value?)
end
it "should return true if any key has the value supplied" do
- @attributes.has_value?("cookies").should == true
+ expect(@attributes.has_value?("cookies")).to eq(true)
end
it "should return false no key has the value supplied" do
- @attributes.has_value?("lololol").should == false
+ expect(@attributes.has_value?("lololol")).to eq(false)
end
it "should alias value?" do
- @attributes.should respond_to(:value?)
+ expect(@attributes).to respond_to(:value?)
end
end
@@ -918,13 +945,13 @@ describe Chef::Node::Attribute do
end
it "should respond to index" do
- @attributes.should respond_to(:index)
+ expect(@attributes).to respond_to(:index)
end
describe "when the value is indexed" do
it "should return the index" do
silence do
- @attributes.index("six").should == "one"
+ expect(@attributes.index("six")).to eq("one")
end
end
end
@@ -932,14 +959,13 @@ describe Chef::Node::Attribute do
describe "when the value is not indexed" do
it "should return nil" do
silence do
- @attributes.index("lolol").should == nil
+ expect(@attributes.index("lolol")).to eq(nil)
end
end
end
end
-
describe "values" do
before do
@attributes = Chef::Node::Attribute.new(
@@ -960,18 +986,18 @@ describe Chef::Node::Attribute do
end
it "should respond to values" do
- @attributes.should respond_to(:values)
+ expect(@attributes).to respond_to(:values)
end
it "should return an array of values" do
- @attributes.values.length.should == 4
+ expect(@attributes.values.length).to eq(4)
end
it "should match the values output from each" do
- @attributes.values.should include("six")
- @attributes.values.should include("cookies")
- @attributes.values.should include("three")
- @attributes.values.should include("on a plane")
+ expect(@attributes.values).to include("six")
+ expect(@attributes.values).to include("cookies")
+ expect(@attributes.values).to include("three")
+ expect(@attributes.values).to include("on a plane")
end
end
@@ -996,26 +1022,26 @@ describe Chef::Node::Attribute do
end
it "should respond to select" do
- @attributes.should respond_to(:select)
+ expect(@attributes).to respond_to(:select)
end
if RUBY_VERSION >= "1.8.7"
it "should not raise a LocalJumpError if no block is given" do
- lambda { @attributes.select }.should_not raise_error
+ expect { @attributes.select }.not_to raise_error
end
else
it "should raise a LocalJumpError if no block is given" do
- lambda{ @attributes.select }.should raise_error(LocalJumpError)
+ expect{ @attributes.select }.to raise_error(LocalJumpError)
end
end
it "should return an empty hash/array (ruby-version-dependent) for a block containing nil" do
- @attributes.select { nil }.should == {}.select { nil }
+ expect(@attributes.select { nil }).to eq({}.select { nil })
end
# sorted for spec clarity
it "should return a new array of k,v pairs for which the block returns true" do
- @attributes.select { true }.sort.should == (
+ expect(@attributes.select { true }.sort).to eq(
[
["hut", "three"],
["one", "six"],
@@ -1048,37 +1074,37 @@ describe Chef::Node::Attribute do
end
it "should respond to size" do
- @attributes.should respond_to(:size)
+ expect(@attributes).to respond_to(:size)
end
it "should alias length to size" do
- @attributes.should respond_to(:length)
+ expect(@attributes).to respond_to(:length)
end
it "should return 0 for an empty attribute" do
- @empty.size.should == 0
+ expect(@empty.size).to eq(0)
end
it "should return the number of pairs" do
- @attributes.size.should == 4
+ expect(@attributes.size).to eq(4)
end
end
describe "kind_of?" do
it "should falsely inform you that it is a Hash" do
- @attributes.should be_a_kind_of(Hash)
+ expect(@attributes).to be_a_kind_of(Hash)
end
it "should falsely inform you that it is a Mash" do
- @attributes.should be_a_kind_of(Mash)
+ expect(@attributes).to be_a_kind_of(Mash)
end
it "should inform you that it is a Chef::Node::Attribute" do
- @attributes.should be_a_kind_of(Chef::Node::Attribute)
+ expect(@attributes).to be_a_kind_of(Chef::Node::Attribute)
end
it "should inform you that it is anything else" do
- @attributes.should_not be_a_kind_of(Chef::Node)
+ expect(@attributes).not_to be_a_kind_of(Chef::Node)
end
end
@@ -1087,54 +1113,11 @@ describe Chef::Node::Attribute do
# NOTE: previous implementation hid the values, showing @automatic={...}
# That is nice and compact, but hides a lot of info, which seems counter
# to the point of calling #inspect...
- @attributes.inspect.should =~ /@automatic=\{.*\}/
- @attributes.inspect.should =~ /@normal=\{.*\}/
+ expect(@attributes.inspect).to match(/@automatic=\{.*\}/)
+ expect(@attributes.inspect).to match(/@normal=\{.*\}/)
end
end
- # For expedience, this test is implementation-heavy.
- describe "when a component attribute is mutated" do
- [
- :clear,
- :shift
- ].each do |mutator|
- it "resets the cache when the mutator #{mutator} is called" do
- @attributes.should_receive(:reset_cache)
- @attributes.default.send(mutator)
- end
- end
-
- it "resets the cache when the mutator delete is called" do
- @attributes.should_receive(:reset_cache)
- @attributes.default.delete(:music)
- end
-
- [
- :merge!,
- :update,
- :replace
- ].each do |mutator|
- it "resets the cache when the mutator #{mutator} is called" do
- # Implementation of Mash means that this could get called many times. That's okay.
- @attributes.should_receive(:reset_cache).at_least(1).times
- @attributes.default.send(mutator, {:foo => :bar})
- end
- end
-
- [
- :delete_if,
- :keep_if,
- :reject!,
- :select!,
- ].each do |mutator|
- it "resets the cache when the mutator #{mutator} is called" do
- # Implementation of Mash means that this could get called many times. That's okay.
- @attributes.should_receive(:reset_cache).at_least(1).times
- block = lambda {|k,v| true }
- @attributes.default.send(mutator, &block)
- end
- end
- end
describe "when not mutated" do
@@ -1142,7 +1125,7 @@ describe Chef::Node::Attribute do
@attributes.default[:foo][:bar] = "set on original"
subtree = @attributes[:foo]
@attributes.default[:foo].dup[:bar] = "set on dup"
- subtree[:bar].should == "set on original"
+ expect(subtree[:bar]).to eq("set on original")
end
end
@@ -1151,38 +1134,71 @@ describe Chef::Node::Attribute do
it "converts the input in to a VividMash tree (default)" do
@attributes.default = {}
@attributes.default.foo = "bar"
- @attributes.merged_attributes[:foo].should == "bar"
+ expect(@attributes.merged_attributes[:foo]).to eq("bar")
end
it "converts the input in to a VividMash tree (normal)" do
@attributes.normal = {}
@attributes.normal.foo = "bar"
- @attributes.merged_attributes[:foo].should == "bar"
+ expect(@attributes.merged_attributes[:foo]).to eq("bar")
end
it "converts the input in to a VividMash tree (override)" do
@attributes.override = {}
@attributes.override.foo = "bar"
- @attributes.merged_attributes[:foo].should == "bar"
+ expect(@attributes.merged_attributes[:foo]).to eq("bar")
end
it "converts the input in to a VividMash tree (automatic)" do
@attributes.automatic = {}
@attributes.automatic.foo = "bar"
- @attributes.merged_attributes[:foo].should == "bar"
+ expect(@attributes.merged_attributes[:foo]).to eq("bar")
+ end
+ end
+
+ describe "when deep-merging between precedence levels" do
+ it "correctly deep merges hashes and preserves the original contents" do
+ @attributes.default = { "arglebargle" => { "foo" => "bar" } }
+ @attributes.override = { "arglebargle" => { "fizz" => "buzz" } }
+ expect(@attributes.merged_attributes[:arglebargle]).to eq({ "foo" => "bar", "fizz" => "buzz" })
+ expect(@attributes.default[:arglebargle]).to eq({ "foo" => "bar" })
+ expect(@attributes.override[:arglebargle]).to eq({ "fizz" => "buzz" })
+ end
+
+ it "does not deep merge arrays, and preserves the original contents" do
+ @attributes.default = { "arglebargle" => [ 1, 2, 3 ] }
+ @attributes.override = { "arglebargle" => [ 4, 5, 6 ] }
+ expect(@attributes.merged_attributes[:arglebargle]).to eq([ 4, 5, 6 ])
+ expect(@attributes.default[:arglebargle]).to eq([ 1, 2, 3 ])
+ expect(@attributes.override[:arglebargle]).to eq([ 4, 5, 6 ])
+ end
+
+ it "correctly deep merges hashes and preserves the original contents when merging default and role_default" do
+ @attributes.default = { "arglebargle" => { "foo" => "bar" } }
+ @attributes.role_default = { "arglebargle" => { "fizz" => "buzz" } }
+ expect(@attributes.merged_attributes[:arglebargle]).to eq({ "foo" => "bar", "fizz" => "buzz" })
+ expect(@attributes.default[:arglebargle]).to eq({ "foo" => "bar" })
+ expect(@attributes.role_default[:arglebargle]).to eq({ "fizz" => "buzz" })
+ end
+
+ it "correctly deep merges arrays, and preserves the original contents when merging default and role_default" do
+ @attributes.default = { "arglebargle" => [ 1, 2, 3 ] }
+ @attributes.role_default = { "arglebargle" => [ 4, 5, 6 ] }
+ expect(@attributes.merged_attributes[:arglebargle]).to eq([ 1, 2, 3, 4, 5, 6 ])
+ expect(@attributes.default[:arglebargle]).to eq([ 1, 2, 3 ])
+ expect(@attributes.role_default[:arglebargle]).to eq([ 4, 5, 6 ])
end
end
describe "when attemping to write without specifying precedence" do
it "raises an error when using []=" do
- lambda { @attributes[:new_key] = "new value" }.should raise_error(Chef::Exceptions::ImmutableAttributeModification)
+ expect { @attributes[:new_key] = "new value" }.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
end
it "raises an error when using `attr=value`" do
- lambda { @attributes.new_key = "new value" }.should raise_error(Chef::Exceptions::ImmutableAttributeModification)
+ expect { @attributes.new_key = "new value" }.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
end
end
end
-
diff --git a/spec/unit/node/immutable_collections_spec.rb b/spec/unit/node/immutable_collections_spec.rb
index 1c216e327a..b1e7b9169b 100644
--- a/spec/unit/node/immutable_collections_spec.rb
+++ b/spec/unit/node/immutable_collections_spec.rb
@@ -30,28 +30,28 @@ describe Chef::Node::ImmutableMash do
end
it "element references like regular hash" do
- @immutable_mash[:top][:second_level].should == "some value"
+ expect(@immutable_mash[:top][:second_level]).to eq("some value")
end
it "elelment references like a regular Mash" do
- @immutable_mash[:top_level_2].should == %w[array of values]
+ expect(@immutable_mash[:top_level_2]).to eq(%w[array of values])
end
it "converts Hash-like inputs into ImmutableMash's" do
- @immutable_mash[:top].should be_a(Chef::Node::ImmutableMash)
+ expect(@immutable_mash[:top]).to be_a(Chef::Node::ImmutableMash)
end
it "converts array inputs into ImmutableArray's" do
- @immutable_mash[:top_level_2].should be_a(Chef::Node::ImmutableArray)
+ expect(@immutable_mash[:top_level_2]).to be_a(Chef::Node::ImmutableArray)
end
it "converts arrays of hashes to ImmutableArray's of ImmutableMashes" do
- @immutable_mash[:top_level_3].first.should be_a(Chef::Node::ImmutableMash)
+ expect(@immutable_mash[:top_level_3].first).to be_a(Chef::Node::ImmutableMash)
end
it "converts nested hashes to ImmutableMashes" do
- @immutable_mash[:top_level_4].should be_a(Chef::Node::ImmutableMash)
- @immutable_mash[:top_level_4][:level2].should be_a(Chef::Node::ImmutableMash)
+ expect(@immutable_mash[:top_level_4]).to be_a(Chef::Node::ImmutableMash)
+ expect(@immutable_mash[:top_level_4][:level2]).to be_a(Chef::Node::ImmutableMash)
end
describe "to_hash" do
@@ -60,23 +60,23 @@ describe Chef::Node::ImmutableMash do
end
it "converts an immutable mash to a new mutable hash" do
- @copy.should be_instance_of(Hash)
+ expect(@copy).to be_instance_of(Hash)
end
it "converts an immutable nested mash to a new mutable hash" do
- @copy['top_level_4']['level2'].should be_instance_of(Hash)
+ expect(@copy['top_level_4']['level2']).to be_instance_of(Hash)
end
it "converts an immutable nested array to a new mutable array" do
- @copy['top_level_2'].should be_instance_of(Array)
+ expect(@copy['top_level_2']).to be_instance_of(Array)
end
it "should create a mash with the same content" do
- @copy.should == @immutable_mash
+ expect(@copy).to eq(@immutable_mash)
end
it 'should allow mutation' do
- lambda { @copy['m'] = 'm' }.should_not raise_error
+ expect { @copy['m'] = 'm' }.not_to raise_error
end
end
@@ -97,14 +97,14 @@ describe Chef::Node::ImmutableMash do
:shift
].each do |mutator|
it "doesn't allow mutation via `#{mutator}'" do
- lambda { @immutable_mash.send(mutator) }.should raise_error
+ expect { @immutable_mash.send(mutator) }.to raise_error
end
end
it "returns a mutable version of itself when duped" do
mutable = @immutable_mash.dup
mutable[:new_key] = :value
- mutable[:new_key].should == :value
+ expect(mutable[:new_key]).to eq(:value)
end
end
@@ -154,7 +154,7 @@ describe Chef::Node::ImmutableArray do
:unshift
].each do |mutator|
it "does not allow mutation via `#{mutator}" do
- lambda { @immutable_array.send(mutator)}.should raise_error
+ expect { @immutable_array.send(mutator)}.to raise_error
end
end
@@ -165,7 +165,7 @@ describe Chef::Node::ImmutableArray do
it "returns a mutable version of itself when duped" do
mutable = @immutable_array.dup
mutable[0] = :value
- mutable[0].should == :value
+ expect(mutable[0]).to eq(:value)
end
describe "to_a" do
@@ -174,23 +174,23 @@ describe Chef::Node::ImmutableArray do
end
it "converts an immutable array to a new mutable array" do
- @copy.should be_instance_of(Array)
+ expect(@copy).to be_instance_of(Array)
end
it "converts an immutable nested array to a new mutable array" do
- @copy[1].should be_instance_of(Array)
+ expect(@copy[1]).to be_instance_of(Array)
end
it "converts an immutable nested mash to a new mutable hash" do
- @copy[2].should be_instance_of(Hash)
+ expect(@copy[2]).to be_instance_of(Hash)
end
it "should create an array with the same content" do
- @copy.should == @immutable_nested_array
+ expect(@copy).to eq(@immutable_nested_array)
end
it 'should allow mutation' do
- lambda { @copy << 'm' }.should_not raise_error
+ expect { @copy << 'm' }.not_to raise_error
end
end
diff --git a/spec/unit/node_map_spec.rb b/spec/unit/node_map_spec.rb
new file mode 100644
index 0000000000..fe7372961b
--- /dev/null
+++ b/spec/unit/node_map_spec.rb
@@ -0,0 +1,155 @@
+#
+# Author:: Lamont Granquist (<lamont@chef.io>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'chef/node_map'
+
+describe Chef::NodeMap do
+
+ let(:node_map) { Chef::NodeMap.new }
+
+ let(:node) { Chef::Node.new }
+
+ describe "with a bad filter name" do
+ it "should raise an error" do
+ expect{ node_map.set(node, :thing, on_platform_family: 'rhel') }.to raise_error
+ end
+ end
+
+ describe "when no matchers are set at all" do
+ before do
+ node_map.set(:thing, :foo)
+ end
+
+ it "returns the value" do
+ expect(node_map.get(node, :thing)).to eql(:foo)
+ end
+
+ it "returns nil for keys that do not exist" do
+ expect(node_map.get(node, :other_thing)).to eql(nil)
+ end
+ end
+
+ describe "filtering by os" do
+ before do
+ node_map.set(:thing, :foo, os: ["windows"])
+ node_map.set(:thing, :bar, os: "linux")
+ end
+ it "returns the correct value for windows" do
+ allow(node).to receive(:[]).with(:os).and_return("windows")
+ expect(node_map.get(node, :thing)).to eql(:foo)
+ end
+ it "returns the correct value for linux" do
+ allow(node).to receive(:[]).with(:os).and_return("linux")
+ expect(node_map.get(node, :thing)).to eql(:bar)
+ end
+ it "returns nil for a non-matching os" do
+ allow(node).to receive(:[]).with(:os).and_return("freebsd")
+ expect(node_map.get(node, :thing)).to eql(nil)
+ end
+ end
+
+ describe "rejecting an os" do
+ before do
+ node_map.set(:thing, :foo, os: "!windows")
+ end
+ it "returns nil for windows" do
+ allow(node).to receive(:[]).with(:os).and_return("windows")
+ expect(node_map.get(node, :thing)).to eql(nil)
+ end
+ it "returns the correct value for linux" do
+ allow(node).to receive(:[]).with(:os).and_return("linux")
+ expect(node_map.get(node, :thing)).to eql(:foo)
+ end
+ end
+
+ describe "filtering by os and platform_family" do
+ before do
+ node_map.set(:thing, :bar, os: "linux", platform_family: "rhel")
+ end
+
+ it "returns the correct value when both match" do
+ allow(node).to receive(:[]).with(:os).and_return("linux")
+ allow(node).to receive(:[]).with(:platform_family).and_return("rhel")
+ expect(node_map.get(node, :thing)).to eql(:bar)
+ end
+
+ it "returns nil for a non-matching os" do
+ allow(node).to receive(:[]).with(:os).and_return("freebsd")
+ expect(node_map.get(node, :thing)).to eql(nil)
+ end
+
+ it "returns nil when the platform_family does not match" do
+ allow(node).to receive(:[]).with(:os).and_return("linux")
+ allow(node).to receive(:[]).with(:platform_family).and_return("debian")
+ expect(node_map.get(node, :thing)).to eql(nil)
+ end
+ end
+
+ describe "with a block doing platform_version checks" do
+ before do
+ node_map.set(:thing, :foo, platform_family: "rhel") do |node|
+ node[:platform_version].to_i >= 7
+ end
+ end
+
+ it "returns the value when the node matches" do
+ allow(node).to receive(:[]).with(:platform_family).and_return("rhel")
+ allow(node).to receive(:[]).with(:platform_version).and_return("7.0")
+ expect(node_map.get(node, :thing)).to eql(:foo)
+ end
+
+ it "returns nil when the block does not match" do
+ allow(node).to receive(:[]).with(:platform_family).and_return("rhel")
+ allow(node).to receive(:[]).with(:platform_version).and_return("6.4")
+ expect(node_map.get(node, :thing)).to eql(nil)
+ end
+
+ it "returns nil when the platform_family filter does not match" do
+ allow(node).to receive(:[]).with(:platform_family).and_return("debian")
+ allow(node).to receive(:[]).with(:platform_version).and_return("7.0")
+ expect(node_map.get(node, :thing)).to eql(nil)
+ end
+
+ it "returns nil when both do not match" do
+ allow(node).to receive(:[]).with(:platform_family).and_return("debian")
+ allow(node).to receive(:[]).with(:platform_version).and_return("6.0")
+ expect(node_map.get(node, :thing)).to eql(nil)
+ end
+ end
+
+ describe "resource back-compat testing" do
+ it "should handle :on_platforms => :all" do
+ node_map.set(:chef_gem, :foo, :on_platforms => :all)
+ allow(node).to receive(:[]).with(:platform).and_return("windows")
+ expect(node_map.get(node, :chef_gem)).to eql(:foo)
+ end
+ it "should handle :on_platforms => [ 'windows' ]" do
+ node_map.set(:dsc_script, :foo, :on_platforms => [ 'windows' ])
+ allow(node).to receive(:[]).with(:platform).and_return("windows")
+ expect(node_map.get(node, :dsc_script)).to eql(:foo)
+ end
+ it "should handle :on_platform => :all" do
+ node_map.set(:link, :foo, :on_platform => :all)
+ allow(node).to receive(:[]).with(:platform).and_return("windows")
+ expect(node_map.get(node, :link)).to eql(:foo)
+ end
+ end
+
+end
+
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index 00879dcb13..1daaf9ec52 100644
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -28,167 +28,167 @@ describe Chef::Node do
it "creates a node and assigns it a name" do
node = Chef::Node.build('solo-node')
- node.name.should == 'solo-node'
+ expect(node.name).to eq('solo-node')
end
it "should validate the name of the node" do
- lambda{Chef::Node.build('solo node')}.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect{Chef::Node.build('solo node')}.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "should be sortable" do
n1 = Chef::Node.build('alpha')
n2 = Chef::Node.build('beta')
n3 = Chef::Node.build('omega')
- [n3, n1, n2].sort.should == [n1, n2, n3]
+ expect([n3, n1, n2].sort).to eq([n1, n2, n3])
end
describe "when the node does not exist on the server" do
before do
response = OpenStruct.new(:code => '404')
exception = Net::HTTPServerException.new("404 not found", response)
- Chef::Node.stub(:load).and_raise(exception)
+ allow(Chef::Node).to receive(:load).and_raise(exception)
node.name("created-node")
end
it "creates a new node for find_or_create" do
- Chef::Node.stub(:new).and_return(node)
- node.should_receive(:create).and_return(node)
+ allow(Chef::Node).to receive(:new).and_return(node)
+ expect(node).to receive(:create).and_return(node)
node = Chef::Node.find_or_create("created-node")
- node.name.should == 'created-node'
- node.should equal(node)
+ expect(node.name).to eq('created-node')
+ expect(node).to equal(node)
end
end
describe "when the node exists on the server" do
before do
node.name('existing-node')
- Chef::Node.stub(:load).and_return(node)
+ allow(Chef::Node).to receive(:load).and_return(node)
end
it "loads the node via the REST API for find_or_create" do
- Chef::Node.find_or_create('existing-node').should equal(node)
+ expect(Chef::Node.find_or_create('existing-node')).to equal(node)
end
end
describe "run_state" do
it "is an empty hash" do
- node.run_state.should respond_to(:keys)
- node.run_state.should be_empty
+ expect(node.run_state).to respond_to(:keys)
+ expect(node.run_state).to be_empty
end
end
describe "initialize" do
it "should default to the '_default' chef_environment" do
n = Chef::Node.new
- n.chef_environment.should == '_default'
+ expect(n.chef_environment).to eq('_default')
end
end
describe "name" do
it "should allow you to set a name with name(something)" do
- lambda { node.name("latte") }.should_not raise_error
+ expect { node.name("latte") }.not_to raise_error
end
it "should return the name with name()" do
node.name("latte")
- node.name.should eql("latte")
+ expect(node.name).to eql("latte")
end
it "should always have a string for name" do
- lambda { node.name(Hash.new) }.should raise_error(ArgumentError)
+ expect { node.name(Hash.new) }.to raise_error(ArgumentError)
end
it "cannot be blank" do
- lambda { node.name("")}.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { node.name("")}.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "should not accept name doesn't match /^[\-[:alnum:]_:.]+$/" do
- lambda { node.name("space in it")}.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { node.name("space in it")}.to raise_error(Chef::Exceptions::ValidationFailed)
end
end
describe "chef_environment" do
it "should set an environment with chef_environment(something)" do
- lambda { node.chef_environment("latte") }.should_not raise_error
+ expect { node.chef_environment("latte") }.not_to raise_error
end
it "should return the chef_environment with chef_environment()" do
node.chef_environment("latte")
- node.chef_environment.should == "latte"
+ expect(node.chef_environment).to eq("latte")
end
it "should disallow non-strings" do
- lambda { node.chef_environment(Hash.new) }.should raise_error(ArgumentError)
- lambda { node.chef_environment(42) }.should raise_error(ArgumentError)
+ expect { node.chef_environment(Hash.new) }.to raise_error(ArgumentError)
+ expect { node.chef_environment(42) }.to raise_error(ArgumentError)
end
it "cannot be blank" do
- lambda { node.chef_environment("")}.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { node.chef_environment("")}.to raise_error(Chef::Exceptions::ValidationFailed)
end
end
describe "attributes" do
it "should have attributes" do
- node.attribute.should be_a_kind_of(Hash)
+ expect(node.attribute).to be_a_kind_of(Hash)
end
it "should allow attributes to be accessed by name or symbol directly on node[]" do
node.default["locust"] = "something"
- node[:locust].should eql("something")
- node["locust"].should eql("something")
+ expect(node[:locust]).to eql("something")
+ expect(node["locust"]).to eql("something")
end
it "should return nil if it cannot find an attribute with node[]" do
- node["secret"].should eql(nil)
+ expect(node["secret"]).to eql(nil)
end
it "does not allow you to set an attribute via node[]=" do
- lambda { node["secret"] = "shush" }.should raise_error(Chef::Exceptions::ImmutableAttributeModification)
+ expect { node["secret"] = "shush" }.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
end
it "should allow you to query whether an attribute exists with attribute?" do
node.default["locust"] = "something"
- node.attribute?("locust").should eql(true)
- node.attribute?("no dice").should eql(false)
+ expect(node.attribute?("locust")).to eql(true)
+ expect(node.attribute?("no dice")).to eql(false)
end
it "should let you go deep with attribute?" do
node.set["battles"]["people"]["wonkey"] = true
- node["battles"]["people"].attribute?("wonkey").should == true
- node["battles"]["people"].attribute?("snozzberry").should == false
+ expect(node["battles"]["people"].attribute?("wonkey")).to eq(true)
+ expect(node["battles"]["people"].attribute?("snozzberry")).to eq(false)
end
it "does not allow you to set an attribute via method_missing" do
- lambda { node.sunshine = "is bright"}.should raise_error(Chef::Exceptions::ImmutableAttributeModification)
+ expect { node.sunshine = "is bright"}.to raise_error(Chef::Exceptions::ImmutableAttributeModification)
end
it "should allow you get get an attribute via method_missing" do
node.default.sunshine = "is bright"
- node.sunshine.should eql("is bright")
+ expect(node.sunshine).to eql("is bright")
end
describe "normal attributes" do
it "should allow you to set an attribute with set, without pre-declaring a hash" do
node.set[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set an attribute with set_unless" do
node.set_unless[:snoopy][:is_a_puppy] = false
- node[:snoopy][:is_a_puppy].should == false
+ expect(node[:snoopy][:is_a_puppy]).to eq(false)
end
it "should not allow you to set an attribute with set_unless if it already exists" do
node.set[:snoopy][:is_a_puppy] = true
node.set_unless[:snoopy][:is_a_puppy] = false
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set a value after a set_unless" do
# this tests for set_unless_present state bleeding between statements CHEF-3806
node.set_unless[:snoopy][:is_a_puppy] = false
node.set[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should let you set a value after a 'dangling' set_unless" do
@@ -196,43 +196,43 @@ describe Chef::Node do
node.set[:snoopy][:is_a_puppy] = "what"
node.set_unless[:snoopy][:is_a_puppy]
node.set[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "auto-vivifies attributes created via method syntax" do
node.set.fuu.bahrr.baz = "qux"
- node.fuu.bahrr.baz.should == "qux"
+ expect(node.fuu.bahrr.baz).to eq("qux")
end
it "should let you use tag as a convience method for the tags attribute" do
node.normal['tags'] = ['one', 'two']
node.tag('three', 'four')
- node['tags'].should == ['one', 'two', 'three', 'four']
+ expect(node['tags']).to eq(['one', 'two', 'three', 'four'])
end
end
describe "default attributes" do
it "should be set with default, without pre-declaring a hash" do
node.default[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set with default_unless without pre-declaring a hash" do
node.default_unless[:snoopy][:is_a_puppy] = false
- node[:snoopy][:is_a_puppy].should == false
+ expect(node[:snoopy][:is_a_puppy]).to eq(false)
end
it "should not allow you to set an attribute with default_unless if it already exists" do
node.default[:snoopy][:is_a_puppy] = true
node.default_unless[:snoopy][:is_a_puppy] = false
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set a value after a default_unless" do
# this tests for set_unless_present state bleeding between statements CHEF-3806
node.default_unless[:snoopy][:is_a_puppy] = false
node.default[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set a value after a 'dangling' default_unless" do
@@ -240,44 +240,37 @@ describe Chef::Node do
node.default[:snoopy][:is_a_puppy] = "what"
node.default_unless[:snoopy][:is_a_puppy]
node.default[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "auto-vivifies attributes created via method syntax" do
node.default.fuu.bahrr.baz = "qux"
- node.fuu.bahrr.baz.should == "qux"
+ expect(node.fuu.bahrr.baz).to eq("qux")
end
-
- it "accesses force defaults via default!" do
- node.default![:foo] = "wet bar"
- node.default[:foo] = "bar"
- node[:foo].should == "wet bar"
- end
-
end
describe "override attributes" do
it "should be set with override, without pre-declaring a hash" do
node.override[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set with override_unless without pre-declaring a hash" do
node.override_unless[:snoopy][:is_a_puppy] = false
- node[:snoopy][:is_a_puppy].should == false
+ expect(node[:snoopy][:is_a_puppy]).to eq(false)
end
it "should not allow you to set an attribute with override_unless if it already exists" do
node.override[:snoopy][:is_a_puppy] = true
node.override_unless[:snoopy][:is_a_puppy] = false
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set a value after an override_unless" do
# this tests for set_unless_present state bleeding between statements CHEF-3806
node.override_unless[:snoopy][:is_a_puppy] = false
node.override[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "should allow you to set a value after a 'dangling' override_unless" do
@@ -285,24 +278,341 @@ describe Chef::Node do
node.override_unless[:snoopy][:is_a_puppy] = "what"
node.override_unless[:snoopy][:is_a_puppy]
node.override[:snoopy][:is_a_puppy] = true
- node[:snoopy][:is_a_puppy].should == true
+ expect(node[:snoopy][:is_a_puppy]).to eq(true)
end
it "auto-vivifies attributes created via method syntax" do
node.override.fuu.bahrr.baz = "qux"
- node.fuu.bahrr.baz.should == "qux"
+ expect(node.fuu.bahrr.baz).to eq("qux")
end
+ end
+
+ describe "globally deleting attributes" do
+ context "with hash values" do
+ before do
+ node.role_default["mysql"]["server"]["port"] = 1234
+ node.normal["mysql"]["server"]["port"] = 2345
+ node.override["mysql"]["server"]["port"] = 3456
+ end
+
+ it "deletes all the values and returns the value with the highest precidence" do
+ expect( node.rm("mysql", "server", "port") ).to eql(3456)
+ expect( node["mysql"]["server"]["port"] ).to be_nil
+ expect( node["mysql"]["server"] ).to eql({})
+ end
+
+ it "deletes nested things correctly" do
+ node.default["mysql"]["client"]["client_setting"] = "foo"
+ expect( node.rm("mysql", "server") ).to eql( {"port" => 3456} )
+ expect( node["mysql"] ).to eql( { "client" => { "client_setting" => "foo" } } )
+ end
+
+ it "returns nil if the node attribute does not exist" do
+ expect( node.rm("no", "such", "thing") ).to be_nil
+ end
- it "sets force_overrides via override!" do
- node.override![:foo] = "wet bar"
- node.override[:foo] = "bar"
- node[:foo].should == "wet bar"
+ it "can delete the entire tree" do
+ expect( node.rm("mysql") ).to eql({"server"=>{"port"=>3456}})
+ end
end
+ context "when trying to delete through a thing that isn't an array-like or hash-like object" do
+ before do
+ node.default["mysql"] = true
+ end
+
+ it "returns nil when you're two levels deeper" do
+ expect( node.rm("mysql", "server", "port") ).to eql(nil)
+ end
+
+ it "returns nil when you're one level deeper" do
+ expect( node.rm("mysql", "server") ).to eql(nil)
+ end
+
+ it "correctly deletes at the top level" do
+ expect( node.rm("mysql") ).to eql(true)
+ end
+ end
+
+ context "with array indexes" do
+ before do
+ node.role_default["mysql"]["server"][0]["port"] = 1234
+ node.normal["mysql"]["server"][0]["port"] = 2345
+ node.override["mysql"]["server"][0]["port"] = 3456
+ node.override["mysql"]["server"][1]["port"] = 3456
+ end
+
+ it "deletes the array element" do
+ expect( node.rm("mysql", "server", 0, "port") ).to eql(3456)
+ expect( node["mysql"]["server"][0]["port"] ).to be_nil
+ expect( node["mysql"]["server"][1]["port"] ).to eql(3456)
+ end
+ end
+
+ context "with real arrays" do
+ before do
+ node.role_default["mysql"]["server"] = [ {
+ "port" => 1234,
+ } ]
+ node.normal["mysql"]["server"] = [ {
+ "port" => 2345,
+ } ]
+ node.override["mysql"]["server"] = [ {
+ "port" => 3456,
+ } ]
+ end
+
+ it "deletes the array element" do
+ expect( node.rm("mysql", "server", 0, "port") ).to eql(3456)
+ expect( node["mysql"]["server"][0]["port"] ).to be_nil
+ end
+
+ it "does not have a horrible error message when mistaking arrays for hashes" do
+ expect { node.rm("mysql", "server", "port") }.to raise_error(TypeError, "Wrong type in index of attribute (did you use a Hash index on an Array?)")
+ end
+ end
+ end
+
+ describe "granular deleting attributes" do
+ context "when only defaults exist" do
+ before do
+ node.role_default["mysql"]["server"]["port"] = 1234
+ node.default["mysql"]["server"]["port"] = 2345
+ node.force_default["mysql"]["server"]["port"] = 3456
+ end
+
+ it "returns the deleted values" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(3456)
+ end
+
+ it "returns nil for the combined attribues" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(3456)
+ expect( node["mysql"]["server"]["port"] ).to eql(nil)
+ end
+
+ it "returns an empty hash for the default attrs" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(3456)
+ # this auto-vivifies, should it?
+ expect( node.default_attrs["mysql"]["server"]["port"] ).to eql({})
+ end
+
+ it "returns an empty hash after the last key is deleted" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(3456)
+ expect( node["mysql"]["server"] ).to eql({})
+ end
+ end
+
+ context "when trying to delete through a thing that isn't an array-like or hash-like object" do
+ before do
+ node.default["mysql"] = true
+ end
+
+ it "returns nil when you're two levels deeper" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(nil)
+ end
+
+ it "returns nil when you're one level deeper" do
+ expect( node.rm_default("mysql", "server") ).to eql(nil)
+ end
+
+ it "correctly deletes at the top level" do
+ expect( node.rm_default("mysql") ).to eql(true)
+ end
+ end
+
+ context "when a higher precedence exists" do
+ before do
+ node.role_default["mysql"]["server"]["port"] = 1234
+ node.default["mysql"]["server"]["port"] = 2345
+ node.force_default["mysql"]["server"]["port"] = 3456
+
+ node.override["mysql"]["server"]["port"] = 9999
+ end
+
+ it "returns the deleted values" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(3456)
+ end
+
+ it "returns the higher precedence values after the delete" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(3456)
+ expect( node["mysql"]["server"]["port"] ).to eql(9999)
+ end
+
+ it "returns an empty has for the default attrs" do
+ expect( node.rm_default("mysql", "server", "port") ).to eql(3456)
+ # this auto-vivifies, should it?
+ expect( node.default_attrs["mysql"]["server"]["port"] ).to eql({})
+ end
+ end
+
+ context "when a lower precedence exists" do
+ before do
+ node.default["mysql"]["server"]["port"] = 2345
+ node.override["mysql"]["server"]["port"] = 9999
+ node.role_override["mysql"]["server"]["port"] = 9876
+ node.force_override["mysql"]["server"]["port"] = 6669
+ end
+
+ it "returns the deleted values" do
+ expect( node.rm_override("mysql", "server", "port") ).to eql(6669)
+ end
+
+ it "returns the lower precedence levels after the delete" do
+ expect( node.rm_override("mysql", "server", "port") ).to eql(6669)
+ expect( node["mysql"]["server"]["port"] ).to eql(2345)
+ end
+
+ it "returns an empty has for the override attrs" do
+ expect( node.rm_override("mysql", "server", "port") ).to eql(6669)
+ # this auto-vivifies, should it?
+ expect( node.override_attrs["mysql"]["server"]["port"] ).to eql({})
+ end
+ end
+
+ it "rm_default returns nil on deleting non-existent values" do
+ expect( node.rm_default("no", "such", "thing") ).to be_nil
+ end
+
+ it "rm_normal returns nil on deleting non-existent values" do
+ expect( node.rm_normal("no", "such", "thing") ).to be_nil
+ end
+
+ it "rm_override returns nil on deleting non-existent values" do
+ expect( node.rm_override("no", "such", "thing") ).to be_nil
+ end
+ end
+
+ describe "granular replacing attributes" do
+ it "removes everything at the level of the last key" do
+ node.default["mysql"]["server"]["port"] = 2345
+
+ node.default!["mysql"]["server"] = { "data_dir" => "/my_raid_volume/lib/mysql" }
+
+ expect( node["mysql"]["server"] ).to eql({ "data_dir" => "/my_raid_volume/lib/mysql" })
+ end
+
+ it "replaces a value at the cookbook sub-level of the atributes only" do
+ node.default["mysql"]["server"]["port"] = 2345
+ node.default["mysql"]["server"]["service_name"] = "fancypants-sql"
+ node.role_default["mysql"]["server"]["port"] = 1234
+ node.force_default["mysql"]["server"]["port"] = 3456
+
+ node.default!["mysql"]["server"] = { "data_dir" => "/my_raid_volume/lib/mysql" }
+
+ expect( node["mysql"]["server"]["port"] ).to eql(3456)
+ expect( node["mysql"]["server"]["service_name"] ).to be_nil
+ expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
+ expect( node["mysql"]["server"] ).to eql({ "port" => 3456, "data_dir" => "/my_raid_volume/lib/mysql" })
+ end
+
+ it "higher precedence values aren't removed" do
+ node.role_default["mysql"]["server"]["port"] = 1234
+ node.default["mysql"]["server"]["port"] = 2345
+ node.force_default["mysql"]["server"]["port"] = 3456
+ node.override["mysql"]["server"]["service_name"] = "fancypants-sql"
+
+ node.default!["mysql"]["server"] = { "data_dir" => "/my_raid_volume/lib/mysql" }
+
+ expect( node["mysql"]["server"]["port"] ).to eql(3456)
+ expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
+ expect( node["mysql"]["server"] ).to eql({ "service_name" => "fancypants-sql", "port" => 3456, "data_dir" => "/my_raid_volume/lib/mysql" })
+ end
+ end
+
+ describe "granular force replacing attributes" do
+ it "removes everything at the level of the last key" do
+ node.force_default["mysql"]["server"]["port"] = 2345
+
+ node.force_default!["mysql"]["server"] = {
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ }
+
+ expect( node["mysql"]["server"] ).to eql({
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ })
+ end
+
+ it "removes all values from the precedence level when setting" do
+ node.role_default["mysql"]["server"]["port"] = 1234
+ node.default["mysql"]["server"]["port"] = 2345
+ node.force_default["mysql"]["server"]["port"] = 3456
+
+ node.force_default!["mysql"]["server"] = {
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ }
+
+ expect( node["mysql"]["server"]["port"] ).to be_nil
+ expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
+ expect( node["mysql"]["server"] ).to eql({
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ })
+ end
+
+ it "higher precedence levels are not removed" do
+ node.role_default["mysql"]["server"]["port"] = 1234
+ node.default["mysql"]["server"]["port"] = 2345
+ node.force_default["mysql"]["server"]["port"] = 3456
+ node.override["mysql"]["server"]["service_name"] = "fancypants-sql"
+
+ node.force_default!["mysql"]["server"] = {
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ }
+
+ expect( node["mysql"]["server"]["port"] ).to be_nil
+ expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
+ expect( node["mysql"]["server"] ).to eql({
+ "service_name" => "fancypants-sql",
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ })
+ end
+
+ it "will autovivify" do
+ node.force_default!["mysql"]["server"] = {
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ }
+ expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
+ end
+
+ it "lower precedence levels aren't removed" do
+ node.role_override["mysql"]["server"]["port"] = 1234
+ node.override["mysql"]["server"]["port"] = 2345
+ node.force_override["mysql"]["server"]["port"] = 3456
+ node.default["mysql"]["server"]["service_name"] = "fancypants-sql"
+
+ node.force_override!["mysql"]["server"] = {
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ }
+
+ expect( node["mysql"]["server"]["port"] ).to be_nil
+ expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
+ expect( node["mysql"]["server"] ).to eql({
+ "service_name" => "fancypants-sql",
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ })
+ end
+
+ it "when overwriting a non-hash/array" do
+ node.override["mysql"] = false
+ node.force_override["mysql"] = true
+ node.force_override!["mysql"]["server"] = {
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ }
+ expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql")
+ end
+
+ it "when overwriting an array with a hash" do
+ node.force_override["mysql"][0] = true
+ node.force_override!["mysql"]["server"] = {
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ }
+ expect( node["mysql"]["server"] ).to eql({
+ "data_dir" => "/my_raid_volume/lib/mysql",
+ })
+ end
end
it "should raise an ArgumentError if you ask for an attribute that doesn't exist via method_missing" do
- lambda { node.sunshine }.should raise_error(NoMethodError)
+ expect { node.sunshine }.to raise_error(NoMethodError)
end
it "should allow you to iterate over attributes with each_attribute" do
@@ -312,10 +622,10 @@ describe Chef::Node do
node.each_attribute do |a,v|
seen_attributes[a] = v
end
- seen_attributes.should have_key("sunshine")
- seen_attributes.should have_key("canada")
- seen_attributes["sunshine"].should == "is bright"
- seen_attributes["canada"].should == "is a nice place"
+ expect(seen_attributes).to have_key("sunshine")
+ expect(seen_attributes).to have_key("canada")
+ expect(seen_attributes["sunshine"]).to eq("is bright")
+ expect(seen_attributes["canada"]).to eq("is a nice place")
end
end
@@ -327,62 +637,62 @@ describe Chef::Node do
it "consumes the run list portion of a collection of attributes and returns the remainder" do
attrs = {"run_list" => [ "role[base]", "recipe[chef::server]" ], "foo" => "bar"}
- node.consume_run_list(attrs).should == {"foo" => "bar"}
- node.run_list.should == [ "role[base]", "recipe[chef::server]" ]
+ expect(node.consume_run_list(attrs)).to eq({"foo" => "bar"})
+ expect(node.run_list).to eq([ "role[base]", "recipe[chef::server]" ])
end
it "should overwrites the run list with the run list it consumes" do
node.consume_run_list "recipes" => [ "one", "two" ]
node.consume_run_list "recipes" => [ "three" ]
- node.run_list.should == [ "three" ]
+ expect(node.run_list).to eq([ "three" ])
end
it "should not add duplicate recipes from the json attributes" do
node.run_list << "one"
node.consume_run_list "recipes" => [ "one", "two", "three" ]
- node.run_list.should == [ "one", "two", "three" ]
+ expect(node.run_list).to eq([ "one", "two", "three" ])
end
it "doesn't change the run list if no run_list is specified in the json" do
node.run_list << "role[database]"
node.consume_run_list "foo" => "bar"
- node.run_list.should == ["role[database]"]
+ expect(node.run_list).to eq(["role[database]"])
end
it "raises an exception if you provide both recipe and run_list attributes, since this is ambiguous" do
- lambda { node.consume_run_list "recipes" => "stuff", "run_list" => "other_stuff" }.should raise_error(Chef::Exceptions::AmbiguousRunlistSpecification)
+ expect { node.consume_run_list "recipes" => "stuff", "run_list" => "other_stuff" }.to raise_error(Chef::Exceptions::AmbiguousRunlistSpecification)
end
it "should add json attributes to the node" do
node.consume_external_attrs(@ohai_data, {"one" => "two", "three" => "four"})
- node.one.should eql("two")
- node.three.should eql("four")
+ expect(node.one).to eql("two")
+ expect(node.three).to eql("four")
end
it "should set the tags attribute to an empty array if it is not already defined" do
node.consume_external_attrs(@ohai_data, {})
- node.tags.should eql([])
+ expect(node.tags).to eql([])
end
it "should not set the tags attribute to an empty array if it is already defined" do
node.normal[:tags] = [ "radiohead" ]
node.consume_external_attrs(@ohai_data, {})
- node.tags.should eql([ "radiohead" ])
+ expect(node.tags).to eql([ "radiohead" ])
end
it "deep merges attributes instead of overwriting them" do
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"three" => "four"}})
- node.one.to_hash.should == {"two" => {"three" => "four"}}
+ expect(node.one.to_hash).to eq({"two" => {"three" => "four"}})
node.consume_external_attrs(@ohai_data, "one" => {"abc" => "123"})
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"foo" => "bar"}})
- node.one.to_hash.should == {"two" => {"three" => "four", "foo" => "bar"}, "abc" => "123"}
+ expect(node.one.to_hash).to eq({"two" => {"three" => "four", "foo" => "bar"}, "abc" => "123"})
end
it "gives attributes from JSON priority when deep merging" do
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"three" => "four"}})
- node.one.to_hash.should == {"two" => {"three" => "four"}}
+ expect(node.one.to_hash).to eq({"two" => {"three" => "four"}})
node.consume_external_attrs(@ohai_data, "one" => {"two" => {"three" => "forty-two"}})
- node.one.to_hash.should == {"two" => {"three" => "forty-two"}}
+ expect(node.one.to_hash).to eq({"two" => {"three" => "forty-two"}})
end
end
@@ -394,21 +704,21 @@ describe Chef::Node do
it "sets its platform according to platform detection" do
node.consume_external_attrs(@ohai_data, {})
- node.automatic_attrs[:platform].should == 'foobuntu'
- node.automatic_attrs[:platform_version].should == '23.42'
+ expect(node.automatic_attrs[:platform]).to eq('foobuntu')
+ expect(node.automatic_attrs[:platform_version]).to eq('23.42')
end
it "consumes the run list from provided json attributes" do
node.consume_external_attrs(@ohai_data, {"run_list" => ['recipe[unicorn]']})
- node.run_list.should == ['recipe[unicorn]']
+ expect(node.run_list).to eq(['recipe[unicorn]'])
end
it "saves non-runlist json attrs for later" do
expansion = Chef::RunList::RunListExpansion.new('_default', [])
- node.run_list.stub(:expand).and_return(expansion)
+ allow(node.run_list).to receive(:expand).and_return(expansion)
node.consume_external_attrs(@ohai_data, {"foo" => "bar"})
node.expand!
- node.normal_attrs.should == {"foo" => "bar", "tags" => []}
+ expect(node.normal_attrs).to eq({"foo" => "bar", "tags" => []})
end
end
@@ -420,44 +730,44 @@ describe Chef::Node do
e.default_attributes("env default key" => "env default value")
e.override_attributes("env override key" => "env override value")
end
- Chef::Environment.should_receive(:load).with("rspec_env").and_return(@environment)
+ expect(Chef::Environment).to receive(:load).with("rspec_env").and_return(@environment)
@expansion = Chef::RunList::RunListExpansion.new("rspec_env", [])
node.chef_environment("rspec_env")
- node.run_list.stub(:expand).and_return(@expansion)
+ allow(node.run_list).to receive(:expand).and_return(@expansion)
end
it "sets the 'recipes' automatic attribute to the recipes in the expanded run_list" do
@expansion.recipes << 'recipe[chef::client]' << 'recipe[nginx::default]'
node.expand!
- node.automatic_attrs[:recipes].should == ['recipe[chef::client]', 'recipe[nginx::default]']
+ expect(node.automatic_attrs[:recipes]).to eq(['recipe[chef::client]', 'recipe[nginx::default]'])
end
it "sets the 'roles' automatic attribute to the expanded role list" do
@expansion.instance_variable_set(:@applied_roles, {'arf' => nil, 'countersnark' => nil})
node.expand!
- node.automatic_attrs[:roles].sort.should == ['arf', 'countersnark']
+ expect(node.automatic_attrs[:roles].sort).to eq(['arf', 'countersnark'])
end
it "applies default attributes from the environment as environment defaults" do
node.expand!
- node.attributes.env_default["env default key"].should == "env default value"
+ expect(node.attributes.env_default["env default key"]).to eq("env default value")
end
it "applies override attributes from the environment as env overrides" do
node.expand!
- node.attributes.env_override["env override key"].should == "env override value"
+ expect(node.attributes.env_override["env override key"]).to eq("env override value")
end
it "applies default attributes from roles as role defaults" do
@expansion.default_attrs["role default key"] = "role default value"
node.expand!
- node.attributes.role_default["role default key"].should == "role default value"
+ expect(node.attributes.role_default["role default key"]).to eq("role default value")
end
it "applies override attributes from roles as role overrides" do
@expansion.override_attrs["role override key"] = "role override value"
node.expand!
- node.attributes.role_override["role override key"].should == "role override value"
+ expect(node.attributes.role_override["role override key"]).to eq("role override value")
end
end
@@ -472,8 +782,8 @@ describe Chef::Node do
node.automatic_attrs[:recipes] = [ "nginx::other_module" ]
node.loaded_recipe(:nginx, "module")
expect(node.automatic_attrs[:recipes].length).to eq(2)
- expect(node.recipe?("nginx::module")).to be_true
- expect(node.recipe?("nginx::other_module")).to be_true
+ expect(node.recipe?("nginx::module")).to be true
+ expect(node.recipe?("nginx::other_module")).to be true
end
end
@@ -484,11 +794,11 @@ describe Chef::Node do
end
it "finds the recipe" do
- node.recipe?("nginx::module").should be_true
+ expect(node.recipe?("nginx::module")).to be true
end
it "does not find a recipe not in the run list" do
- node.recipe?("nginx::other_module").should be_false
+ expect(node.recipe?("nginx::other_module")).to be false
end
end
context "when a recipe is in the expanded run list only" do
@@ -498,11 +808,11 @@ describe Chef::Node do
end
it "finds a recipe in the expanded run list" do
- node.recipe?("nginx::module").should be_true
+ expect(node.recipe?("nginx::module")).to be true
end
it "does not find a recipe that's not in the run list" do
- node.recipe?("nginx::other_module").should be_false
+ expect(node.recipe?("nginx::other_module")).to be false
end
end
end
@@ -516,15 +826,15 @@ describe Chef::Node do
end
it "removes default attributes" do
- node.default.should be_empty
+ expect(node.default).to be_empty
end
it "removes override attributes" do
- node.override.should be_empty
+ expect(node.override).to be_empty
end
it "leaves normal level attributes untouched" do
- node[:foo].should == "normal"
+ expect(node[:foo]).to eq("normal")
end
end
@@ -536,36 +846,35 @@ describe Chef::Node do
@expansion.default_attrs.replace({:default => "from role", :d_role => "role only"})
@expansion.override_attrs.replace({:override => "from role", :o_role => "role only"})
-
@environment = Chef::Environment.new
@environment.default_attributes = {:default => "from env", :d_env => "env only" }
@environment.override_attributes = {:override => "from env", :o_env => "env only"}
- Chef::Environment.stub(:load).and_return(@environment)
+ allow(Chef::Environment).to receive(:load).and_return(@environment)
node.apply_expansion_attributes(@expansion)
end
it "does not nuke role-only default attrs" do
- node[:d_role].should == "role only"
+ expect(node[:d_role]).to eq("role only")
end
it "does not nuke role-only override attrs" do
- node[:o_role].should == "role only"
+ expect(node[:o_role]).to eq("role only")
end
it "does not nuke env-only default attrs" do
- node[:o_env].should == "env only"
+ expect(node[:o_env]).to eq("env only")
end
it "does not nuke role-only override attrs" do
- node[:o_env].should == "env only"
+ expect(node[:o_env]).to eq("env only")
end
it "gives role defaults precedence over env defaults" do
- node[:default].should == "from role"
+ expect(node[:default]).to eq("from role")
end
it "gives env overrides precedence over role overrides" do
- node[:override].should == "from env"
+ expect(node[:override]).to eq("from env")
end
end
@@ -585,60 +894,60 @@ describe Chef::Node do
end
it "sets attributes from the files" do
- node.ldap_server.should eql("ops1prod")
- node.ldap_basedn.should eql("dc=hjksolutions,dc=com")
- node.ldap_replication_password.should eql("forsure")
- node.smokey.should eql("robinson")
+ expect(node.ldap_server).to eql("ops1prod")
+ expect(node.ldap_basedn).to eql("dc=hjksolutions,dc=com")
+ expect(node.ldap_replication_password).to eql("forsure")
+ expect(node.smokey).to eql("robinson")
end
it "gives a sensible error when attempting to load a missing attributes file" do
- lambda { node.include_attribute("nope-this::doesnt-exist") }.should raise_error(Chef::Exceptions::CookbookNotFound)
+ expect { node.include_attribute("nope-this::doesnt-exist") }.to raise_error(Chef::Exceptions::CookbookNotFound)
end
end
describe "roles" do
it "should allow you to query whether or not it has a recipe applied with role?" do
node.run_list << "role[sunrise]"
- node.role?("sunrise").should eql(true)
- node.role?("not at home").should eql(false)
+ expect(node.role?("sunrise")).to eql(true)
+ expect(node.role?("not at home")).to eql(false)
end
it "should allow you to set roles with arguments" do
node.run_list << "role[one]"
node.run_list << "role[two]"
- node.role?("one").should eql(true)
- node.role?("two").should eql(true)
+ expect(node.role?("one")).to eql(true)
+ expect(node.role?("two")).to eql(true)
end
end
describe "run_list" do
it "should have a Chef::RunList of recipes and roles that should be applied" do
- node.run_list.should be_a_kind_of(Chef::RunList)
+ expect(node.run_list).to be_a_kind_of(Chef::RunList)
end
it "should allow you to query the run list with arguments" do
node.run_list "recipe[baz]"
- node.run_list?("recipe[baz]").should eql(true)
+ expect(node.run_list?("recipe[baz]")).to eql(true)
end
it "should allow you to set the run list with arguments" do
node.run_list "recipe[baz]", "role[foo]"
- node.run_list?("recipe[baz]").should eql(true)
- node.run_list?("role[foo]").should eql(true)
+ expect(node.run_list?("recipe[baz]")).to eql(true)
+ expect(node.run_list?("role[foo]")).to eql(true)
end
end
describe "from file" do
it "should load a node from a ruby file" do
node.from_file(File.expand_path(File.join(CHEF_SPEC_DATA, "nodes", "test.rb")))
- node.name.should eql("test.example.com-short")
- node.sunshine.should eql("in")
- node.something.should eql("else")
- node.run_list.should == ["operations-master", "operations-monitoring"]
+ expect(node.name).to eql("test.example.com-short")
+ expect(node.sunshine).to eql("in")
+ expect(node.something).to eql("else")
+ expect(node.run_list).to eq(["operations-master", "operations-monitoring"])
end
it "should raise an exception if the file cannot be found or read" do
- lambda { node.from_file("/tmp/monkeydiving") }.should raise_error(IOError)
+ expect { node.from_file("/tmp/monkeydiving") }.to raise_error(IOError)
end
end
@@ -666,16 +975,16 @@ describe Chef::Node do
it "allows update of everything except name" do
node.update_from!(@example)
- node.name.should == "orig"
- node.chef_environment.should == @example.chef_environment
- node.default_attrs.should == @example.default_attrs
- node.override_attrs.should == @example.override_attrs
- node.normal_attrs.should == @example.normal_attrs
- node.run_list.should == @example.run_list
+ expect(node.name).to eq("orig")
+ expect(node.chef_environment).to eq(@example.chef_environment)
+ expect(node.default_attrs).to eq(@example.default_attrs)
+ expect(node.override_attrs).to eq(@example.override_attrs)
+ expect(node.normal_attrs).to eq(@example.normal_attrs)
+ expect(node.run_list).to eq(@example.run_list)
end
it "should not update the name of the node" do
- node.should_not_receive(:name).with(@example.name)
+ expect(node).not_to receive(:name).with(@example.name)
node.update_from!(@example)
end
end
@@ -690,15 +999,19 @@ describe Chef::Node do
node.run_list << "role[leninist]"
node.run_list << "recipe[stalinist]"
h = node.to_hash
- h["one"]["two"].should == "three"
- h["one"]["four"].should == "six"
- h["one"]["eight"].should == "nine"
- h["role"].should be_include("marxist")
- h["role"].should be_include("leninist")
- h["run_list"].should be_include("role[marxist]")
- h["run_list"].should be_include("role[leninist]")
- h["run_list"].should be_include("recipe[stalinist]")
- h["chef_environment"].should == "dev"
+ expect(h["one"]["two"]).to eq("three")
+ expect(h["one"]["four"]).to eq("six")
+ expect(h["one"]["eight"]).to eq("nine")
+ expect(h["role"]).to be_include("marxist")
+ expect(h["role"]).to be_include("leninist")
+ expect(h["run_list"]).to be_include("role[marxist]")
+ expect(h["run_list"]).to be_include("role[leninist]")
+ expect(h["run_list"]).to be_include("recipe[stalinist]")
+ expect(h["chef_environment"]).to eq("dev")
+ end
+
+ it 'should return an empty array for empty run_list' do
+ expect(node.to_hash["run_list"]).to eq([])
end
end
@@ -706,13 +1019,13 @@ describe Chef::Node do
it "should serialize itself as json", :json => true do
node.from_file(File.expand_path("nodes/test.example.com.rb", CHEF_SPEC_DATA))
json = Chef::JSONCompat.to_json(node)
- json.should =~ /json_class/
- json.should =~ /name/
- json.should =~ /chef_environment/
- json.should =~ /normal/
- json.should =~ /default/
- json.should =~ /override/
- json.should =~ /run_list/
+ expect(json).to match(/json_class/)
+ expect(json).to match(/name/)
+ expect(json).to match(/chef_environment/)
+ expect(json).to match(/normal/)
+ expect(json).to match(/default/)
+ expect(json).to match(/override/)
+ expect(json).to match(/run_list/)
end
it 'should serialize valid json with a run list', :json => true do
@@ -721,46 +1034,45 @@ describe Chef::Node do
node.run_list << {"type" => "role", "name" => 'Cthulu'}
node.run_list << {"type" => "role", "name" => 'Hastur'}
json = Chef::JSONCompat.to_json(node)
- json.should =~ /\"run_list\":\[\"role\[Cthulu\]\",\"role\[Hastur\]\"\]/
+ expect(json).to match(/\"run_list\":\[\"role\[Cthulu\]\",\"role\[Hastur\]\"\]/)
end
it "should serialize the correct run list", :json => true do
node.run_list << "role[marxist]"
node.run_list << "role[leninist]"
node.override_runlist << "role[stalinist]"
- node.run_list.should be_include("role[stalinist]")
+ expect(node.run_list).to be_include("role[stalinist]")
json = Chef::JSONCompat.to_json(node)
- json.should =~ /\"run_list\":\[\"role\[marxist\]\",\"role\[leninist\]\"\]/
+ expect(json).to match(/\"run_list\":\[\"role\[marxist\]\",\"role\[leninist\]\"\]/)
end
it "merges the override components into a combined override object" do
node.attributes.role_override["role override"] = "role override"
node.attributes.env_override["env override"] = "env override"
node_for_json = node.for_json
- node_for_json["override"]["role override"].should == "role override"
- node_for_json["override"]["env override"].should == "env override"
+ expect(node_for_json["override"]["role override"]).to eq("role override")
+ expect(node_for_json["override"]["env override"]).to eq("env override")
end
it "merges the default components into a combined default object" do
node.attributes.role_default["role default"] = "role default"
node.attributes.env_default["env default"] = "env default"
node_for_json = node.for_json
- node_for_json["default"]["role default"].should == "role default"
- node_for_json["default"]["env default"].should == "env default"
+ expect(node_for_json["default"]["role default"]).to eq("role default")
+ expect(node_for_json["default"]["env default"]).to eq("env default")
end
-
it "should deserialize itself from json", :json => true do
node.from_file(File.expand_path("nodes/test.example.com.rb", CHEF_SPEC_DATA))
json = Chef::JSONCompat.to_json(node)
serialized_node = Chef::JSONCompat.from_json(json)
- serialized_node.should be_a_kind_of(Chef::Node)
- serialized_node.name.should eql(node.name)
- serialized_node.chef_environment.should eql(node.chef_environment)
+ expect(serialized_node).to be_a_kind_of(Chef::Node)
+ expect(serialized_node.name).to eql(node.name)
+ expect(serialized_node.chef_environment).to eql(node.chef_environment)
node.each_attribute do |k,v|
- serialized_node[k].should eql(v)
+ expect(serialized_node[k]).to eql(v)
end
- serialized_node.run_list.should == node.run_list
+ expect(serialized_node.run_list).to eq(node.run_list)
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
@@ -774,45 +1086,45 @@ describe Chef::Node do
describe "to_s" do
it "should turn into a string like node[name]" do
node.name("airplane")
- node.to_s.should eql("node[airplane]")
+ expect(node.to_s).to eql("node[airplane]")
end
end
describe "api model" do
before(:each) do
@rest = double("Chef::REST")
- Chef::REST.stub(:new).and_return(@rest)
+ allow(Chef::REST).to receive(:new).and_return(@rest)
@query = double("Chef::Search::Query")
- Chef::Search::Query.stub(:new).and_return(@query)
+ allow(Chef::Search::Query).to receive(:new).and_return(@query)
end
describe "list" do
describe "inflated" do
it "should return a hash of node names and objects" do
n1 = double("Chef::Node", :name => "one")
- @query.should_receive(:search).with(:node).and_yield(n1)
+ expect(@query).to receive(:search).with(:node).and_yield(n1)
r = Chef::Node.list(true)
- r["one"].should == n1
+ expect(r["one"]).to eq(n1)
end
end
it "should return a hash of node names and urls" do
- @rest.should_receive(:get_rest).and_return({ "one" => "http://foo" })
+ expect(@rest).to receive(:get_rest).and_return({ "one" => "http://foo" })
r = Chef::Node.list
- r["one"].should == "http://foo"
+ expect(r["one"]).to eq("http://foo")
end
end
describe "load" do
it "should load a node by name" do
- @rest.should_receive(:get_rest).with("nodes/monkey").and_return("foo")
- Chef::Node.load("monkey").should == "foo"
+ expect(@rest).to receive(:get_rest).with("nodes/monkey").and_return("foo")
+ expect(Chef::Node.load("monkey")).to eq("foo")
end
end
describe "destroy" do
it "should destroy a node" do
- @rest.should_receive(:delete_rest).with("nodes/monkey").and_return("foo")
+ expect(@rest).to receive(:delete_rest).with("nodes/monkey").and_return("foo")
node.name("monkey")
node.destroy
end
@@ -821,25 +1133,25 @@ describe Chef::Node do
describe "save" do
it "should update a node if it already exists" do
node.name("monkey")
- node.stub(:data_for_save).and_return({})
- @rest.should_receive(:put_rest).with("nodes/monkey", {}).and_return("foo")
+ allow(node).to receive(:data_for_save).and_return({})
+ expect(@rest).to receive(:put_rest).with("nodes/monkey", {}).and_return("foo")
node.save
end
it "should not try and create if it can update" do
node.name("monkey")
- node.stub(:data_for_save).and_return({})
- @rest.should_receive(:put_rest).with("nodes/monkey", {}).and_return("foo")
- @rest.should_not_receive(:post_rest)
+ allow(node).to receive(:data_for_save).and_return({})
+ expect(@rest).to receive(:put_rest).with("nodes/monkey", {}).and_return("foo")
+ expect(@rest).not_to receive(:post_rest)
node.save
end
it "should create if it cannot update" do
node.name("monkey")
- node.stub(:data_for_save).and_return({})
+ allow(node).to receive(:data_for_save).and_return({})
exception = double("404 error", :code => "404")
- @rest.should_receive(:put_rest).and_raise(Net::HTTPServerException.new("foo", exception))
- @rest.should_receive(:post_rest).with("nodes", {})
+ expect(@rest).to receive(:put_rest).and_raise(Net::HTTPServerException.new("foo", exception))
+ expect(@rest).to receive(:post_rest).with("nodes", {})
node.save
end
@@ -852,8 +1164,8 @@ describe Chef::Node do
end
it "should not save" do
node.name("monkey")
- @rest.should_not_receive(:put_rest)
- @rest.should_not_receive(:post_rest)
+ expect(@rest).not_to receive(:put_rest)
+ expect(@rest).not_to receive(:post_rest)
node.save
end
end
@@ -896,8 +1208,8 @@ describe Chef::Node do
}
node.name("picky-monkey")
- node.stub(:for_json).and_return(data)
- @rest.should_receive(:put_rest).with("nodes/picky-monkey", selected_data).and_return("foo")
+ allow(node).to receive(:for_json).and_return(data)
+ expect(@rest).to receive(:put_rest).with("nodes/picky-monkey", selected_data).and_return("foo")
node.save
end
@@ -919,8 +1231,8 @@ describe Chef::Node do
}
node.name("picky-monkey")
- node.stub(:for_json).and_return(data)
- @rest.should_receive(:put_rest).with("nodes/picky-monkey", selected_data).and_return("foo")
+ allow(node).to receive(:for_json).and_return(data)
+ expect(@rest).to receive(:put_rest).with("nodes/picky-monkey", selected_data).and_return("foo")
node.save
end
end
diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb
index 6adea5eecf..7aafc287ea 100644
--- a/spec/unit/platform/query_helpers_spec.rb
+++ b/spec/unit/platform/query_helpers_spec.rb
@@ -20,9 +20,9 @@ require 'spec_helper'
describe "Chef::Platform#windows_server_2003?" do
it "returns false early when not on windows" do
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
expect(Chef::Platform).not_to receive(:require)
- expect(Chef::Platform.windows_server_2003?).to be_false
+ expect(Chef::Platform.windows_server_2003?).to be_falsey
end
# CHEF-4888: Need to call WIN32OLE.ole_initialize in new threads
@@ -34,14 +34,14 @@ end
describe 'Chef::Platform#supports_dsc?' do
it 'returns false if powershell is not present' do
node = Chef::Node.new
- Chef::Platform.supports_dsc?(node).should be_false
+ expect(Chef::Platform.supports_dsc?(node)).to be_falsey
end
['1.0', '2.0', '3.0'].each do |version|
it "returns false for Powershell #{version}" do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = version
- Chef::Platform.supports_dsc?(node).should be_false
+ expect(Chef::Platform.supports_dsc?(node)).to be_falsey
end
end
@@ -49,7 +49,7 @@ describe 'Chef::Platform#supports_dsc?' do
it "returns true for Powershell #{version}" do
node = Chef::Node.new
node.automatic[:languages][:powershell][:version] = version
- Chef::Platform.supports_dsc?(node).should be_true
+ expect(Chef::Platform.supports_dsc?(node)).to be_truthy
end
end
end
diff --git a/spec/unit/platform_spec.rb b/spec/unit/platform_spec.rb
index 9a65cbe878..fb65ef0fea 100644
--- a/spec/unit/platform_spec.rb
+++ b/spec/unit/platform_spec.rb
@@ -41,7 +41,7 @@ describe "Chef::Platform supports" do
:ibm_powerkvm
].each do |platform|
it "#{platform}" do
- Chef::Platform.platforms.should have_key(platform)
+ expect(Chef::Platform.platforms).to have_key(platform)
end
end
end
@@ -86,57 +86,57 @@ describe Chef::Platform do
it "should allow you to look up a platform by name and version, returning the provider map for it" do
pmap = Chef::Platform.find("Darwin", "9.2.2")
- pmap.should be_a_kind_of(Hash)
- pmap[:file].should eql("darwinian")
+ expect(pmap).to be_a_kind_of(Hash)
+ expect(pmap[:file]).to eql("darwinian")
end
it "should allow you to look up a platform by name and version using \"greater than\" style operators" do
pmap = Chef::Platform.find("Darwin", "11.1.0")
- pmap.should be_a_kind_of(Hash)
- pmap[:file].should eql("new_darwinian")
+ expect(pmap).to be_a_kind_of(Hash)
+ expect(pmap[:file]).to eql("new_darwinian")
end
it "should use the default providers for an os if the specific version does not exist" do
pmap = Chef::Platform.find("Darwin", "1")
- pmap.should be_a_kind_of(Hash)
- pmap[:file].should eql("old school")
+ expect(pmap).to be_a_kind_of(Hash)
+ expect(pmap[:file]).to eql("old school")
end
it "should use the default providers if the os doesn't give me a default, but does exist" do
pmap = Chef::Platform.find("mars_volta", "1")
- pmap.should be_a_kind_of(Hash)
- pmap[:file].should eql(Chef::Provider::File)
+ expect(pmap).to be_a_kind_of(Hash)
+ expect(pmap[:file]).to eql(Chef::Provider::File)
end
it "should use the default provider if the os does not exist" do
pmap = Chef::Platform.find("AIX", "1")
- pmap.should be_a_kind_of(Hash)
- pmap[:file].should eql(Chef::Provider::File)
+ expect(pmap).to be_a_kind_of(Hash)
+ expect(pmap[:file]).to eql(Chef::Provider::File)
end
it "should merge the defaults for an os with the specific version" do
pmap = Chef::Platform.find("Darwin", "9.2.2")
- pmap[:file].should eql("darwinian")
- pmap[:snicker].should eql("snack")
+ expect(pmap[:file]).to eql("darwinian")
+ expect(pmap[:snicker]).to eql("snack")
end
it "should merge the defaults for an os with the universal defaults" do
pmap = Chef::Platform.find("Darwin", "9.2.2")
- pmap[:file].should eql("darwinian")
- pmap[:pax].should eql("brittania")
+ expect(pmap[:file]).to eql("darwinian")
+ expect(pmap[:pax]).to eql("brittania")
end
it "should allow you to look up a provider for a platform directly by symbol" do
- Chef::Platform.find_provider("Darwin", "9.2.2", :file).should eql("darwinian")
+ expect(Chef::Platform.find_provider("Darwin", "9.2.2", :file)).to eql("darwinian")
end
it "should raise an exception if a provider cannot be found for a resource type" do
- lambda { Chef::Platform.find_provider("Darwin", "9.2.2", :coffee) }.should raise_error(ArgumentError)
+ expect { Chef::Platform.find_provider("Darwin", "9.2.2", :coffee) }.to raise_error(ArgumentError)
end
it "should look up a provider for a resource with a Chef::Resource object" do
kitty = Chef::Resource::Cat.new("loulou")
- Chef::Platform.find_provider("Darwin", "9.2.2", kitty).should eql("nice")
+ expect(Chef::Platform.find_provider("Darwin", "9.2.2", kitty)).to eql("nice")
end
it "should look up a provider with a node and a Chef::Resource object" do
@@ -145,21 +145,21 @@ describe Chef::Platform do
node.name("Intel")
node.automatic_attrs[:platform] = "mac_os_x"
node.automatic_attrs[:platform_version] = "9.2.2"
- Chef::Platform.find_provider_for_node(node, kitty).should eql("nice")
+ expect(Chef::Platform.find_provider_for_node(node, kitty)).to eql("nice")
end
it "should not throw an exception when the platform version has an unknown format" do
- Chef::Platform.find_provider(:darwin, "bad-version", :file).should eql("old school")
+ expect(Chef::Platform.find_provider(:darwin, "bad-version", :file)).to eql("old school")
end
it "should prefer an explicit provider" do
kitty = Chef::Resource::Cat.new("loulou")
- kitty.stub(:provider).and_return(Chef::Provider::File)
+ allow(kitty).to receive(:provider).and_return(Chef::Provider::File)
node = Chef::Node.new
node.name("Intel")
node.automatic_attrs[:platform] = "mac_os_x"
node.automatic_attrs[:platform_version] = "9.2.2"
- Chef::Platform.find_provider_for_node(node, kitty).should eql(Chef::Provider::File)
+ expect(Chef::Platform.find_provider_for_node(node, kitty)).to eql(Chef::Provider::File)
end
it "should look up a provider based on the resource name if nothing else matches" do
@@ -170,7 +170,7 @@ describe Chef::Platform do
node.name("Intel")
node.automatic_attrs[:platform] = "mac_os_x"
node.automatic_attrs[:platform_version] = "8.5"
- Chef::Platform.find_provider_for_node(node, kitty).should eql(Chef::Provider::Cat)
+ expect(Chef::Platform.find_provider_for_node(node, kitty)).to eql(Chef::Provider::Cat)
end
def setup_file_resource
@@ -184,26 +184,26 @@ describe Chef::Platform do
it "returns a provider object given a Chef::Resource object which has a valid run context and an action" do
file, run_context = setup_file_resource
provider = Chef::Platform.provider_for_resource(file, :foo)
- provider.should be_an_instance_of(Chef::Provider::File)
- provider.new_resource.should equal(file)
- provider.run_context.should equal(run_context)
+ expect(provider).to be_an_instance_of(Chef::Provider::File)
+ expect(provider.new_resource).to equal(file)
+ expect(provider.run_context).to equal(run_context)
end
it "returns a provider object given a Chef::Resource object which has a valid run context without an action" do
file, run_context = setup_file_resource
provider = Chef::Platform.provider_for_resource(file)
- provider.should be_an_instance_of(Chef::Provider::File)
- provider.new_resource.should equal(file)
- provider.run_context.should equal(run_context)
+ expect(provider).to be_an_instance_of(Chef::Provider::File)
+ expect(provider.new_resource).to equal(file)
+ expect(provider.run_context).to equal(run_context)
end
it "raises an error when trying to find the provider for a resource with no run context" do
file = Chef::Resource::File.new("whateva")
- lambda {Chef::Platform.provider_for_resource(file)}.should raise_error(ArgumentError)
+ expect {Chef::Platform.provider_for_resource(file)}.to raise_error(ArgumentError)
end
it "does not support finding a provider by resource and node -- a run context is required" do
- lambda {Chef::Platform.provider_for_node('node', 'resource')}.should raise_error(NotImplementedError)
+ expect {Chef::Platform.provider_for_node('node', 'resource')}.to raise_error(NotImplementedError)
end
it "should update the provider map with map" do
@@ -213,18 +213,18 @@ describe Chef::Platform do
:resource => :file,
:provider => "masterful"
)
- Chef::Platform.platforms[:darwin]["9.2.2"][:file].should eql("masterful")
+ expect(Chef::Platform.platforms[:darwin]["9.2.2"][:file]).to eql("masterful")
Chef::Platform.set(
:platform => :darwin,
:resource => :file,
:provider => "masterful"
)
- Chef::Platform.platforms[:darwin][:default][:file].should eql("masterful")
+ expect(Chef::Platform.platforms[:darwin][:default][:file]).to eql("masterful")
Chef::Platform.set(
:resource => :file,
:provider => "masterful"
)
- Chef::Platform.platforms[:default][:file].should eql("masterful")
+ expect(Chef::Platform.platforms[:default][:file]).to eql("masterful")
Chef::Platform.set(
:platform => :hero,
@@ -232,13 +232,13 @@ describe Chef::Platform do
:resource => :file,
:provider => "masterful"
)
- Chef::Platform.platforms[:hero]["9.2.2"][:file].should eql("masterful")
+ expect(Chef::Platform.platforms[:hero]["9.2.2"][:file]).to eql("masterful")
Chef::Platform.set(
:resource => :file,
:provider => "masterful"
)
- Chef::Platform.platforms[:default][:file].should eql("masterful")
+ expect(Chef::Platform.platforms[:default][:file]).to eql("masterful")
Chef::Platform.platforms = {}
@@ -246,11 +246,11 @@ describe Chef::Platform do
:resource => :file,
:provider => "masterful"
)
- Chef::Platform.platforms[:default][:file].should eql("masterful")
+ expect(Chef::Platform.platforms[:default][:file]).to eql("masterful")
Chef::Platform.platforms = { :neurosis => {} }
Chef::Platform.set(:platform => :neurosis, :resource => :package, :provider => "masterful")
- Chef::Platform.platforms[:neurosis][:default][:package].should eql("masterful")
+ expect(Chef::Platform.platforms[:neurosis][:default][:package]).to eql("masterful")
end
@@ -260,8 +260,8 @@ describe Chef::Platform do
:platform => :default,
:provider => "new school"
)
- Chef::Platform.platforms[:default][:file].should eql("new school")
- Chef::Platform.platforms[:default][:cat].should eql("nice")
+ expect(Chef::Platform.platforms[:default][:file]).to eql("new school")
+ expect(Chef::Platform.platforms[:default][:cat]).to eql("nice")
end
end
@@ -270,36 +270,36 @@ describe Chef::Platform do
it "should use the solaris package provider on Solaris <11" do
pmap = Chef::Platform.find("Solaris2", "5.9")
- pmap[:package].should eql(Chef::Provider::Package::Solaris)
+ expect(pmap[:package]).to eql(Chef::Provider::Package::Solaris)
end
it "should use the IPS package provider on Solaris 11" do
pmap = Chef::Platform.find("Solaris2", "5.11")
- pmap[:package].should eql(Chef::Provider::Package::Ips)
+ expect(pmap[:package]).to eql(Chef::Provider::Package::Ips)
end
it "should use the Redhat service provider on SLES11" do
1.upto(3) do |sp|
pmap = Chef::Platform.find("SUSE", "11.#{sp}")
- pmap[:service].should eql(Chef::Provider::Service::Redhat)
+ expect(pmap[:service]).to eql(Chef::Provider::Service::Redhat)
end
end
it "should use the Systemd service provider on SLES12" do
pmap = Chef::Platform.find("SUSE", "12.0")
- pmap[:service].should eql(Chef::Provider::Service::Systemd)
+ expect(pmap[:service]).to eql(Chef::Provider::Service::Systemd)
end
it "should use the SUSE group provider on SLES11" do
1.upto(3) do |sp|
pmap = Chef::Platform.find("SUSE", "11.#{sp}")
- pmap[:group].should eql(Chef::Provider::Group::Suse)
+ expect(pmap[:group]).to eql(Chef::Provider::Group::Suse)
end
end
it "should use the Gpasswd group provider on SLES12" do
pmap = Chef::Platform.find("SUSE", "12.0")
- pmap[:group].should eql(Chef::Provider::Group::Gpasswd)
+ expect(pmap[:group]).to eql(Chef::Provider::Group::Gpasswd)
end
end
diff --git a/spec/unit/policy_builder/expand_node_object_spec.rb b/spec/unit/policy_builder/expand_node_object_spec.rb
index a1e0b881d5..8e9fdc305e 100644
--- a/spec/unit/policy_builder/expand_node_object_spec.rb
+++ b/spec/unit/policy_builder/expand_node_object_spec.rb
@@ -73,7 +73,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
it "creates a new in-memory node object with the given name" do
policy_builder.load_node
- policy_builder.node.name.should == node_name
+ expect(policy_builder.node.name).to eq(node_name)
end
end
@@ -83,9 +83,9 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
let(:node) { Chef::Node.new.tap { |n| n.name(node_name) } }
it "loads or creates a node on the server" do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
policy_builder.load_node
- policy_builder.node.should == node
+ expect(policy_builder.node).to eq(node)
end
end
@@ -95,7 +95,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
# XXX: Chef::Client just needs to be able to call this, it doesn't depend on the return value.
it "builds the node and returns the updated node object" do
- pending
+ skip
end
end
@@ -133,7 +133,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
end
before do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
policy_builder.load_node
end
@@ -167,7 +167,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
before do
Chef::Config[:environment] = configured_environment
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
policy_builder.load_node
policy_builder.build_node
end
@@ -186,7 +186,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
end
it "reports that a temporary_policy is not being used" do
- expect(policy_builder.temporary_policy?).to be_false
+ expect(policy_builder.temporary_policy?).to be_falsey
end
describe "when the given run list is not in expanded form" do
@@ -210,7 +210,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
node.override_attrs = original_override_attrs
node.run_list(primary_runlist)
- node.should_receive(:expand!).with("server") do
+ expect(node).to receive(:expand!).with("server") do
node.run_list("recipe[from_role::default]")
expansion
end
@@ -248,7 +248,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
end
it "reports that a temporary policy is being used" do
- expect(policy_builder.temporary_policy?).to be_true
+ expect(policy_builder.temporary_policy?).to be_truthy
end
end
@@ -267,7 +267,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
let(:environment) do
environment = Chef::Environment.new.tap {|e| e.name("prod") }
- Chef::Environment.should_receive(:load).with("prod").and_return(environment)
+ expect(Chef::Environment).to receive(:load).with("prod").and_return(environment)
environment
end
@@ -302,27 +302,27 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
let(:cookbook_synchronizer) { double("CookbookSynchronizer") }
before do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
- policy_builder.stub(:api_service).and_return(chef_http)
+ allow(policy_builder).to receive(:api_service).and_return(chef_http)
policy_builder.load_node
policy_builder.build_node
run_list_expansion = policy_builder.run_list_expansion
- chef_http.should_receive(:post).with(cookbook_resolve_url, cookbook_resolve_post_data).and_return(cookbook_hash)
- Chef::CookbookSynchronizer.should_receive(:new).with(cookbook_hash, events).and_return(cookbook_synchronizer)
- cookbook_synchronizer.should_receive(:sync_cookbooks)
+ expect(chef_http).to receive(:post).with(cookbook_resolve_url, cookbook_resolve_post_data).and_return(cookbook_hash)
+ expect(Chef::CookbookSynchronizer).to receive(:new).with(cookbook_hash, events).and_return(cookbook_synchronizer)
+ expect(cookbook_synchronizer).to receive(:sync_cookbooks)
- Chef::RunContext.any_instance.should_receive(:load).with(run_list_expansion)
+ expect_any_instance_of(Chef::RunContext).to receive(:load).with(run_list_expansion)
policy_builder.setup_run_context
end
it "configures FileVendor to fetch files remotely" do
manifest = double("cookbook manifest")
- Chef::Cookbook::RemoteFileVendor.should_receive(:new).with(manifest, chef_http)
+ expect(Chef::Cookbook::RemoteFileVendor).to receive(:new).with(manifest, chef_http)
Chef::Cookbook::FileVendor.create_from_manifest(manifest)
end
@@ -333,4 +333,3 @@ describe Chef::PolicyBuilder::ExpandNodeObject do
end
end
-
diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb
index f02c79ef12..5e2844201d 100644
--- a/spec/unit/policy_builder/policyfile_spec.rb
+++ b/spec/unit/policy_builder/policyfile_spec.rb
@@ -96,7 +96,7 @@ describe Chef::PolicyBuilder::Policyfile do
http = double("Chef::REST")
server_url = "https://api.opscode.com/organizations/example"
Chef::Config[:chef_server_url] = server_url
- Chef::REST.should_receive(:new).with(server_url).and_return(http)
+ expect(Chef::REST).to receive(:new).with(server_url).and_return(http)
expect(policy_builder.http_api).to eq(http)
end
@@ -107,7 +107,7 @@ describe Chef::PolicyBuilder::Policyfile do
end
it "always gives `false` for #temporary_policy?" do
- expect(initialize_pb.temporary_policy?).to be_false
+ expect(initialize_pb.temporary_policy?).to be_falsey
end
context "chef-solo" do
@@ -168,15 +168,15 @@ describe Chef::PolicyBuilder::Policyfile do
before do
# TODO: agree on this name and logic.
Chef::Config[:deployment_group] = "example-policy-stage"
- policy_builder.stub(:http_api).and_return(http_api)
+ allow(policy_builder).to receive(:http_api).and_return(http_api)
end
context "when the deployment group cannot be loaded" do
let(:error404) { Net::HTTPServerException.new("404 message", :body) }
before do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
- http_api.should_receive(:get).
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
+ expect(http_api).to receive(:get).
with("data/policyfiles/example-policy-stage").
and_raise(error404)
end
@@ -186,7 +186,7 @@ describe Chef::PolicyBuilder::Policyfile do
end
it "sends error message to the event system" do
- events.should_receive(:node_load_failed).with(node_name, an_instance_of(err_namespace::ConfigurationError), Chef::Config)
+ expect(events).to receive(:node_load_failed).with(node_name, an_instance_of(err_namespace::ConfigurationError), Chef::Config)
expect { policy_builder.load_node }.to raise_error(err_namespace::ConfigurationError)
end
@@ -195,7 +195,7 @@ describe Chef::PolicyBuilder::Policyfile do
describe "when the deployment_group is not configured" do
before do
Chef::Config[:deployment_group] = nil
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
end
it "errors while loading the node" do
@@ -206,14 +206,14 @@ describe Chef::PolicyBuilder::Policyfile do
it "passes error information to the event system" do
# TODO: also make sure something acceptable happens with the error formatters
err_class = err_namespace::ConfigurationError
- events.should_receive(:node_load_failed).with(node_name, an_instance_of(err_class), Chef::Config)
+ expect(events).to receive(:node_load_failed).with(node_name, an_instance_of(err_class), Chef::Config)
expect { policy_builder.load_node }.to raise_error(err_class)
end
end
context "and a deployment_group is configured" do
before do
- http_api.should_receive(:get).with("data/policyfiles/example-policy-stage").and_return(parsed_policyfile_json)
+ expect(http_api).to receive(:get).with("data/policyfiles/example-policy-stage").and_return(parsed_policyfile_json)
end
it "fetches the policy file from a data bag item" do
@@ -239,7 +239,7 @@ describe Chef::PolicyBuilder::Policyfile do
end
it "implements #expand_run_list in a manner compatible with ExpandNodeObject" do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
policy_builder.load_node
expect(policy_builder.expand_run_list).to respond_to(:recipes)
expect(policy_builder.expand_run_list.recipes).to eq(["example1::default", "example2::server"])
@@ -278,7 +278,7 @@ describe Chef::PolicyBuilder::Policyfile do
describe "building the node object" do
before do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
policy_builder.load_node
policy_builder.build_node
@@ -339,7 +339,7 @@ describe Chef::PolicyBuilder::Policyfile do
let(:error404) { Net::HTTPServerException.new("404 message", :body) }
before do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
# Remove references to example2 cookbook because we're iterating
# over a Hash data structure and on ruby 1.8.7 iteration order will
@@ -350,7 +350,7 @@ describe Chef::PolicyBuilder::Policyfile do
policy_builder.load_node
policy_builder.build_node
- http_api.should_receive(:get).with("cookbooks/example1/#{example1_xyz_version}").
+ expect(http_api).to receive(:get).with("cookbooks/example1/#{example1_xyz_version}").
and_raise(error404)
end
@@ -362,17 +362,17 @@ describe Chef::PolicyBuilder::Policyfile do
context "and the cookbooks can be fetched" do
before do
- Chef::Node.should_receive(:find_or_create).with(node_name).and_return(node)
+ expect(Chef::Node).to receive(:find_or_create).with(node_name).and_return(node)
policy_builder.load_node
policy_builder.build_node
- http_api.should_receive(:get).with("cookbooks/example1/#{example1_xyz_version}").
+ expect(http_api).to receive(:get).with("cookbooks/example1/#{example1_xyz_version}").
and_return(example1_cookbook_object)
- http_api.should_receive(:get).with("cookbooks/example2/#{example2_xyz_version}").
+ expect(http_api).to receive(:get).with("cookbooks/example2/#{example2_xyz_version}").
and_return(example2_cookbook_object)
- Chef::CookbookSynchronizer.stub(:new).
+ allow(Chef::CookbookSynchronizer).to receive(:new).
with(expected_cookbook_hash, events).
and_return(cookbook_synchronizer)
end
@@ -382,13 +382,13 @@ describe Chef::PolicyBuilder::Policyfile do
end
it "syncs the desired cookbooks via CookbookSynchronizer" do
- cookbook_synchronizer.should_receive(:sync_cookbooks)
+ expect(cookbook_synchronizer).to receive(:sync_cookbooks)
policy_builder.sync_cookbooks
end
it "builds a run context" do
- cookbook_synchronizer.should_receive(:sync_cookbooks)
- Chef::RunContext.any_instance.should_receive(:load).with(policy_builder.run_list_expansion_ish)
+ expect(cookbook_synchronizer).to receive(:sync_cookbooks)
+ expect_any_instance_of(Chef::RunContext).to receive(:load).with(policy_builder.run_list_expansion_ish)
run_context = policy_builder.setup_run_context
expect(run_context.node).to eq(node)
expect(run_context.cookbook_collection.keys).to match_array(["example1", "example2"])
diff --git a/spec/unit/provider/breakpoint_spec.rb b/spec/unit/provider/breakpoint_spec.rb
index 05f3e8e0ed..386e5a1d17 100644
--- a/spec/unit/provider/breakpoint_spec.rb
+++ b/spec/unit/provider/breakpoint_spec.rb
@@ -26,28 +26,28 @@ describe Chef::Provider::Breakpoint do
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
@collection = double("resource collection")
- @run_context.stub(:resource_collection).and_return(@collection)
+ allow(@run_context).to receive(:resource_collection).and_return(@collection)
@provider = Chef::Provider::Breakpoint.new(@resource, @run_context)
end
it "responds to load_current_resource" do
- @provider.should respond_to(:load_current_resource)
+ expect(@provider).to respond_to(:load_current_resource)
end
it "gets the iterator from @collection and pauses it" do
- Shell.stub(:running?).and_return(true)
+ allow(Shell).to receive(:running?).and_return(true)
@iterator = double("stepable_iterator")
- @collection.stub(:iterator).and_return(@iterator)
- @iterator.should_receive(:pause)
+ allow(@collection).to receive(:iterator).and_return(@iterator)
+ expect(@iterator).to receive(:pause)
@provider.action_break
- @resource.should be_updated
+ expect(@resource).to be_updated
end
it "doesn't pause the iterator if chef-shell isn't running" do
- Shell.stub(:running?).and_return(false)
+ allow(Shell).to receive(:running?).and_return(false)
@iterator = double("stepable_iterator")
- @collection.stub(:iterator).and_return(@iterator)
- @iterator.should_not_receive(:pause)
+ allow(@collection).to receive(:iterator).and_return(@iterator)
+ expect(@iterator).not_to receive(:pause)
@provider.action_break
end
diff --git a/spec/unit/provider/cookbook_file/content_spec.rb b/spec/unit/provider/cookbook_file/content_spec.rb
index ed8942aaf2..6946966153 100644
--- a/spec/unit/provider/cookbook_file/content_spec.rb
+++ b/spec/unit/provider/cookbook_file/content_spec.rb
@@ -28,12 +28,12 @@ describe Chef::Provider::CookbookFile::Content do
end
it "prefers the explicit cookbook name on the resource to the implicit one" do
- new_resource.stub(:cookbook).and_return('nginx')
- content.send(:resource_cookbook).should == 'nginx'
+ allow(new_resource).to receive(:cookbook).and_return('nginx')
+ expect(content.send(:resource_cookbook)).to eq('nginx')
end
it "falls back to the implicit cookbook name on the resource" do
- content.send(:resource_cookbook).should == 'apache2'
+ expect(content.send(:resource_cookbook)).to eq('apache2')
end
end
diff --git a/spec/unit/provider/cookbook_file_spec.rb b/spec/unit/provider/cookbook_file_spec.rb
index 131fca2ba6..a7cbba97cb 100644
--- a/spec/unit/provider/cookbook_file_spec.rb
+++ b/spec/unit/provider/cookbook_file_spec.rb
@@ -37,7 +37,7 @@ describe Chef::Provider::CookbookFile do
let(:provider) do
provider = described_class.new(resource, run_context)
- provider.stub(:content).and_return(content)
+ allow(provider).to receive(:content).and_return(content)
provider
end
diff --git a/spec/unit/provider/cron_spec.rb b/spec/unit/provider/cron_spec.rb
index 460fb0ca6a..7a917a4f27 100644
--- a/spec/unit/provider/cron_spec.rb
+++ b/spec/unit/provider/cron_spec.rb
@@ -35,7 +35,7 @@ describe Chef::Provider::Cron do
context "with a matching entry in the user's crontab" do
before :each do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -49,18 +49,18 @@ CRONTAB
it "should set cron_exists" do
@provider.load_current_resource
- @provider.cron_exists.should == true
- @provider.cron_empty.should == false
+ expect(@provider.cron_exists).to eq(true)
+ expect(@provider.cron_empty).to eq(false)
end
it "should pull the details out of the cron line" do
cron = @provider.load_current_resource
- cron.time.should == :reboot
- cron.command.should == '/bin/true param1 param2'
+ expect(cron.time).to eq(:reboot)
+ expect(cron.command).to eq('/bin/true param1 param2')
end
it "should pull env vars out" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -75,16 +75,16 @@ HOME=/home/foo
# Another comment
CRONTAB
cron = @provider.load_current_resource
- cron.mailto.should == 'foo@example.com'
- cron.shell.should == '/bin/foosh'
- cron.path.should == '/bin:/foo'
- cron.home.should == '/home/foo'
- cron.time.should == :reboot
- cron.command.should == '/bin/true param1 param2'
+ expect(cron.mailto).to eq('foo@example.com')
+ expect(cron.shell).to eq('/bin/foosh')
+ expect(cron.path).to eq('/bin:/foo')
+ expect(cron.home).to eq('/home/foo')
+ expect(cron.time).to eq(:reboot)
+ expect(cron.command).to eq('/bin/true param1 param2')
end
it "should parse and load generic and standard environment variables from cron entry" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
# Chef Name: cronhole some stuff
MAILTO=warn@example.com
TEST=lol
@@ -93,12 +93,12 @@ FLAG=1
CRONTAB
cron = @provider.load_current_resource
- cron.mailto.should == "warn@example.com"
- cron.environment.should == {"TEST" => "lol", "FLAG" => "1"}
+ expect(cron.mailto).to eq("warn@example.com")
+ expect(cron.environment).to eq({"TEST" => "lol", "FLAG" => "1"})
end
it "should not break with variables that match the cron resource internals" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
# Chef Name: cronhole some stuff
MINUTE=40
REBOOT=midnight
@@ -108,19 +108,19 @@ ENVIRONMENT=production
CRONTAB
cron = @provider.load_current_resource
- cron.time.should == :reboot
- cron.environment.should == {"MINUTE" => "40", "REBOOT" => "midnight", "TEST" => "lol", "ENVIRONMENT" => "production"}
+ expect(cron.time).to eq(:reboot)
+ expect(cron.environment).to eq({"MINUTE" => "40", "REBOOT" => "midnight", "TEST" => "lol", "ENVIRONMENT" => "production"})
end
it "should report the match" do
- Chef::Log.should_receive(:debug).with("Found cron '#{@new_resource.name}'")
+ expect(Chef::Log).to receive(:debug).with("Found cron '#{@new_resource.name}'")
@provider.load_current_resource
end
describe "action_create" do
before :each do
- @provider.stub(:write_crontab)
- @provider.stub(:read_crontab).and_return(nil)
+ allow(@provider).to receive(:write_crontab)
+ allow(@provider).to receive(:read_crontab).and_return(nil)
end
context "when there is no existing crontab" do
@@ -130,7 +130,7 @@ CRONTAB
end
it "should create a crontab with the entry" do
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
# Chef Name: cronhole some stuff
@reboot /bin/true
ENDCRON
@@ -156,24 +156,24 @@ CRONTAB
describe "when examining the current system state" do
context "with no crontab for the user" do
before :each do
- @provider.stub(:read_crontab).and_return(nil)
+ allow(@provider).to receive(:read_crontab).and_return(nil)
end
it "should set cron_empty" do
@provider.load_current_resource
- @provider.cron_empty.should == true
- @provider.cron_exists.should == false
+ expect(@provider.cron_empty).to eq(true)
+ expect(@provider.cron_exists).to eq(false)
end
it "should report an empty crontab" do
- Chef::Log.should_receive(:debug).with("Cron empty for '#{@new_resource.user}'")
+ expect(Chef::Log).to receive(:debug).with("Cron empty for '#{@new_resource.user}'")
@provider.load_current_resource
end
end
context "with no matching entry in the user's crontab" do
before :each do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: something else
@@ -185,29 +185,29 @@ CRONTAB
it "should not set cron_exists or cron_empty" do
@provider.load_current_resource
- @provider.cron_exists.should == false
- @provider.cron_empty.should == false
+ expect(@provider.cron_exists).to eq(false)
+ expect(@provider.cron_empty).to eq(false)
end
it "should report no entry found" do
- Chef::Log.should_receive(:debug).with("Cron '#{@new_resource.name}' not found")
+ expect(Chef::Log).to receive(:debug).with("Cron '#{@new_resource.name}' not found")
@provider.load_current_resource
end
it "should not fail if there's an existing cron with a numerical argument" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
# Chef Name: foo[bar] (baz)
21 */4 * * * some_prog 1234567
CRONTAB
- lambda {
+ expect {
@provider.load_current_resource
- }.should_not raise_error
+ }.not_to raise_error
end
end
context "with a matching entry in the user's crontab" do
before :each do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -221,23 +221,23 @@ CRONTAB
it "should set cron_exists" do
@provider.load_current_resource
- @provider.cron_exists.should == true
- @provider.cron_empty.should == false
+ expect(@provider.cron_exists).to eq(true)
+ expect(@provider.cron_empty).to eq(false)
end
it "should pull the details out of the cron line" do
cron = @provider.load_current_resource
- cron.minute.should == '*'
- cron.hour.should == '5'
- cron.day.should == '*'
- cron.month.should == '1'
- cron.weekday.should == '*'
- cron.time.should == nil
- cron.command.should == '/bin/true param1 param2'
+ expect(cron.minute).to eq('*')
+ expect(cron.hour).to eq('5')
+ expect(cron.day).to eq('*')
+ expect(cron.month).to eq('1')
+ expect(cron.weekday).to eq('*')
+ expect(cron.time).to eq(nil)
+ expect(cron.command).to eq('/bin/true param1 param2')
end
it "should pull env vars out" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -252,21 +252,21 @@ HOME=/home/foo
# Another comment
CRONTAB
cron = @provider.load_current_resource
- cron.mailto.should == 'foo@example.com'
- cron.shell.should == '/bin/foosh'
- cron.path.should == '/bin:/foo'
- cron.home.should == '/home/foo'
- cron.minute.should == '*'
- cron.hour.should == '5'
- cron.day.should == '*'
- cron.month.should == '1'
- cron.weekday.should == '*'
- cron.time.should == nil
- cron.command.should == '/bin/true param1 param2'
+ expect(cron.mailto).to eq('foo@example.com')
+ expect(cron.shell).to eq('/bin/foosh')
+ expect(cron.path).to eq('/bin:/foo')
+ expect(cron.home).to eq('/home/foo')
+ expect(cron.minute).to eq('*')
+ expect(cron.hour).to eq('5')
+ expect(cron.day).to eq('*')
+ expect(cron.month).to eq('1')
+ expect(cron.weekday).to eq('*')
+ expect(cron.time).to eq(nil)
+ expect(cron.command).to eq('/bin/true param1 param2')
end
it "should parse and load generic and standard environment variables from cron entry" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
# Chef Name: cronhole some stuff
MAILTO=warn@example.com
TEST=lol
@@ -275,12 +275,12 @@ FLAG=1
CRONTAB
cron = @provider.load_current_resource
- cron.mailto.should == "warn@example.com"
- cron.environment.should == {"TEST" => "lol", "FLAG" => "1"}
+ expect(cron.mailto).to eq("warn@example.com")
+ expect(cron.environment).to eq({"TEST" => "lol", "FLAG" => "1"})
end
it "should not break with variabels that match the cron resource internals" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
# Chef Name: cronhole some stuff
MINUTE=40
HOUR=midnight
@@ -290,20 +290,20 @@ ENVIRONMENT=production
CRONTAB
cron = @provider.load_current_resource
- cron.minute.should == '*'
- cron.hour.should == '5'
- cron.environment.should == {"MINUTE" => "40", "HOUR" => "midnight", "TEST" => "lol", "ENVIRONMENT" => "production"}
+ expect(cron.minute).to eq('*')
+ expect(cron.hour).to eq('5')
+ expect(cron.environment).to eq({"MINUTE" => "40", "HOUR" => "midnight", "TEST" => "lol", "ENVIRONMENT" => "production"})
end
it "should report the match" do
- Chef::Log.should_receive(:debug).with("Found cron '#{@new_resource.name}'")
+ expect(Chef::Log).to receive(:debug).with("Found cron '#{@new_resource.name}'")
@provider.load_current_resource
end
end
context "with a matching entry in the user's crontab using month names and weekday names (#CHEF-3178)" do
before :each do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -317,64 +317,64 @@ CRONTAB
it "should set cron_exists" do
@provider.load_current_resource
- @provider.cron_exists.should == true
- @provider.cron_empty.should == false
+ expect(@provider.cron_exists).to eq(true)
+ expect(@provider.cron_empty).to eq(false)
end
it "should pull the details out of the cron line" do
cron = @provider.load_current_resource
- cron.minute.should == '*'
- cron.hour.should == '5'
- cron.day.should == '*'
- cron.month.should == 'Jan'
- cron.weekday.should == 'Mon'
- cron.command.should == '/bin/true param1 param2'
+ expect(cron.minute).to eq('*')
+ expect(cron.hour).to eq('5')
+ expect(cron.day).to eq('*')
+ expect(cron.month).to eq('Jan')
+ expect(cron.weekday).to eq('Mon')
+ expect(cron.command).to eq('/bin/true param1 param2')
end
it "should report the match" do
- Chef::Log.should_receive(:debug).with("Found cron '#{@new_resource.name}'")
+ expect(Chef::Log).to receive(:debug).with("Found cron '#{@new_resource.name}'")
@provider.load_current_resource
end
end
context "with a matching entry without a crontab line" do
it "should set cron_exists and leave current_resource values at defaults" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
CRONTAB
cron = @provider.load_current_resource
- @provider.cron_exists.should == true
- cron.minute.should == '*'
- cron.hour.should == '*'
- cron.day.should == '*'
- cron.month.should == '*'
- cron.weekday.should == '*'
- cron.time.should == nil
- cron.command.should == nil
+ expect(@provider.cron_exists).to eq(true)
+ expect(cron.minute).to eq('*')
+ expect(cron.hour).to eq('*')
+ expect(cron.day).to eq('*')
+ expect(cron.month).to eq('*')
+ expect(cron.weekday).to eq('*')
+ expect(cron.time).to eq(nil)
+ expect(cron.command).to eq(nil)
end
it "should not pick up a commented out crontab line" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
#* 5 * 1 * /bin/true param1 param2
CRONTAB
cron = @provider.load_current_resource
- @provider.cron_exists.should == true
- cron.minute.should == '*'
- cron.hour.should == '*'
- cron.day.should == '*'
- cron.month.should == '*'
- cron.weekday.should == '*'
- cron.time.should == nil
- cron.command.should == nil
+ expect(@provider.cron_exists).to eq(true)
+ expect(cron.minute).to eq('*')
+ expect(cron.hour).to eq('*')
+ expect(cron.day).to eq('*')
+ expect(cron.month).to eq('*')
+ expect(cron.weekday).to eq('*')
+ expect(cron.time).to eq(nil)
+ expect(cron.command).to eq(nil)
end
it "should not pick up a later crontab entry" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -385,14 +385,14 @@ CRONTAB
# Another comment
CRONTAB
cron = @provider.load_current_resource
- @provider.cron_exists.should == true
- cron.minute.should == '*'
- cron.hour.should == '*'
- cron.day.should == '*'
- cron.month.should == '*'
- cron.weekday.should == '*'
- cron.time.should == nil
- cron.command.should == nil
+ expect(@provider.cron_exists).to eq(true)
+ expect(cron.minute).to eq('*')
+ expect(cron.hour).to eq('*')
+ expect(cron.day).to eq('*')
+ expect(cron.month).to eq('*')
+ expect(cron.weekday).to eq('*')
+ expect(cron.time).to eq(nil)
+ expect(cron.command).to eq(nil)
end
end
end
@@ -409,35 +409,35 @@ CRONTAB
[:minute, :hour, :day, :month, :weekday, :command, :mailto, :path, :shell, :home].each do |attribute|
it "should return true if #{attribute} doesn't match" do
@new_resource.send(attribute, "something_else")
- @provider.cron_different?.should eql(true)
+ expect(@provider.cron_different?).to eql(true)
end
end
it "should return true if special time string doesn't match" do
@new_resource.send(:time, :reboot)
- @provider.cron_different?.should eql(true)
+ expect(@provider.cron_different?).to eql(true)
end
it "should return true if environment doesn't match" do
@new_resource.environment "FOO" => "something_else"
- @provider.cron_different?.should eql(true)
+ expect(@provider.cron_different?).to eql(true)
end
it "should return true if mailto doesn't match" do
@current_resource.mailto "foo@bar.com"
@new_resource.mailto(nil)
- @provider.cron_different?.should eql(true)
+ expect(@provider.cron_different?).to eql(true)
end
it "should return false if the objects are identical" do
- @provider.cron_different?.should == false
+ expect(@provider.cron_different?).to eq(false)
end
end
describe "action_create" do
before :each do
- @provider.stub(:write_crontab)
- @provider.stub(:read_crontab).and_return(nil)
+ allow(@provider).to receive(:write_crontab)
+ allow(@provider).to receive(:read_crontab).and_return(nil)
end
context "when there is no existing crontab" do
@@ -447,7 +447,7 @@ CRONTAB
end
it "should create a crontab with the entry" do
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
# Chef Name: cronhole some stuff
30 * * * * /bin/true
ENDCRON
@@ -460,7 +460,7 @@ CRONTAB
@new_resource.shell '/bin/foosh'
@new_resource.home '/home/foo'
@new_resource.environment "TEST" => "LOL"
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
# Chef Name: cronhole some stuff
MAILTO=foo@example.com
PATH=/usr/bin:/my/custom/path
@@ -474,11 +474,11 @@ TEST=LOL
it "should mark the resource as updated" do
@provider.run_action(:create)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should log the action" do
- Chef::Log.should_receive(:info).with("cron[cronhole some stuff] added crontab entry")
+ expect(Chef::Log).to receive(:info).with("cron[cronhole some stuff] added crontab entry")
@provider.run_action(:create)
end
end
@@ -486,7 +486,7 @@ TEST=LOL
context "when there is a crontab with no matching section" do
before :each do
@provider.cron_exists = false
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: something else
@@ -497,7 +497,7 @@ TEST=LOL
end
it "should add the entry to the crontab" do
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: something else
@@ -516,7 +516,7 @@ TEST=LOL
@new_resource.shell '/bin/foosh'
@new_resource.home '/home/foo'
@new_resource.environment "TEST" => "LOL"
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: something else
@@ -536,11 +536,11 @@ TEST=LOL
it "should mark the resource as updated" do
@provider.run_action(:create)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should log the action" do
- Chef::Log.should_receive(:info).with("cron[cronhole some stuff] added crontab entry")
+ expect(Chef::Log).to receive(:info).with("cron[cronhole some stuff] added crontab entry")
@provider.run_action(:create)
end
end
@@ -548,8 +548,8 @@ TEST=LOL
context "when there is a crontab with a matching but different section" do
before :each do
@provider.cron_exists = true
- @provider.stub(:cron_different?).and_return(true)
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:cron_different?).and_return(true)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -562,7 +562,7 @@ TEST=LOL
end
it "should update the crontab entry" do
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -581,7 +581,7 @@ TEST=LOL
@new_resource.shell '/bin/foosh'
@new_resource.home '/home/foo'
@new_resource.environment "TEST" => "LOL"
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -601,11 +601,11 @@ TEST=LOL
it "should mark the resource as updated" do
@provider.run_action(:create)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should log the action" do
- Chef::Log.should_receive(:info).with("cron[cronhole some stuff] updated crontab entry")
+ expect(Chef::Log).to receive(:info).with("cron[cronhole some stuff] updated crontab entry")
@provider.run_action(:create)
end
end
@@ -613,16 +613,16 @@ TEST=LOL
context "when there is a crontab with a matching section with no crontab line in it" do
before :each do
@provider.cron_exists = true
- @provider.stub(:cron_different?).and_return(true)
+ allow(@provider).to receive(:cron_different?).and_return(true)
end
it "should add the crontab to the entry" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
CRONTAB
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -632,7 +632,7 @@ TEST=LOL
end
it "should not blat any following entries" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -642,7 +642,7 @@ TEST=LOL
# Another comment
CRONTAB
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -657,7 +657,7 @@ TEST=LOL
end
it "should handle env vars with no crontab" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -675,7 +675,7 @@ HOME=/home/foo
@new_resource.path '/usr/bin:/my/custom/path'
@new_resource.shell '/bin/foosh'
@new_resource.home '/home/foo'
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -697,8 +697,8 @@ HOME=/home/foo
context "when there is a crontab with a matching and identical section" do
before :each do
@provider.cron_exists = true
- @provider.stub(:cron_different?).and_return(false)
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:cron_different?).and_return(false)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -709,18 +709,18 @@ CRONTAB
end
it "should not update the crontab" do
- @provider.should_not_receive(:write_crontab)
+ expect(@provider).not_to receive(:write_crontab)
@provider.run_action(:create)
end
it "should not mark the resource as updated" do
@provider.run_action(:create)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should log nothing changed" do
- Chef::Log.should_receive(:debug).with("Found cron '#{@new_resource.name}'")
- Chef::Log.should_receive(:debug).with("Skipping existing cron entry '#{@new_resource.name}'")
+ expect(Chef::Log).to receive(:debug).with("Found cron '#{@new_resource.name}'")
+ expect(Chef::Log).to receive(:debug).with("Skipping existing cron entry '#{@new_resource.name}'")
@provider.run_action(:create)
end
end
@@ -728,8 +728,8 @@ CRONTAB
describe "action_delete" do
before :each do
- @provider.stub(:write_crontab)
- @provider.stub(:read_crontab).and_return(nil)
+ allow(@provider).to receive(:write_crontab)
+ allow(@provider).to receive(:read_crontab).and_return(nil)
end
context "when the user's crontab has no matching section" do
@@ -738,21 +738,21 @@ CRONTAB
end
it "should do nothing" do
- @provider.should_not_receive(:write_crontab)
- Chef::Log.should_not_receive(:info)
+ expect(@provider).not_to receive(:write_crontab)
+ expect(Chef::Log).not_to receive(:info)
@provider.run_action(:delete)
end
it "should not mark the resource as updated" do
@provider.run_action(:delete)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
end
context "when the user has a crontab with a matching section" do
before :each do
@provider.cron_exists = true
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -765,7 +765,7 @@ CRONTAB
end
it "should remove the entry" do
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: something else
@@ -777,7 +777,7 @@ CRONTAB
end
it "should remove any env vars with the entry" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -789,7 +789,7 @@ FOO=test
# Another comment
CRONTAB
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
# Chef Name: something else
@@ -802,11 +802,11 @@ FOO=test
it "should mark the resource as updated" do
@provider.run_action(:delete)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should log the action" do
- Chef::Log.should_receive(:info).with("#{@new_resource} deleted crontab entry")
+ expect(Chef::Log).to receive(:info).with("#{@new_resource} deleted crontab entry")
@provider.run_action(:delete)
end
end
@@ -817,12 +817,12 @@ FOO=test
end
it "should remove the section" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
CRONTAB
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
ENDCRON
@@ -830,7 +830,7 @@ FOO=test
end
it "should not blat following sections" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -840,7 +840,7 @@ FOO=test
# Another comment
CRONTAB
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
#30 * * 3 * /bin/true
@@ -853,7 +853,7 @@ FOO=test
end
it "should remove any envvars with the section" do
- @provider.stub(:read_crontab).and_return(<<-CRONTAB)
+ allow(@provider).to receive(:read_crontab).and_return(<<-CRONTAB)
0 2 * * * /some/other/command
# Chef Name: cronhole some stuff
@@ -864,7 +864,7 @@ MAILTO=foo@example.com
# Another comment
CRONTAB
- @provider.should_receive(:write_crontab).with(<<-ENDCRON)
+ expect(@provider).to receive(:write_crontab).with(<<-ENDCRON)
0 2 * * * /some/other/command
#30 * * 3 * /bin/true
@@ -889,17 +889,17 @@ MAILTO=foo@example.com
# Another comment
CRONTAB
- @provider.stub(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(1234, StringIO.new, @stdout, StringIO.new).and_return(@status)
end
it "should call crontab -l with the user" do
- @provider.should_receive(:popen4).with("crontab -l -u #{@new_resource.user}").and_return(@status)
+ expect(@provider).to receive(:popen4).with("crontab -l -u #{@new_resource.user}").and_return(@status)
@provider.send(:read_crontab)
end
it "should return the contents of the crontab" do
crontab = @provider.send(:read_crontab)
- crontab.should == <<-CRONTAB
+ expect(crontab).to eq <<-CRONTAB
0 2 * * * /some/other/command
# Chef Name: something else
@@ -911,16 +911,16 @@ MAILTO=foo@example.com
it "should return nil if the user has no crontab" do
status = double("Status", :exitstatus => 1)
- @provider.stub(:popen4).and_return(status)
- @provider.send(:read_crontab).should == nil
+ allow(@provider).to receive(:popen4).and_return(status)
+ expect(@provider.send(:read_crontab)).to eq(nil)
end
it "should raise an exception if another error occurs" do
status = double("Status", :exitstatus => 2)
- @provider.stub(:popen4).and_return(status)
- lambda do
+ allow(@provider).to receive(:popen4).and_return(status)
+ expect do
@provider.send(:read_crontab)
- end.should raise_error(Chef::Exceptions::Cron, "Error determining state of #{@new_resource.name}, exit: 2")
+ end.to raise_error(Chef::Exceptions::Cron, "Error determining state of #{@new_resource.name}, exit: 2")
end
end
@@ -928,24 +928,24 @@ MAILTO=foo@example.com
before :each do
@status = double("Status", :exitstatus => 0)
@stdin = StringIO.new
- @provider.stub(:popen4).and_yield(1234, @stdin, StringIO.new, StringIO.new).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(1234, @stdin, StringIO.new, StringIO.new).and_return(@status)
end
it "should call crontab for the user" do
- @provider.should_receive(:popen4).with("crontab -u #{@new_resource.user} -", :waitlast => true).and_return(@status)
+ expect(@provider).to receive(:popen4).with("crontab -u #{@new_resource.user} -", :waitlast => true).and_return(@status)
@provider.send(:write_crontab, "Foo")
end
it "should write the given string to the crontab command" do
@provider.send(:write_crontab, "Foo\n# wibble\n wah!!")
- @stdin.string.should == "Foo\n# wibble\n wah!!"
+ expect(@stdin.string).to eq("Foo\n# wibble\n wah!!")
end
it "should raise an exception if the command returns non-zero" do
- @status.stub(:exitstatus).and_return(1)
- lambda do
+ allow(@status).to receive(:exitstatus).and_return(1)
+ expect do
@provider.send(:write_crontab, "Foo")
- end.should raise_error(Chef::Exceptions::Cron, "Error updating state of #{@new_resource.name}, exit: 1")
+ end.to raise_error(Chef::Exceptions::Cron, "Error updating state of #{@new_resource.name}, exit: 1")
end
it "should raise an exception if the command die's and parent tries to write" do
@@ -954,14 +954,14 @@ MAILTO=foo@example.com
raise Errno::EPIPE, "Test"
end
end
- @status.stub(:exitstatus).and_return(1)
- @provider.stub(:popen4).and_yield(1234, WriteErrPipe.new, StringIO.new, StringIO.new).and_return(@status)
+ allow(@status).to receive(:exitstatus).and_return(1)
+ allow(@provider).to receive(:popen4).and_yield(1234, WriteErrPipe.new, StringIO.new, StringIO.new).and_return(@status)
- Chef::Log.should_receive(:debug).with("Broken pipe - Test")
+ expect(Chef::Log).to receive(:debug).with("Broken pipe - Test")
- lambda do
+ expect do
@provider.send(:write_crontab, "Foo")
- end.should raise_error(Chef::Exceptions::Cron, "Error updating state of #{@new_resource.name}, exit: 1")
+ end.to raise_error(Chef::Exceptions::Cron, "Error updating state of #{@new_resource.name}, exit: 1")
end
end
@@ -970,7 +970,7 @@ MAILTO=foo@example.com
context "when weekday is symbol" do
it "should return weekday in crontab format" do
@new_resource.weekday :wednesday
- @provider.send(:weekday_in_crontab).should eq("3")
+ expect(@provider.send(:weekday_in_crontab)).to eq("3")
end
it "should raise an error with an unknown weekday" do
@@ -981,7 +981,7 @@ MAILTO=foo@example.com
context "when weekday is a number in a string" do
it "should return the string" do
@new_resource.weekday "3"
- @provider.send(:weekday_in_crontab).should eq("3")
+ expect(@provider.send(:weekday_in_crontab)).to eq("3")
end
it "should raise an error with an out of range number" do
@@ -992,14 +992,14 @@ MAILTO=foo@example.com
context "when weekday is string with the name of the week" do
it "should return the string" do
@new_resource.weekday "mon"
- @provider.send(:weekday_in_crontab).should eq("mon")
+ expect(@provider.send(:weekday_in_crontab)).to eq("mon")
end
end
context "when weekday is an integer" do
it "should return the integer" do
@new_resource.weekday 1
- @provider.send(:weekday_in_crontab).should eq("1")
+ expect(@provider.send(:weekday_in_crontab)).to eq("1")
end
it "should raise an error with an out of range integer" do
diff --git a/spec/unit/provider/deploy/revision_spec.rb b/spec/unit/provider/deploy/revision_spec.rb
index 9fa8bdf826..4ca64e3445 100644
--- a/spec/unit/provider/deploy/revision_spec.rb
+++ b/spec/unit/provider/deploy/revision_spec.rb
@@ -21,7 +21,7 @@ require 'spec_helper'
describe Chef::Provider::Deploy::Revision do
before do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
@temp_dir = Dir.mktmpdir
Chef::Config[:file_cache_path] = @temp_dir
@resource = Chef::Resource::Deploy.new("/my/deploy/dir")
@@ -32,7 +32,7 @@ describe Chef::Provider::Deploy::Revision do
@provider = Chef::Provider::Deploy::Revision.new(@resource, @run_context)
@provider.load_current_resource
@runner = double("runnah")
- Chef::Runner.stub(:new).and_return(@runner)
+ allow(Chef::Runner).to receive(:new).and_return(@runner)
@expected_release_dir = "/my/deploy/dir/releases/8a3195bf3efa246f743c5dfa83683201880f935c"
end
@@ -43,41 +43,41 @@ describe Chef::Provider::Deploy::Revision do
it "uses the resolved revision from the SCM as the release slug" do
- @provider.scm_provider.stub(:revision_slug).and_return("uglySlugly")
- @provider.send(:release_slug).should == "uglySlugly"
+ allow(@provider.scm_provider).to receive(:revision_slug).and_return("uglySlugly")
+ expect(@provider.send(:release_slug)).to eq("uglySlugly")
end
it "deploys to a dir named after the revision" do
- @provider.release_path.should == @expected_release_dir
+ expect(@provider.release_path).to eq(@expected_release_dir)
end
it "stores the release dir in the file cache in the cleanup step" do
- FileUtils.stub(:mkdir_p)
- FileUtils.stub(:cp_r)
+ allow(FileUtils).to receive(:mkdir_p)
+ allow(FileUtils).to receive(:cp_r)
@provider.cleanup!
- @provider.stub(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2")
+ allow(@provider).to receive(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2")
@provider.load_current_resource
@provider.cleanup!
second_release = "/my/deploy/dir/releases/73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2"
- @provider.all_releases.should == [@expected_release_dir,second_release]
+ expect(@provider.all_releases).to eq([@expected_release_dir,second_release])
end
it "removes a release from the file cache when it's used again in another release and append it to the end" do
- FileUtils.stub(:mkdir_p)
- FileUtils.stub(:cp_r)
+ allow(FileUtils).to receive(:mkdir_p)
+ allow(FileUtils).to receive(:cp_r)
@provider.cleanup!
- @provider.stub(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2")
+ allow(@provider).to receive(:release_slug).and_return("73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2")
@provider.load_current_resource
@provider.cleanup!
second_release = "/my/deploy/dir/releases/73219b87e977d9c7ba1aa57e9ad1d88fa91a0ec2"
- @provider.all_releases.should == [@expected_release_dir,second_release]
+ expect(@provider.all_releases).to eq([@expected_release_dir,second_release])
@provider.cleanup!
- @provider.stub(:release_slug).and_return("8a3195bf3efa246f743c5dfa83683201880f935c")
+ allow(@provider).to receive(:release_slug).and_return("8a3195bf3efa246f743c5dfa83683201880f935c")
@provider.load_current_resource
@provider.cleanup!
- @provider.all_releases.should == [second_release, @expected_release_dir]
+ expect(@provider.all_releases).to eq([second_release, @expected_release_dir])
end
it "removes a release from the file cache when it's deleted by :cleanup!" do
@@ -87,25 +87,25 @@ describe Chef::Provider::Deploy::Revision do
release_paths.each do |release_path|
@provider.send(:release_created, release_path)
end
- @provider.all_releases.should == release_paths
+ expect(@provider.all_releases).to eq(release_paths)
- FileUtils.stub(:rm_rf)
+ allow(FileUtils).to receive(:rm_rf)
@provider.cleanup!
expected_release_paths = (%w{second third fourth fifth} << @resource.revision).map do |release_name|
"/my/deploy/dir/releases/#{release_name}"
end
- @provider.all_releases.should == expected_release_paths
+ expect(@provider.all_releases).to eq(expected_release_paths)
end
it "regenerates the file cache if it's not available" do
oldest = "/my/deploy/dir/releases/oldest"
latest = "/my/deploy/dir/releases/latest"
- Dir.should_receive(:glob).with("/my/deploy/dir/releases/*").and_return([latest, oldest])
- ::File.should_receive(:ctime).with(oldest).and_return(Time.now - 10)
- ::File.should_receive(:ctime).with(latest).and_return(Time.now - 1)
- @provider.all_releases.should == [oldest, latest]
+ expect(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return([latest, oldest])
+ expect(::File).to receive(:ctime).with(oldest).and_return(Time.now - 10)
+ expect(::File).to receive(:ctime).with(latest).and_return(Time.now - 1)
+ expect(@provider.all_releases).to eq([oldest, latest])
end
end
diff --git a/spec/unit/provider/deploy/timestamped_spec.rb b/spec/unit/provider/deploy/timestamped_spec.rb
index 1d42abfc05..b189d33502 100644
--- a/spec/unit/provider/deploy/timestamped_spec.rb
+++ b/spec/unit/provider/deploy/timestamped_spec.rb
@@ -22,7 +22,7 @@ describe Chef::Provider::Deploy::Timestamped do
before do
@release_time = Time.utc( 2004, 8, 15, 16, 23, 42)
- Time.stub(:now).and_return(@release_time)
+ allow(Time).to receive(:now).and_return(@release_time)
@expected_release_dir = "/my/deploy/dir/releases/20040815162342"
@resource = Chef::Resource::Deploy.new("/my/deploy/dir")
@node = Chef::Node.new
@@ -30,11 +30,11 @@ describe Chef::Provider::Deploy::Timestamped do
@run_context = Chef::RunContext.new(@node, {}, @events)
@timestamped_deploy = Chef::Provider::Deploy::Timestamped.new(@resource, @run_context)
@runner = double("runnah")
- Chef::Runner.stub(:new).and_return(@runner)
+ allow(Chef::Runner).to receive(:new).and_return(@runner)
end
it "gives a timestamp for release_slug" do
- @timestamped_deploy.send(:release_slug).should == "20040815162342"
+ expect(@timestamped_deploy.send(:release_slug)).to eq("20040815162342")
end
end
diff --git a/spec/unit/provider/deploy_spec.rb b/spec/unit/provider/deploy_spec.rb
index d85ee4c7fd..c95a9b3d57 100644
--- a/spec/unit/provider/deploy_spec.rb
+++ b/spec/unit/provider/deploy_spec.rb
@@ -21,205 +21,205 @@ require 'spec_helper'
describe Chef::Provider::Deploy do
before do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
@release_time = Time.utc( 2004, 8, 15, 16, 23, 42)
- Time.stub(:now).and_return(@release_time)
+ allow(Time).to receive(:now).and_return(@release_time)
@expected_release_dir = "/my/deploy/dir/releases/20040815162342"
@resource = Chef::Resource::Deploy.new("/my/deploy/dir")
@node = Chef::Node.new
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
@provider = Chef::Provider::Deploy.new(@resource, @run_context)
- @provider.stub(:release_slug)
- @provider.stub(:release_path).and_return(@expected_release_dir)
+ allow(@provider).to receive(:release_slug)
+ allow(@provider).to receive(:release_path).and_return(@expected_release_dir)
end
it "loads scm resource" do
- @provider.scm_provider.should_receive(:load_current_resource)
+ expect(@provider.scm_provider).to receive(:load_current_resource)
@provider.load_current_resource
end
it "supports :deploy and :rollback actions" do
- @provider.should respond_to(:action_deploy)
- @provider.should respond_to(:action_rollback)
+ expect(@provider).to respond_to(:action_deploy)
+ expect(@provider).to respond_to(:action_rollback)
end
context "when the deploy resource has a timeout attribute" do
let(:ten_seconds) { 10 }
before { @resource.timeout(ten_seconds) }
it "relays the timeout to the scm resource" do
- @provider.scm_provider.new_resource.timeout.should == ten_seconds
+ expect(@provider.scm_provider.new_resource.timeout).to eq(ten_seconds)
end
end
context "when the deploy resource has no timeout attribute" do
it "should not set a timeout on the scm resource" do
- @provider.scm_provider.new_resource.timeout.should be_nil
+ expect(@provider.scm_provider.new_resource.timeout).to be_nil
end
end
context "when the deploy_to dir does not exist yet" do
before do
- FileUtils.should_receive(:mkdir_p).with(@resource.deploy_to).ordered
- FileUtils.should_receive(:mkdir_p).with(@resource.shared_path).ordered
- ::File.stub(:directory?).and_return(false)
- @provider.stub(:symlink)
- @provider.stub(:migrate)
- @provider.stub(:copy_cached_repo)
+ expect(FileUtils).to receive(:mkdir_p).with(@resource.deploy_to).ordered
+ expect(FileUtils).to receive(:mkdir_p).with(@resource.shared_path).ordered
+ allow(::File).to receive(:directory?).and_return(false)
+ allow(@provider).to receive(:symlink)
+ allow(@provider).to receive(:migrate)
+ allow(@provider).to receive(:copy_cached_repo)
end
it "creates deploy_to dir" do
- ::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times
- @provider.should_receive(:enforce_ownership).twice
- @provider.stub(:update_cached_repo)
+ expect(::Dir).to receive(:chdir).with(@expected_release_dir).exactly(4).times
+ expect(@provider).to receive(:enforce_ownership).twice
+ allow(@provider).to receive(:update_cached_repo)
@provider.deploy
end
end
it "does not create deploy_to dir if it exists" do
- ::File.stub(:directory?).and_return(true)
- ::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times
- FileUtils.should_not_receive(:mkdir_p).with(@resource.deploy_to)
- FileUtils.should_not_receive(:mkdir_p).with(@resource.shared_path)
- @provider.should_receive(:enforce_ownership).twice
- @provider.stub(:copy_cached_repo)
- @provider.stub(:update_cached_repo)
- @provider.stub(:symlink)
- @provider.stub(:migrate)
+ allow(::File).to receive(:directory?).and_return(true)
+ expect(::Dir).to receive(:chdir).with(@expected_release_dir).exactly(4).times
+ expect(FileUtils).not_to receive(:mkdir_p).with(@resource.deploy_to)
+ expect(FileUtils).not_to receive(:mkdir_p).with(@resource.shared_path)
+ expect(@provider).to receive(:enforce_ownership).twice
+ allow(@provider).to receive(:copy_cached_repo)
+ allow(@provider).to receive(:update_cached_repo)
+ allow(@provider).to receive(:symlink)
+ allow(@provider).to receive(:migrate)
@provider.deploy
end
it "ensures the deploy_to dir ownership after the verfication that it exists" do
- ::Dir.should_receive(:chdir).with(@expected_release_dir).exactly(4).times
- @provider.should_receive(:verify_directories_exist).ordered
- @provider.should_receive(:enforce_ownership).ordered
- @provider.stub(:copy_cached_repo)
- @provider.stub(:update_cached_repo)
- @provider.stub(:install_gems)
- @provider.should_receive(:enforce_ownership).ordered
- @provider.stub(:enforce_ownership)
- @provider.stub(:symlink)
- @provider.stub(:migrate)
+ expect(::Dir).to receive(:chdir).with(@expected_release_dir).exactly(4).times
+ expect(@provider).to receive(:verify_directories_exist).ordered
+ expect(@provider).to receive(:enforce_ownership).ordered
+ allow(@provider).to receive(:copy_cached_repo)
+ allow(@provider).to receive(:update_cached_repo)
+ allow(@provider).to receive(:install_gems)
+ expect(@provider).to receive(:enforce_ownership).ordered
+ allow(@provider).to receive(:enforce_ownership)
+ allow(@provider).to receive(:symlink)
+ allow(@provider).to receive(:migrate)
@provider.deploy
end
it "updates and copies the repo, then does a migrate, symlink, restart, restart, cleanup on deploy" do
- FileUtils.stub(:mkdir_p).with("/my/deploy/dir")
- FileUtils.stub(:mkdir_p).with("/my/deploy/dir/shared")
- @provider.should_receive(:enforce_ownership).twice
- @provider.should_receive(:update_cached_repo)
- @provider.should_receive(:copy_cached_repo)
- @provider.should_receive(:install_gems)
- @provider.should_receive(:callback).with(:before_migrate, nil)
- @provider.should_receive(:migrate)
- @provider.should_receive(:callback).with(:before_symlink, nil)
- @provider.should_receive(:symlink)
- @provider.should_receive(:callback).with(:before_restart, nil)
- @provider.should_receive(:restart)
- @provider.should_receive(:callback).with(:after_restart, nil)
- @provider.should_receive(:cleanup!)
+ allow(FileUtils).to receive(:mkdir_p).with("/my/deploy/dir")
+ allow(FileUtils).to receive(:mkdir_p).with("/my/deploy/dir/shared")
+ expect(@provider).to receive(:enforce_ownership).twice
+ expect(@provider).to receive(:update_cached_repo)
+ expect(@provider).to receive(:copy_cached_repo)
+ expect(@provider).to receive(:install_gems)
+ expect(@provider).to receive(:callback).with(:before_migrate, nil)
+ expect(@provider).to receive(:migrate)
+ expect(@provider).to receive(:callback).with(:before_symlink, nil)
+ expect(@provider).to receive(:symlink)
+ expect(@provider).to receive(:callback).with(:before_restart, nil)
+ expect(@provider).to receive(:restart)
+ expect(@provider).to receive(:callback).with(:after_restart, nil)
+ expect(@provider).to receive(:cleanup!)
@provider.deploy
end
it "should not deploy if there is already a deploy at release_path, and it is the current release" do
- @provider.stub(:all_releases).and_return([@expected_release_dir])
- @provider.stub(:current_release?).with(@expected_release_dir).and_return(true)
- @provider.should_not_receive(:deploy)
+ allow(@provider).to receive(:all_releases).and_return([@expected_release_dir])
+ allow(@provider).to receive(:current_release?).with(@expected_release_dir).and_return(true)
+ expect(@provider).not_to receive(:deploy)
@provider.run_action(:deploy)
end
it "should call action_rollback if there is already a deploy of this revision at release_path, and it is not the current release" do
- @provider.stub(:all_releases).and_return([@expected_release_dir, "102021"])
- @provider.stub(:current_release?).with(@expected_release_dir).and_return(false)
- @provider.should_receive(:rollback_to).with(@expected_release_dir)
- @provider.should_receive(:current_release?)
+ allow(@provider).to receive(:all_releases).and_return([@expected_release_dir, "102021"])
+ allow(@provider).to receive(:current_release?).with(@expected_release_dir).and_return(false)
+ expect(@provider).to receive(:rollback_to).with(@expected_release_dir)
+ expect(@provider).to receive(:current_release?)
@provider.run_action(:deploy)
end
it "calls deploy when deploying a new release" do
- @provider.stub(:all_releases).and_return([])
- @provider.should_receive(:deploy)
+ allow(@provider).to receive(:all_releases).and_return([])
+ expect(@provider).to receive(:deploy)
@provider.run_action(:deploy)
end
it "runs action svn_force_export when new_resource.svn_force_export is true" do
@resource.svn_force_export true
- @provider.scm_provider.should_receive(:run_action).with(:force_export)
+ expect(@provider.scm_provider).to receive(:run_action).with(:force_export)
@provider.update_cached_repo
end
it "Removes the old release before deploying when force deploying over it" do
- @provider.stub(:all_releases).and_return([@expected_release_dir])
- FileUtils.should_receive(:rm_rf).with(@expected_release_dir)
- @provider.should_receive(:deploy)
+ allow(@provider).to receive(:all_releases).and_return([@expected_release_dir])
+ expect(FileUtils).to receive(:rm_rf).with(@expected_release_dir)
+ expect(@provider).to receive(:deploy)
@provider.run_action(:force_deploy)
end
it "deploys as normal when force deploying and there's no prior release at the same path" do
- @provider.stub(:all_releases).and_return([])
- @provider.should_receive(:deploy)
+ allow(@provider).to receive(:all_releases).and_return([])
+ expect(@provider).to receive(:deploy)
@provider.run_action(:force_deploy)
end
it "dont care by default if error happens on deploy" do
- @provider.stub(:all_releases).and_return(['previous_release'])
- @provider.stub(:deploy).and_return{ raise "Unexpected error" }
- @provider.stub(:previous_release_path).and_return('previous_release')
- @provider.should_not_receive(:rollback)
- lambda {
+ allow(@provider).to receive(:all_releases).and_return(['previous_release'])
+ allow(@provider).to receive(:deploy){ raise "Unexpected error" }
+ allow(@provider).to receive(:previous_release_path).and_return('previous_release')
+ expect(@provider).not_to receive(:rollback)
+ expect {
@provider.run_action(:deploy)
- }.should raise_exception(RuntimeError, "Unexpected error")
+ }.to raise_exception(RuntimeError, "Unexpected error")
end
it "rollbacks to previous release if error happens on deploy" do
@resource.rollback_on_error true
- @provider.stub(:all_releases).and_return(['previous_release'])
- @provider.stub(:deploy).and_return{ raise "Unexpected error" }
- @provider.stub(:previous_release_path).and_return('previous_release')
- @provider.should_receive(:rollback)
- lambda {
+ allow(@provider).to receive(:all_releases).and_return(['previous_release'])
+ allow(@provider).to receive(:deploy){ raise "Unexpected error" }
+ allow(@provider).to receive(:previous_release_path).and_return('previous_release')
+ expect(@provider).to receive(:rollback)
+ expect {
@provider.run_action(:deploy)
- }.should raise_exception(RuntimeError, "Unexpected error")
+ }.to raise_exception(RuntimeError, "Unexpected error")
end
describe "on systems without broken Dir.glob results" do
it "sets the release path to the penultimate release when one is not specified, symlinks, and rm's the last release on rollback" do
- @provider.stub(:release_path).and_return("/my/deploy/dir/releases/3")
+ allow(@provider).to receive(:release_path).and_return("/my/deploy/dir/releases/3")
all_releases = ["/my/deploy/dir/releases/1", "/my/deploy/dir/releases/2", "/my/deploy/dir/releases/3", "/my/deploy/dir/releases/4", "/my/deploy/dir/releases/5"]
- Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
- @provider.should_receive(:symlink)
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/4")
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/5")
+ allow(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ expect(@provider).to receive(:symlink)
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/releases/4")
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/releases/5")
@provider.run_action(:rollback)
- @provider.release_path.should eql("/my/deploy/dir/releases/3")
- @provider.shared_path.should eql("/my/deploy/dir/shared")
+ expect(@provider.release_path).to eql("/my/deploy/dir/releases/3")
+ expect(@provider.shared_path).to eql("/my/deploy/dir/shared")
end
it "sets the release path to the specified release, symlinks, and rm's any newer releases on rollback" do
- @provider.unstub(:release_path)
+ allow(@provider).to receive(:release_path).and_call_original
all_releases = ["/my/deploy/dir/releases/20040815162342", "/my/deploy/dir/releases/20040700000000",
"/my/deploy/dir/releases/20040600000000", "/my/deploy/dir/releases/20040500000000"].sort!
- Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
- @provider.should_receive(:symlink)
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
+ allow(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ expect(@provider).to receive(:symlink)
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
@provider.run_action(:rollback)
- @provider.release_path.should eql("/my/deploy/dir/releases/20040700000000")
- @provider.shared_path.should eql("/my/deploy/dir/shared")
+ expect(@provider.release_path).to eql("/my/deploy/dir/releases/20040700000000")
+ expect(@provider.shared_path).to eql("/my/deploy/dir/shared")
end
it "sets the release path to the penultimate release, symlinks, and rm's the last release on rollback" do
- @provider.unstub(:release_path)
+ allow(@provider).to receive(:release_path).and_call_original
all_releases = [ "/my/deploy/dir/releases/20040815162342",
"/my/deploy/dir/releases/20040700000000",
"/my/deploy/dir/releases/20040600000000",
"/my/deploy/dir/releases/20040500000000"]
- Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
- @provider.should_receive(:symlink)
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
+ allow(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ expect(@provider).to receive(:symlink)
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
@provider.run_action(:rollback)
- @provider.release_path.should eql("/my/deploy/dir/releases/20040700000000")
- @provider.shared_path.should eql("/my/deploy/dir/shared")
+ expect(@provider.release_path).to eql("/my/deploy/dir/releases/20040700000000")
+ expect(@provider.shared_path).to eql("/my/deploy/dir/shared")
end
describe "if there are no releases to fallback to" do
@@ -227,143 +227,143 @@ describe Chef::Provider::Deploy do
it "an exception is raised when there is only 1 release" do
#@provider.unstub(:release_path) -- unstub the release path on top to feed our own release path
all_releases = [ "/my/deploy/dir/releases/20040815162342"]
- Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ allow(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
#@provider.should_receive(:symlink)
#FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
#@provider.run_action(:rollback)
#@provider.release_path.should eql(NIL) -- no check needed since assertions will fail
- lambda {
+ expect {
@provider.run_action(:rollback)
- }.should raise_exception(RuntimeError, "There is no release to rollback to!")
+ }.to raise_exception(RuntimeError, "There is no release to rollback to!")
end
it "an exception is raised when there are no releases" do
all_releases = []
- Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
- lambda {
+ allow(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ expect {
@provider.run_action(:rollback)
- }.should raise_exception(RuntimeError, "There is no release to rollback to!")
+ }.to raise_exception(RuntimeError, "There is no release to rollback to!")
end
end
end
describe "CHEF-628: on systems with broken Dir.glob results" do
it "sets the release path to the penultimate release, symlinks, and rm's the last release on rollback" do
- @provider.unstub(:release_path)
+ allow(@provider).to receive(:release_path).and_call_original
all_releases = [ "/my/deploy/dir/releases/20040500000000",
"/my/deploy/dir/releases/20040600000000",
"/my/deploy/dir/releases/20040700000000",
"/my/deploy/dir/releases/20040815162342" ]
- Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
- @provider.should_receive(:symlink)
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
+ allow(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ expect(@provider).to receive(:symlink)
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/releases/20040815162342")
@provider.run_action(:rollback)
- @provider.release_path.should eql("/my/deploy/dir/releases/20040700000000")
- @provider.shared_path.should eql("/my/deploy/dir/shared")
+ expect(@provider.release_path).to eql("/my/deploy/dir/releases/20040700000000")
+ expect(@provider.shared_path).to eql("/my/deploy/dir/shared")
end
end
it "raises a runtime error when there's no release to rollback to" do
all_releases = []
- Dir.stub(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
- lambda {@provider.run_action(:rollback)}.should raise_error(RuntimeError)
+ allow(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ expect {@provider.run_action(:rollback)}.to raise_error(RuntimeError)
end
it "runs the new resource collection in the runner during a callback" do
@runner = double("Runner")
- Chef::Runner.stub(:new).and_return(@runner)
- @runner.should_receive(:converge)
+ allow(Chef::Runner).to receive(:new).and_return(@runner)
+ expect(@runner).to receive(:converge)
callback_code = Proc.new { :noop }
@provider.callback(:whatevs, callback_code)
end
it "loads callback files from the release/ dir if the file exists" do
foo_callback = @expected_release_dir + "/deploy/foo.rb"
- ::File.should_receive(:exist?).with(foo_callback).once.and_return(true)
- ::Dir.should_receive(:chdir).with(@expected_release_dir).and_yield
- @provider.should_receive(:from_file).with(foo_callback)
+ expect(::File).to receive(:exist?).with(foo_callback).once.and_return(true)
+ expect(::Dir).to receive(:chdir).with(@expected_release_dir).and_yield
+ expect(@provider).to receive(:from_file).with(foo_callback)
@provider.callback(:foo, "deploy/foo.rb")
end
it "raises a runtime error if a callback file is explicitly specified but does not exist" do
baz_callback = "/deploy/baz.rb"
- ::File.should_receive(:exist?).with("#{@expected_release_dir}/#{baz_callback}").and_return(false)
+ expect(::File).to receive(:exist?).with("#{@expected_release_dir}/#{baz_callback}").and_return(false)
@resource.before_migrate baz_callback
@provider.define_resource_requirements
@provider.action = :deploy
- lambda {@provider.process_resource_requirements}.should raise_error(RuntimeError)
+ expect {@provider.process_resource_requirements}.to raise_error(RuntimeError)
end
it "runs a default callback if the callback code is nil" do
bar_callback = @expected_release_dir + "/deploy/bar.rb"
- ::File.should_receive(:exist?).with(bar_callback).and_return(true)
- ::Dir.should_receive(:chdir).with(@expected_release_dir).and_yield
- @provider.should_receive(:from_file).with(bar_callback)
+ expect(::File).to receive(:exist?).with(bar_callback).and_return(true)
+ expect(::Dir).to receive(:chdir).with(@expected_release_dir).and_yield
+ expect(@provider).to receive(:from_file).with(bar_callback)
@provider.callback(:bar, nil)
end
it "skips an eval callback if the file doesn't exist" do
barbaz_callback = @expected_release_dir + "/deploy/barbaz.rb"
- ::File.should_receive(:exist?).with(barbaz_callback).and_return(false)
- ::Dir.should_receive(:chdir).with(@expected_release_dir).and_yield
- @provider.should_not_receive(:from_file)
+ expect(::File).to receive(:exist?).with(barbaz_callback).and_return(false)
+ expect(::Dir).to receive(:chdir).with(@expected_release_dir).and_yield
+ expect(@provider).not_to receive(:from_file)
@provider.callback(:barbaz, nil)
end
# CHEF-3449 #converge_by is called in #recipe_eval and must happen in sequence
# with the other calls to #converge_by to keep the train on the tracks
it "evaluates a callback file before the corresponding step" do
- @provider.should_receive(:verify_directories_exist)
- @provider.should_receive(:update_cached_repo)
- @provider.should_receive(:enforce_ownership)
- @provider.should_receive(:copy_cached_repo)
- @provider.should_receive(:install_gems)
- @provider.should_receive(:enforce_ownership)
- @provider.should_receive(:converge_by).ordered # before_migrate
- @provider.should_receive(:migrate).ordered
- @provider.should_receive(:converge_by).ordered # before_symlink
- @provider.should_receive(:symlink).ordered
- @provider.should_receive(:converge_by).ordered # before_restart
- @provider.should_receive(:restart).ordered
- @provider.should_receive(:converge_by).ordered # after_restart
- @provider.should_receive(:cleanup!)
+ expect(@provider).to receive(:verify_directories_exist)
+ expect(@provider).to receive(:update_cached_repo)
+ expect(@provider).to receive(:enforce_ownership)
+ expect(@provider).to receive(:copy_cached_repo)
+ expect(@provider).to receive(:install_gems)
+ expect(@provider).to receive(:enforce_ownership)
+ expect(@provider).to receive(:converge_by).ordered # before_migrate
+ expect(@provider).to receive(:migrate).ordered
+ expect(@provider).to receive(:converge_by).ordered # before_symlink
+ expect(@provider).to receive(:symlink).ordered
+ expect(@provider).to receive(:converge_by).ordered # before_restart
+ expect(@provider).to receive(:restart).ordered
+ expect(@provider).to receive(:converge_by).ordered # after_restart
+ expect(@provider).to receive(:cleanup!)
@provider.deploy
end
it "gets a SCM provider as specified by its resource" do
- @provider.scm_provider.should be_an_instance_of(Chef::Provider::Git)
- @provider.scm_provider.new_resource.destination.should eql("/my/deploy/dir/shared/cached-copy")
+ expect(@provider.scm_provider).to be_an_instance_of(Chef::Provider::Git)
+ expect(@provider.scm_provider.new_resource.destination).to eql("/my/deploy/dir/shared/cached-copy")
end
it "syncs the cached copy of the repo" do
- @provider.scm_provider.should_receive(:run_action).with(:sync)
+ expect(@provider.scm_provider).to receive(:run_action).with(:sync)
@provider.update_cached_repo
end
it "makes a copy of the cached repo in releases dir" do
- FileUtils.should_receive(:mkdir_p).with("/my/deploy/dir/releases")
- FileUtils.should_receive(:cp_r).with("/my/deploy/dir/shared/cached-copy/.", @expected_release_dir, :preserve => true)
+ expect(FileUtils).to receive(:mkdir_p).with("/my/deploy/dir/releases")
+ expect(FileUtils).to receive(:cp_r).with("/my/deploy/dir/shared/cached-copy/.", @expected_release_dir, :preserve => true)
@provider.copy_cached_repo
end
it "calls the internal callback :release_created when cleaning up the releases" do
- FileUtils.stub(:mkdir_p)
- FileUtils.stub(:cp_r)
- @provider.should_receive(:release_created)
+ allow(FileUtils).to receive(:mkdir_p)
+ allow(FileUtils).to receive(:cp_r)
+ expect(@provider).to receive(:release_created)
@provider.cleanup!
end
it "chowns the whole release dir to user and group specified in the resource" do
@resource.user "foo"
@resource.group "bar"
- FileUtils.should_receive(:chown_R).with("foo", "bar", "/my/deploy/dir")
+ expect(FileUtils).to receive(:chown_R).with("foo", "bar", "/my/deploy/dir")
@provider.enforce_ownership
end
it "skips the migration when resource.migrate => false but runs symlinks before migration" do
@resource.migrate false
- @provider.should_not_receive :run_command
- @provider.should_receive :run_symlinks_before_migrate
+ expect(@provider).not_to receive :run_command
+ expect(@provider).to receive :run_symlinks_before_migrate
@provider.migrate
end
@@ -373,12 +373,12 @@ describe Chef::Provider::Deploy do
@resource.user "deployNinja"
@resource.group "deployNinjas"
@resource.environment "RAILS_ENV" => "production"
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/config/database.yml", @expected_release_dir + "/config/database.yml")
- @provider.should_receive(:enforce_ownership)
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/config/database.yml", @expected_release_dir + "/config/database.yml")
+ expect(@provider).to receive(:enforce_ownership)
- STDOUT.stub(:tty?).and_return(true)
- Chef::Log.stub(:info?).and_return(true)
- @provider.should_receive(:run_command).with(:command => "migration_foo", :cwd => @expected_release_dir,
+ allow(STDOUT).to receive(:tty?).and_return(true)
+ allow(Chef::Log).to receive(:info?).and_return(true)
+ expect(@provider).to receive(:run_command).with(:command => "migration_foo", :cwd => @expected_release_dir,
:user => "deployNinja", :group => "deployNinjas",
:log_level => :info, :live_stream => STDOUT,
:log_tag => "deploy[/my/deploy/dir]",
@@ -387,31 +387,31 @@ describe Chef::Provider::Deploy do
end
it "purges the current release's /log /tmp/pids/ and /public/system directories" do
- FileUtils.should_receive(:rm_rf).with(@expected_release_dir + "/log")
- FileUtils.should_receive(:rm_rf).with(@expected_release_dir + "/tmp/pids")
- FileUtils.should_receive(:rm_rf).with(@expected_release_dir + "/public/system")
+ expect(FileUtils).to receive(:rm_rf).with(@expected_release_dir + "/log")
+ expect(FileUtils).to receive(:rm_rf).with(@expected_release_dir + "/tmp/pids")
+ expect(FileUtils).to receive(:rm_rf).with(@expected_release_dir + "/public/system")
@provider.purge_tempfiles_from_current_release
end
it "symlinks temporary files and logs from the shared dir into the current release" do
- FileUtils.stub(:mkdir_p).with(@resource.shared_path + "/system")
- FileUtils.stub(:mkdir_p).with(@resource.shared_path + "/pids")
- FileUtils.stub(:mkdir_p).with(@resource.shared_path + "/log")
- FileUtils.should_receive(:mkdir_p).with(@expected_release_dir + "/tmp")
- FileUtils.should_receive(:mkdir_p).with(@expected_release_dir + "/public")
- FileUtils.should_receive(:mkdir_p).with(@expected_release_dir + "/config")
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/system", @expected_release_dir + "/public/system")
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/pids", @expected_release_dir + "/tmp/pids")
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/log", @expected_release_dir + "/log")
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/config/database.yml", @expected_release_dir + "/config/database.yml")
- @provider.should_receive(:enforce_ownership)
+ allow(FileUtils).to receive(:mkdir_p).with(@resource.shared_path + "/system")
+ allow(FileUtils).to receive(:mkdir_p).with(@resource.shared_path + "/pids")
+ allow(FileUtils).to receive(:mkdir_p).with(@resource.shared_path + "/log")
+ expect(FileUtils).to receive(:mkdir_p).with(@expected_release_dir + "/tmp")
+ expect(FileUtils).to receive(:mkdir_p).with(@expected_release_dir + "/public")
+ expect(FileUtils).to receive(:mkdir_p).with(@expected_release_dir + "/config")
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/system", @expected_release_dir + "/public/system")
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/pids", @expected_release_dir + "/tmp/pids")
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/log", @expected_release_dir + "/log")
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/config/database.yml", @expected_release_dir + "/config/database.yml")
+ expect(@provider).to receive(:enforce_ownership)
@provider.link_tempfiles_to_current_release
end
it "symlinks the current release dir into production" do
- FileUtils.should_receive(:rm_f).with("/my/deploy/dir/current")
- FileUtils.should_receive(:ln_sf).with(@expected_release_dir, "/my/deploy/dir/current")
- @provider.should_receive(:enforce_ownership)
+ expect(FileUtils).to receive(:rm_f).with("/my/deploy/dir/current")
+ expect(FileUtils).to receive(:ln_sf).with(@expected_release_dir, "/my/deploy/dir/current")
+ expect(@provider).to receive(:enforce_ownership)
@provider.link_current_release_to_production
end
@@ -425,41 +425,41 @@ describe Chef::Provider::Deploy do
end
it "purges the purge_before_symlink directories" do
- FileUtils.should_receive(:rm_rf).with(@expected_release_dir + "/foo")
- FileUtils.should_receive(:rm_rf).with(@expected_release_dir + "/bar")
+ expect(FileUtils).to receive(:rm_rf).with(@expected_release_dir + "/foo")
+ expect(FileUtils).to receive(:rm_rf).with(@expected_release_dir + "/bar")
@provider.purge_tempfiles_from_current_release
end
it "symlinks files from the shared directory to the current release directory" do
- FileUtils.should_receive(:mkdir_p).with(@expected_release_dir + "/baz")
- FileUtils.should_receive(:mkdir_p).with(@expected_release_dir + "/qux")
- FileUtils.stub(:mkdir_p).with(@resource.shared_path + "/foo/bar")
- FileUtils.stub(:mkdir_p).with(@resource.shared_path + "/baz")
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/foo/bar", @expected_release_dir + "/foo/bar")
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/baz", @expected_release_dir + "/qux/baz")
- FileUtils.should_receive(:ln_sf).with("/my/deploy/dir/shared/radiohead/in_rainbows.yml", @expected_release_dir + "/awesome")
- @provider.should_receive(:enforce_ownership)
+ expect(FileUtils).to receive(:mkdir_p).with(@expected_release_dir + "/baz")
+ expect(FileUtils).to receive(:mkdir_p).with(@expected_release_dir + "/qux")
+ allow(FileUtils).to receive(:mkdir_p).with(@resource.shared_path + "/foo/bar")
+ allow(FileUtils).to receive(:mkdir_p).with(@resource.shared_path + "/baz")
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/foo/bar", @expected_release_dir + "/foo/bar")
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/baz", @expected_release_dir + "/qux/baz")
+ expect(FileUtils).to receive(:ln_sf).with("/my/deploy/dir/shared/radiohead/in_rainbows.yml", @expected_release_dir + "/awesome")
+ expect(@provider).to receive(:enforce_ownership)
@provider.link_tempfiles_to_current_release
end
end
it "does nothing for restart if restart_command is empty" do
- @provider.should_not_receive(:run_command)
+ expect(@provider).not_to receive(:run_command)
@provider.restart
end
it "runs the restart command in the current application dir when the resource has a restart_command" do
@resource.restart_command "restartcmd"
- @provider.should_receive(:run_command).with(:command => "restartcmd", :cwd => "/my/deploy/dir/current", :log_tag => "deploy[/my/deploy/dir]", :log_level => :debug)
+ expect(@provider).to receive(:run_command).with(:command => "restartcmd", :cwd => "/my/deploy/dir/current", :log_tag => "deploy[/my/deploy/dir]", :log_level => :debug)
@provider.restart
end
it "lists all available releases" do
all_releases = ["/my/deploy/dir/20040815162342", "/my/deploy/dir/20040700000000",
"/my/deploy/dir/20040600000000", "/my/deploy/dir/20040500000000"].sort!
- Dir.should_receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
- @provider.all_releases.should eql(all_releases)
+ expect(Dir).to receive(:glob).with("/my/deploy/dir/releases/*").and_return(all_releases)
+ expect(@provider.all_releases).to eql(all_releases)
end
it "removes all but the 5 newest releases" do
@@ -467,10 +467,10 @@ describe Chef::Provider::Deploy do
"/my/deploy/dir/20040600000000", "/my/deploy/dir/20040500000000",
"/my/deploy/dir/20040400000000", "/my/deploy/dir/20040300000000",
"/my/deploy/dir/20040200000000", "/my/deploy/dir/20040100000000"].sort!
- @provider.stub(:all_releases).and_return(all_releases)
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040100000000")
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040200000000")
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040300000000")
+ allow(@provider).to receive(:all_releases).and_return(all_releases)
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/20040100000000")
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/20040200000000")
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/20040300000000")
@provider.cleanup!
end
@@ -480,8 +480,8 @@ describe Chef::Provider::Deploy do
"/my/deploy/dir/20040600000000", "/my/deploy/dir/20040500000000",
"/my/deploy/dir/20040400000000", "/my/deploy/dir/20040300000000",
"/my/deploy/dir/20040200000000", "/my/deploy/dir/20040100000000"].sort!
- @provider.stub(:all_releases).and_return(all_releases)
- FileUtils.should_receive(:rm_rf).with("/my/deploy/dir/20040100000000")
+ allow(@provider).to receive(:all_releases).and_return(all_releases)
+ expect(FileUtils).to receive(:rm_rf).with("/my/deploy/dir/20040100000000")
@provider.cleanup!
end
@@ -489,27 +489,27 @@ describe Chef::Provider::Deploy do
all_releases = ["/my/deploy/dir/20040815162342", "/my/deploy/dir/20040700000000",
"/my/deploy/dir/20040600000000", "/my/deploy/dir/20040500000000",
"/my/deploy/dir/20040400000000", "/my/deploy/dir/20040300000000"].sort!
- @provider.stub(:all_releases).and_return(all_releases)
- FileUtils.stub(:rm_rf)
- @provider.should_receive(:release_deleted).with("/my/deploy/dir/20040300000000")
+ allow(@provider).to receive(:all_releases).and_return(all_releases)
+ allow(FileUtils).to receive(:rm_rf)
+ expect(@provider).to receive(:release_deleted).with("/my/deploy/dir/20040300000000")
@provider.cleanup!
end
it "puts resource.to_hash in @configuration for backwards compat with capistano-esque deploy hooks" do
- @provider.instance_variable_get(:@configuration).should == @resource.to_hash
+ expect(@provider.instance_variable_get(:@configuration)).to eq(@resource.to_hash)
end
it "sets @configuration[:environment] to the value of RAILS_ENV for backwards compat reasons" do
resource = Chef::Resource::Deploy.new("/my/deploy/dir")
resource.environment "production"
provider = Chef::Provider::Deploy.new(resource, @run_context)
- provider.instance_variable_get(:@configuration)[:environment].should eql("production")
+ expect(provider.instance_variable_get(:@configuration)[:environment]).to eql("production")
end
it "shouldn't give a no method error on migrate if the environment is nil" do
- @provider.stub(:enforce_ownership)
- @provider.stub(:run_symlinks_before_migrate)
- @provider.stub(:run_command)
+ allow(@provider).to receive(:enforce_ownership)
+ allow(@provider).to receive(:run_symlinks_before_migrate)
+ allow(@provider).to receive(:run_command)
@provider.migrate
end
@@ -521,13 +521,13 @@ describe Chef::Provider::Deploy do
recipe_code = Proc.new {snitch = 42}
#@provider.should_receive(:instance_eval).with(&recipe_code)
@provider.callback(:whateverz, recipe_code)
- snitch.should == 42
+ expect(snitch).to eq(42)
end
it "loads a recipe file from the specified path and from_file evals it" do
- ::File.should_receive(:exist?).with(@expected_release_dir + "/chefz/foobar_callback.rb").once.and_return(true)
- ::Dir.should_receive(:chdir).with(@expected_release_dir).and_yield
- @provider.should_receive(:from_file).with(@expected_release_dir + "/chefz/foobar_callback.rb")
+ expect(::File).to receive(:exist?).with(@expected_release_dir + "/chefz/foobar_callback.rb").once.and_return(true)
+ expect(::Dir).to receive(:chdir).with(@expected_release_dir).and_yield
+ expect(@provider).to receive(:from_file).with(@expected_release_dir + "/chefz/foobar_callback.rb")
@provider.callback(:whateverz, "chefz/foobar_callback.rb")
end
@@ -536,40 +536,40 @@ describe Chef::Provider::Deploy do
restart_cmd = Proc.new {snitch = 42}
@resource.restart(&restart_cmd)
@provider.restart
- snitch.should == 42
+ expect(snitch).to eq(42)
end
end
describe "API bridge to capistrano" do
it "defines sudo as a forwarder to execute" do
- @provider.should_receive(:execute).with("the moon, fool")
+ expect(@provider).to receive(:execute).with("the moon, fool")
@provider.sudo("the moon, fool")
end
it "defines run as a forwarder to execute, setting the user, group, cwd and environment to new_resource.user" do
mock_execution = double("Resource::Execute")
- @provider.should_receive(:execute).with("iGoToHell4this").and_return(mock_execution)
+ expect(@provider).to receive(:execute).with("iGoToHell4this").and_return(mock_execution)
@resource.user("notCoolMan")
@resource.group("Ggroup")
@resource.environment("APP_ENV" => 'staging')
@resource.deploy_to("/my/app")
- mock_execution.should_receive(:user).with("notCoolMan")
- mock_execution.should_receive(:group).with("Ggroup")
- mock_execution.should_receive(:cwd){|*args|
+ expect(mock_execution).to receive(:user).with("notCoolMan")
+ expect(mock_execution).to receive(:group).with("Ggroup")
+ expect(mock_execution).to receive(:cwd){|*args|
if args.empty?
nil
else
- args.size.should == 1
- args.first.should == @provider.release_path
+ expect(args.size).to eq(1)
+ expect(args.first).to eq(@provider.release_path)
end
}.twice
- mock_execution.should_receive(:environment){ |*args|
+ expect(mock_execution).to receive(:environment){ |*args|
if args.empty?
nil
else
- args.size.should == 1
- args.first.should == {"APP_ENV" => "staging"}
+ expect(args.size).to eq(1)
+ expect(args.first).to eq({"APP_ENV" => "staging"})
end
}.twice
@provider.run("iGoToHell4this")
@@ -578,18 +578,18 @@ describe Chef::Provider::Deploy do
it "defines run as a forwarder to execute, setting cwd and environment but not override" do
mock_execution = double("Resource::Execute")
- @provider.should_receive(:execute).with("iGoToHell4this").and_return(mock_execution)
+ expect(@provider).to receive(:execute).with("iGoToHell4this").and_return(mock_execution)
@resource.user("notCoolMan")
- mock_execution.should_receive(:user).with("notCoolMan")
- mock_execution.should_receive(:cwd).with(no_args()).and_return("/some/value")
- mock_execution.should_receive(:environment).with(no_args()).and_return({})
+ expect(mock_execution).to receive(:user).with("notCoolMan")
+ expect(mock_execution).to receive(:cwd).with(no_args()).and_return("/some/value")
+ expect(mock_execution).to receive(:environment).with(no_args()).and_return({})
@provider.run("iGoToHell4this")
end
it "converts sudo and run to exec resources in hooks" do
runner = double("tehRunner")
- Chef::Runner.stub(:new).and_return(runner)
+ allow(Chef::Runner).to receive(:new).and_return(runner)
snitch = nil
@resource.user("tehCat")
@@ -601,40 +601,40 @@ describe Chef::Provider::Deploy do
snitch = temp_collection.lookup("execute[tehMice]")
end
- runner.should_receive(:converge)
+ expect(runner).to receive(:converge)
#
@provider.callback(:phony, callback_code)
- snitch.should be_an_instance_of(Chef::Resource::Execute)
- snitch.user.should == "tehCat"
+ expect(snitch).to be_an_instance_of(Chef::Resource::Execute)
+ expect(snitch.user).to eq("tehCat")
end
end
describe "installing gems from a gems.yml" do
before do
- ::File.stub(:exist?).with("#{@expected_release_dir}/gems.yml").and_return(true)
+ allow(::File).to receive(:exist?).with("#{@expected_release_dir}/gems.yml").and_return(true)
@gem_list = [{:name=>"eventmachine", :version=>"0.12.9"}]
end
it "reads a gems.yml file, creating gem providers for each with action :upgrade" do
- IO.should_receive(:read).with("#{@expected_release_dir}/gems.yml").and_return("cookie")
- YAML.should_receive(:load).with("cookie").and_return(@gem_list)
+ expect(IO).to receive(:read).with("#{@expected_release_dir}/gems.yml").and_return("cookie")
+ expect(YAML).to receive(:load).with("cookie").and_return(@gem_list)
gems = @provider.send(:gem_packages)
- gems.map { |g| g.action }.should == [[:install]]
- gems.map { |g| g.name }.should == %w{eventmachine}
- gems.map { |g| g.version }.should == %w{0.12.9}
+ expect(gems.map { |g| g.action }).to eq([[:install]])
+ expect(gems.map { |g| g.name }).to eq(%w{eventmachine})
+ expect(gems.map { |g| g.version }).to eq(%w{0.12.9})
end
it "takes a list of gem providers converges them" do
- IO.stub(:read)
- YAML.stub(:load).and_return(@gem_list)
+ allow(IO).to receive(:read)
+ allow(YAML).to receive(:load).and_return(@gem_list)
expected_gem_resources = @provider.send(:gem_packages).map { |r| [r.name, r.version] }
gem_runner = @provider.send(:gem_resource_collection_runner)
# no one has heard of defining == to be meaningful so I have use this monstrosity
actual = gem_runner.run_context.resource_collection.all_resources.map { |r| [r.name, r.version] }
- actual.should == expected_gem_resources
+ expect(actual).to eq(expected_gem_resources)
end
end
diff --git a/spec/unit/provider/directory_spec.rb b/spec/unit/provider/directory_spec.rb
index 25ca9e0175..98f860bc75 100644
--- a/spec/unit/provider/directory_spec.rb
+++ b/spec/unit/provider/directory_spec.rb
@@ -42,37 +42,37 @@ describe Chef::Provider::Directory do
end
it "describes the directory's access rights" do
- pending
+ skip
end
end
describe "scanning file security metadata on unix" do
before do
- Chef::Platform.stub(:windows?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(false)
end
let(:mock_stat) do
cstats = double("stats")
- cstats.stub(:uid).and_return(500)
- cstats.stub(:gid).and_return(500)
- cstats.stub(:mode).and_return(0755)
+ allow(cstats).to receive(:uid).and_return(500)
+ allow(cstats).to receive(:gid).and_return(500)
+ allow(cstats).to receive(:mode).and_return(0755)
cstats
end
it "describes the access mode as a String of octal integers" do
- File.stub(:exists?).and_return(true)
- File.should_receive(:stat).and_return(mock_stat)
+ allow(File).to receive(:exists?).and_return(true)
+ expect(File).to receive(:stat).and_return(mock_stat)
@directory.load_current_resource
- @directory.current_resource.mode.should == "0755"
+ expect(@directory.current_resource.mode).to eq("0755")
end
context "when user and group are specified with UID/GID" do
it "describes the current owner and group as UID and GID" do
- File.stub(:exists?).and_return(true)
- File.should_receive(:stat).and_return(mock_stat)
+ allow(File).to receive(:exists?).and_return(true)
+ expect(File).to receive(:stat).and_return(mock_stat)
@directory.load_current_resource
- @directory.current_resource.path.should eql(@new_resource.path)
- @directory.current_resource.owner.should eql(500)
- @directory.current_resource.group.should eql(500)
+ expect(@directory.current_resource.path).to eql(@new_resource.path)
+ expect(@directory.current_resource.owner).to eql(500)
+ expect(@directory.current_resource.group).to eql(500)
end
end
@@ -86,20 +86,20 @@ describe Chef::Provider::Directory do
it "should create a new directory on create, setting updated to true", :unix_only do
@new_resource.path "/tmp/foo"
- File.should_receive(:exists?).at_least(:once).and_return(false)
- File.should_receive(:directory?).with("/tmp").and_return(true)
- Dir.should_receive(:mkdir).with(@new_resource.path).once.and_return(true)
+ expect(File).to receive(:exists?).at_least(:once).and_return(false)
+ expect(File).to receive(:directory?).with("/tmp").and_return(true)
+ expect(Dir).to receive(:mkdir).with(@new_resource.path).once.and_return(true)
- @directory.should_receive(:do_acl_changes)
- @directory.stub(:do_selinux)
+ expect(@directory).to receive(:do_acl_changes)
+ allow(@directory).to receive(:do_selinux)
@directory.run_action(:create)
- @directory.new_resource.should be_updated
+ expect(@directory.new_resource).to be_updated
end
it "should raise an exception if the parent directory does not exist and recursive is false" do
@new_resource.path "/tmp/some/dir"
@new_resource.recursive false
- lambda { @directory.run_action(:create) }.should raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist)
+ expect { @directory.run_action(:create) }.to raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist)
end
# Unix only for now. While file security attribute reporting for windows is
@@ -108,26 +108,26 @@ describe Chef::Provider::Directory do
it "should create a new directory when parent directory does not exist if recursive is true and permissions are correct", :unix_only do
@new_resource.path "/path/to/dir"
@new_resource.recursive true
- File.should_receive(:exists?).with(@new_resource.path).ordered.and_return(false)
+ expect(File).to receive(:exists?).with(@new_resource.path).ordered.and_return(false)
- File.should_receive(:exists?).with('/path/to').ordered.and_return(false)
- File.should_receive(:exists?).with('/path').ordered.and_return(true)
- File.should_receive(:writable?).with('/path').ordered.and_return(true)
- File.should_receive(:exists?).with(@new_resource.path).ordered.and_return(false)
+ expect(File).to receive(:exists?).with('/path/to').ordered.and_return(false)
+ expect(File).to receive(:exists?).with('/path').ordered.and_return(true)
+ expect(File).to receive(:writable?).with('/path').ordered.and_return(true)
+ expect(File).to receive(:exists?).with(@new_resource.path).ordered.and_return(false)
- FileUtils.should_receive(:mkdir_p).with(@new_resource.path).and_return(true)
- @directory.should_receive(:do_acl_changes)
- @directory.stub(:do_selinux)
+ expect(FileUtils).to receive(:mkdir_p).with(@new_resource.path).and_return(true)
+ expect(@directory).to receive(:do_acl_changes)
+ allow(@directory).to receive(:do_selinux)
@directory.run_action(:create)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should raise an error when creating a directory when parent directory is a file" do
- File.should_receive(:directory?).and_return(false)
- Dir.should_not_receive(:mkdir).with(@new_resource.path)
- lambda { @directory.run_action(:create) }.should raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist)
- @directory.new_resource.should_not be_updated
+ expect(File).to receive(:directory?).and_return(false)
+ expect(Dir).not_to receive(:mkdir).with(@new_resource.path)
+ expect { @directory.run_action(:create) }.to raise_error(Chef::Exceptions::EnclosingDirectoryDoesNotExist)
+ expect(@directory.new_resource).not_to be_updated
end
# Unix only for now. While file security attribute reporting for windows is
@@ -136,53 +136,53 @@ describe Chef::Provider::Directory do
it "should not create the directory if it already exists", :unix_only do
stub_file_cstats
@new_resource.path "/tmp/foo"
- File.should_receive(:directory?).at_least(:once).and_return(true)
- File.should_receive(:writable?).with("/tmp").and_return(true)
- File.should_receive(:exists?).at_least(:once).and_return(true)
- Dir.should_not_receive(:mkdir).with(@new_resource.path)
- @directory.should_receive(:do_acl_changes)
+ expect(File).to receive(:directory?).at_least(:once).and_return(true)
+ expect(File).to receive(:writable?).with("/tmp").and_return(true)
+ expect(File).to receive(:exists?).at_least(:once).and_return(true)
+ expect(Dir).not_to receive(:mkdir).with(@new_resource.path)
+ expect(@directory).to receive(:do_acl_changes)
@directory.run_action(:create)
end
it "should delete the directory if it exists, and is writable with action_delete" do
- File.should_receive(:directory?).and_return(true)
- File.should_receive(:writable?).once.and_return(true)
- Dir.should_receive(:delete).with(@new_resource.path).once.and_return(true)
+ expect(File).to receive(:directory?).and_return(true)
+ expect(File).to receive(:writable?).once.and_return(true)
+ expect(Dir).to receive(:delete).with(@new_resource.path).once.and_return(true)
@directory.run_action(:delete)
end
it "should raise an exception if it cannot delete the directory due to bad permissions" do
- File.stub(:exists?).and_return(true)
- File.stub(:writable?).and_return(false)
- lambda { @directory.run_action(:delete) }.should raise_error(RuntimeError)
+ allow(File).to receive(:exists?).and_return(true)
+ allow(File).to receive(:writable?).and_return(false)
+ expect { @directory.run_action(:delete) }.to raise_error(RuntimeError)
end
it "should take no action when deleting a target directory that does not exist" do
@new_resource.path "/an/invalid/path"
- File.stub(:exists?).and_return(false)
- Dir.should_not_receive(:delete).with(@new_resource.path)
+ allow(File).to receive(:exists?).and_return(false)
+ expect(Dir).not_to receive(:delete).with(@new_resource.path)
@directory.run_action(:delete)
- @directory.new_resource.should_not be_updated
+ expect(@directory.new_resource).not_to be_updated
end
it "should raise an exception when deleting a directory when target directory is a file" do
stub_file_cstats
@new_resource.path "/an/invalid/path"
- File.stub(:exists?).and_return(true)
- File.should_receive(:directory?).and_return(false)
- Dir.should_not_receive(:delete).with(@new_resource.path)
- lambda { @directory.run_action(:delete) }.should raise_error(RuntimeError)
- @directory.new_resource.should_not be_updated
+ allow(File).to receive(:exists?).and_return(true)
+ expect(File).to receive(:directory?).and_return(false)
+ expect(Dir).not_to receive(:delete).with(@new_resource.path)
+ expect { @directory.run_action(:delete) }.to raise_error(RuntimeError)
+ expect(@directory.new_resource).not_to be_updated
end
def stub_file_cstats
cstats = double("stats")
- cstats.stub(:uid).and_return(500)
- cstats.stub(:gid).and_return(500)
- cstats.stub(:mode).and_return(0755)
+ allow(cstats).to receive(:uid).and_return(500)
+ allow(cstats).to receive(:gid).and_return(500)
+ allow(cstats).to receive(:mode).and_return(0755)
# File.stat is called in:
# - Chef::Provider::File.load_current_resource_attrs
# - Chef::ScanAccessControl via Chef::Provider::File.setup_acl
- File.stub(:stat).and_return(cstats)
+ allow(File).to receive(:stat).and_return(cstats)
end
end
diff --git a/spec/unit/provider/dsc_script_spec.rb b/spec/unit/provider/dsc_script_spec.rb
index d8fbee3ff9..d018c8ad54 100644
--- a/spec/unit/provider/dsc_script_spec.rb
+++ b/spec/unit/provider/dsc_script_spec.rb
@@ -39,21 +39,21 @@ describe Chef::Provider::DscScript do
it "describes the resource as converged if there were 0 DSC resources" do
allow(provider).to receive(:run_configuration).with(:test).and_return([])
provider.load_current_resource
- provider.instance_variable_get('@resource_converged').should be_true
+ expect(provider.instance_variable_get('@resource_converged')).to be_truthy
end
it "describes the resource as not converged if there is 1 DSC resources that is converged" do
dsc_resource_info = Chef::Util::DSC::ResourceInfo.new('resource', false, ['nothing will change something'])
allow(provider).to receive(:run_configuration).with(:test).and_return([dsc_resource_info])
provider.load_current_resource
- provider.instance_variable_get('@resource_converged').should be_true
+ expect(provider.instance_variable_get('@resource_converged')).to be_truthy
end
it "describes the resource as not converged if there is 1 DSC resources that is not converged" do
dsc_resource_info = Chef::Util::DSC::ResourceInfo.new('resource', true, ['will change something'])
allow(provider).to receive(:run_configuration).with(:test).and_return([dsc_resource_info])
provider.load_current_resource
- provider.instance_variable_get('@resource_converged').should be_false
+ expect(provider.instance_variable_get('@resource_converged')).to be_falsey
end
it "describes the resource as not converged if there are any DSC resources that are not converged" do
@@ -62,7 +62,7 @@ describe Chef::Provider::DscScript do
allow(provider).to receive(:run_configuration).with(:test).and_return([dsc_resource_info1, dsc_resource_info2])
provider.load_current_resource
- provider.instance_variable_get('@resource_converged').should be_false
+ expect(provider.instance_variable_get('@resource_converged')).to be_falsey
end
it "describes the resource as converged if all DSC resources that are converged" do
@@ -71,7 +71,7 @@ describe Chef::Provider::DscScript do
allow(provider).to receive(:run_configuration).with(:test).and_return([dsc_resource_info1, dsc_resource_info2])
provider.load_current_resource
- provider.instance_variable_get('@resource_converged').should be_true
+ expect(provider.instance_variable_get('@resource_converged')).to be_truthy
end
end
@@ -82,7 +82,7 @@ describe Chef::Provider::DscScript do
allow(provider).to receive(:load_current_resource)
resource.command("path_to_script")
generator = double('Chef::Util::DSC::ConfigurationGenerator')
- generator.should_receive(:configuration_document_from_script_path)
+ expect(generator).to receive(:configuration_document_from_script_path)
allow(Chef::Util::DSC::ConfigurationGenerator).to receive(:new).and_return(generator)
provider.send(:generate_configuration_document, 'tmp', nil)
end
@@ -91,7 +91,7 @@ describe Chef::Provider::DscScript do
allow(provider).to receive(:load_current_resource)
resource.code("ImADSCResource{}")
generator = double('Chef::Util::DSC::ConfigurationGenerator')
- generator.should_receive(:configuration_document_from_script_code)
+ expect(generator).to receive(:configuration_document_from_script_code)
allow(Chef::Util::DSC::ConfigurationGenerator).to receive(:new).and_return(generator)
provider.send(:generate_configuration_document, 'tmp', nil)
end
@@ -99,7 +99,7 @@ describe Chef::Provider::DscScript do
it 'should noop if neither code or command are provided' do
allow(provider).to receive(:load_current_resource)
generator = double('Chef::Util::DSC::ConfigurationGenerator')
- generator.should_receive(:configuration_document_from_script_code).with('', anything(), anything())
+ expect(generator).to receive(:configuration_document_from_script_code).with('', anything(), anything())
allow(Chef::Util::DSC::ConfigurationGenerator).to receive(:new).and_return(generator)
provider.send(:generate_configuration_document, 'tmp', nil)
end
@@ -112,14 +112,14 @@ describe Chef::Provider::DscScript do
allow(provider).to receive(:run_configuration).with(:set)
provider.run_action(:run)
- resource.should be_updated
+ expect(resource).to be_updated
end
it 'should not converge if the script is already converged' do
allow(provider).to receive(:run_configuration).with(:test).and_return([])
provider.run_action(:run)
- resource.should_not be_updated
+ expect(resource).not_to be_updated
end
end
@@ -127,19 +127,19 @@ describe Chef::Provider::DscScript do
it 'removes the resource name from the beginning of any log line from the LCM' do
dsc_resource_info = Chef::Util::DSC::ResourceInfo.new('resourcename', true, ['resourcename doing something', 'lastline'])
provider.instance_variable_set('@dsc_resources_info', [dsc_resource_info])
- provider.send(:generate_description)[1].should match(/converge DSC resource resourcename by doing something/)
+ expect(provider.send(:generate_description)[1]).to match(/converge DSC resource resourcename by doing something/)
end
it 'ignores the last line' do
dsc_resource_info = Chef::Util::DSC::ResourceInfo.new('resourcename', true, ['resourcename doing something', 'lastline'])
provider.instance_variable_set('@dsc_resources_info', [dsc_resource_info])
- provider.send(:generate_description)[1].should_not match(/lastline/)
+ expect(provider.send(:generate_description)[1]).not_to match(/lastline/)
end
it 'reports a dsc resource has not been changed if the LCM reported no change was required' do
dsc_resource_info = Chef::Util::DSC::ResourceInfo.new('resourcename', false, ['resourcename does nothing', 'lastline'])
provider.instance_variable_set('@dsc_resources_info', [dsc_resource_info])
- provider.send(:generate_description)[1].should match(/converge DSC resource resourcename by doing nothing/)
+ expect(provider.send(:generate_description)[1]).to match(/converge DSC resource resourcename by doing nothing/)
end
end
end
diff --git a/spec/unit/provider/env/windows_spec.rb b/spec/unit/provider/env/windows_spec.rb
index 2ea137c1d9..99f33d392a 100644
--- a/spec/unit/provider/env/windows_spec.rb
+++ b/spec/unit/provider/env/windows_spec.rb
@@ -31,7 +31,7 @@ describe Chef::Provider::Env::Windows, :windows_only do
}
let(:provider) {
provider = Chef::Provider::Env::Windows.new(new_resource, run_context)
- provider.stub(:env_obj).and_return(double('null object').as_null_object)
+ allow(provider).to receive(:env_obj).and_return(double('null object').as_null_object)
provider
}
@@ -53,7 +53,7 @@ describe Chef::Provider::Env::Windows, :windows_only do
end
it "should update the ruby ENV object when it updates the value" do
- provider.should_receive(:compare_value).and_return(true)
+ expect(provider).to receive(:requires_modify_or_create?).and_return(true)
new_resource.value("foobar")
provider.action_modify
expect(ENV['CHEF_WINDOWS_ENV_TEST']).to eql('foobar')
@@ -83,7 +83,7 @@ describe Chef::Provider::Env::Windows, :windows_only do
}
let(:provider) {
provider = Chef::Provider::Env::Windows.new(new_resource, run_context)
- provider.stub(:env_obj).and_return(double('null object').as_null_object)
+ allow(provider).to receive(:env_obj).and_return(double('null object').as_null_object)
provider
}
@@ -92,8 +92,8 @@ describe Chef::Provider::Env::Windows, :windows_only do
end
it "replaces Windows system variables" do
- provider.should_receive(:compare_value).and_return(true)
- provider.should_receive(:expand_path).with(system_root).and_return(system_root_value)
+ expect(provider).to receive(:requires_modify_or_create?).and_return(true)
+ expect(provider).to receive(:expand_path).with(system_root).and_return(system_root_value)
provider.action_modify
expect(ENV['PATH']).to eql(system_root_value)
end
diff --git a/spec/unit/provider/env_spec.rb b/spec/unit/provider/env_spec.rb
index dc6176d45c..19233dfba9 100644
--- a/spec/unit/provider/env_spec.rb
+++ b/spec/unit/provider/env_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Provider::Env do
end
it "assumes the key_name exists by default" do
- @provider.key_exists.should be_true
+ expect(@provider.key_exists).to be_truthy
end
describe "when loading the current status" do
@@ -38,73 +38,73 @@ describe Chef::Provider::Env do
#@current_resource = @new_resource.clone
#Chef::Resource::Env.stub(:new).and_return(@current_resource)
@provider.current_resource = @current_resource
- @provider.stub(:env_value).with("FOO").and_return("bar")
- @provider.stub(:env_key_exists).and_return(true)
+ allow(@provider).to receive(:env_value).with("FOO").and_return("bar")
+ allow(@provider).to receive(:env_key_exists).and_return(true)
end
it "should create a current resource with the same name as the new resource" do
@provider.load_current_resource
- @provider.new_resource.name.should == "FOO"
+ expect(@provider.new_resource.name).to eq("FOO")
end
it "should set the key_name to the key name of the new resource" do
@provider.load_current_resource
- @provider.current_resource.key_name.should == "FOO"
+ expect(@provider.current_resource.key_name).to eq("FOO")
end
it "should check if the key_name exists" do
- @provider.should_receive(:env_key_exists).with("FOO").and_return(true)
+ expect(@provider).to receive(:env_key_exists).with("FOO").and_return(true)
@provider.load_current_resource
- @provider.key_exists.should be_true
+ expect(@provider.key_exists).to be_truthy
end
it "should flip the value of exists if the key does not exist" do
- @provider.should_receive(:env_key_exists).with("FOO").and_return(false)
+ expect(@provider).to receive(:env_key_exists).with("FOO").and_return(false)
@provider.load_current_resource
- @provider.key_exists.should be_false
+ expect(@provider.key_exists).to be_falsey
end
it "should return the current resource" do
- @provider.load_current_resource.should be_a_kind_of(Chef::Resource::Env)
+ expect(@provider.load_current_resource).to be_a_kind_of(Chef::Resource::Env)
end
end
describe "action_create" do
before do
@provider.key_exists = false
- @provider.stub(:create_env).and_return(true)
- @provider.stub(:modify_env).and_return(true)
+ allow(@provider).to receive(:create_env).and_return(true)
+ allow(@provider).to receive(:modify_env).and_return(true)
end
it "should call create_env if the key does not exist" do
- @provider.should_receive(:create_env).and_return(true)
+ expect(@provider).to receive(:create_env).and_return(true)
@provider.action_create
end
it "should set the new_resources updated flag when it creates the key" do
@provider.action_create
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should check to see if the values are the same if the key exists" do
@provider.key_exists = true
- @provider.should_receive(:compare_value).and_return(false)
+ expect(@provider).to receive(:requires_modify_or_create?).and_return(false)
@provider.action_create
end
it "should call modify_env if the key exists and values are not equal" do
@provider.key_exists = true
- @provider.stub(:compare_value).and_return(true)
- @provider.should_receive(:modify_env).and_return(true)
+ allow(@provider).to receive(:requires_modify_or_create?).and_return(true)
+ expect(@provider).to receive(:modify_env).and_return(true)
@provider.action_create
end
it "should set the new_resources updated flag when it updates an existing value" do
@provider.key_exists = true
- @provider.stub(:compare_value).and_return(true)
- @provider.stub(:modify_env).and_return(true)
+ allow(@provider).to receive(:requires_modify_or_create?).and_return(true)
+ allow(@provider).to receive(:modify_env).and_return(true)
@provider.action_create
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
@@ -112,30 +112,30 @@ describe Chef::Provider::Env do
before(:each) do
@provider.current_resource = @current_resource
@provider.key_exists = false
- @provider.stub(:delete_element).and_return(false)
- @provider.stub(:delete_env).and_return(true)
+ allow(@provider).to receive(:delete_element).and_return(false)
+ allow(@provider).to receive(:delete_env).and_return(true)
end
it "should not call delete_env if the key does not exist" do
- @provider.should_not_receive(:delete_env)
+ expect(@provider).not_to receive(:delete_env)
@provider.action_delete
end
it "should not call delete_element if the key does not exist" do
- @provider.should_not_receive(:delete_element)
+ expect(@provider).not_to receive(:delete_element)
@provider.action_delete
end
it "should call delete_env if the key exists" do
@provider.key_exists = true
- @provider.should_receive(:delete_env)
+ expect(@provider).to receive(:delete_env)
@provider.action_delete
end
it "should set the new_resources updated flag to true if the key is deleted" do
@provider.key_exists = true
@provider.action_delete
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
@@ -143,31 +143,31 @@ describe Chef::Provider::Env do
before(:each) do
@provider.current_resource = @current_resource
@provider.key_exists = true
- @provider.stub(:modify_env).and_return(true)
+ allow(@provider).to receive(:modify_env).and_return(true)
end
it "should call modify_group if the key exists and values are not equal" do
- @provider.should_receive(:compare_value).and_return(true)
- @provider.should_receive(:modify_env).and_return(true)
+ expect(@provider).to receive(:requires_modify_or_create?).and_return(true)
+ expect(@provider).to receive(:modify_env).and_return(true)
@provider.action_modify
end
it "should set the new resources updated flag to true if modify_env is called" do
- @provider.stub(:compare_value).and_return(true)
- @provider.stub(:modify_env).and_return(true)
+ allow(@provider).to receive(:requires_modify_or_create?).and_return(true)
+ allow(@provider).to receive(:modify_env).and_return(true)
@provider.action_modify
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not call modify_env if the key exists but the values are equal" do
- @provider.should_receive(:compare_value).and_return(false)
- @provider.should_not_receive(:modify_env)
+ expect(@provider).to receive(:requires_modify_or_create?).and_return(false)
+ expect(@provider).not_to receive(:modify_env)
@provider.action_modify
end
it "should raise a Chef::Exceptions::Env if the key doesn't exist" do
@provider.key_exists = false
- lambda { @provider.action_modify }.should raise_error(Chef::Exceptions::Env)
+ expect { @provider.action_modify }.to raise_error(Chef::Exceptions::Env)
end
end
@@ -183,24 +183,46 @@ describe Chef::Provider::Env do
end
it "should return true if the element is not found" do
- @new_resource.stub(:value).and_return("C:/baz/bin")
- @provider.delete_element.should eql(true)
+ allow(@new_resource).to receive(:value).and_return("C:/baz/bin")
+ expect(@provider.delete_element).to eql(true)
end
it "should return false if the delim not defined" do
- @new_resource.stub(:delim).and_return(nil)
- @provider.delete_element.should eql(false)
+ allow(@new_resource).to receive(:delim).and_return(nil)
+ expect(@provider.delete_element).to eql(false)
end
it "should return true if the element is deleted" do
@new_resource.value("C:/foo/bin")
- @provider.should_receive(:create_env)
- @provider.delete_element.should eql(true)
- @new_resource.should be_updated
+ expect(@provider).to receive(:create_env)
+ expect(@provider.delete_element).to eql(true)
+ expect(@new_resource).to be_updated
+ end
+
+ context "when new_resource's value contains the delimiter" do
+ it "should return false if all the elements are deleted" do
+ # This indicates that the entire key needs to be deleted
+ @new_resource.value("C:/foo/bin;C:/bar/bin")
+ expect(@provider.delete_element).to eql(false)
+ expect(@new_resource).not_to be_updated # This will be updated in action_delete
+ end
+
+ it "should return true if any, but not all, of the elements are deleted" do
+ @new_resource.value("C:/foo/bin;C:/notbaz/bin")
+ expect(@provider).to receive(:create_env)
+ expect(@provider.delete_element).to eql(true)
+ expect(@new_resource).to be_updated
+ end
+
+ it "should return true if none of the elements are deleted" do
+ @new_resource.value("C:/notfoo/bin;C:/notbaz/bin")
+ expect(@provider.delete_element).to eql(true)
+ expect(@new_resource).not_to be_updated
+ end
end
end
- describe "compare_value" do
+ describe "requires_modify_or_create?" do
before(:each) do
@new_resource.value("C:/bar")
@current_resource = @new_resource.clone
@@ -208,31 +230,47 @@ describe Chef::Provider::Env do
end
it "should return false if the values are equal" do
- @provider.compare_value.should be_false
+ expect(@provider.requires_modify_or_create?).to be_falsey
end
it "should return true if the values not are equal" do
@new_resource.value("C:/elsewhere")
- @provider.compare_value.should be_true
+ expect(@provider.requires_modify_or_create?).to be_truthy
end
it "should return false if the current value contains the element" do
@new_resource.delim(";")
@current_resource.value("C:/bar;C:/foo;C:/baz")
- @provider.compare_value.should be_false
+ expect(@provider.requires_modify_or_create?).to be_falsey
end
it "should return true if the current value does not contain the element" do
@new_resource.delim(";")
@current_resource.value("C:/biz;C:/foo/bin;C:/baz")
- @provider.compare_value.should be_true
+ expect(@provider.requires_modify_or_create?).to be_truthy
+ end
+
+ context "when new_resource's value contains the delimiter" do
+ it "should return false if all the current values are contained" do
+ @new_resource.value("C:/biz;C:/baz")
+ @new_resource.delim(";")
+ @current_resource.value("C:/biz;C:/foo/bin;C:/baz")
+ expect(@provider.requires_modify_or_create?).to be_falsey
+ end
+
+ it "should return true if any of the new values are not contained" do
+ @new_resource.value("C:/biz;C:/baz;C:/bin")
+ @new_resource.delim(";")
+ @current_resource.value("C:/biz;C:/foo/bin;C:/baz")
+ expect(@provider.requires_modify_or_create?).to be_truthy
+ end
end
end
describe "modify_env" do
before(:each) do
- @provider.stub(:create_env).and_return(true)
+ allow(@provider).to receive(:create_env).and_return(true)
@new_resource.delim ";"
@current_resource = Chef::Resource::Env.new("FOO")
@@ -245,7 +283,15 @@ describe Chef::Provider::Env do
passed_value = new_value.dup
@new_resource.value(passed_value)
@provider.modify_env
- passed_value.should == new_value
+ expect(passed_value).to eq(new_value)
+ end
+
+ it "should only add values not already contained when a delimiter is provided" do
+ @new_resource.value("C:/foo;C:/bar;C:/baz")
+ @new_resource.delim(";")
+ @current_resource.value("C:/foo/bar;C:/bar;C:/baz")
+ @provider.modify_env
+ expect(@new_resource.value).to eq("C:/foo;C:/foo/bar;C:/bar;C:/baz")
end
end
end
diff --git a/spec/unit/provider/erl_call_spec.rb b/spec/unit/provider/erl_call_spec.rb
index 19e16f282f..2fb7e5b737 100644
--- a/spec/unit/provider/erl_call_spec.rb
+++ b/spec/unit/provider/erl_call_spec.rb
@@ -31,7 +31,7 @@ describe Chef::Provider::ErlCall do
@provider = Chef::Provider::ErlCall.new(@new_resource, @run_context)
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@stdin = StringIO.new
@stdout = StringIO.new('{ok, woohoo}')
@stderr = StringIO.new
@@ -40,11 +40,11 @@ describe Chef::Provider::ErlCall do
it "should return a Chef::Provider::ErlCall object" do
provider = Chef::Provider::ErlCall.new(@new_resource, @run_context)
- provider.should be_a_kind_of(Chef::Provider::ErlCall)
+ expect(provider).to be_a_kind_of(Chef::Provider::ErlCall)
end
it "should return true" do
- @provider.load_current_resource.should eql(true)
+ expect(@provider.load_current_resource).to eql(true)
end
describe "when running a distributed erl call resource" do
@@ -56,12 +56,12 @@ describe Chef::Provider::ErlCall do
it "should write to stdin of the erl_call command" do
expected_cmd = "erl_call -e -s -sname chef@localhost -c nomnomnom"
- @provider.should_receive(:popen4).with(expected_cmd, :waitlast => true).and_return([@pid, @stdin, @stdout, @stderr])
- Process.should_receive(:wait).with(@pid)
+ expect(@provider).to receive(:popen4).with(expected_cmd, :waitlast => true).and_return([@pid, @stdin, @stdout, @stderr])
+ expect(Process).to receive(:wait).with(@pid)
@provider.action_run
- @stdin.string.should == "#{@new_resource.code}\n"
+ expect(@stdin.string).to eq("#{@new_resource.code}\n")
end
end
@@ -73,12 +73,12 @@ describe Chef::Provider::ErlCall do
end
it "should write to stdin of the erl_call command" do
- @provider.should_receive(:popen4).with("erl_call -e -name chef@localhost ", :waitlast => true).and_return([@pid, @stdin, @stdout, @stderr])
- Process.should_receive(:wait).with(@pid)
+ expect(@provider).to receive(:popen4).with("erl_call -e -name chef@localhost ", :waitlast => true).and_return([@pid, @stdin, @stdout, @stderr])
+ expect(Process).to receive(:wait).with(@pid)
@provider.action_run
- @stdin.string.should == "#{@new_resource.code}\n"
+ expect(@stdin.string).to eq("#{@new_resource.code}\n")
end
end
diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb
index 6aa48f1e2a..ea16d8cf54 100644
--- a/spec/unit/provider/execute_spec.rb
+++ b/spec/unit/provider/execute_spec.rb
@@ -33,7 +33,7 @@ describe Chef::Provider::Execute do
@provider.current_resource = @current_resource
Chef::Log.level = :info
# FIXME: There should be a test for how STDOUT.tty? changes the live_stream option being passed
- STDOUT.stub(:tty?).and_return(true)
+ allow(STDOUT).to receive(:tty?).and_return(true)
end
let(:opts) do
@@ -47,59 +47,59 @@ describe Chef::Provider::Execute do
end
it "should execute foo_resource" do
- @provider.stub(:load_current_resource)
- @provider.should_receive(:shell_out!).with(@new_resource.command, opts)
- @provider.should_receive(:converge_by).with("execute foo_resource").and_call_original
- Chef::Log.should_not_receive(:warn)
+ allow(@provider).to receive(:load_current_resource)
+ expect(@provider).to receive(:shell_out!).with(@new_resource.command, opts)
+ expect(@provider).to receive(:converge_by).with("execute foo_resource").and_call_original
+ expect(Chef::Log).not_to receive(:warn)
@provider.run_action(:run)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should honor sensitive attribute" do
@new_resource.sensitive true
@provider = Chef::Provider::Execute.new(@new_resource, @run_context)
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
# Since the resource is sensitive, it should not have :live_stream set
- @provider.should_receive(:shell_out!).with(@new_resource.command, opts.reject { |k| k == :live_stream })
- Chef::Log.should_not_receive(:warn)
- @provider.should_receive(:converge_by).with("execute sensitive resource").and_call_original
+ expect(@provider).to receive(:shell_out!).with(@new_resource.command, opts.reject { |k| k == :live_stream })
+ expect(Chef::Log).not_to receive(:warn)
+ expect(@provider).to receive(:converge_by).with("execute sensitive resource").and_call_original
@provider.run_action(:run)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should do nothing if the sentinel file exists" do
- @provider.stub(:load_current_resource)
- File.should_receive(:exists?).with(@new_resource.creates).and_return(true)
- @provider.should_not_receive(:shell_out!)
- Chef::Log.should_not_receive(:warn)
+ allow(@provider).to receive(:load_current_resource)
+ expect(File).to receive(:exists?).with(@new_resource.creates).and_return(true)
+ expect(@provider).not_to receive(:shell_out!)
+ expect(Chef::Log).not_to receive(:warn)
@provider.run_action(:run)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
it "should respect cwd options for 'creates'" do
@new_resource.cwd "/tmp"
@new_resource.creates "foo_resource"
- @provider.stub(:load_current_resource)
- File.should_receive(:exists?).with(@new_resource.creates).and_return(false)
- File.should_receive(:exists?).with(File.join("/tmp", @new_resource.creates)).and_return(true)
- Chef::Log.should_not_receive(:warn)
- @provider.should_not_receive(:shell_out!)
+ allow(@provider).to receive(:load_current_resource)
+ expect(File).to receive(:exists?).with(@new_resource.creates).and_return(false)
+ expect(File).to receive(:exists?).with(File.join("/tmp", @new_resource.creates)).and_return(true)
+ expect(Chef::Log).not_to receive(:warn)
+ expect(@provider).not_to receive(:shell_out!)
@provider.run_action(:run)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
it "should warn if user specified relative path without cwd" do
@new_resource.creates "foo_resource"
- @provider.stub(:load_current_resource)
- Chef::Log.should_receive(:warn).with(/relative path/)
- File.should_receive(:exists?).with(@new_resource.creates).and_return(true)
- @provider.should_not_receive(:shell_out!)
+ allow(@provider).to receive(:load_current_resource)
+ expect(Chef::Log).to receive(:warn).with(/relative path/)
+ expect(File).to receive(:exists?).with(@new_resource.creates).and_return(true)
+ expect(@provider).not_to receive(:shell_out!)
@provider.run_action(:run)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
end
diff --git a/spec/unit/provider/file/content_spec.rb b/spec/unit/provider/file/content_spec.rb
index 34d98b6619..0a45d15bc9 100644
--- a/spec/unit/provider/file/content_spec.rb
+++ b/spec/unit/provider/file/content_spec.rb
@@ -53,27 +53,49 @@ describe Chef::Provider::File::Content do
describe "when the resource has a content attribute set" do
before do
- new_resource.stub(:content).and_return("Do do do do, do do do do, do do do do, do do do do")
+ allow(new_resource).to receive(:content).and_return("Do do do do, do do do do, do do do do, do do do do")
end
it "returns a tempfile" do
- content.tempfile.should be_a_kind_of(Tempfile)
+ expect(content.tempfile).to be_a_kind_of(Tempfile)
end
it "the tempfile contents should match the resource contents" do
- IO.read(content.tempfile.path).should == new_resource.content
+ expect(IO.read(content.tempfile.path)).to eq(new_resource.content)
end
it "returns a tempfile in the tempdir when :file_staging_uses_destdir is not set" do
Chef::Config[:file_staging_uses_destdir] = false
- content.tempfile.path.start_with?(Dir::tmpdir).should be_true
- canonicalize_path(content.tempfile.path).start_with?(enclosing_directory).should be_false
+ expect(content.tempfile.path.start_with?(Dir::tmpdir)).to be_truthy
+ expect(canonicalize_path(content.tempfile.path).start_with?(enclosing_directory)).to be_falsey
end
- it "returns a tempfile in the destdir when :file_desployment_uses_destdir is not set" do
+ it "returns a tempfile in the destdir when :file_deployment_uses_destdir is set" do
Chef::Config[:file_staging_uses_destdir] = true
- content.tempfile.path.start_with?(Dir::tmpdir).should be_false
- canonicalize_path(content.tempfile.path).start_with?(enclosing_directory).should be_true
+ expect(content.tempfile.path.start_with?(Dir::tmpdir)).to be_falsey
+ expect(canonicalize_path(content.tempfile.path).start_with?(enclosing_directory)).to be_truthy
+ end
+
+ context "when creating a tempfiles in destdir fails" do
+ let(:enclosing_directory) {
+ canonicalize_path("/nonexisting/path")
+ }
+
+ it "returns a tempfile in the tempdir when :file_deployment_uses_destdir is set to :auto" do
+ Chef::Config[:file_staging_uses_destdir] = :auto
+ expect(content.tempfile.path.start_with?(Dir::tmpdir)).to be_truthy
+ expect(canonicalize_path(content.tempfile.path).start_with?(enclosing_directory)).to be_falsey
+ end
+
+ it "fails when :file_desployment_uses_destdir is set" do
+ Chef::Config[:file_staging_uses_destdir] = true
+ expect{content.tempfile}.to raise_error
+ end
+
+ it "returns a tempfile in the tempdir when :file_desployment_uses_destdir is not set" do
+ expect(content.tempfile.path.start_with?(Dir::tmpdir)).to be_truthy
+ expect(canonicalize_path(content.tempfile.path).start_with?(enclosing_directory)).to be_falsey
+ end
end
end
@@ -81,13 +103,12 @@ describe Chef::Provider::File::Content do
describe "when the resource does not have a content attribute set" do
before do
- new_resource.stub(:content).and_return(nil)
+ allow(new_resource).to receive(:content).and_return(nil)
end
it "should return nil instead of a tempfile" do
- content.tempfile.should be_nil
+ expect(content.tempfile).to be_nil
end
end
end
-
diff --git a/spec/unit/provider/file_spec.rb b/spec/unit/provider/file_spec.rb
index 059f1722fb..504ae045d9 100644
--- a/spec/unit/provider/file_spec.rb
+++ b/spec/unit/provider/file_spec.rb
@@ -46,7 +46,7 @@ describe Chef::Provider::File do
let(:provider) do
provider = described_class.new(resource, run_context)
- provider.stub(:content).and_return(content)
+ allow(provider).to receive(:content).and_return(content)
provider
end
diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb
index 02d155efbd..1e282c098d 100644
--- a/spec/unit/provider/git_spec.rb
+++ b/spec/unit/provider/git_spec.rb
@@ -21,7 +21,7 @@ require 'spec_helper'
describe Chef::Provider::Git do
before(:each) do
- STDOUT.stub(:tty?).and_return(true)
+ allow(STDOUT).to receive(:tty?).and_return(true)
Chef::Log.level = :info
@current_resource = Chef::Resource::Git.new("web2.0 app")
@@ -47,36 +47,36 @@ describe Chef::Provider::Git do
end
it "sets the current revision to nil if the deploy dir does not exist" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(false)
- @provider.find_current_revision.should be_nil
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(false)
+ expect(@provider.find_current_revision).to be_nil
end
it "determines the current revision when there is one" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
@stdout = "9b4d8dc38dd471246e7cfb1c3c1ad14b0f2bee13\n"
- @provider.should_receive(:shell_out!).with('git rev-parse HEAD', {:cwd => '/my/deploy/dir', :returns => [0,128]}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.find_current_revision.should eql("9b4d8dc38dd471246e7cfb1c3c1ad14b0f2bee13")
+ expect(@provider).to receive(:shell_out!).with('git rev-parse HEAD', {:cwd => '/my/deploy/dir', :returns => [0,128]}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.find_current_revision).to eql("9b4d8dc38dd471246e7cfb1c3c1ad14b0f2bee13")
end
it "gives the current revision as nil when there is no current revision" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
@stderr = "fatal: Not a git repository (or any of the parent directories): .git"
@stdout = ""
- @provider.should_receive(:shell_out!).with('git rev-parse HEAD', :cwd => '/my/deploy/dir', :returns => [0,128]).and_return(double("ShellOut result", :stdout => "", :stderr => @stderr))
- @provider.find_current_revision.should be_nil
+ expect(@provider).to receive(:shell_out!).with('git rev-parse HEAD', :cwd => '/my/deploy/dir', :returns => [0,128]).and_return(double("ShellOut result", :stdout => "", :stderr => @stderr))
+ expect(@provider.find_current_revision).to be_nil
end
end
it "creates a current_resource with the currently deployed revision when a clone exists in the destination dir" do
- @provider.stub(:find_current_revision).and_return("681c9802d1c62a45b490786c18f0b8216b309440")
+ allow(@provider).to receive(:find_current_revision).and_return("681c9802d1c62a45b490786c18f0b8216b309440")
@provider.load_current_resource
- @provider.current_resource.name.should eql(@resource.name)
- @provider.current_resource.revision.should eql("681c9802d1c62a45b490786c18f0b8216b309440")
+ expect(@provider.current_resource.name).to eql(@resource.name)
+ expect(@provider.current_resource.revision).to eql("681c9802d1c62a45b490786c18f0b8216b309440")
end
it "keeps the node and resource passed to it on initialize" do
- @provider.node.should equal(@node)
- @provider.new_resource.should equal(@resource)
+ expect(@provider.node).to equal(@node)
+ expect(@provider.new_resource).to equal(@resource)
end
context "resolving revisions to a SHA" do
@@ -86,15 +86,15 @@ describe Chef::Provider::Git do
end
it "returns resource.revision as is if revision is already a full SHA" do
- @provider.target_revision.should eql("d35af14d41ae22b19da05d7d03a0bafc321b244c")
+ expect(@provider.target_revision).to eql("d35af14d41ae22b19da05d7d03a0bafc321b244c")
end
it "converts resource.revision from a tag to a SHA" do
@resource.revision "v1.0"
@stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" +
"503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n")
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("503c22a5e41f5ae3193460cca044ed1435029f53")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("503c22a5e41f5ae3193460cca044ed1435029f53")
end
it "converts resource.revision from an annotated tag to the tagged SHA (not SHA of tag)" do
@@ -102,8 +102,8 @@ describe Chef::Provider::Git do
@stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" +
"503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n" +
"663c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0^{}\n")
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("663c22a5e41f5ae3193460cca044ed1435029f53")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("663c22a5e41f5ae3193460cca044ed1435029f53")
end
it "converts resource.revision from a tag to a SHA using an exact match" do
@@ -111,8 +111,8 @@ describe Chef::Provider::Git do
@stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" +
"663c22a5e41f5ae3193460cca044ed1435029f53\trefs/tags/releases/v1.0\n" +
"503c22a5e41f5ae3193460cca044ed1435029f53\trefs/tags/v1.0\n")
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("503c22a5e41f5ae3193460cca044ed1435029f53")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("503c22a5e41f5ae3193460cca044ed1435029f53")
end
it "converts resource.revision from a tag to a SHA, matching tags first, then heads" do
@@ -120,8 +120,8 @@ describe Chef::Provider::Git do
@stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" +
"663c22a5e41f5ae3193460cca044ed1435029f53\trefs/tags/v1.0\n" +
"503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n")
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("663c22a5e41f5ae3193460cca044ed1435029f53")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("663c22a5e41f5ae3193460cca044ed1435029f53")
end
it "converts resource.revision from a tag to a SHA, matching heads if no tags match" do
@@ -129,8 +129,8 @@ describe Chef::Provider::Git do
@stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" +
"663c22a5e41f5ae3193460cca044ed1435029f53\trefs/tags/v1.1\n" +
"503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n")
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("503c22a5e41f5ae3193460cca044ed1435029f53")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("503c22a5e41f5ae3193460cca044ed1435029f53")
end
it "converts resource.revision from a tag to a SHA, matching tags first, then heads, then revision" do
@@ -139,8 +139,8 @@ describe Chef::Provider::Git do
"663c22a5e41f5ae3193460cca044ed1435029f53\trefs/tags/v1.0\n" +
"805c22a5e41f5ae3193460cca044ed1435029f53\trefs/pulls/v1.0\n" +
"503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n")
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"refs/pulls/v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("805c22a5e41f5ae3193460cca044ed1435029f53")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"refs/pulls/v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("805c22a5e41f5ae3193460cca044ed1435029f53")
end
it "converts resource.revision from a tag to a SHA, using full path if provided" do
@@ -148,40 +148,40 @@ describe Chef::Provider::Git do
@stdout = ("d03c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n" +
"663c22a5e41f5ae3193460cca044ed1435029f53\trefs/tags/v1.0\n" +
"503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/v1.0\n")
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"refs/heads/v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("503c22a5e41f5ae3193460cca044ed1435029f53")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"refs/heads/v1.0*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("503c22a5e41f5ae3193460cca044ed1435029f53")
end
it "raises an invalid remote reference error if you try to deploy from ``origin'' and assertions are run" do
@resource.revision "origin/"
@provider.action = :checkout
@provider.define_resource_requirements
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- lambda {@provider.process_resource_requirements}.should raise_error(Chef::Exceptions::InvalidRemoteGitReference)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ expect {@provider.process_resource_requirements}.to raise_error(Chef::Exceptions::InvalidRemoteGitReference)
end
it "raises an unresolvable git reference error if the revision can't be resolved to any revision and assertions are run" do
@resource.revision "FAIL, that's the revision I want"
@provider.action = :checkout
- @provider.should_receive(:shell_out!).and_return(double("ShellOut result", :stdout => "\n"))
+ expect(@provider).to receive(:shell_out!).and_return(double("ShellOut result", :stdout => "\n"))
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::UnresolvableGitReference)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::UnresolvableGitReference)
end
it "does not raise an error if the revision can't be resolved when assertions are not run" do
@resource.revision "FAIL, that's the revision I want"
- @provider.should_receive(:shell_out!).and_return(double("ShellOut result", :stdout => "\n"))
- @provider.target_revision.should == nil
+ expect(@provider).to receive(:shell_out!).and_return(double("ShellOut result", :stdout => "\n"))
+ expect(@provider.target_revision).to eq(nil)
end
it "does not raise an error when the revision is valid and assertions are run." do
@resource.revision "0.8-alpha"
@stdout = "503c22a5e41f5ae3193460cca044ed1435029f53\trefs/heads/0.8-alpha\n"
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"0.8-alpha*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"0.8-alpha*\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
@provider.action = :checkout
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
it "gives the latest HEAD revision SHA if nothing is specified" do
@@ -202,13 +202,13 @@ b7d19519a1c15f1c1a324e2683bd728b6198ce5a\trefs/tags/0.7.8^{}
ebc1b392fe7e8f0fbabc305c299b4d365d2b4d9b\trefs/tags/chef-server-package
SHAS
@resource.revision ''
- @provider.should_receive(:shell_out!).with(@git_ls_remote + "\"HEAD\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
- @provider.target_revision.should eql("28af684d8460ba4793eda3e7ac238c864a5d029a")
+ expect(@provider).to receive(:shell_out!).with(@git_ls_remote + "\"HEAD\"", {:log_tag=>"git[web2.0 app]"}).and_return(double("ShellOut result", :stdout => @stdout))
+ expect(@provider.target_revision).to eql("28af684d8460ba4793eda3e7ac238c864a5d029a")
end
end
it "responds to :revision_slug as an alias for target_revision" do
- @provider.should respond_to(:revision_slug)
+ expect(@provider).to respond_to(:revision_slug)
end
context "with an ssh wrapper" do
@@ -225,11 +225,11 @@ SHAS
before do
@resource.user deploy_user
@resource.ssh_wrapper wrapper
- Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja"))
+ allow(Etc).to receive(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja"))
end
context "without a timeout set" do
it "clones a repo with default git options" do
- @provider.should_receive(:shell_out!).with(expected_cmd, default_options)
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, default_options)
@provider.clone
end
end
@@ -237,7 +237,7 @@ SHAS
let (:seconds) { 10 }
before { @resource.timeout(seconds) }
it "clones a repo with amended git options" do
- @provider.should_receive(:shell_out!).with(expected_cmd, default_options.merge(:timeout => seconds))
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, default_options.merge(:timeout => seconds))
@provider.clone
end
end
@@ -257,7 +257,7 @@ SHAS
end
before { @resource.environment(override_home) }
it "clones a repo with amended git options with specific home" do
- @provider.should_receive(:shell_out!).with(expected_cmd, overrided_options)
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, overrided_options)
@provider.clone
end
end
@@ -265,11 +265,11 @@ SHAS
it "runs a clone command with escaped destination" do
@resource.user "deployNinja"
- Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja"))
+ allow(Etc).to receive(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/deployNinja"))
@resource.destination "/Application Support/with/space"
@resource.ssh_wrapper "do_it_this_way.sh"
expected_cmd = "git clone \"git://github.com/opscode/chef.git\" \"/Application Support/with/space\""
- @provider.should_receive(:shell_out!).with(expected_cmd, :user => "deployNinja",
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :user => "deployNinja",
:environment =>{"GIT_SSH"=>"do_it_this_way.sh",
"HOME" => "/home/deployNinja"},
:log_tag => "git[web2.0 app]")
@@ -280,10 +280,10 @@ SHAS
@resource.depth 5
expected_cmd = "git clone --depth 5 \"git://github.com/opscode/chef.git\" \"/my/deploy/dir\""
version_response = double('shell_out')
- version_response.stub(:stdout) { 'git version 1.7.9' }
- @provider.should_receive(:shell_out!).with("git --version",
+ allow(version_response).to receive(:stdout) { 'git version 1.7.9' }
+ expect(@provider).to receive(:shell_out!).with("git --version",
:log_tag => "git[web2.0 app]").and_return(version_response)
- @provider.should_receive(:shell_out!).with(expected_cmd, :log_tag => "git[web2.0 app]")
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :log_tag => "git[web2.0 app]")
@provider.clone
end
@@ -291,24 +291,24 @@ SHAS
@resource.depth 5
expected_cmd = "git clone --depth 5 --no-single-branch \"git://github.com/opscode/chef.git\" \"/my/deploy/dir\""
version_response = double('shell_out')
- version_response.stub(:stdout) { 'git version 1.7.10' }
- @provider.should_receive(:shell_out!).with("git --version",
+ allow(version_response).to receive(:stdout) { 'git version 1.7.10' }
+ expect(@provider).to receive(:shell_out!).with("git --version",
:log_tag => "git[web2.0 app]").and_return(version_response)
- @provider.should_receive(:shell_out!).with(expected_cmd, :log_tag => "git[web2.0 app]")
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :log_tag => "git[web2.0 app]")
@provider.clone
end
it "compiles a clone command with a remote other than ``origin''" do
@resource.remote "opscode"
expected_cmd = "git clone -o opscode \"git://github.com/opscode/chef.git\" \"/my/deploy/dir\""
- @provider.should_receive(:shell_out!).with(expected_cmd, :log_tag => "git[web2.0 app]")
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :log_tag => "git[web2.0 app]")
@provider.clone
end
it "runs a checkout command with default options" do
- @provider.should_receive(:shell_out!).with('git branch -f deploy d35af14d41ae22b19da05d7d03a0bafc321b244c', :cwd => "/my/deploy/dir",
+ expect(@provider).to receive(:shell_out!).with('git branch -f deploy d35af14d41ae22b19da05d7d03a0bafc321b244c', :cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]").ordered
- @provider.should_receive(:shell_out!).with('git checkout deploy', :cwd => "/my/deploy/dir",
+ expect(@provider).to receive(:shell_out!).with('git checkout deploy', :cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]").ordered
@provider.checkout
end
@@ -316,32 +316,32 @@ SHAS
it "runs an enable_submodule command" do
@resource.enable_submodules true
expected_cmd = "git submodule sync"
- @provider.should_receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir",
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]")
expected_cmd = "git submodule update --init --recursive"
- @provider.should_receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]")
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]")
@provider.enable_submodules
end
it "does nothing for enable_submodules if resource.enable_submodules #=> false" do
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.enable_submodules
end
it "runs a sync command with default options" do
- @provider.should_receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
+ expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
expected_cmd = "git fetch origin && git fetch origin --tags && git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c"
- @provider.should_receive(:shell_out!).with(expected_cmd, :cwd=> "/my/deploy/dir", :log_tag => "git[web2.0 app]")
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :cwd=> "/my/deploy/dir", :log_tag => "git[web2.0 app]")
@provider.fetch_updates
end
it "runs a sync command with the user and group specified in the resource" do
@resource.user("whois")
- Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois"))
+ allow(Etc).to receive(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois"))
@resource.group("thisis")
- @provider.should_receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
+ expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
expected_cmd = "git fetch origin && git fetch origin --tags && git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c"
- @provider.should_receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir",
+ expect(@provider).to receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir",
:user => "whois", :group => "thisis",
:log_tag => "git[web2.0 app]",
:environment=>{"HOME"=>"/home/whois"})
@@ -350,17 +350,17 @@ SHAS
it "configures remote tracking branches when remote is ``origin''" do
@resource.remote "origin"
- @provider.should_receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
+ expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
fetch_command = "git fetch origin && git fetch origin --tags && git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c"
- @provider.should_receive(:shell_out!).with(fetch_command, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]")
+ expect(@provider).to receive(:shell_out!).with(fetch_command, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]")
@provider.fetch_updates
end
it "configures remote tracking branches when remote is not ``origin''" do
@resource.remote "opscode"
- @provider.should_receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
+ expect(@provider).to receive(:setup_remote_tracking_branches).with(@resource.remote, @resource.repository)
fetch_command = "git fetch opscode && git fetch opscode --tags && git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c"
- @provider.should_receive(:shell_out!).with(fetch_command, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]")
+ expect(@provider).to receive(:shell_out!).with(fetch_command, :cwd => "/my/deploy/dir", :log_tag => "git[web2.0 app]")
@provider.fetch_updates
end
@@ -368,14 +368,14 @@ SHAS
it "checks if a remote with this name already exists" do
command_response = double('shell_out')
- command_response.stub(:exitstatus) { 1 }
+ allow(command_response).to receive(:exitstatus) { 1 }
expected_command = "git config --get remote.#{@resource.remote}.url"
- @provider.should_receive(:shell_out!).with(expected_command,
+ expect(@provider).to receive(:shell_out!).with(expected_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]",
:returns => [0,1,2]).and_return(command_response)
add_remote_command = "git remote add #{@resource.remote} #{@resource.repository}"
- @provider.should_receive(:shell_out!).with(add_remote_command,
+ expect(@provider).to receive(:shell_out!).with(add_remote_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
@@ -384,11 +384,11 @@ SHAS
it "runs the config with the user and group specified in the resource" do
@resource.user("whois")
@resource.group("thisis")
- Etc.stub(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois"))
+ allow(Etc).to receive(:getpwnam).and_return(double("Struct::Passwd", :name => @resource.user, :dir => "/home/whois"))
command_response = double('shell_out')
- command_response.stub(:exitstatus) { 1 }
+ allow(command_response).to receive(:exitstatus) { 1 }
expected_command = "git config --get remote.#{@resource.remote}.url"
- @provider.should_receive(:shell_out!).with(expected_command,
+ expect(@provider).to receive(:shell_out!).with(expected_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]",
:user => "whois",
@@ -396,7 +396,7 @@ SHAS
:environment=>{"HOME"=>"/home/whois"},
:returns => [0,1,2]).and_return(command_response)
add_remote_command = "git remote add #{@resource.remote} #{@resource.repository}"
- @provider.should_receive(:shell_out!).with(add_remote_command,
+ expect(@provider).to receive(:shell_out!).with(add_remote_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]",
:user => "whois",
@@ -408,14 +408,14 @@ SHAS
describe "when a remote with a given name hasn't been configured yet" do
it "adds a new remote " do
command_response = double('shell_out')
- command_response.stub(:exitstatus) { 1 }
+ allow(command_response).to receive(:exitstatus) { 1 }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
- @provider.should_receive(:shell_out!).with(check_remote_command,
+ expect(@provider).to receive(:shell_out!).with(check_remote_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]",
:returns => [0,1,2]).and_return(command_response)
expected_command = "git remote add #{@resource.remote} #{@resource.repository}"
- @provider.should_receive(:shell_out!).with(expected_command,
+ expect(@provider).to receive(:shell_out!).with(expected_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
@@ -425,15 +425,15 @@ SHAS
describe "when a remote with a given name has already been configured" do
it "updates remote url when the url is different" do
command_response = double('shell_out')
- command_response.stub(:exitstatus) { 0 }
- command_response.stub(:stdout) { "some_other_url" }
+ allow(command_response).to receive(:exitstatus) { 0 }
+ allow(command_response).to receive(:stdout) { "some_other_url" }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
- @provider.should_receive(:shell_out!).with(check_remote_command,
+ expect(@provider).to receive(:shell_out!).with(check_remote_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]",
:returns => [0,1,2]).and_return(command_response)
expected_command = "git config --replace-all remote.#{@resource.remote}.url #{@resource.repository}"
- @provider.should_receive(:shell_out!).with(expected_command,
+ expect(@provider).to receive(:shell_out!).with(expected_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
@@ -441,15 +441,15 @@ SHAS
it "doesn't update remote url when the url is the same" do
command_response = double('shell_out')
- command_response.stub(:exitstatus) { 0 }
- command_response.stub(:stdout) { @resource.repository }
+ allow(command_response).to receive(:exitstatus) { 0 }
+ allow(command_response).to receive(:stdout) { @resource.repository }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
- @provider.should_receive(:shell_out!).with(check_remote_command,
+ expect(@provider).to receive(:shell_out!).with(check_remote_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]",
:returns => [0,1,2]).and_return(command_response)
unexpected_command = "git config --replace-all remote.#{@resource.remote}.url #{@resource.repository}"
- @provider.should_not_receive(:shell_out!).with(unexpected_command,
+ expect(@provider).not_to receive(:shell_out!).with(unexpected_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
@@ -457,14 +457,14 @@ SHAS
it "resets remote url when it has multiple values" do
command_response = double('shell_out')
- command_response.stub(:exitstatus) { 2 }
+ allow(command_response).to receive(:exitstatus) { 2 }
check_remote_command = "git config --get remote.#{@resource.remote}.url"
- @provider.should_receive(:shell_out!).with(check_remote_command,
+ expect(@provider).to receive(:shell_out!).with(check_remote_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]",
:returns => [0,1,2]).and_return(command_response)
expected_command = "git config --replace-all remote.#{@resource.remote}.url #{@resource.repository}"
- @provider.should_receive(:shell_out!).with(expected_command,
+ expect(@provider).to receive(:shell_out!).with(expected_command,
:cwd => "/my/deploy/dir",
:log_tag => "git[web2.0 app]")
@provider.setup_remote_tracking_branches(@resource.remote, @resource.repository)
@@ -473,20 +473,20 @@ SHAS
end
it "raises an error if the git clone command would fail because the enclosing directory doesn't exist" do
- @provider.stub(:shell_out!)
- lambda {@provider.run_action(:sync)}.should raise_error(Chef::Exceptions::MissingParentDirectory)
+ allow(@provider).to receive(:shell_out!)
+ expect {@provider.run_action(:sync)}.to raise_error(Chef::Exceptions::MissingParentDirectory)
end
it "does a checkout by cloning the repo and then enabling submodules" do
# will be invoked in load_current_resource
- ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false)
-
- ::File.stub(:exist?).with("/my/deploy/dir").and_return(true)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..'])
- @provider.should_receive(:clone)
- @provider.should_receive(:checkout)
- @provider.should_receive(:enable_submodules)
+ allow(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(false)
+
+ allow(::File).to receive(:exist?).with("/my/deploy/dir").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ allow(::Dir).to receive(:entries).with("/my/deploy/dir").and_return(['.','..'])
+ expect(@provider).to receive(:clone)
+ expect(@provider).to receive(:checkout)
+ expect(@provider).to receive(:enable_submodules)
@provider.run_action(:checkout)
# Even though an actual run will cause an update to occur, the fact that we've stubbed out
# the actions above will prevent updates from registering
@@ -495,119 +495,119 @@ SHAS
it "does not call checkout if enable_checkout is false" do
# will be invoked in load_current_resource
- ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false)
+ allow(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(false)
- ::File.stub(:exist?).with("/my/deploy/dir").and_return(true)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..'])
+ allow(::File).to receive(:exist?).with("/my/deploy/dir").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ allow(::Dir).to receive(:entries).with("/my/deploy/dir").and_return(['.','..'])
@resource.enable_checkout false
- @provider.should_receive(:clone)
- @provider.should_not_receive(:checkout)
- @provider.should_receive(:enable_submodules)
+ expect(@provider).to receive(:clone)
+ expect(@provider).not_to receive(:checkout)
+ expect(@provider).to receive(:enable_submodules)
@provider.run_action(:checkout)
end
# REGRESSION TEST: on some OSes, the entries from an empty directory will be listed as
# ['..', '.'] but this shouldn't change the behavior
it "does a checkout by cloning the repo and then enabling submodules when the directory entries are listed as %w{.. .}" do
- ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false)
- ::File.stub(:exist?).with("/my/deploy/dir").and_return(false)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['..','.'])
- @provider.should_receive(:clone)
- @provider.should_receive(:checkout)
- @provider.should_receive(:enable_submodules)
- @provider.should_receive(:add_remotes)
+ allow(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(false)
+ allow(::File).to receive(:exist?).with("/my/deploy/dir").and_return(false)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ allow(::Dir).to receive(:entries).with("/my/deploy/dir").and_return(['..','.'])
+ expect(@provider).to receive(:clone)
+ expect(@provider).to receive(:checkout)
+ expect(@provider).to receive(:enable_submodules)
+ expect(@provider).to receive(:add_remotes)
@provider.run_action(:checkout)
# @resource.should be_updated
end
it "should not checkout if the destination exists or is a non empty directory" do
# will be invoked in load_current_resource
- ::File.stub(:exist?).with("/my/deploy/dir/.git").and_return(false)
-
- ::File.stub(:exist?).with("/my/deploy/dir").and_return(true)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar'])
- @provider.should_not_receive(:clone)
- @provider.should_not_receive(:checkout)
- @provider.should_not_receive(:enable_submodules)
- @provider.should_not_receive(:add_remotes)
+ allow(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(false)
+
+ allow(::File).to receive(:exist?).with("/my/deploy/dir").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ allow(::Dir).to receive(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar'])
+ expect(@provider).not_to receive(:clone)
+ expect(@provider).not_to receive(:checkout)
+ expect(@provider).not_to receive(:enable_submodules)
+ expect(@provider).not_to receive(:add_remotes)
@provider.run_action(:checkout)
- @resource.should_not be_updated
+ expect(@resource).not_to be_updated
end
it "syncs the code by updating the source when the repo has already been checked out" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- @provider.should_receive(:find_current_revision).exactly(1).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
- @provider.should_not_receive(:fetch_updates)
- @provider.should_receive(:add_remotes)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ expect(@provider).to receive(:find_current_revision).exactly(1).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
+ expect(@provider).not_to receive(:fetch_updates)
+ expect(@provider).to receive(:add_remotes)
@provider.run_action(:sync)
- @resource.should_not be_updated
+ expect(@resource).not_to be_updated
end
it "marks the resource as updated when the repo is updated and gets a new version" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
# invoked twice - first time from load_current_resource
- @provider.should_receive(:find_current_revision).exactly(1).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
- @provider.stub(:target_revision).and_return('28af684d8460ba4793eda3e7ac238c864a5d029a')
- @provider.should_receive(:fetch_updates)
- @provider.should_receive(:enable_submodules)
- @provider.should_receive(:add_remotes)
+ expect(@provider).to receive(:find_current_revision).exactly(1).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
+ allow(@provider).to receive(:target_revision).and_return('28af684d8460ba4793eda3e7ac238c864a5d029a')
+ expect(@provider).to receive(:fetch_updates)
+ expect(@provider).to receive(:enable_submodules)
+ expect(@provider).to receive(:add_remotes)
@provider.run_action(:sync)
# @resource.should be_updated
end
it "does not fetch any updates if the remote revision matches the current revision" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- @provider.stub(:find_current_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
- @provider.stub(:target_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
- @provider.should_not_receive(:fetch_updates)
- @provider.should_receive(:add_remotes)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ allow(@provider).to receive(:find_current_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
+ allow(@provider).to receive(:target_revision).and_return('d35af14d41ae22b19da05d7d03a0bafc321b244c')
+ expect(@provider).not_to receive(:fetch_updates)
+ expect(@provider).to receive(:add_remotes)
@provider.run_action(:sync)
- @resource.should_not be_updated
+ expect(@resource).not_to be_updated
end
it "clones the repo instead of fetching it if the deploy directory doesn't exist" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").exactly(2).and_return(false)
- @provider.should_receive(:action_checkout)
- @provider.should_not_receive(:shell_out!)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").exactly(2).and_return(false)
+ expect(@provider).to receive(:action_checkout)
+ expect(@provider).not_to receive(:shell_out!)
@provider.run_action(:sync)
# @resource.should be_updated
end
it "clones the repo instead of fetching updates if the deploy directory is empty" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.git").exactly(2).and_return(false)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::File.stub(:directory?).with("/my/deploy/dir").and_return(true)
- @provider.stub(:sync_command).and_return("huzzah!")
- @provider.should_receive(:action_checkout)
- @provider.should_not_receive(:shell_out!).with("huzzah!", :cwd => "/my/deploy/dir")
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.git").exactly(2).and_return(false)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy/dir").and_return(true)
+ allow(@provider).to receive(:sync_command).and_return("huzzah!")
+ expect(@provider).to receive(:action_checkout)
+ expect(@provider).not_to receive(:shell_out!).with("huzzah!", :cwd => "/my/deploy/dir")
@provider.run_action(:sync)
#@resource.should be_updated
end
it "does an export by cloning the repo then removing the .git directory" do
- @provider.should_receive(:action_checkout)
- FileUtils.should_receive(:rm_rf).with(@resource.destination + "/.git")
+ expect(@provider).to receive(:action_checkout)
+ expect(FileUtils).to receive(:rm_rf).with(@resource.destination + "/.git")
@provider.run_action(:export)
- @resource.should be_updated
+ expect(@resource).to be_updated
end
describe "calling add_remotes" do
it "adds a new remote for each entry in additional remotes hash" do
@resource.additional_remotes({:opscode => "opscode_repo_url",
:another_repo => "some_other_repo_url"})
- STDOUT.stub(:tty?).and_return(false)
+ allow(STDOUT).to receive(:tty?).and_return(false)
command_response = double('shell_out')
- command_response.stub(:exitstatus) { 0 }
+ allow(command_response).to receive(:exitstatus) { 0 }
@resource.additional_remotes.each_pair do |remote_name, remote_url|
- @provider.should_receive(:setup_remote_tracking_branches).with(remote_name, remote_url)
+ expect(@provider).to receive(:setup_remote_tracking_branches).with(remote_name, remote_url)
end
@provider.add_remotes
end
@@ -620,22 +620,22 @@ SHAS
describe "when check remote command returns with status 2" do
it "returns true" do
- @command_response.stub(:exitstatus) { 2 }
- @provider.multiple_remotes?(@command_response).should be_true
+ allow(@command_response).to receive(:exitstatus) { 2 }
+ expect(@provider.multiple_remotes?(@command_response)).to be_truthy
end
end
describe "when check remote command returns with status 0" do
it "returns false" do
- @command_response.stub(:exitstatus) { 0 }
- @provider.multiple_remotes?(@command_response).should be_false
+ allow(@command_response).to receive(:exitstatus) { 0 }
+ expect(@provider.multiple_remotes?(@command_response)).to be_falsey
end
end
describe "when check remote command returns with status 0" do
it "returns false" do
- @command_response.stub(:exitstatus) { 1 }
- @provider.multiple_remotes?(@command_response).should be_false
+ allow(@command_response).to receive(:exitstatus) { 1 }
+ expect(@provider.multiple_remotes?(@command_response)).to be_falsey
end
end
end
@@ -647,17 +647,17 @@ SHAS
describe "when output of the check remote command matches the repository url" do
it "returns true" do
- @command_response.stub(:exitstatus) { 0 }
- @command_response.stub(:stdout) { @resource.repository }
- @provider.remote_matches?(@resource.repository, @command_response).should be_true
+ allow(@command_response).to receive(:exitstatus) { 0 }
+ allow(@command_response).to receive(:stdout) { @resource.repository }
+ expect(@provider.remote_matches?(@resource.repository, @command_response)).to be_truthy
end
end
describe "when output of the check remote command doesn't match the repository url" do
it "returns false" do
- @command_response.stub(:exitstatus) { 0 }
- @command_response.stub(:stdout) { @resource.repository + "test" }
- @provider.remote_matches?(@resource.repository, @command_response).should be_false
+ allow(@command_response).to receive(:exitstatus) { 0 }
+ allow(@command_response).to receive(:stdout) { @resource.repository + "test" }
+ expect(@provider.remote_matches?(@resource.repository, @command_response)).to be_falsey
end
end
end
diff --git a/spec/unit/provider/group/dscl_spec.rb b/spec/unit/provider/group/dscl_spec.rb
index 8848a01bf2..e09365a828 100644
--- a/spec/unit/provider/group/dscl_spec.rb
+++ b/spec/unit/provider/group/dscl_spec.rb
@@ -32,64 +32,64 @@ describe Chef::Provider::Group::Dscl do
@stdin = StringIO.new
@stdout = StringIO.new("\n")
@stderr = StringIO.new("")
- @provider.stub(:popen4).and_yield(@pid,@stdin,@stdout,@stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid,@stdin,@stdout,@stderr).and_return(@status)
end
it "should run popen4 with the supplied array of arguments appended to the dscl command" do
- @provider.should_receive(:popen4).with("dscl . -cmd /Path arg1 arg2")
+ expect(@provider).to receive(:popen4).with("dscl . -cmd /Path arg1 arg2")
@provider.dscl("cmd", "/Path", "arg1", "arg2")
end
it "should return an array of four elements - cmd, status, stdout, stderr" do
dscl_retval = @provider.dscl("cmd /Path args")
- dscl_retval.should be_a_kind_of(Array)
- dscl_retval.should == ["dscl . -cmd /Path args",@status,"\n",""]
+ expect(dscl_retval).to be_a_kind_of(Array)
+ expect(dscl_retval).to eq(["dscl . -cmd /Path args",@status,"\n",""])
end
describe "safe_dscl" do
before do
@node = Chef::Node.new
@provider = Chef::Provider::Group::Dscl.new(@node, @new_resource)
- @provider.stub(:dscl).and_return(["cmd", @status, "stdout", "stderr"])
+ allow(@provider).to receive(:dscl).and_return(["cmd", @status, "stdout", "stderr"])
end
it "should run dscl with the supplied cmd /Path args" do
- @provider.should_receive(:dscl).with("cmd /Path args")
+ expect(@provider).to receive(:dscl).with("cmd /Path args")
@provider.safe_dscl("cmd /Path args")
end
describe "with the dscl command returning a non zero exit status for a delete" do
before do
@status = double("Process::Status", :exitstatus => 1)
- @provider.stub(:dscl).and_return(["cmd", @status, "stdout", "stderr"])
+ allow(@provider).to receive(:dscl).and_return(["cmd", @status, "stdout", "stderr"])
end
it "should return an empty string of standard output for a delete" do
safe_dscl_retval = @provider.safe_dscl("delete /Path args")
- safe_dscl_retval.should be_a_kind_of(String)
- safe_dscl_retval.should == ""
+ expect(safe_dscl_retval).to be_a_kind_of(String)
+ expect(safe_dscl_retval).to eq("")
end
it "should raise an exception for any other command" do
- lambda { @provider.safe_dscl("cmd /Path arguments") }.should raise_error(Chef::Exceptions::Group)
+ expect { @provider.safe_dscl("cmd /Path arguments") }.to raise_error(Chef::Exceptions::Group)
end
end
describe "with the dscl command returning no such key" do
before do
- @provider.stub(:dscl).and_return(["cmd", @status, "No such key: ", "stderr"])
+ allow(@provider).to receive(:dscl).and_return(["cmd", @status, "No such key: ", "stderr"])
end
it "should raise an exception" do
- lambda { @provider.safe_dscl("cmd /Path arguments") }.should raise_error(Chef::Exceptions::Group)
+ expect { @provider.safe_dscl("cmd /Path arguments") }.to raise_error(Chef::Exceptions::Group)
end
end
describe "with the dscl command returning a zero exit status" do
it "should return the third array element, the string of standard output" do
safe_dscl_retval = @provider.safe_dscl("cmd /Path args")
- safe_dscl_retval.should be_a_kind_of(String)
- safe_dscl_retval.should == "stdout"
+ expect(safe_dscl_retval).to be_a_kind_of(String)
+ expect(safe_dscl_retval).to eq("stdout")
end
end
end
@@ -98,21 +98,21 @@ describe Chef::Provider::Group::Dscl do
before do
@node = Chef::Node.new
@provider = Chef::Provider::Group::Dscl.new(@node, @new_resource)
- @provider.stub(:safe_dscl).and_return("\naj 200\njt 201\n")
+ allow(@provider).to receive(:safe_dscl).and_return("\naj 200\njt 201\n")
end
it "should run safe_dscl with list /Groups gid" do
- @provider.should_receive(:safe_dscl).with("list /Groups gid")
+ expect(@provider).to receive(:safe_dscl).with("list /Groups gid")
@provider.get_free_gid
end
it "should return the first unused gid number on or above 200" do
- @provider.get_free_gid.should equal(202)
+ expect(@provider.get_free_gid).to equal(202)
end
it "should raise an exception when the search limit is exhausted" do
search_limit = 1
- lambda { @provider.get_free_gid(search_limit) }.should raise_error(RuntimeError)
+ expect { @provider.get_free_gid(search_limit) }.to raise_error(RuntimeError)
end
end
@@ -120,41 +120,41 @@ describe Chef::Provider::Group::Dscl do
before do
@node = Chef::Node.new
@provider = Chef::Provider::Group::Dscl.new(@node, @new_resource)
- @provider.stub(:safe_dscl).and_return("\naj 500\n")
+ allow(@provider).to receive(:safe_dscl).and_return("\naj 500\n")
end
it "should run safe_dscl with list /Groups gid" do
- @provider.should_receive(:safe_dscl).with("list /Groups gid")
+ expect(@provider).to receive(:safe_dscl).with("list /Groups gid")
@provider.gid_used?(500)
end
it "should return true for a used gid number" do
- @provider.gid_used?(500).should be_true
+ expect(@provider.gid_used?(500)).to be_truthy
end
it "should return false for an unused gid number" do
- @provider.gid_used?(501).should be_false
+ expect(@provider.gid_used?(501)).to be_falsey
end
it "should return false if not given any valid gid number" do
- @provider.gid_used?(nil).should be_false
+ expect(@provider.gid_used?(nil)).to be_falsey
end
end
describe "set_gid" do
describe "with the new resource and a gid number which is already in use" do
before do
- @provider.stub(:gid_used?).and_return(true)
+ allow(@provider).to receive(:gid_used?).and_return(true)
end
it "should raise an exception if the new resources gid is already in use" do
- lambda { @provider.set_gid }.should raise_error(Chef::Exceptions::Group)
+ expect { @provider.set_gid }.to raise_error(Chef::Exceptions::Group)
end
end
describe "with no gid number for the new resources" do
it "should run get_free_gid and return a valid, unused gid number" do
- @provider.should_receive(:get_free_gid).and_return(501)
+ expect(@provider).to receive(:get_free_gid).and_return(501)
@provider.set_gid
end
end
@@ -162,20 +162,20 @@ describe Chef::Provider::Group::Dscl do
describe "with blank gid number for the new resources" do
before do
@new_resource.instance_variable_set(:@gid, nil)
- @new_resource.stub(:safe_dscl)
+ allow(@new_resource).to receive(:safe_dscl)
end
it "should run get_free_gid and return a valid, unused gid number" do
- @provider.should_receive(:get_free_gid).and_return(501)
+ expect(@provider).to receive(:get_free_gid).and_return(501)
@provider.set_gid
end
end
describe "with a valid gid number which is not already in use" do
it "should run safe_dscl with create /Groups/group PrimaryGroupID gid" do
- @provider.stub(:get_free_gid).and_return(50)
- @provider.should_receive(:safe_dscl).with("list /Groups gid")
- @provider.should_receive(:safe_dscl).with("create /Groups/aj PrimaryGroupID 50").and_return(true)
+ allow(@provider).to receive(:get_free_gid).and_return(50)
+ expect(@provider).to receive(:safe_dscl).with("list /Groups gid")
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/aj PrimaryGroupID 50").and_return(true)
@provider.set_gid
end
end
@@ -185,19 +185,19 @@ describe Chef::Provider::Group::Dscl do
describe "with existing members in the current resource and append set to false in the new resource" do
before do
- @new_resource.stub(:members).and_return([])
- @new_resource.stub(:append).and_return(false)
- @current_resource.stub(:members).and_return(["all", "your", "base"])
+ allow(@new_resource).to receive(:members).and_return([])
+ allow(@new_resource).to receive(:append).and_return(false)
+ allow(@current_resource).to receive(:members).and_return(["all", "your", "base"])
end
it "should log an appropriate message" do
- Chef::Log.should_receive(:debug).with("group[aj] removing group members all your base")
+ expect(Chef::Log).to receive(:debug).with("group[aj] removing group members all your base")
@provider.set_members
end
it "should run safe_dscl with create /Groups/group GroupMembership to clear the Group's UID list" do
- @provider.should_receive(:safe_dscl).with("create /Groups/aj GroupMembers ''").and_return(true)
- @provider.should_receive(:safe_dscl).with("create /Groups/aj GroupMembership ''").and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/aj GroupMembers ''").and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/aj GroupMembership ''").and_return(true)
@provider.set_members
end
end
@@ -209,14 +209,14 @@ describe Chef::Provider::Group::Dscl do
end
it "should log an appropriate debug message" do
- Chef::Log.should_receive(:debug).with("group[aj] setting group members all, your, base")
+ expect(Chef::Log).to receive(:debug).with("group[aj] setting group members all, your, base")
@provider.set_members
end
it "should run safe_dscl with append /Groups/group GroupMembership and group members all, your, base" do
- @provider.should_receive(:safe_dscl).with("create /Groups/aj GroupMembers ''").and_return(true)
- @provider.should_receive(:safe_dscl).with("append /Groups/aj GroupMembership all your base").and_return(true)
- @provider.should_receive(:safe_dscl).with("create /Groups/aj GroupMembership ''").and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/aj GroupMembers ''").and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("append /Groups/aj GroupMembership all your base").and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/aj GroupMembership ''").and_return(true)
@provider.set_members
end
end
@@ -228,7 +228,7 @@ describe Chef::Provider::Group::Dscl do
end
it "should not call safe_dscl" do
- @provider.should_not_receive(:safe_dscl)
+ expect(@provider).not_to receive(:safe_dscl)
@provider.set_members
end
end
@@ -242,23 +242,23 @@ describe Chef::Provider::Group::Dscl do
end
it "raises an error if the required binary /usr/bin/dscl doesn't exist" do
- File.should_receive(:exists?).with("/usr/bin/dscl").and_return(false)
+ expect(File).to receive(:exists?).with("/usr/bin/dscl").and_return(false)
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
end
it "doesn't raise an error if /usr/bin/dscl exists" do
- File.stub(:exists?).and_return(true)
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ allow(File).to receive(:exists?).and_return(true)
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
end
-
+
describe "when creating the group" do
it "creates the group, password field, gid, and sets group membership" do
- @provider.should_receive(:set_gid).and_return(true)
- @provider.should_receive(:set_members).and_return(true)
- @provider.should_receive(:safe_dscl).with("create /Groups/aj Password '*'")
- @provider.should_receive(:safe_dscl).with("create /Groups/aj")
+ expect(@provider).to receive(:set_gid).and_return(true)
+ expect(@provider).to receive(:set_members).and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/aj Password '*'")
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/aj")
@provider.create_group
end
end
@@ -267,30 +267,30 @@ describe Chef::Provider::Group::Dscl do
it "should manage the group_name if it changed and the new resources group_name is not null" do
@current_resource.group_name("oldval")
@new_resource.group_name("newname")
- @provider.should_receive(:set_members).and_return(true)
- @provider.should_receive(:safe_dscl).with("create /Groups/newname")
- @provider.should_receive(:safe_dscl).with("create /Groups/newname Password '*'")
+ expect(@provider).to receive(:set_members).and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/newname")
+ expect(@provider).to receive(:safe_dscl).with("create /Groups/newname Password '*'")
@provider.manage_group
end
it "should manage the gid if it changed and the new resources gid is not null" do
@current_resource.gid(23)
@new_resource.gid(42)
- @provider.should_receive(:set_gid)
+ expect(@provider).to receive(:set_gid)
@provider.manage_group
end
it "should manage the members if it changed and the new resources members is not null" do
@current_resource.members(%{charlie root})
@new_resource.members(%{crab revenge})
- @provider.should_receive(:set_members)
+ expect(@provider).to receive(:set_members)
@provider.manage_group
end
end
describe "remove_group" do
it "should run safe_dscl with delete /Groups/group and with the new resources group name" do
- @provider.should_receive(:safe_dscl).with("delete /Groups/aj").and_return(true)
+ expect(@provider).to receive(:safe_dscl).with("delete /Groups/aj").and_return(true)
@provider.remove_group
end
end
@@ -301,7 +301,8 @@ describe 'Test DSCL loading' do
@node = Chef::Node.new
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
- @new_resource = Chef::Resource::Group.new("aj")
+ @new_resource = Chef::Resource::Group.new("group name aj")
+ @new_resource.group_name("aj")
@provider = Chef::Provider::Group::Dscl.new(@new_resource, @run_context)
@output = <<-EOF
AppleMetaNodeLocation: /Local/Default
@@ -317,17 +318,17 @@ RecordName: com.apple.aj
RecordType: dsRecTypeStandard:Groups
GroupMembership: waka bar
EOF
- @provider.stub(:safe_dscl).with("read /Groups/aj").and_return(@output)
+ allow(@provider).to receive(:safe_dscl).with("read /Groups/aj").and_return(@output)
@current_resource = @provider.load_current_resource
end
it 'should parse gid properly' do
- File.stub(:exists?).and_return(true)
- @current_resource.gid.should eq("999")
+ allow(File).to receive(:exists?).and_return(true)
+ expect(@current_resource.gid).to eq("999")
end
it 'should parse members properly' do
- File.stub(:exists?).and_return(true)
- @current_resource.members.should eq(['waka', 'bar'])
+ allow(File).to receive(:exists?).and_return(true)
+ expect(@current_resource.members).to eq(['waka', 'bar'])
end
end
diff --git a/spec/unit/provider/group/gpasswd_spec.rb b/spec/unit/provider/group/gpasswd_spec.rb
index 5bd7fdc569..55d978fa7e 100644
--- a/spec/unit/provider/group/gpasswd_spec.rb
+++ b/spec/unit/provider/group/gpasswd_spec.rb
@@ -41,14 +41,14 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do
# for Chef::Provider::Group - no need to repeat it here. We'll
# include only what's specific to this provider.
it "should raise an error if the required binary /usr/bin/gpasswd doesn't exist" do
- File.stub(:exists?).and_return(true)
- File.should_receive(:exists?).with("/usr/bin/gpasswd").and_return(false)
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group)
+ allow(File).to receive(:exists?).and_return(true)
+ expect(File).to receive(:exists?).with("/usr/bin/gpasswd").and_return(false)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
end
it "shouldn't raise an error if the required binaries exist" do
- File.stub(:exists?).and_return(true)
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ allow(File).to receive(:exists?).and_return(true)
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
end
@@ -65,8 +65,8 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do
end
it "logs a message and sets group's members to 'none'" do
- Chef::Log.should_receive(:debug).with("group[wheel] setting group members to: none")
- @provider.should_receive(:shell_out!).with("gpasswd -M \"\" wheel")
+ expect(Chef::Log).to receive(:debug).with("group[wheel] setting group members to: none")
+ expect(@provider).to receive(:shell_out!).with("gpasswd -M \"\" wheel")
@provider.modify_group_members
end
end
@@ -78,20 +78,20 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do
end
it "does not modify group membership" do
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.modify_group_members
end
end
describe "when the resource specifies group members" do
it "should log an appropriate debug message" do
- Chef::Log.should_receive(:debug).with("group[wheel] setting group members to: lobster, rage, fist")
- @provider.stub(:shell_out!)
+ expect(Chef::Log).to receive(:debug).with("group[wheel] setting group members to: lobster, rage, fist")
+ allow(@provider).to receive(:shell_out!)
@provider.modify_group_members
end
it "should run gpasswd with the members joined by ',' followed by the target group" do
- @provider.should_receive(:shell_out!).with("gpasswd -M lobster,rage,fist wheel")
+ expect(@provider).to receive(:shell_out!).with("gpasswd -M lobster,rage,fist wheel")
@provider.modify_group_members
end
@@ -104,9 +104,9 @@ describe Chef::Provider::Group::Gpasswd, "modify_group_members" do
it "should run gpasswd individually for each user when the append option is set" do
@new_resource.append(true)
- @provider.should_receive(:shell_out!).with("gpasswd -a lobster wheel")
- @provider.should_receive(:shell_out!).with("gpasswd -a rage wheel")
- @provider.should_receive(:shell_out!).with("gpasswd -a fist wheel")
+ expect(@provider).to receive(:shell_out!).with("gpasswd -a lobster wheel")
+ expect(@provider).to receive(:shell_out!).with("gpasswd -a rage wheel")
+ expect(@provider).to receive(:shell_out!).with("gpasswd -a fist wheel")
@provider.modify_group_members
end
end
diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb
index 793615d04c..94150b7a88 100644
--- a/spec/unit/provider/group/groupadd_spec.rb
+++ b/spec/unit/provider/group/groupadd_spec.rb
@@ -43,47 +43,47 @@ describe Chef::Provider::Group::Groupadd, "set_options" do
field_list.each do |attribute, option|
it "should check for differences in #{attribute.to_s} between the current and new resources" do
- @new_resource.should_receive(attribute)
- @current_resource.should_receive(attribute)
+ expect(@new_resource).to receive(attribute)
+ expect(@current_resource).to receive(attribute)
@provider.set_options
end
it "should set the option for #{attribute} if the new resources #{attribute} is not null" do
- @new_resource.stub(attribute).and_return("wowaweea")
- @provider.set_options.should eql(" #{option} '#{@new_resource.send(attribute)}' #{@new_resource.group_name}")
+ allow(@new_resource).to receive(attribute).and_return("wowaweea")
+ expect(@provider.set_options).to eql(" #{option} '#{@new_resource.send(attribute)}' #{@new_resource.group_name}")
end
end
it "should combine all the possible options" do
match_string = ""
field_list.sort{ |a,b| a[0] <=> b[0] }.each do |attribute, option|
- @new_resource.stub(attribute).and_return("hola")
+ allow(@new_resource).to receive(attribute).and_return("hola")
match_string << " #{option} 'hola'"
end
match_string << " aj"
- @provider.set_options.should eql(match_string)
+ expect(@provider.set_options).to eql(match_string)
end
describe "when we want to create a system group" do
it "should not set groupadd_options '-r' when system is false" do
@new_resource.system(false)
- @provider.groupadd_options.should_not =~ /-r/
+ expect(@provider.groupadd_options).not_to match(/-r/)
end
it "should set groupadd -r if system is true" do
@new_resource.system(true)
- @provider.groupadd_options.should == " -r"
+ expect(@provider.groupadd_options).to eq(" -r")
end
end
describe "when we want to create a non_unique gid group" do
it "should not set groupadd_options '-o' when non_unique is false" do
@new_resource.non_unique(false)
- @provider.groupadd_options.should_not =~ /-o/
+ expect(@provider.groupadd_options).not_to match(/-o/)
end
it "should set groupadd -o if non_unique is true" do
@new_resource.non_unique(true)
- @provider.groupadd_options.should == " -o"
+ expect(@provider.groupadd_options).to eq(" -o")
end
end
end
@@ -93,19 +93,19 @@ describe Chef::Provider::Group::Groupadd, "create_group" do
@node = Chef::Node.new
@new_resource = Chef::Resource::Group.new("aj")
@provider = Chef::Provider::Group::Groupadd.new(@node, @new_resource)
- @provider.stub(:run_command).and_return(true)
- @provider.stub(:set_options).and_return(" monkey")
- @provider.stub(:groupadd_options).and_return("")
- @provider.stub(:modify_group_members).and_return(true)
+ allow(@provider).to receive(:run_command).and_return(true)
+ allow(@provider).to receive(:set_options).and_return(" monkey")
+ allow(@provider).to receive(:groupadd_options).and_return("")
+ allow(@provider).to receive(:modify_group_members).and_return(true)
end
it "should run groupadd with the return of set_options" do
- @provider.should_receive(:run_command).with({ :command => "groupadd monkey" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "groupadd monkey" }).and_return(true)
@provider.create_group
end
it "should modify the group members" do
- @provider.should_receive(:modify_group_members).and_return(true)
+ expect(@provider).to receive(:modify_group_members).and_return(true)
@provider.create_group
end
end
@@ -117,20 +117,20 @@ describe Chef::Provider::Group::Groupadd do
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Group.new("aj")
@provider = Chef::Provider::Group::Groupadd.new(@new_resource, @run_context)
- @provider.stub(:run_command).and_return(true)
- @provider.stub(:set_options).and_return(" monkey")
+ allow(@provider).to receive(:run_command).and_return(true)
+ allow(@provider).to receive(:set_options).and_return(" monkey")
end
describe "manage group" do
it "should run groupmod with the return of set_options" do
- @provider.stub(:modify_group_members).and_return(true)
- @provider.should_receive(:run_command).with({ :command => "groupmod monkey" }).and_return(true)
+ allow(@provider).to receive(:modify_group_members).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "groupmod monkey" }).and_return(true)
@provider.manage_group
end
it "should modify the group members" do
- @provider.should_receive(:modify_group_members).and_return(true)
+ expect(@provider).to receive(:modify_group_members).and_return(true)
@provider.manage_group
end
end
@@ -138,36 +138,36 @@ describe Chef::Provider::Group::Groupadd do
describe "remove_group" do
it "should run groupdel with the new resources group name" do
- @provider.should_receive(:run_command).with({ :command => "groupdel aj" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "groupdel aj" }).and_return(true)
@provider.remove_group
end
end
[:add_member, :remove_member, :set_members].each do |m|
it "should raise an error when calling #{m}" do
- lambda { @provider.send(m, [ ]) }.should raise_error(Chef::Exceptions::Group, "you must override #{m} in #{@provider.to_s}")
+ expect { @provider.send(m, [ ]) }.to raise_error(Chef::Exceptions::Group, "you must override #{m} in #{@provider.to_s}")
end
end
describe "load_current_resource" do
before do
- File.stub(:exists?).and_return(false)
+ allow(File).to receive(:exists?).and_return(false)
@provider.define_resource_requirements
end
it "should raise an error if the required binary /usr/sbin/groupadd doesn't exist" do
- File.should_receive(:exists?).with("/usr/sbin/groupadd").and_return(false)
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group)
+ expect(File).to receive(:exists?).with("/usr/sbin/groupadd").and_return(false)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
end
it "should raise an error if the required binary /usr/sbin/groupmod doesn't exist" do
- File.should_receive(:exists?).with("/usr/sbin/groupadd").and_return(true)
- File.should_receive(:exists?).with("/usr/sbin/groupmod").and_return(false)
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group)
+ expect(File).to receive(:exists?).with("/usr/sbin/groupadd").and_return(true)
+ expect(File).to receive(:exists?).with("/usr/sbin/groupmod").and_return(false)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
end
it "should raise an error if the required binary /usr/sbin/groupdel doesn't exist" do
- File.should_receive(:exists?).with("/usr/sbin/groupadd").and_return(true)
- File.should_receive(:exists?).with("/usr/sbin/groupmod").and_return(true)
- File.should_receive(:exists?).with("/usr/sbin/groupdel").and_return(false)
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group)
+ expect(File).to receive(:exists?).with("/usr/sbin/groupadd").and_return(true)
+ expect(File).to receive(:exists?).with("/usr/sbin/groupmod").and_return(true)
+ expect(File).to receive(:exists?).with("/usr/sbin/groupdel").and_return(false)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
end
end
diff --git a/spec/unit/provider/group/groupmod_spec.rb b/spec/unit/provider/group/groupmod_spec.rb
index 001f9c66e8..496d1e28fa 100644
--- a/spec/unit/provider/group/groupmod_spec.rb
+++ b/spec/unit/provider/group/groupmod_spec.rb
@@ -33,18 +33,18 @@ describe Chef::Provider::Group::Groupmod do
describe "manage_group" do
describe "when determining the current group state" do
it "should raise an error if the required binary /usr/sbin/group doesn't exist" do
- File.should_receive(:exists?).with("/usr/sbin/group").and_return(false)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Group)
+ expect(File).to receive(:exists?).with("/usr/sbin/group").and_return(false)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Group)
end
it "should raise an error if the required binary /usr/sbin/user doesn't exist" do
- File.should_receive(:exists?).with("/usr/sbin/group").and_return(true)
- File.should_receive(:exists?).with("/usr/sbin/user").and_return(false)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Group)
+ expect(File).to receive(:exists?).with("/usr/sbin/group").and_return(true)
+ expect(File).to receive(:exists?).with("/usr/sbin/user").and_return(false)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Group)
end
it "shouldn't raise an error if the required binaries exist" do
- File.stub(:exists?).and_return(true)
- lambda { @provider.load_current_resource }.should_not raise_error
+ allow(File).to receive(:exists?).and_return(true)
+ expect { @provider.load_current_resource }.not_to raise_error
end
end
@@ -61,10 +61,10 @@ describe Chef::Provider::Group::Groupmod do
end
it "logs a message and sets group's members to 'none', then removes existing group members" do
- Chef::Log.should_receive(:debug).with("group[wheel] setting group members to: none")
- @provider.should_receive(:shell_out!).with("group mod -n wheel_bak wheel")
- @provider.should_receive(:shell_out!).with("group add -g '123' -o wheel")
- @provider.should_receive(:shell_out!).with("group del wheel_bak")
+ expect(Chef::Log).to receive(:debug).with("group[wheel] setting group members to: none")
+ expect(@provider).to receive(:shell_out!).with("group mod -n wheel_bak wheel")
+ expect(@provider).to receive(:shell_out!).with("group add -g '123' -o wheel")
+ expect(@provider).to receive(:shell_out!).with("group del wheel_bak")
@provider.manage_group
end
end
@@ -76,8 +76,8 @@ describe Chef::Provider::Group::Groupmod do
end
it "logs a message and does not modify group membership" do
- Chef::Log.should_receive(:debug).with("group[wheel] not changing group members, the group has no members to add")
- @provider.should_not_receive(:shell_out!)
+ expect(Chef::Log).to receive(:debug).with("group[wheel] not changing group members, the group has no members to add")
+ expect(@provider).not_to receive(:shell_out!)
@provider.manage_group
end
end
@@ -89,11 +89,11 @@ describe Chef::Provider::Group::Groupmod do
end
it "updates group membership correctly" do
- Chef::Log.stub(:debug)
- @provider.should_receive(:shell_out!).with("group mod -n wheel_bak wheel")
- @provider.should_receive(:shell_out!).with("user mod -G wheel lobster")
- @provider.should_receive(:shell_out!).with("group add -g '123' -o wheel")
- @provider.should_receive(:shell_out!).with("group del wheel_bak")
+ allow(Chef::Log).to receive(:debug)
+ expect(@provider).to receive(:shell_out!).with("group mod -n wheel_bak wheel")
+ expect(@provider).to receive(:shell_out!).with("user mod -G wheel lobster")
+ expect(@provider).to receive(:shell_out!).with("group add -g '123' -o wheel")
+ expect(@provider).to receive(:shell_out!).with("group del wheel_bak")
@provider.manage_group
end
end
@@ -108,10 +108,10 @@ describe Chef::Provider::Group::Groupmod do
end
it "should run a group add command and some user mod commands" do
- @provider.should_receive(:shell_out!).with("group add -g '123' wheel")
- @provider.should_receive(:shell_out!).with("user mod -G wheel lobster")
- @provider.should_receive(:shell_out!).with("user mod -G wheel rage")
- @provider.should_receive(:shell_out!).with("user mod -G wheel fist")
+ expect(@provider).to receive(:shell_out!).with("group add -g '123' wheel")
+ expect(@provider).to receive(:shell_out!).with("user mod -G wheel lobster")
+ expect(@provider).to receive(:shell_out!).with("user mod -G wheel rage")
+ expect(@provider).to receive(:shell_out!).with("user mod -G wheel fist")
@provider.create_group
end
end
@@ -125,7 +125,7 @@ describe Chef::Provider::Group::Groupmod do
end
it "should run a group del command" do
- @provider.should_receive(:shell_out!).with("group del wheel")
+ expect(@provider).to receive(:shell_out!).with("group del wheel")
@provider.remove_group
end
end
diff --git a/spec/unit/provider/group/pw_spec.rb b/spec/unit/provider/group/pw_spec.rb
index fdc2e35746..af74b3b2ce 100644
--- a/spec/unit/provider/group/pw_spec.rb
+++ b/spec/unit/provider/group/pw_spec.rb
@@ -37,19 +37,19 @@ describe Chef::Provider::Group::Pw do
describe "when setting options for the pw command" do
it "does not set the gid option if gids match or are unmanaged" do
- @provider.set_options.should == " wheel"
+ expect(@provider.set_options).to eq(" wheel")
end
it "sets the option for gid if it is not nil" do
@new_resource.gid(42)
- @provider.set_options.should eql(" wheel -g '42'")
+ expect(@provider.set_options).to eql(" wheel -g '42'")
end
end
describe "when creating a group" do
it "should run pw groupadd with the return of set_options and set_members_option" do
@new_resource.gid(23)
- @provider.should_receive(:run_command).with({ :command => "pw groupadd wheel -g '23' -M root,aj" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw groupadd wheel -g '23' -M root,aj" }).and_return(true)
@provider.create_group
end
end
@@ -59,8 +59,8 @@ describe Chef::Provider::Group::Pw do
it "should run pw groupmod with the return of set_options" do
@new_resource.gid(42)
@new_resource.members(["someone"])
- @provider.should_receive(:run_command).with({ :command => "pw groupmod wheel -g '42' -m someone" }).and_return(true)
- @provider.should_receive(:run_command).with({ :command => "pw groupmod wheel -g '42' -d root,aj" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw groupmod wheel -g '42' -m someone" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw groupmod wheel -g '42' -d root,aj" }).and_return(true)
@provider.manage_group
end
@@ -68,7 +68,7 @@ describe Chef::Provider::Group::Pw do
describe "when removing the group" do
it "should run pw groupdel with the new resources group name" do
- @provider.should_receive(:run_command).with({ :command => "pw groupdel wheel" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw groupdel wheel" }).and_return(true)
@provider.remove_group
end
end
@@ -77,44 +77,44 @@ describe Chef::Provider::Group::Pw do
describe "with an empty members array in both the new and current resource" do
before do
- @new_resource.stub(:members).and_return([])
- @current_resource.stub(:members).and_return([])
+ allow(@new_resource).to receive(:members).and_return([])
+ allow(@current_resource).to receive(:members).and_return([])
end
it "should set no options" do
- @provider.set_members_options.should eql([ ])
+ expect(@provider.set_members_options).to eql([ ])
end
end
describe "with an empty members array in the new resource and existing members in the current resource" do
before do
- @new_resource.stub(:members).and_return([])
- @current_resource.stub(:members).and_return(["all", "your", "base"])
+ allow(@new_resource).to receive(:members).and_return([])
+ allow(@current_resource).to receive(:members).and_return(["all", "your", "base"])
end
it "should log an appropriate message" do
- Chef::Log.should_receive(:debug).with("group[wheel] removing group members: all,your,base")
+ expect(Chef::Log).to receive(:debug).with("group[wheel] removing group members: all,your,base")
@provider.set_members_options
end
it "should set the -d option with the members joined by ','" do
- @provider.set_members_options.should eql([ " -d all,your,base" ])
+ expect(@provider.set_members_options).to eql([ " -d all,your,base" ])
end
end
describe "with supplied members array in the new resource and an empty members array in the current resource" do
before do
- @new_resource.stub(:members).and_return(["all", "your", "base"])
- @current_resource.stub(:members).and_return([])
+ allow(@new_resource).to receive(:members).and_return(["all", "your", "base"])
+ allow(@current_resource).to receive(:members).and_return([])
end
it "should log an appropriate debug message" do
- Chef::Log.should_receive(:debug).with("group[wheel] adding group members: all,your,base")
+ expect(Chef::Log).to receive(:debug).with("group[wheel] adding group members: all,your,base")
@provider.set_members_options
end
it "should set the -m option with the members joined by ','" do
- @provider.set_members_options.should eql([ " -m all,your,base" ])
+ expect(@provider.set_members_options).to eql([ " -m all,your,base" ])
end
end
end
@@ -126,13 +126,13 @@ describe Chef::Provider::Group::Pw do
@provider.define_resource_requirements
end
it "should raise an error if the required binary /usr/sbin/pw doesn't exist" do
- File.should_receive(:exists?).with("/usr/sbin/pw").and_return(false)
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group)
+ expect(File).to receive(:exists?).with("/usr/sbin/pw").and_return(false)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
end
it "shouldn't raise an error if /usr/sbin/pw exists" do
- File.stub(:exists?).and_return(true)
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ allow(File).to receive(:exists?).and_return(true)
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
end
end
diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb
index bd9eac4ede..3f06e9ebf1 100644
--- a/spec/unit/provider/group/usermod_spec.rb
+++ b/spec/unit/provider/group/usermod_spec.rb
@@ -27,19 +27,19 @@ describe Chef::Provider::Group::Usermod do
@new_resource.members [ "all", "your", "base" ]
@new_resource.excluded_members [ ]
@provider = Chef::Provider::Group::Usermod.new(@new_resource, @run_context)
- @provider.stub(:run_command)
+ allow(@provider).to receive(:run_command)
end
describe "modify_group_members" do
describe "with an empty members array" do
before do
- @new_resource.stub(:append).and_return(true)
- @new_resource.stub(:members).and_return([])
+ allow(@new_resource).to receive(:append).and_return(true)
+ allow(@new_resource).to receive(:members).and_return([])
end
it "should log an appropriate message" do
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.modify_group_members
end
end
@@ -56,8 +56,8 @@ describe Chef::Provider::Group::Usermod do
}
before do
- @new_resource.stub(:members).and_return(["all", "your", "base"])
- File.stub(:exists?).and_return(true)
+ allow(@new_resource).to receive(:members).and_return(["all", "your", "base"])
+ allow(File).to receive(:exists?).and_return(true)
end
it "should raise an error when setting the entire group directly" do
@@ -65,7 +65,7 @@ describe Chef::Provider::Group::Usermod do
@provider.load_current_resource
@provider.instance_variable_set("@group_exists", true)
@provider.action = :modify
- lambda { @provider.run_action(@provider.process_resource_requirements) }.should raise_error(Chef::Exceptions::Group, "setting group members directly is not supported by #{@provider.to_s}, must set append true in group")
+ expect { @provider.run_action(@provider.process_resource_requirements) }.to raise_error(Chef::Exceptions::Group, "setting group members directly is not supported by #{@provider.to_s}, must set append true in group")
end
it "should raise an error when excluded_members are set" do
@@ -73,9 +73,9 @@ describe Chef::Provider::Group::Usermod do
@provider.load_current_resource
@provider.instance_variable_set("@group_exists", true)
@provider.action = :modify
- @new_resource.stub(:append).and_return(true)
- @new_resource.stub(:excluded_members).and_return(["someone"])
- lambda { @provider.run_action(@provider.process_resource_requirements) }.should raise_error(Chef::Exceptions::Group, "excluded_members is not supported by #{@provider.to_s}")
+ allow(@new_resource).to receive(:append).and_return(true)
+ allow(@new_resource).to receive(:excluded_members).and_return(["someone"])
+ expect { @provider.run_action(@provider.process_resource_requirements) }.to raise_error(Chef::Exceptions::Group, "excluded_members is not supported by #{@provider.to_s}")
end
platforms.each do |platform, flags|
@@ -84,10 +84,10 @@ describe Chef::Provider::Group::Usermod do
current_resource.members([ ])
@provider.current_resource = current_resource
@node.automatic_attrs[:platform] = platform
- @new_resource.stub(:append).and_return(true)
- @provider.should_receive(:shell_out!).with("usermod #{flags} wheel all")
- @provider.should_receive(:shell_out!).with("usermod #{flags} wheel your")
- @provider.should_receive(:shell_out!).with("usermod #{flags} wheel base")
+ allow(@new_resource).to receive(:append).and_return(true)
+ expect(@provider).to receive(:shell_out!).with("usermod #{flags} wheel all")
+ expect(@provider).to receive(:shell_out!).with("usermod #{flags} wheel your")
+ expect(@provider).to receive(:shell_out!).with("usermod #{flags} wheel base")
@provider.modify_group_members
end
end
@@ -96,20 +96,20 @@ describe Chef::Provider::Group::Usermod do
describe "when loading the current resource" do
before(:each) do
- File.stub(:exists?).and_return(false)
+ allow(File).to receive(:exists?).and_return(false)
@provider.action = :create
@provider.define_resource_requirements
end
it "should raise an error if the required binary /usr/sbin/usermod doesn't exist" do
- File.stub(:exists?).and_return(true)
- File.should_receive(:exists?).with("/usr/sbin/usermod").and_return(false)
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Group)
+ allow(File).to receive(:exists?).and_return(true)
+ expect(File).to receive(:exists?).with("/usr/sbin/usermod").and_return(false)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
end
it "shouldn't raise an error if the required binaries exist" do
- File.stub(:exists?).and_return(true)
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ allow(File).to receive(:exists?).and_return(true)
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
end
end
diff --git a/spec/unit/provider/group/windows_spec.rb b/spec/unit/provider/group/windows_spec.rb
index 6888c750f5..23dfa8315f 100644
--- a/spec/unit/provider/group/windows_spec.rb
+++ b/spec/unit/provider/group/windows_spec.rb
@@ -34,14 +34,14 @@ describe Chef::Provider::Group::Windows do
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Group.new("staff")
@net_group = double("Chef::Util::Windows::NetGroup")
- Chef::Util::Windows::NetGroup.stub(:new).and_return(@net_group)
+ allow(Chef::Util::Windows::NetGroup).to receive(:new).and_return(@net_group)
@provider = Chef::Provider::Group::Windows.new(@new_resource, @run_context)
end
describe "when creating the group" do
it "should call @net_group.local_add" do
- @net_group.should_receive(:local_set_members).with([])
- @net_group.should_receive(:local_add)
+ expect(@net_group).to receive(:local_set_members).with([])
+ expect(@net_group).to receive(:local_add)
@provider.create_group
end
end
@@ -52,22 +52,22 @@ describe Chef::Provider::Group::Windows do
@current_resource = Chef::Resource::Group.new("staff")
@current_resource.members [ "all", "your", "base" ]
- Chef::Util::Windows::NetGroup.stub(:new).and_return(@net_group)
- @net_group.stub(:local_add_members)
- @net_group.stub(:local_set_members)
- @provider.stub(:local_group_name_to_sid)
+ allow(Chef::Util::Windows::NetGroup).to receive(:new).and_return(@net_group)
+ allow(@net_group).to receive(:local_add_members)
+ allow(@net_group).to receive(:local_set_members)
+ allow(@provider).to receive(:local_group_name_to_sid)
@provider.current_resource = @current_resource
end
it "should call @net_group.local_set_members" do
- @new_resource.stub(:append).and_return(false)
- @net_group.should_receive(:local_set_members).with(@new_resource.members)
+ allow(@new_resource).to receive(:append).and_return(false)
+ expect(@net_group).to receive(:local_set_members).with(@new_resource.members)
@provider.manage_group
end
it "should call @net_group.local_add_members" do
- @new_resource.stub(:append).and_return(true)
- @net_group.should_receive(:local_add_members).with(@new_resource.members)
+ allow(@new_resource).to receive(:append).and_return(true)
+ expect(@net_group).to receive(:local_add_members).with(@new_resource.members)
@provider.manage_group
end
@@ -75,12 +75,12 @@ describe Chef::Provider::Group::Windows do
describe "remove_group" do
before do
- Chef::Util::Windows::NetGroup.stub(:new).and_return(@net_group)
- @provider.stub(:run_command).and_return(true)
+ allow(Chef::Util::Windows::NetGroup).to receive(:new).and_return(@net_group)
+ allow(@provider).to receive(:run_command).and_return(true)
end
it "should call @net_group.local_delete" do
- @net_group.should_receive(:local_delete)
+ expect(@net_group).to receive(:local_delete)
@provider.remove_group
end
end
@@ -95,7 +95,7 @@ describe Chef::Provider::Group::Windows, "NetGroup" do
@new_resource.group_name "Remote Desktop Users"
end
it 'sets group_name correctly' do
- Chef::Util::Windows::NetGroup.should_receive(:new).with("Remote Desktop Users")
+ expect(Chef::Util::Windows::NetGroup).to receive(:new).with("Remote Desktop Users")
Chef::Provider::Group::Windows.new(@new_resource, @run_context)
end
end
diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb
index e467da751f..b36bfe364b 100644
--- a/spec/unit/provider/group_spec.rb
+++ b/spec/unit/provider/group_spec.rb
@@ -41,89 +41,89 @@ describe Chef::Provider::User do
:gid => 20,
:mem => [ "root", "aj" ]
)
- Etc.stub(:getgrnam).with('wheel').and_return(@pw_group)
+ allow(Etc).to receive(:getgrnam).with('wheel').and_return(@pw_group)
end
it "assumes the group exists by default" do
- @provider.group_exists.should be_true
+ expect(@provider.group_exists).to be_truthy
end
describe "when establishing the current state of the group" do
it "sets the group name of the current resource to the group name of the new resource" do
@provider.load_current_resource
- @provider.current_resource.group_name.should == 'wheel'
+ expect(@provider.current_resource.group_name).to eq('wheel')
end
it "does not modify the desired gid if set" do
@provider.load_current_resource
- @new_resource.gid.should == 500
+ expect(@new_resource.gid).to eq(500)
end
it "sets the desired gid to the current gid if none is set" do
@new_resource.instance_variable_set(:@gid, nil)
@provider.load_current_resource
- @new_resource.gid.should == 20
+ expect(@new_resource.gid).to eq(20)
end
it "looks up the group in /etc/group with getgrnam" do
- Etc.should_receive(:getgrnam).with(@new_resource.group_name).and_return(@pw_group)
+ expect(Etc).to receive(:getgrnam).with(@new_resource.group_name).and_return(@pw_group)
@provider.load_current_resource
- @provider.current_resource.gid.should == 20
- @provider.current_resource.members.should == %w{root aj}
+ expect(@provider.current_resource.gid).to eq(20)
+ expect(@provider.current_resource.members).to eq(%w{root aj})
end
it "should flip the value of exists if it cannot be found in /etc/group" do
- Etc.stub(:getgrnam).and_raise(ArgumentError)
+ allow(Etc).to receive(:getgrnam).and_raise(ArgumentError)
@provider.load_current_resource
- @provider.group_exists.should be_false
+ expect(@provider.group_exists).to be_falsey
end
it "should return the current resource" do
- @provider.load_current_resource.should equal(@provider.current_resource)
+ expect(@provider.load_current_resource).to equal(@provider.current_resource)
end
end
describe "when determining if the system is already in the target state" do
[ :gid, :members ].each do |attribute|
it "should return true if #{attribute} doesn't match" do
- @current_resource.stub(attribute).and_return("looooooooooooooooooool")
- @provider.compare_group.should be_true
+ allow(@current_resource).to receive(attribute).and_return("looooooooooooooooooool")
+ expect(@provider.compare_group).to be_truthy
end
end
it "should return false if gid and members are equal" do
- @provider.compare_group.should be_false
+ expect(@provider.compare_group).to be_falsey
end
it "should coerce an integer to a string for comparison" do
- @current_resource.stub(:gid).and_return("500")
- @provider.compare_group.should be_false
+ allow(@current_resource).to receive(:gid).and_return("500")
+ expect(@provider.compare_group).to be_falsey
end
it "should return false if append is true and the group member(s) already exists" do
@current_resource.members << "extra_user"
- @new_resource.stub(:append).and_return(true)
- @provider.compare_group.should be_false
+ allow(@new_resource).to receive(:append).and_return(true)
+ expect(@provider.compare_group).to be_falsey
end
it "should return true if append is true and the group member(s) do not already exist" do
@new_resource.members << "extra_user"
- @new_resource.stub(:append).and_return(true)
- @provider.compare_group.should be_true
+ allow(@new_resource).to receive(:append).and_return(true)
+ expect(@provider.compare_group).to be_truthy
end
it "should return false if append is true and excluded_members include a non existing member" do
@new_resource.excluded_members << "extra_user"
- @new_resource.stub(:append).and_return(true)
- @provider.compare_group.should be_false
+ allow(@new_resource).to receive(:append).and_return(true)
+ expect(@provider.compare_group).to be_falsey
end
it "should return true if the append is true and excluded_members include an existing user" do
@new_resource.members.each {|m| @new_resource.excluded_members << m }
@new_resource.members.clear
- @new_resource.stub(:append).and_return(true)
- @provider.compare_group.should be_true
+ allow(@new_resource).to receive(:append).and_return(true)
+ expect(@provider.compare_group).to be_truthy
end
end
@@ -131,40 +131,40 @@ describe Chef::Provider::User do
describe "when creating a group" do
it "should call create_group if the group does not exist" do
@provider.group_exists = false
- @provider.should_receive(:create_group).and_return(true)
+ expect(@provider).to receive(:create_group).and_return(true)
@provider.run_action(:create)
end
it "should set the new_resources updated flag when it creates the group" do
@provider.group_exists = false
- @provider.stub(:create_group)
+ allow(@provider).to receive(:create_group)
@provider.run_action(:create)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
it "should check to see if the group has mismatched attributes if the group exists" do
@provider.group_exists = true
- @provider.stub(:compare_group).and_return(false)
- @provider.stub(:change_desc).and_return([ ])
+ allow(@provider).to receive(:compare_group).and_return(false)
+ allow(@provider).to receive(:change_desc).and_return([ ])
@provider.run_action(:create)
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
it "should call manage_group if the group exists and has mismatched attributes" do
@provider.group_exists = true
- @provider.stub(:compare_group).and_return(true)
- @provider.stub(:change_desc).and_return([ ])
- @provider.should_receive(:manage_group).and_return(true)
+ allow(@provider).to receive(:compare_group).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return([ ])
+ expect(@provider).to receive(:manage_group).and_return(true)
@provider.run_action(:create)
end
it "should set the new_resources updated flag when it creates the group if we call manage_group" do
@provider.group_exists = true
- @provider.stub(:compare_group).and_return(true)
- @provider.stub(:change_desc).and_return(["Some changes are going to be done."])
- @provider.stub(:manage_group).and_return(true)
+ allow(@provider).to receive(:compare_group).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return(["Some changes are going to be done."])
+ allow(@provider).to receive(:manage_group).and_return(true)
@provider.run_action(:create)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
@@ -172,50 +172,50 @@ describe Chef::Provider::User do
it "should not call remove_group if the group does not exist" do
@provider.group_exists = false
- @provider.should_not_receive(:remove_group)
+ expect(@provider).not_to receive(:remove_group)
@provider.run_action(:remove)
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
it "should call remove_group if the group exists" do
@provider.group_exists = true
- @provider.should_receive(:remove_group)
+ expect(@provider).to receive(:remove_group)
@provider.run_action(:remove)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
end
describe "when updating a group" do
before(:each) do
@provider.group_exists = true
- @provider.stub(:manage_group).and_return(true)
+ allow(@provider).to receive(:manage_group).and_return(true)
end
it "should run manage_group if the group exists and has mismatched attributes" do
- @provider.should_receive(:compare_group).and_return(true)
- @provider.stub(:change_desc).and_return(["Some changes are going to be done."])
- @provider.should_receive(:manage_group).and_return(true)
+ expect(@provider).to receive(:compare_group).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return(["Some changes are going to be done."])
+ expect(@provider).to receive(:manage_group).and_return(true)
@provider.run_action(:manage)
end
it "should set the new resources updated flag to true if manage_group is called" do
- @provider.stub(:compare_group).and_return(true)
- @provider.stub(:change_desc).and_return(["Some changes are going to be done."])
- @provider.stub(:manage_group).and_return(true)
+ allow(@provider).to receive(:compare_group).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return(["Some changes are going to be done."])
+ allow(@provider).to receive(:manage_group).and_return(true)
@provider.run_action(:manage)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not run manage_group if the group does not exist" do
@provider.group_exists = false
- @provider.should_not_receive(:manage_group)
+ expect(@provider).not_to receive(:manage_group)
@provider.run_action(:manage)
end
it "should not run manage_group if the group exists but has no differing attributes" do
- @provider.should_receive(:compare_group).and_return(false)
- @provider.stub(:change_desc).and_return(["Some changes are going to be done."])
- @provider.should_not_receive(:manage_group)
+ expect(@provider).to receive(:compare_group).and_return(false)
+ allow(@provider).to receive(:change_desc).and_return(["Some changes are going to be done."])
+ expect(@provider).not_to receive(:manage_group)
@provider.run_action(:manage)
end
end
@@ -223,34 +223,34 @@ describe Chef::Provider::User do
describe "when modifying the group" do
before(:each) do
@provider.group_exists = true
- @provider.stub(:manage_group).and_return(true)
+ allow(@provider).to receive(:manage_group).and_return(true)
end
it "should run manage_group if the group exists and has mismatched attributes" do
- @provider.should_receive(:compare_group).and_return(true)
- @provider.stub(:change_desc).and_return(["Some changes are going to be done."])
- @provider.should_receive(:manage_group).and_return(true)
+ expect(@provider).to receive(:compare_group).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return(["Some changes are going to be done."])
+ expect(@provider).to receive(:manage_group).and_return(true)
@provider.run_action(:modify)
end
it "should set the new resources updated flag to true if manage_group is called" do
- @provider.stub(:compare_group).and_return(true)
- @provider.stub(:change_desc).and_return(["Some changes are going to be done."])
- @provider.stub(:manage_group).and_return(true)
+ allow(@provider).to receive(:compare_group).and_return(true)
+ allow(@provider).to receive(:change_desc).and_return(["Some changes are going to be done."])
+ allow(@provider).to receive(:manage_group).and_return(true)
@provider.run_action(:modify)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not run manage_group if the group exists but has no differing attributes" do
- @provider.should_receive(:compare_group).and_return(false)
- @provider.stub(:change_desc).and_return(["Some changes are going to be done."])
- @provider.should_not_receive(:manage_group)
+ expect(@provider).to receive(:compare_group).and_return(false)
+ allow(@provider).to receive(:change_desc).and_return(["Some changes are going to be done."])
+ expect(@provider).not_to receive(:manage_group)
@provider.run_action(:modify)
end
it "should raise a Chef::Exceptions::Group if the group doesn't exist" do
@provider.group_exists = false
- lambda { @provider.run_action(:modify) }.should raise_error(Chef::Exceptions::Group)
+ expect { @provider.run_action(:modify) }.to raise_error(Chef::Exceptions::Group)
end
end
@@ -258,28 +258,28 @@ describe Chef::Provider::User do
it "should report which group members are missing if members are missing and appending to the group" do
@new_resource.members << "user1"
@new_resource.members << "user2"
- @new_resource.stub(:append).and_return true
- @provider.compare_group.should be_true
- @provider.change_desc.should == [ "add missing member(s): user1, user2" ]
+ allow(@new_resource).to receive(:append).and_return true
+ expect(@provider.compare_group).to be_truthy
+ expect(@provider.change_desc).to eq([ "add missing member(s): user1, user2" ])
end
it "should report that the group members will be overwritten if not appending" do
@new_resource.members << "user1"
- @new_resource.stub(:append).and_return false
- @provider.compare_group.should be_true
- @provider.change_desc.should == [ "replace group members with new list of members" ]
+ allow(@new_resource).to receive(:append).and_return false
+ expect(@provider.compare_group).to be_truthy
+ expect(@provider.change_desc).to eq([ "replace group members with new list of members" ])
end
it "should report the gid will be changed when it does not match" do
- @current_resource.stub(:gid).and_return("BADF00D")
- @provider.compare_group.should be_true
- @provider.change_desc.should == [ "change gid #{@current_resource.gid} to #{@new_resource.gid}" ]
+ allow(@current_resource).to receive(:gid).and_return("BADF00D")
+ expect(@provider.compare_group).to be_truthy
+ expect(@provider.change_desc).to eq([ "change gid #{@current_resource.gid} to #{@new_resource.gid}" ])
end
it "should report no change reason when no change is required" do
- @provider.compare_group.should be_false
- @provider.change_desc.should == [ ]
+ expect(@provider.compare_group).to be_falsey
+ expect(@provider.change_desc).to eq([ ])
end
end
diff --git a/spec/unit/provider/http_request_spec.rb b/spec/unit/provider/http_request_spec.rb
index 3077685b97..a84dd5e2a0 100644
--- a/spec/unit/provider/http_request_spec.rb
+++ b/spec/unit/provider/http_request_spec.rb
@@ -35,7 +35,7 @@ describe Chef::Provider::HttpRequest do
describe "load_current_resource" do
it "should set up a Chef::REST client, with no authentication" do
- Chef::HTTP::Simple.should_receive(:new).with(@new_resource.url)
+ expect(Chef::HTTP::Simple).to receive(:new).with(@new_resource.url)
@provider.load_current_resource
end
end
@@ -44,7 +44,7 @@ describe Chef::Provider::HttpRequest do
before(:each) do
# run_action(x) forces load_current_resource to run;
# that would overwrite our supplied mock Chef::Rest # object
- @provider.stub(:load_current_resource).and_return(true)
+ allow(@provider).to receive(:load_current_resource).and_return(true)
@http = double("Chef::REST")
@provider.http = @http
end
@@ -53,53 +53,53 @@ describe Chef::Provider::HttpRequest do
it "should inflate a message block at runtime" do
@new_resource.message { "return" }
- @http.should_receive(:get).with("http://www.opscode.com/", {})
+ expect(@http).to receive(:get).with("http://www.opscode.com/", {})
@provider.run_action(:get)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should run a GET request" do
- @http.should_receive(:get).with("http://www.opscode.com/", {})
+ expect(@http).to receive(:get).with("http://www.opscode.com/", {})
@provider.run_action(:get)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "action_put" do
it "should run a PUT request with the message as the payload" do
- @http.should_receive(:put).with("http://www.opscode.com/", @new_resource.message, {})
+ expect(@http).to receive(:put).with("http://www.opscode.com/", @new_resource.message, {})
@provider.run_action(:put)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should inflate a message block at runtime" do
- @new_resource.stub(:message).and_return(lambda { "return" })
- @http.should_receive(:put).with("http://www.opscode.com/", "return", {})
+ allow(@new_resource).to receive(:message).and_return(lambda { "return" })
+ expect(@http).to receive(:put).with("http://www.opscode.com/", "return", {})
@provider.run_action(:put)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "action_post" do
it "should run a PUT request with the message as the payload" do
- @http.should_receive(:post).with("http://www.opscode.com/", @new_resource.message, {})
+ expect(@http).to receive(:post).with("http://www.opscode.com/", @new_resource.message, {})
@provider.run_action(:post)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should inflate a message block at runtime" do
@new_resource.message { "return" }
- @http.should_receive(:post).with("http://www.opscode.com/", "return", {})
+ expect(@http).to receive(:post).with("http://www.opscode.com/", "return", {})
@provider.run_action(:post)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "action_delete" do
it "should run a DELETE request" do
- @http.should_receive(:delete).with("http://www.opscode.com/", {})
+ expect(@http).to receive(:delete).with("http://www.opscode.com/", {})
@provider.run_action(:delete)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
@@ -112,46 +112,46 @@ describe Chef::Provider::HttpRequest do
it "should inflate a message block at runtime" do
@new_resource.message { "return" }
- @http.should_receive(:head).with("http://www.opscode.com/", {}).and_return(nil)
+ expect(@http).to receive(:head).with("http://www.opscode.com/", {}).and_return(nil)
@provider.run_action(:head)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should run a HEAD request" do
- @http.should_receive(:head).with("http://www.opscode.com/", {}).and_return(nil)
+ expect(@http).to receive(:head).with("http://www.opscode.com/", {}).and_return(nil)
@provider.run_action(:head)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should update a HEAD request with empty string response body (CHEF-4762)" do
- @http.should_receive(:head).with("http://www.opscode.com/", {}).and_return("")
+ expect(@http).to receive(:head).with("http://www.opscode.com/", {}).and_return("")
@provider.run_action(:head)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should update a HEAD request with nil response body (CHEF-4762)" do
- @http.should_receive(:head).with("http://www.opscode.com/", {}).and_return(nil)
+ expect(@http).to receive(:head).with("http://www.opscode.com/", {}).and_return(nil)
@provider.run_action(:head)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not update a HEAD request if a not modified response (CHEF-4762)" do
if_modified_since = File.mtime(__FILE__).httpdate
@new_resource.headers "If-Modified-Since" => if_modified_since
- @http.should_receive(:head).with("http://www.opscode.com/", {"If-Modified-Since" => if_modified_since}).and_return(false)
+ expect(@http).to receive(:head).with("http://www.opscode.com/", {"If-Modified-Since" => if_modified_since}).and_return(false)
@provider.run_action(:head)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
it "should run a HEAD request with If-Modified-Since header" do
@new_resource.headers "If-Modified-Since" => File.mtime(__FILE__).httpdate
- @http.should_receive(:head).with("http://www.opscode.com/", @new_resource.headers)
+ expect(@http).to receive(:head).with("http://www.opscode.com/", @new_resource.headers)
@provider.run_action(:head)
end
it "doesn't call converge_by if HEAD does not return modified" do
- @http.should_receive(:head).and_return(false)
- @provider.should_not_receive(:converge_by)
+ expect(@http).to receive(:head).and_return(false)
+ expect(@provider).not_to receive(:converge_by)
@provider.run_action(:head)
end
end
diff --git a/spec/unit/provider/ifconfig/aix_spec.rb b/spec/unit/provider/ifconfig/aix_spec.rb
index 24f5fb18f3..6e685823ac 100644
--- a/spec/unit/provider/ifconfig/aix_spec.rb
+++ b/spec/unit/provider/ifconfig/aix_spec.rb
@@ -50,7 +50,7 @@ IFCONFIG
describe "#load_current_resource" do
before do
status = double("Status", :exitstatus => 0)
- @provider.should_receive(:popen4).with("ifconfig -a").and_yield(@pid,@stdin,StringIO.new(@ifconfig_output),@stderr).and_return(status)
+ expect(@provider).to receive(:popen4).with("ifconfig -a").and_yield(@pid,@stdin,StringIO.new(@ifconfig_output),@stderr).and_return(status)
@new_resource.device "en0"
end
it "should load given interface with attributes." do
@@ -67,21 +67,21 @@ IFCONFIG
it "should add an interface if it does not exist" do
@new_resource.device "en10"
- @provider.stub(:load_current_resource) do
+ allow(@provider).to receive(:load_current_resource) do
@provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
@provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context))
end
command = "chdev -l #{@new_resource.device} -a netaddr=#{@new_resource.name}"
- @provider.should_receive(:run_command).with(:command => command)
+ expect(@provider).to receive(:run_command).with(:command => command)
@provider.run_action(:add)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should raise exception if metric attribute is set" do
@new_resource.device "en0"
@new_resource.metric "1"
- @provider.stub(:load_current_resource) do
+ allow(@provider).to receive(:load_current_resource) do
@provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
@provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context))
end
@@ -93,15 +93,15 @@ IFCONFIG
describe "#action_enable" do
it "should enable an interface if it does not exist" do
@new_resource.device "en10"
- @provider.stub(:load_current_resource) do
+ allow(@provider).to receive(:load_current_resource) do
@provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
@provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context))
end
command = "ifconfig #{@new_resource.device} #{@new_resource.name}"
- @provider.should_receive(:run_command).with(:command => command)
+ expect(@provider).to receive(:run_command).with(:command => command)
@provider.run_action(:enable)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
@@ -109,21 +109,21 @@ IFCONFIG
it "should not disable an interface if it does not exist" do
@new_resource.device "en10"
- @provider.stub(:load_current_resource) do
+ allow(@provider).to receive(:load_current_resource) do
@provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
@provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context))
end
- @provider.should_not_receive(:run_command)
+ expect(@provider).not_to receive(:run_command)
@provider.run_action(:disable)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
context "interface exists" do
before do
@new_resource.device "en10"
- @provider.stub(:load_current_resource) do
+ allow(@provider).to receive(:load_current_resource) do
@provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)
current_resource.device @new_resource.device
@@ -133,10 +133,10 @@ IFCONFIG
it "should disable an interface if it exists" do
command = "ifconfig #{@new_resource.device} down"
- @provider.should_receive(:run_command).with(:command => command)
+ expect(@provider).to receive(:run_command).with(:command => command)
@provider.run_action(:disable)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
@@ -146,21 +146,21 @@ IFCONFIG
it "should not delete an interface if it does not exist" do
@new_resource.device "en10"
- @provider.stub(:load_current_resource) do
+ allow(@provider).to receive(:load_current_resource) do
@provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
@provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context))
end
- @provider.should_not_receive(:run_command)
+ expect(@provider).not_to receive(:run_command)
@provider.run_action(:delete)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
context "interface exists" do
before do
@new_resource.device "en10"
- @provider.stub(:load_current_resource) do
+ allow(@provider).to receive(:load_current_resource) do
@provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)
current_resource.device @new_resource.device
@@ -170,10 +170,10 @@ IFCONFIG
it "should delete an interface if it exists" do
command = "chdev -l #{@new_resource.device} -a state=down"
- @provider.should_receive(:run_command).with(:command => command)
+ expect(@provider).to receive(:run_command).with(:command => command)
@provider.run_action(:delete)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
end
diff --git a/spec/unit/provider/ifconfig/debian_spec.rb b/spec/unit/provider/ifconfig/debian_spec.rb
index ebb16e22af..351e734040 100644
--- a/spec/unit/provider/ifconfig/debian_spec.rb
+++ b/spec/unit/provider/ifconfig/debian_spec.rb
@@ -77,29 +77,29 @@ describe Chef::Provider::Ifconfig::Debian do
context "when the interface_dot_d directory does not exist" do
before do
FileUtils.rmdir tempdir_path
- expect(File.exists?(tempdir_path)).to be_false
+ expect(File.exists?(tempdir_path)).to be_falsey
end
it "should create the /etc/network/interfaces.d directory" do
provider.run_action(:add)
- expect(File.exists?(tempdir_path)).to be_true
- expect(File.directory?(tempdir_path)).to be_true
+ expect(File.exists?(tempdir_path)).to be_truthy
+ expect(File.directory?(tempdir_path)).to be_truthy
end
it "should mark the resource as updated" do
provider.run_action(:add)
- expect(new_resource.updated_by_last_action?).to be_true
+ expect(new_resource.updated_by_last_action?).to be_truthy
end
end
context "when the interface_dot_d directory exists" do
before do
- expect(File.exists?(tempdir_path)).to be_true
+ expect(File.exists?(tempdir_path)).to be_truthy
end
it "should still mark the resource as updated (we still write a file to it)" do
provider.run_action(:add)
- expect(new_resource.updated_by_last_action?).to be_true
+ expect(new_resource.updated_by_last_action?).to be_truthy
end
end
end
@@ -120,7 +120,7 @@ iface eth0 inet static
netmask 255.255.254.0
EOF
)
- expect(File.exists?(tempdir_path)).to be_true # since the file exists, the enclosing dir must also exist
+ expect(File.exists?(tempdir_path)).to be_truthy # since the file exists, the enclosing dir must also exist
end
context "when the /etc/network/interfaces file has the source line" do
@@ -147,7 +147,7 @@ EOF
it "should not mark the resource as updated" do
provider.run_action(:add)
pending "superclass ifconfig provider is not idempotent"
- expect(new_resource.updated_by_last_action?).to be_false
+ expect(new_resource.updated_by_last_action?).to be_falsey
end
end
@@ -175,7 +175,7 @@ EOF
it "should mark the resource as updated" do
provider.run_action(:add)
- expect(new_resource.updated_by_last_action?).to be_true
+ expect(new_resource.updated_by_last_action?).to be_truthy
end
end
end
@@ -215,28 +215,28 @@ EOF
context "when the interface_dot_d directory does not exist" do
before do
FileUtils.rmdir tempdir_path
- expect(File.exists?(tempdir_path)).to be_false
+ expect(File.exists?(tempdir_path)).to be_falsey
end
it "should not create the /etc/network/interfaces.d directory" do
provider.run_action(:add)
- expect(File.exists?(tempdir_path)).not_to be_true
+ expect(File.exists?(tempdir_path)).not_to be_truthy
end
it "should mark the resource as updated" do
provider.run_action(:add)
- expect(new_resource.updated_by_last_action?).to be_true
+ expect(new_resource.updated_by_last_action?).to be_truthy
end
end
context "when the interface_dot_d directory exists" do
before do
- expect(File.exists?(tempdir_path)).to be_true
+ expect(File.exists?(tempdir_path)).to be_truthy
end
it "should still mark the resource as updated (we still write a file to it)" do
provider.run_action(:add)
- expect(new_resource.updated_by_last_action?).to be_true
+ expect(new_resource.updated_by_last_action?).to be_truthy
end
end
end
@@ -258,7 +258,7 @@ iface eth0 inet static
EOF
)
expect(File).not_to receive(:new).with(config_filename_ifcfg, "w")
- expect(File.exists?(tempdir_path)).to be_true # since the file exists, the enclosing dir must also exist
+ expect(File.exists?(tempdir_path)).to be_truthy # since the file exists, the enclosing dir must also exist
end
context "when the /etc/network/interfaces file has the source line" do
@@ -283,7 +283,7 @@ another line
it "should not mark the resource as updated" do
provider.run_action(:add)
pending "superclass ifconfig provider is not idempotent"
- expect(new_resource.updated_by_last_action?).to be_false
+ expect(new_resource.updated_by_last_action?).to be_falsey
end
end
@@ -308,7 +308,7 @@ source #{tempdir_path}/*
it "should mark the resource as updated" do
provider.run_action(:add)
- expect(new_resource.updated_by_last_action?).to be_true
+ expect(new_resource.updated_by_last_action?).to be_truthy
end
end
end
@@ -340,14 +340,14 @@ source #{tempdir_path}/*
current_resource.device new_resource.device
# belt and suspenders testing?
- Chef::Util::Backup.any_instance.should_receive(:do_backup).and_call_original
+ expect_any_instance_of(Chef::Util::Backup).to receive(:do_backup).and_call_original
# internal implementation detail of Ifconfig.
- Chef::Provider::File.any_instance.should_receive(:action_delete).and_call_original
+ expect_any_instance_of(Chef::Provider::File).to receive(:action_delete).and_call_original
- expect(File.exist?(config_filename_ifcfg)).to be_true
+ expect(File.exist?(config_filename_ifcfg)).to be_truthy
provider.run_action(:delete)
- expect(File.exist?(config_filename_ifcfg)).to be_false
+ expect(File.exist?(config_filename_ifcfg)).to be_falsey
end
end
diff --git a/spec/unit/provider/ifconfig/redhat_spec.rb b/spec/unit/provider/ifconfig/redhat_spec.rb
index 138c2a389d..620fd341d7 100644
--- a/spec/unit/provider/ifconfig/redhat_spec.rb
+++ b/spec/unit/provider/ifconfig/redhat_spec.rb
@@ -40,21 +40,21 @@ describe Chef::Provider::Ifconfig::Redhat do
config_filename = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}"
@config = double("chef-resource-file")
- @provider.should_receive(:resource_for_config).with(config_filename).and_return(@config)
+ expect(@provider).to receive(:resource_for_config).with(config_filename).and_return(@config)
end
describe "generate_config for action_add" do
it "should write network-script for centos" do
- @provider.stub(:load_current_resource)
- @provider.stub(:run_command)
- @config.should_receive(:content) do |arg|
- arg.should match(/^\s*DEVICE=eth0\s*$/)
- arg.should match(/^\s*IPADDR=10\.0\.0\.1\s*$/)
- arg.should match(/^\s*NETMASK=255\.255\.254\.0\s*$/)
+ allow(@provider).to receive(:load_current_resource)
+ allow(@provider).to receive(:run_command)
+ expect(@config).to receive(:content) do |arg|
+ expect(arg).to match(/^\s*DEVICE=eth0\s*$/)
+ expect(arg).to match(/^\s*IPADDR=10\.0\.0\.1\s*$/)
+ expect(arg).to match(/^\s*NETMASK=255\.255\.254\.0\s*$/)
end
- @config.should_receive(:run_action).with(:create)
- @config.should_receive(:updated?).and_return(true)
+ expect(@config).to receive(:run_action).with(:create)
+ expect(@config).to receive(:updated?).and_return(true)
@provider.run_action(:add)
end
end
@@ -63,10 +63,10 @@ describe Chef::Provider::Ifconfig::Redhat do
it "should delete network-script if it exists for centos" do
@current_resource.device @new_resource.device
- @provider.stub(:load_current_resource)
- @provider.stub(:run_command)
- @config.should_receive(:run_action).with(:delete)
- @config.should_receive(:updated?).and_return(true)
+ allow(@provider).to receive(:load_current_resource)
+ allow(@provider).to receive(:run_command)
+ expect(@config).to receive(:run_action).with(:delete)
+ expect(@config).to receive(:updated?).and_return(true)
@provider.run_action(:delete)
end
end
diff --git a/spec/unit/provider/ifconfig_spec.rb b/spec/unit/provider/ifconfig_spec.rb
index b09e365c65..126112dd43 100644
--- a/spec/unit/provider/ifconfig_spec.rb
+++ b/spec/unit/provider/ifconfig_spec.rb
@@ -43,39 +43,39 @@ describe Chef::Provider::Ifconfig do
describe Chef::Provider::Ifconfig, "load_current_resource" do
before do
status = double("Status", :exitstatus => 1)
- @provider.should_receive(:popen4).and_return status
+ expect(@provider).to receive(:popen4).and_return status
@provider.load_current_resource
end
it "should track state of ifconfig failure." do
- @provider.instance_variable_get("@status").exitstatus.should_not == 0
+ expect(@provider.instance_variable_get("@status").exitstatus).not_to eq(0)
end
it "should thrown an exception when ifconfig fails" do
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error Chef::Exceptions::Ifconfig
+ expect { @provider.process_resource_requirements }.to raise_error Chef::Exceptions::Ifconfig
end
end
describe Chef::Provider::Ifconfig, "action_add" do
it "should add an interface if it does not exist" do
#@provider.stub(:run_command).and_return(true)
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
@current_resource.inet_addr nil
command = "ifconfig eth0 10.0.0.1 netmask 255.255.254.0 metric 1 mtu 1500"
- @provider.should_receive(:run_command).with(:command => command)
- @provider.should_receive(:generate_config)
+ expect(@provider).to receive(:run_command).with(:command => command)
+ expect(@provider).to receive(:generate_config)
@provider.run_action(:add)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not add an interface if it already exists" do
- @provider.stub(:load_current_resource)
- @provider.should_not_receive(:run_command)
+ allow(@provider).to receive(:load_current_resource)
+ expect(@provider).not_to receive(:run_command)
@current_resource.inet_addr "10.0.0.1"
- @provider.should_receive(:generate_config)
+ expect(@provider).to receive(:generate_config)
@provider.run_action(:add)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
#We are not testing this case with the assumption that anyone writing the cookbook would not make a typo == lo
@@ -86,95 +86,95 @@ describe Chef::Provider::Ifconfig do
describe Chef::Provider::Ifconfig, "action_enable" do
it "should enable interface if does not exist" do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
@current_resource.inet_addr nil
command = "ifconfig eth0 10.0.0.1 netmask 255.255.254.0 metric 1 mtu 1500"
- @provider.should_receive(:run_command).with(:command => command)
- @provider.should_not_receive(:generate_config)
+ expect(@provider).to receive(:run_command).with(:command => command)
+ expect(@provider).not_to receive(:generate_config)
@provider.run_action(:enable)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not enable interface if it already exists" do
- @provider.stub(:load_current_resource)
- @provider.should_not_receive(:run_command)
+ allow(@provider).to receive(:load_current_resource)
+ expect(@provider).not_to receive(:run_command)
@current_resource.inet_addr "10.0.0.1"
- @provider.should_not_receive(:generate_config)
+ expect(@provider).not_to receive(:generate_config)
@provider.run_action(:enable)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
end
describe Chef::Provider::Ifconfig, "action_delete" do
it "should delete interface if it exists" do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
@current_resource.device "eth0"
command = "ifconfig #{@new_resource.device} down"
- @provider.should_receive(:run_command).with(:command => command)
- @provider.should_receive(:delete_config)
+ expect(@provider).to receive(:run_command).with(:command => command)
+ expect(@provider).to receive(:delete_config)
@provider.run_action(:delete)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not delete interface if it does not exist" do
- @provider.stub(:load_current_resource)
- @provider.should_not_receive(:run_command)
- @provider.should_receive(:delete_config)
+ allow(@provider).to receive(:load_current_resource)
+ expect(@provider).not_to receive(:run_command)
+ expect(@provider).to receive(:delete_config)
@provider.run_action(:delete)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
end
describe Chef::Provider::Ifconfig, "action_disable" do
it "should disable interface if it exists" do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
@current_resource.device "eth0"
command = "ifconfig #{@new_resource.device} down"
- @provider.should_receive(:run_command).with(:command => command)
- @provider.should_not_receive(:delete_config)
+ expect(@provider).to receive(:run_command).with(:command => command)
+ expect(@provider).not_to receive(:delete_config)
@provider.run_action(:disable)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not delete interface if it does not exist" do
- @provider.stub(:load_current_resource)
- @provider.should_not_receive(:run_command)
- @provider.should_not_receive(:delete_config)
+ allow(@provider).to receive(:load_current_resource)
+ expect(@provider).not_to receive(:run_command)
+ expect(@provider).not_to receive(:delete_config)
@provider.run_action(:disable)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
end
describe Chef::Provider::Ifconfig, "action_delete" do
it "should delete interface of it exists" do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
@current_resource.device "eth0"
command = "ifconfig #{@new_resource.device} down"
- @provider.should_receive(:run_command).with(:command => command)
- @provider.should_receive(:delete_config)
+ expect(@provider).to receive(:run_command).with(:command => command)
+ expect(@provider).to receive(:delete_config)
@provider.run_action(:delete)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not delete interface if it does not exist" do
# This is so that our fake values do not get overwritten
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
# This is so that nothing actually runs
- @provider.should_not_receive(:run_command)
- @provider.should_receive(:delete_config)
+ expect(@provider).not_to receive(:run_command)
+ expect(@provider).to receive(:delete_config)
@provider.run_action(:delete)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
end
end
diff --git a/spec/unit/provider/link_spec.rb b/spec/unit/provider/link_spec.rb
index 2f0a5f2020..ab5b439eac 100644
--- a/spec/unit/provider/link_spec.rb
+++ b/spec/unit/provider/link_spec.rb
@@ -45,36 +45,36 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
describe "when the target is a symlink" do
before(:each) do
lstat = double("stats", :ino => 5)
- lstat.stub(:uid).and_return(501)
- lstat.stub(:gid).and_return(501)
- lstat.stub(:mode).and_return(0777)
- File.stub(:lstat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(lstat)
- provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
- provider.file_class.stub(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile")
+ allow(lstat).to receive(:uid).and_return(501)
+ allow(lstat).to receive(:gid).and_return(501)
+ allow(lstat).to receive(:mode).and_return(0777)
+ allow(File).to receive(:lstat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(lstat)
+ allow(provider.file_class).to receive(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
+ allow(provider.file_class).to receive(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile")
end
describe "to a file that exists" do
before do
- File.stub(:exist?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
+ allow(File).to receive(:exist?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
new_resource.owner 501 # only loaded in current_resource if present in new
new_resource.group 501
provider.load_current_resource
end
it "should set the symlink target" do
- provider.current_resource.target_file.should == "#{CHEF_SPEC_DATA}/fofile-link"
+ expect(provider.current_resource.target_file).to eq("#{CHEF_SPEC_DATA}/fofile-link")
end
it "should set the link type" do
- provider.current_resource.link_type.should == :symbolic
+ expect(provider.current_resource.link_type).to eq(:symbolic)
end
it "should update the source of the existing link with the links target" do
- paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile").should be_true
+ expect(paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile")).to be_truthy
end
it "should set the owner" do
- provider.current_resource.owner.should == 501
+ expect(provider.current_resource.owner).to eq(501)
end
it "should set the group" do
- provider.current_resource.group.should == 501
+ expect(provider.current_resource.group).to eq(501)
end
# We test create in unit tests because there is no other way to ensure
@@ -87,7 +87,7 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
result
end
it 'create does no work' do
- provider.access_controls.should_not_receive(:set_all)
+ expect(provider.access_controls).not_to receive(:set_all)
provider.run_action(:create)
end
end
@@ -95,139 +95,139 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
describe "to a file that doesn't exist" do
before do
- File.stub(:exist?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
- provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
- provider.file_class.stub(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile")
+ allow(File).to receive(:exist?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
+ allow(provider.file_class).to receive(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
+ allow(provider.file_class).to receive(:readlink).with("#{CHEF_SPEC_DATA}/fofile-link").and_return("#{CHEF_SPEC_DATA}/fofile")
new_resource.owner "501" # only loaded in current_resource if present in new
new_resource.group "501"
provider.load_current_resource
end
it "should set the symlink target" do
- provider.current_resource.target_file.should == "#{CHEF_SPEC_DATA}/fofile-link"
+ expect(provider.current_resource.target_file).to eq("#{CHEF_SPEC_DATA}/fofile-link")
end
it "should set the link type" do
- provider.current_resource.link_type.should == :symbolic
+ expect(provider.current_resource.link_type).to eq(:symbolic)
end
it "should update the source of the existing link to the link's target" do
- paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile").should be_true
+ expect(paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile")).to be_truthy
end
it "should not set the owner" do
- provider.current_resource.owner.should be_nil
+ expect(provider.current_resource.owner).to be_nil
end
it "should not set the group" do
- provider.current_resource.group.should be_nil
+ expect(provider.current_resource.group).to be_nil
end
end
end
describe "when the target doesn't exist" do
before do
- File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
- provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
+ allow(File).to receive(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
+ allow(provider.file_class).to receive(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
provider.load_current_resource
end
it "should set the symlink target" do
- provider.current_resource.target_file.should == "#{CHEF_SPEC_DATA}/fofile-link"
+ expect(provider.current_resource.target_file).to eq("#{CHEF_SPEC_DATA}/fofile-link")
end
it "should update the source of the existing link to nil" do
- provider.current_resource.to.should be_nil
+ expect(provider.current_resource.to).to be_nil
end
it "should not set the owner" do
- provider.current_resource.owner.should == nil
+ expect(provider.current_resource.owner).to eq(nil)
end
it "should not set the group" do
- provider.current_resource.group.should == nil
+ expect(provider.current_resource.group).to eq(nil)
end
end
describe "when the target is a regular old file" do
before do
stat = double("stats", :ino => 5)
- stat.stub(:uid).and_return(501)
- stat.stub(:gid).and_return(501)
- stat.stub(:mode).and_return(0755)
- provider.file_class.stub(:stat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(stat)
+ allow(stat).to receive(:uid).and_return(501)
+ allow(stat).to receive(:gid).and_return(501)
+ allow(stat).to receive(:mode).and_return(0755)
+ allow(provider.file_class).to receive(:stat).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(stat)
- File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
- provider.file_class.stub(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
+ allow(File).to receive(:exists?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(true)
+ allow(provider.file_class).to receive(:symlink?).with("#{CHEF_SPEC_DATA}/fofile-link").and_return(false)
end
describe "and the source does not exist" do
before do
- File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(false)
+ allow(File).to receive(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(false)
provider.load_current_resource
end
it "should set the symlink target" do
- provider.current_resource.target_file.should == "#{CHEF_SPEC_DATA}/fofile-link"
+ expect(provider.current_resource.target_file).to eq("#{CHEF_SPEC_DATA}/fofile-link")
end
it "should update the current source of the existing link with an empty string" do
- provider.current_resource.to.should == ''
+ expect(provider.current_resource.to).to eq('')
end
it "should not set the owner" do
- provider.current_resource.owner.should == nil
+ expect(provider.current_resource.owner).to eq(nil)
end
it "should not set the group" do
- provider.current_resource.group.should == nil
+ expect(provider.current_resource.group).to eq(nil)
end
end
describe "and the source exists" do
before do
stat = double("stats", :ino => 6)
- stat.stub(:uid).and_return(502)
- stat.stub(:gid).and_return(502)
- stat.stub(:mode).and_return(0644)
+ allow(stat).to receive(:uid).and_return(502)
+ allow(stat).to receive(:gid).and_return(502)
+ allow(stat).to receive(:mode).and_return(0644)
- provider.file_class.stub(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat)
+ allow(provider.file_class).to receive(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat)
- File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true)
+ allow(File).to receive(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true)
provider.load_current_resource
end
it "should set the symlink target" do
- provider.current_resource.target_file.should == "#{CHEF_SPEC_DATA}/fofile-link"
+ expect(provider.current_resource.target_file).to eq("#{CHEF_SPEC_DATA}/fofile-link")
end
it "should update the current source of the existing link with an empty string" do
- provider.current_resource.to.should == ''
+ expect(provider.current_resource.to).to eq('')
end
it "should not set the owner" do
- provider.current_resource.owner.should == nil
+ expect(provider.current_resource.owner).to eq(nil)
end
it "should not set the group" do
- provider.current_resource.group.should == nil
+ expect(provider.current_resource.group).to eq(nil)
end
end
describe "and is hardlinked to the source" do
before do
stat = double("stats", :ino => 5)
- stat.stub(:uid).and_return(502)
- stat.stub(:gid).and_return(502)
- stat.stub(:mode).and_return(0644)
+ allow(stat).to receive(:uid).and_return(502)
+ allow(stat).to receive(:gid).and_return(502)
+ allow(stat).to receive(:mode).and_return(0644)
- provider.file_class.stub(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat)
+ allow(provider.file_class).to receive(:stat).with("#{CHEF_SPEC_DATA}/fofile").and_return(stat)
- File.stub(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true)
+ allow(File).to receive(:exists?).with("#{CHEF_SPEC_DATA}/fofile").and_return(true)
provider.load_current_resource
end
it "should set the symlink target" do
- provider.current_resource.target_file.should == "#{CHEF_SPEC_DATA}/fofile-link"
+ expect(provider.current_resource.target_file).to eq("#{CHEF_SPEC_DATA}/fofile-link")
end
it "should set the link type" do
- provider.current_resource.link_type.should == :hard
+ expect(provider.current_resource.link_type).to eq(:hard)
end
it "should update the source of the existing link to the link's target" do
- paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile").should be_true
+ expect(paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile")).to be_truthy
end
it "should not set the owner" do
- provider.current_resource.owner.should == nil
+ expect(provider.current_resource.owner).to eq(nil)
end
it "should not set the group" do
- provider.current_resource.group.should == nil
+ expect(provider.current_resource.group).to eq(nil)
end
# We test create in unit tests because there is no other way to ensure
@@ -241,9 +241,9 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
result
end
it 'create does no work' do
- provider.file_class.should_not_receive(:symlink)
- provider.file_class.should_not_receive(:link)
- provider.access_controls.should_not_receive(:set_all)
+ expect(provider.file_class).not_to receive(:symlink)
+ expect(provider.file_class).not_to receive(:link)
+ expect(provider.access_controls).not_to receive(:set_all)
provider.run_action(:create)
end
end
diff --git a/spec/unit/provider/log_spec.rb b/spec/unit/provider/log_spec.rb
index a270ee4822..1ecc633ce1 100644
--- a/spec/unit/provider/log_spec.rb
+++ b/spec/unit/provider/log_spec.rb
@@ -32,10 +32,6 @@ describe Chef::Provider::Log::ChefLog do
let(:provider) { Chef::Provider::Log::ChefLog.new(new_resource, run_context) }
- it "should be registered with the default platform hash" do
- expect(Chef::Platform.platforms[:default][:log]).not_to be_nil
- end
-
it "should write the string to the Chef::Log object at default level (info)" do
expect(Chef::Log).to receive(:info).with(log_str).and_return(true)
provider.run_action(:write)
diff --git a/spec/unit/provider/mdadm_spec.rb b/spec/unit/provider/mdadm_spec.rb
index 6595728741..77ed5798a8 100644
--- a/spec/unit/provider/mdadm_spec.rb
+++ b/spec/unit/provider/mdadm_spec.rb
@@ -32,22 +32,22 @@ describe Chef::Provider::Mdadm do
describe "when determining the current metadevice status" do
it "should set the current resources mount point to the new resources mount point" do
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:status => 0))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:status => 0))
@provider.load_current_resource
- @provider.current_resource.name.should == '/dev/md1'
- @provider.current_resource.raid_device.should == '/dev/md1'
+ expect(@provider.current_resource.name).to eq('/dev/md1')
+ expect(@provider.current_resource.raid_device).to eq('/dev/md1')
end
it "determines that the metadevice exists when mdadm exit code is zero" do
- @provider.stub(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 0))
+ allow(@provider).to receive(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 0))
@provider.load_current_resource
- @provider.current_resource.exists.should be_true
+ expect(@provider.current_resource.exists).to be_truthy
end
it "determines that the metadevice does not exist when mdadm exit code is 4" do
- @provider.stub(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 4))
+ allow(@provider).to receive(:shell_out!).with("mdadm --detail --test /dev/md1", :returns => [0,4]).and_return(OpenStruct.new(:status => 4))
@provider.load_current_resource
- @provider.current_resource.exists.should be_false
+ expect(@provider.current_resource.exists).to be_falsey
end
end
@@ -55,7 +55,7 @@ describe Chef::Provider::Mdadm do
before(:each) do
@current_resource = Chef::Resource::Mdadm.new('/dev/md1')
@new_resource.level 5
- @provider.stub(:load_current_resource).and_return(true)
+ allow(@provider).to receive(:load_current_resource).and_return(true)
@provider.current_resource = @current_resource
end
@@ -63,7 +63,7 @@ describe Chef::Provider::Mdadm do
it "should create the raid device if it doesnt exist" do
@current_resource.exists(false)
expected_command = "yes | mdadm --create /dev/md1 --level 5 --chunk=16 --metadata=0.90 --raid-devices 3 /dev/sdz1 /dev/sdz2 /dev/sdz3"
- @provider.should_receive(:shell_out!).with(expected_command)
+ expect(@provider).to receive(:shell_out!).with(expected_command)
@provider.run_action(:create)
end
@@ -71,25 +71,25 @@ describe Chef::Provider::Mdadm do
@current_resource.exists(false)
@new_resource.bitmap('grow')
expected_command = "yes | mdadm --create /dev/md1 --level 5 --chunk=16 --metadata=0.90 --bitmap=grow --raid-devices 3 /dev/sdz1 /dev/sdz2 /dev/sdz3"
- @provider.should_receive(:shell_out!).with(expected_command)
+ expect(@provider).to receive(:shell_out!).with(expected_command)
@provider.run_action(:create)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should not specify a chunksize if raid level 1" do
@current_resource.exists(false)
@new_resource.level 1
expected_command = "yes | mdadm --create /dev/md1 --level 1 --metadata=0.90 --raid-devices 3 /dev/sdz1 /dev/sdz2 /dev/sdz3"
- @provider.should_receive(:shell_out!).with(expected_command)
+ expect(@provider).to receive(:shell_out!).with(expected_command)
@provider.run_action(:create)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should not create the raid device if it does exist" do
@current_resource.exists(true)
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.run_action(:create)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
end
@@ -97,16 +97,16 @@ describe Chef::Provider::Mdadm do
it "should assemble the raid device if it doesnt exist" do
@current_resource.exists(false)
expected_mdadm_cmd = "yes | mdadm --assemble /dev/md1 /dev/sdz1 /dev/sdz2 /dev/sdz3"
- @provider.should_receive(:shell_out!).with(expected_mdadm_cmd)
+ expect(@provider).to receive(:shell_out!).with(expected_mdadm_cmd)
@provider.run_action(:assemble)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should not assemble the raid device if it doesnt exist" do
@current_resource.exists(true)
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.run_action(:assemble)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
end
@@ -115,16 +115,16 @@ describe Chef::Provider::Mdadm do
it "should stop the raid device if it exists" do
@current_resource.exists(true)
expected_mdadm_cmd = "yes | mdadm --stop /dev/md1"
- @provider.should_receive(:shell_out!).with(expected_mdadm_cmd)
+ expect(@provider).to receive(:shell_out!).with(expected_mdadm_cmd)
@provider.run_action(:stop)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should not attempt to stop the raid device if it does not exist" do
@current_resource.exists(false)
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.run_action(:stop)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
end
end
diff --git a/spec/unit/provider/mount/aix_spec.rb b/spec/unit/provider/mount/aix_spec.rb
index dcd9170e1f..ca0ddd006c 100644
--- a/spec/unit/provider/mount/aix_spec.rb
+++ b/spec/unit/provider/mount/aix_spec.rb
@@ -60,18 +60,18 @@ ENABLED
@provider = Chef::Provider::Mount::Aix.new(@new_resource, @run_context)
- ::File.stub(:exists?).with("/dev/sdz1").and_return true
- ::File.stub(:exists?).with("/tmp/foo").and_return true
+ allow(::File).to receive(:exists?).with("/dev/sdz1").and_return true
+ allow(::File).to receive(:exists?).with("/tmp/foo").and_return true
end
def stub_mounted(provider, mounted_output)
response = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => mounted_output, :stderr => "")
- provider.should_receive(:shell_out!).with("mount").and_return(response)
+ expect(provider).to receive(:shell_out!).with("mount").and_return(response)
end
def stub_enabled(provider, enabled_output)
response = double("Mixlib::ShellOut command", :exitstatus => 0, :stdout => enabled_output, :stderr => "")
- provider.should_receive(:shell_out).with("lsfs -c #{@new_resource.mount_point}").and_return(response)
+ expect(provider).to receive(:shell_out).with("lsfs -c #{@new_resource.mount_point}").and_return(response)
end
def stub_mounted_enabled(provider, mounted_output, enabled_output)
@@ -84,7 +84,7 @@ ENABLED
stub_mounted_enabled(@provider, @mounted_output, "")
@provider.load_current_resource
- expect(@provider.current_resource.mounted).to be_true
+ expect(@provider.current_resource.mounted).to be_truthy
end
it "should set current_resource.mounted to false if device is not mounted" do
@@ -92,7 +92,7 @@ ENABLED
@provider.load_current_resource
- expect(@provider.current_resource.mounted).to be_false
+ expect(@provider.current_resource.mounted).to be_falsey
end
it "should set current_resource.mounted to false if the mount point is used for another device" do
@@ -100,7 +100,7 @@ ENABLED
@provider.load_current_resource
- expect(@provider.current_resource.mounted).to be_false
+ expect(@provider.current_resource.mounted).to be_falsey
end
end
@@ -110,8 +110,8 @@ ENABLED
@provider.load_current_resource
- expect(@provider.current_resource.enabled).to be_true
- expect(@provider.current_resource.mounted).to be_true
+ expect(@provider.current_resource.enabled).to be_truthy
+ expect(@provider.current_resource.mounted).to be_truthy
expect(@provider.current_resource.mount_point).to eql(@new_resource.mount_point)
expect(@provider.current_resource.fstype).to eql("jfs2")
expect(@provider.current_resource.options).to eql(['rw'])
@@ -121,7 +121,7 @@ ENABLED
it "should mount resource if it is not mounted" do
stub_mounted_enabled(@provider, @unmounted_output, "")
- @provider.should_receive(:shell_out!).with("mount -v #{@new_resource.fstype} #{@new_resource.device} #{@new_resource.mount_point}")
+ expect(@provider).to receive(:shell_out!).with("mount -v #{@new_resource.fstype} #{@new_resource.device} #{@new_resource.mount_point}")
@provider.run_action(:mount)
end
@@ -129,7 +129,7 @@ ENABLED
it "should not mount resource if it is already mounted" do
stub_mounted_enabled(@provider, @mounted_output, "")
- @provider.should_not_receive(:mount_fs)
+ expect(@provider).not_to receive(:mount_fs)
@provider.run_action(:mount)
end
@@ -139,7 +139,7 @@ ENABLED
it "should umount resource if it is already mounted" do
stub_mounted_enabled(@provider, @mounted_output, "")
- @provider.should_receive(:shell_out!).with("umount #{@new_resource.mount_point}")
+ expect(@provider).to receive(:shell_out!).with("umount #{@new_resource.mount_point}")
@provider.run_action(:umount)
end
@@ -147,7 +147,7 @@ ENABLED
it "should not umount resource if it is not mounted" do
stub_mounted_enabled(@provider, @unmounted_output, "")
- @provider.should_not_receive(:umount_fs)
+ expect(@provider).not_to receive(:umount_fs)
@provider.run_action(:umount)
end
@@ -158,7 +158,7 @@ ENABLED
@new_resource.supports({:remount => true})
stub_mounted_enabled(@provider, @mounted_output, "")
- @provider.should_receive(:shell_out!).with("mount -o remount #{@new_resource.device} #{@new_resource.mount_point}")
+ expect(@provider).to receive(:shell_out!).with("mount -o remount #{@new_resource.device} #{@new_resource.mount_point}")
@provider.run_action(:remount)
end
@@ -168,7 +168,7 @@ ENABLED
@new_resource.options("nodev,rw")
stub_mounted_enabled(@provider, @mounted_output, "")
- @provider.should_receive(:shell_out!).with("mount -o remount,nodev,rw #{@new_resource.device} #{@new_resource.mount_point}")
+ expect(@provider).to receive(:shell_out!).with("mount -o remount,nodev,rw #{@new_resource.device} #{@new_resource.mount_point}")
@provider.run_action(:remount)
end
@@ -179,18 +179,18 @@ ENABLED
@new_resource.options("nodev,rw")
stub_mounted_enabled(@provider, @mounted_output, "")
filesystems = StringIO.new
- ::File.stub(:open).with("/etc/filesystems", "a").and_yield(filesystems)
+ allow(::File).to receive(:open).with("/etc/filesystems", "a").and_yield(filesystems)
@provider.run_action(:enable)
- filesystems.string.should match(%r{^/tmp/foo:\n\tdev\t\t= /dev/sdz1\n\tvfs\t\t= jfs2\n\tmount\t\t= false\n\toptions\t\t= nodev,rw\n$})
+ expect(filesystems.string).to match(%r{^/tmp/foo:\n\tdev\t\t= /dev/sdz1\n\tvfs\t\t= jfs2\n\tmount\t\t= false\n\toptions\t\t= nodev,rw\n$})
end
it "should not enable mount if it is mounted and already enabled and mount options are unchanged" do
stub_mounted_enabled(@provider, @mounted_output, @enabled_output)
@new_resource.options "rw"
- @provider.should_not_receive(:enable_fs)
+ expect(@provider).not_to receive(:enable_fs)
@provider.run_action(:enable)
end
@@ -200,7 +200,7 @@ ENABLED
it "should disable mount if it is mounted and enabled" do
stub_mounted_enabled(@provider, @mounted_output, @enabled_output)
- ::File.stub(:open).with("/etc/filesystems", "r").and_return(<<-ETCFILESYSTEMS)
+ allow(::File).to receive(:open).with("/etc/filesystems", "r").and_return(<<-ETCFILESYSTEMS)
/tmp/foo:
dev = /dev/sdz1
vfs = jfs2
@@ -219,17 +219,17 @@ ENABLED
ETCFILESYSTEMS
filesystems = StringIO.new
- ::File.stub(:open).with("/etc/filesystems", "w").and_yield(filesystems)
+ allow(::File).to receive(:open).with("/etc/filesystems", "w").and_yield(filesystems)
@provider.run_action(:disable)
- filesystems.string.should match(%r{^/tmp/abc:\s+dev\s+= /dev/sdz2\s+vfs\s+= jfs2\s+mount\s+= true\s+options\s+= rw\n$})
+ expect(filesystems.string).to match(%r{^/tmp/abc:\s+dev\s+= /dev/sdz2\s+vfs\s+= jfs2\s+mount\s+= true\s+options\s+= rw\n$})
end
it "should not disable mount if it is not mounted" do
stub_mounted_enabled(@provider, @unmounted_output, "")
- @provider.should_not_receive(:disable_fs)
+ expect(@provider).not_to receive(:disable_fs)
@provider.run_action(:disable)
end
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index d6f71bc613..7e9531a8ac 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -34,30 +34,30 @@ describe Chef::Provider::Mount::Mount do
@provider = Chef::Provider::Mount::Mount.new(@new_resource, @run_context)
- ::File.stub(:exists?).with("/dev/sdz1").and_return true
- ::File.stub(:exists?).with("/tmp/foo").and_return true
- ::File.stub(:realpath).with("/dev/sdz1").and_return "/dev/sdz1"
- ::File.stub(:realpath).with("/tmp/foo").and_return "/tmp/foo"
+ allow(::File).to receive(:exists?).with("/dev/sdz1").and_return true
+ allow(::File).to receive(:exists?).with("/tmp/foo").and_return true
+ allow(::File).to receive(:realpath).with("/dev/sdz1").and_return "/dev/sdz1"
+ allow(::File).to receive(:realpath).with("/tmp/foo").and_return "/tmp/foo"
end
describe "when discovering the current fs state" do
before do
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => ''))
- ::File.stub(:foreach).with("/etc/fstab")
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => ''))
+ allow(::File).to receive(:foreach).with("/etc/fstab")
end
it "should create a current resource with the same mount point and device" do
@provider.load_current_resource
- @provider.current_resource.name.should == '/tmp/foo'
- @provider.current_resource.mount_point.should == '/tmp/foo'
- @provider.current_resource.device.should == '/dev/sdz1'
+ expect(@provider.current_resource.name).to eq('/tmp/foo')
+ expect(@provider.current_resource.mount_point).to eq('/tmp/foo')
+ expect(@provider.current_resource.device).to eq('/dev/sdz1')
end
it "should accecpt device_type :uuid", :not_supported_on_solaris do
@new_resource.device_type :uuid
@new_resource.device "d21afe51-a0fe-4dc6-9152-ac733763ae0a"
@stdout_findfs = double("STDOUT", :first => "/dev/sdz1")
- @provider.should_receive(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,@stdout_findfs,@stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,@stdout_findfs,@stderr).and_return(@status)
@provider.load_current_resource()
@provider.mountable?
end
@@ -67,28 +67,28 @@ describe Chef::Provider::Mount::Mount do
"cifs" => "//cifsserver/share" }.each do |type, fs_spec|
it "should detect network fs_spec (#{type})" do
@new_resource.device fs_spec
- @provider.network_device?.should be_true
+ expect(@provider.network_device?).to be_truthy
end
it "should ignore trailing slash and set mounted to true for network mount (#{type})" do
@new_resource.device fs_spec
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "#{fs_spec}/ on /tmp/foo type #{type} (rw)\n"))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "#{fs_spec}/ on /tmp/foo type #{type} (rw)\n"))
@provider.load_current_resource
- @provider.current_resource.mounted.should be_true
+ expect(@provider.current_resource.mounted).to be_truthy
end
end
end
it "should raise an error if the mount device does not exist" do
- ::File.stub(:exists?).with("/dev/sdz1").and_return false
- lambda { @provider.load_current_resource();@provider.mountable? }.should raise_error(Chef::Exceptions::Mount)
+ allow(::File).to receive(:exists?).with("/dev/sdz1").and_return false
+ expect { @provider.load_current_resource();@provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
it "should not call mountable? with load_current_resource - CHEF-1565" do
- ::File.stub(:exists?).with("/dev/sdz1").and_return false
- @provider.should_receive(:mounted?).and_return(true)
- @provider.should_receive(:enabled?).and_return(true)
- @provider.should_not_receive(:mountable?)
+ allow(::File).to receive(:exists?).with("/dev/sdz1").and_return false
+ expect(@provider).to receive(:mounted?).and_return(true)
+ expect(@provider).to receive(:enabled?).and_return(true)
+ expect(@provider).not_to receive(:mountable?)
@provider.load_current_resource
end
@@ -97,55 +97,51 @@ describe Chef::Provider::Mount::Mount do
@new_resource.device "d21afe51-a0fe-4dc6-9152-ac733763ae0a"
status_findfs = double("Status", :exitstatus => 1)
stdout_findfs = double("STDOUT", :first => nil)
- @provider.should_receive(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,stdout_findfs,@stderr).and_return(status_findfs)
- ::File.should_receive(:exists?).with("").and_return(false)
- lambda { @provider.load_current_resource();@provider.mountable? }.should raise_error(Chef::Exceptions::Mount)
+ expect(@provider).to receive(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,stdout_findfs,@stderr).and_return(status_findfs)
+ expect(::File).to receive(:exists?).with("").and_return(false)
+ expect { @provider.load_current_resource();@provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
it "should raise an error if the mount point does not exist" do
- ::File.stub(:exists?).with("/tmp/foo").and_return false
- lambda { @provider.load_current_resource();@provider.mountable? }.should raise_error(Chef::Exceptions::Mount)
+ allow(::File).to receive(:exists?).with("/tmp/foo").and_return false
+ expect { @provider.load_current_resource();@provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
- it "does not expect the device to exist for tmpfs" do
- @new_resource.fstype("tmpfs")
- @new_resource.device("whatever")
- lambda { @provider.load_current_resource();@provider.mountable? }.should_not raise_error
- end
-
- it "does not expect the device to exist for Fuse filesystems" do
- @new_resource.fstype("fuse")
- @new_resource.device("nilfs#xxx")
- lambda { @provider.load_current_resource();@provider.mountable? }.should_not raise_error
+ [ "tmpfs", "fuse", "cgroup" ].each do |fstype|
+ it "does not expect the device to exist for #{fstype}" do
+ @new_resource.fstype(fstype)
+ @new_resource.device("whatever")
+ expect { @provider.load_current_resource();@provider.mountable? }.not_to raise_error
+ end
end
it "does not expect the device to exist if it's none" do
@new_resource.device("none")
- lambda { @provider.load_current_resource();@provider.mountable? }.should_not raise_error
+ expect { @provider.load_current_resource();@provider.mountable? }.not_to raise_error
end
it "should set mounted true if the mount point is found in the mounts list" do
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdz1 on /tmp/foo type ext3 (rw)\n"))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdz1 on /tmp/foo type ext3 (rw)\n"))
@provider.load_current_resource()
- @provider.current_resource.mounted.should be_true
+ expect(@provider.current_resource.mounted).to be_truthy
end
it "should set mounted false if another mount point beginning with the same path is found in the mounts list" do
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdz1 on /tmp/foobar type ext3 (rw)\n"))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdz1 on /tmp/foobar type ext3 (rw)\n"))
@provider.load_current_resource()
- @provider.current_resource.mounted.should be_false
+ expect(@provider.current_resource.mounted).to be_falsey
end
it "should set mounted true if the symlink target of the device is found in the mounts list" do
# expand the target path to correct specs on Windows
target = ::File.expand_path('/dev/mapper/target')
- ::File.stub(:symlink?).with("#{@new_resource.device}").and_return(true)
- ::File.stub(:readlink).with("#{@new_resource.device}").and_return(target)
+ allow(::File).to receive(:symlink?).with("#{@new_resource.device}").and_return(true)
+ allow(::File).to receive(:readlink).with("#{@new_resource.device}").and_return(target)
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "#{target} on /tmp/foo type ext3 (rw)\n"))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "#{target} on /tmp/foo type ext3 (rw)\n"))
@provider.load_current_resource()
- @provider.current_resource.mounted.should be_true
+ expect(@provider.current_resource.mounted).to be_truthy
end
it "should set mounted true if the symlink target of the device is relative and is found in the mounts list - CHEF-4957" do
@@ -154,109 +150,109 @@ describe Chef::Provider::Mount::Mount do
# expand the target path to correct specs on Windows
absolute_target = ::File.expand_path("/dev/xsdz1")
- ::File.stub(:symlink?).with("#{@new_resource.device}").and_return(true)
- ::File.stub(:readlink).with("#{@new_resource.device}").and_return(target)
+ allow(::File).to receive(:symlink?).with("#{@new_resource.device}").and_return(true)
+ allow(::File).to receive(:readlink).with("#{@new_resource.device}").and_return(target)
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "#{absolute_target} on /tmp/foo type ext3 (rw)\n"))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "#{absolute_target} on /tmp/foo type ext3 (rw)\n"))
@provider.load_current_resource()
- @provider.current_resource.mounted.should be_true
+ expect(@provider.current_resource.mounted).to be_truthy
end
it "should set mounted true if the mount point is found last in the mounts list" do
mount = "/dev/sdy1 on #{@new_resource.mount_point} type ext3 (rw)\n"
mount << "#{@new_resource.device} on #{@new_resource.mount_point} type ext3 (rw)\n"
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => mount))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => mount))
@provider.load_current_resource()
- @provider.current_resource.mounted.should be_true
+ expect(@provider.current_resource.mounted).to be_truthy
end
it "should set mounted false if the mount point is not last in the mounts list" do
mount = "#{@new_resource.device} on #{@new_resource.mount_point} type ext3 (rw)\n"
mount << "/dev/sdy1 on #{@new_resource.mount_point} type ext3 (rw)\n"
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => mount))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => mount))
@provider.load_current_resource()
- @provider.current_resource.mounted.should be_false
+ expect(@provider.current_resource.mounted).to be_falsey
end
it "mounted should be false if the mount point is not found in the mounts list" do
- @provider.stub(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdy1 on /tmp/foo type ext3 (rw)\n"))
+ allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(:stdout => "/dev/sdy1 on /tmp/foo type ext3 (rw)\n"))
@provider.load_current_resource()
- @provider.current_resource.mounted.should be_false
+ expect(@provider.current_resource.mounted).to be_falsey
end
it "should set enabled to true if the mount point is last in fstab" do
fstab1 = "/dev/sdy1 /tmp/foo ext3 defaults 1 2\n"
fstab2 = "#{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2)
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2)
@provider.load_current_resource
- @provider.current_resource.enabled.should be_true
+ expect(@provider.current_resource.enabled).to be_truthy
end
it "should set enabled to true if the mount point is not last in fstab and mount_point is a substring of another mount" do
fstab1 = "#{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n"
fstab2 = "/dev/sdy1 /tmp/foo/bar ext3 defaults 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2)
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield(fstab1).and_yield(fstab2)
@provider.load_current_resource
- @provider.current_resource.enabled.should be_true
+ expect(@provider.current_resource.enabled).to be_truthy
end
it "should set enabled to true if the symlink target is in fstab" do
target = "/dev/mapper/target"
- ::File.stub(:symlink?).with("#{@new_resource.device}").and_return(true)
- ::File.stub(:readlink).with("#{@new_resource.device}").and_return(target)
+ allow(::File).to receive(:symlink?).with("#{@new_resource.device}").and_return(true)
+ allow(::File).to receive(:readlink).with("#{@new_resource.device}").and_return(target)
fstab = "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield fstab
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab
@provider.load_current_resource
- @provider.current_resource.enabled.should be_true
+ expect(@provider.current_resource.enabled).to be_truthy
end
it "should set enabled to true if the symlink target is relative and is in fstab - CHEF-4957" do
target = "xsdz1"
- ::File.stub(:symlink?).with("#{@new_resource.device}").and_return(true)
- ::File.stub(:readlink).with("#{@new_resource.device}").and_return(target)
+ allow(::File).to receive(:symlink?).with("#{@new_resource.device}").and_return(true)
+ allow(::File).to receive(:readlink).with("#{@new_resource.device}").and_return(target)
fstab = "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield fstab
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab
@provider.load_current_resource
- @provider.current_resource.enabled.should be_true
+ expect(@provider.current_resource.enabled).to be_truthy
end
it "should set enabled to false if the mount point is not in fstab" do
fstab = "/dev/sdy1 #{@new_resource.mount_point} ext3 defaults 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield fstab
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab
@provider.load_current_resource
- @provider.current_resource.enabled.should be_false
+ expect(@provider.current_resource.enabled).to be_falsey
end
it "should ignore commented lines in fstab " do
fstab = "\# #{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield fstab
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab
@provider.load_current_resource
- @provider.current_resource.enabled.should be_false
+ expect(@provider.current_resource.enabled).to be_falsey
end
it "should set enabled to false if the mount point is not last in fstab" do
line_1 = "#{@new_resource.device} #{@new_resource.mount_point} ext3 defaults 1 2\n"
line_2 = "/dev/sdy1 #{@new_resource.mount_point} ext3 defaults 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield(line_1).and_yield(line_2)
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield(line_1).and_yield(line_2)
@provider.load_current_resource
- @provider.current_resource.enabled.should be_false
+ expect(@provider.current_resource.enabled).to be_falsey
end
it "should not mangle the mount options if the device in fstab is a symlink" do
@@ -264,26 +260,26 @@ describe Chef::Provider::Mount::Mount do
target = "/dev/mapper/target"
options = "rw,noexec,noauto"
- ::File.stub(:symlink?).with(@new_resource.device).and_return(true)
- ::File.stub(:readlink).with(@new_resource.device).and_return(target)
+ allow(::File).to receive(:symlink?).with(@new_resource.device).and_return(true)
+ allow(::File).to receive(:readlink).with(@new_resource.device).and_return(target)
fstab = "#{@new_resource.device} #{@new_resource.mount_point} #{@new_resource.fstype} #{options} 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield fstab
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab
@provider.load_current_resource
- @provider.current_resource.options.should eq(options.split(','))
+ expect(@provider.current_resource.options).to eq(options.split(','))
end
it "should not mangle the mount options if the symlink target is in fstab" do
target = ::File.expand_path("/dev/mapper/target")
options = "rw,noexec,noauto"
- ::File.stub(:symlink?).with(@new_resource.device).and_return(true)
- ::File.stub(:readlink).with(@new_resource.device).and_return(target)
+ allow(::File).to receive(:symlink?).with(@new_resource.device).and_return(true)
+ allow(::File).to receive(:readlink).with(@new_resource.device).and_return(target)
fstab = "#{target} #{@new_resource.mount_point} #{@new_resource.fstype} #{options} 1 2\n"
- ::File.stub(:foreach).with("/etc/fstab").and_yield fstab
+ allow(::File).to receive(:foreach).with("/etc/fstab").and_yield fstab
@provider.load_current_resource
- @provider.current_resource.options.should eq(options.split(','))
+ expect(@provider.current_resource.options).to eq(options.split(','))
end
end
@@ -299,14 +295,14 @@ describe Chef::Provider::Mount::Mount do
describe "mount_fs" do
it "should mount the filesystem if it is not mounted" do
- @provider.should_receive(:shell_out!).with("mount -t ext3 -o defaults /dev/sdz1 /tmp/foo")
+ expect(@provider).to receive(:shell_out!).with("mount -t ext3 -o defaults /dev/sdz1 /tmp/foo")
@provider.mount_fs()
end
it "should mount the filesystem with options if options were passed" do
options = "rw,noexec,noauto"
@new_resource.options(%w{rw noexec noauto})
- @provider.should_receive(:shell_out!).with("mount -t ext3 -o rw,noexec,noauto /dev/sdz1 /tmp/foo")
+ expect(@provider).to receive(:shell_out!).with("mount -t ext3 -o rw,noexec,noauto /dev/sdz1 /tmp/foo")
@provider.mount_fs()
end
@@ -314,16 +310,16 @@ describe Chef::Provider::Mount::Mount do
@new_resource.device "d21afe51-a0fe-4dc6-9152-ac733763ae0a"
@new_resource.device_type :uuid
@stdout_findfs = double("STDOUT", :first => "/dev/sdz1")
- @provider.stub(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,@stdout_findfs,@stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).with("/sbin/findfs UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_yield(@pid,@stdin,@stdout_findfs,@stderr).and_return(@status)
@stdout_mock = double('stdout mock')
- @stdout_mock.stub(:each).and_yield("#{@new_resource.device} on #{@new_resource.mount_point}")
- @provider.should_receive(:shell_out!).with("mount -t #{@new_resource.fstype} -o defaults -U #{@new_resource.device} #{@new_resource.mount_point}").and_return(@stdout_mock)
+ allow(@stdout_mock).to receive(:each).and_yield("#{@new_resource.device} on #{@new_resource.mount_point}")
+ expect(@provider).to receive(:shell_out!).with("mount -t #{@new_resource.fstype} -o defaults -U #{@new_resource.device} #{@new_resource.mount_point}").and_return(@stdout_mock)
@provider.mount_fs()
end
it "should not mount the filesystem if it is mounted" do
- @current_resource.stub(:mounted).and_return(true)
- @provider.should_not_receive(:shell_out!)
+ allow(@current_resource).to receive(:mounted).and_return(true)
+ expect(@provider).not_to receive(:shell_out!)
@provider.mount_fs()
end
@@ -332,13 +328,13 @@ describe Chef::Provider::Mount::Mount do
describe "umount_fs" do
it "should umount the filesystem if it is mounted" do
@current_resource.mounted(true)
- @provider.should_receive(:shell_out!).with("umount /tmp/foo")
+ expect(@provider).to receive(:shell_out!).with("umount /tmp/foo")
@provider.umount_fs()
end
it "should not umount the filesystem if it is not mounted" do
@current_resource.mounted(false)
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.umount_fs()
end
end
@@ -347,7 +343,7 @@ describe Chef::Provider::Mount::Mount do
it "should use mount -o remount if remount is supported" do
@new_resource.supports({:remount => true})
@current_resource.mounted(true)
- @provider.should_receive(:shell_out!).with("mount -o remount,defaults #{@new_resource.mount_point}")
+ expect(@provider).to receive(:shell_out!).with("mount -o remount,defaults #{@new_resource.mount_point}")
@provider.remount_fs
end
@@ -356,24 +352,24 @@ describe Chef::Provider::Mount::Mount do
options = "rw,noexec,noauto"
@new_resource.options(%w{rw noexec noauto})
@current_resource.mounted(true)
- @provider.should_receive(:shell_out!).with("mount -o remount,rw,noexec,noauto #{@new_resource.mount_point}")
+ expect(@provider).to receive(:shell_out!).with("mount -o remount,rw,noexec,noauto #{@new_resource.mount_point}")
@provider.remount_fs
end
it "should umount and mount if remount is not supported" do
@new_resource.supports({:remount => false})
@current_resource.mounted(true)
- @provider.should_receive(:umount_fs)
- @provider.should_receive(:sleep).with(1)
- @provider.should_receive(:mount_fs)
+ expect(@provider).to receive(:umount_fs)
+ expect(@provider).to receive(:sleep).with(1)
+ expect(@provider).to receive(:mount_fs)
@provider.remount_fs()
end
it "should not try to remount at all if mounted is false" do
@current_resource.mounted(false)
- @provider.should_not_receive(:shell_out!)
- @provider.should_not_receive(:umount_fs)
- @provider.should_not_receive(:mount_fs)
+ expect(@provider).not_to receive(:shell_out!)
+ expect(@provider).not_to receive(:umount_fs)
+ expect(@provider).not_to receive(:mount_fs)
@provider.remount_fs()
end
end
@@ -383,9 +379,9 @@ describe Chef::Provider::Mount::Mount do
@current_resource.enabled(false)
@fstab = StringIO.new
- ::File.stub(:open).with("/etc/fstab", "a").and_yield(@fstab)
+ allow(::File).to receive(:open).with("/etc/fstab", "a").and_yield(@fstab)
@provider.enable_fs
- @fstab.string.should match(%r{^/dev/sdz1\s+/tmp/foo\s+ext3\s+defaults\s+0\s+2\s*$})
+ expect(@fstab.string).to match(%r{^/dev/sdz1\s+/tmp/foo\s+ext3\s+defaults\s+0\s+2\s*$})
end
it "should not enable if enabled is true and resources match" do
@@ -394,7 +390,7 @@ describe Chef::Provider::Mount::Mount do
@current_resource.options(["defaults"])
@current_resource.dump(0)
@current_resource.pass(2)
- ::File.should_not_receive(:open).with("/etc/fstab", "a")
+ expect(::File).not_to receive(:open).with("/etc/fstab", "a")
@provider.enable_fs
end
@@ -406,9 +402,9 @@ describe Chef::Provider::Mount::Mount do
@current_resource.dump(0)
@current_resource.pass(2)
@fstab = StringIO.new
- ::File.stub(:readlines).and_return([])
- ::File.should_receive(:open).once.with("/etc/fstab", "w").and_yield(@fstab)
- ::File.should_receive(:open).once.with("/etc/fstab", "a").and_yield(@fstab)
+ allow(::File).to receive(:readlines).and_return([])
+ expect(::File).to receive(:open).once.with("/etc/fstab", "w").and_yield(@fstab)
+ expect(::File).to receive(:open).once.with("/etc/fstab", "a").and_yield(@fstab)
@provider.enable_fs
end
@@ -422,13 +418,13 @@ describe Chef::Provider::Mount::Mount do
this_mount = "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n"
@fstab_read = [this_mount, other_mount]
- ::File.stub(:readlines).with("/etc/fstab").and_return(@fstab_read)
+ allow(::File).to receive(:readlines).with("/etc/fstab").and_return(@fstab_read)
@fstab_write = StringIO.new
- ::File.stub(:open).with("/etc/fstab", "w").and_yield(@fstab_write)
+ allow(::File).to receive(:open).with("/etc/fstab", "w").and_yield(@fstab_write)
@provider.disable_fs
- @fstab_write.string.should match(Regexp.escape(other_mount))
- @fstab_write.string.should_not match(Regexp.escape(this_mount))
+ expect(@fstab_write.string).to match(Regexp.escape(other_mount))
+ expect(@fstab_write.string).not_to match(Regexp.escape(this_mount))
end
it "should disable if enabled is true and ignore commented lines" do
@@ -439,37 +435,37 @@ describe Chef::Provider::Mount::Mount do
%q{#/dev/sdz1 /tmp/foo ext3 defaults 1 2}]
fstab_write = StringIO.new
- ::File.stub(:readlines).with("/etc/fstab").and_return(fstab_read)
- ::File.stub(:open).with("/etc/fstab", "w").and_yield(fstab_write)
+ allow(::File).to receive(:readlines).with("/etc/fstab").and_return(fstab_read)
+ allow(::File).to receive(:open).with("/etc/fstab", "w").and_yield(fstab_write)
@provider.disable_fs
- fstab_write.string.should match(%r{^/dev/sdy1 /tmp/foo ext3 defaults 1 2$})
- fstab_write.string.should match(%r{^#/dev/sdz1 /tmp/foo ext3 defaults 1 2$})
- fstab_write.string.should_not match(%r{^/dev/sdz1 /tmp/foo ext3 defaults 1 2$})
+ expect(fstab_write.string).to match(%r{^/dev/sdy1 /tmp/foo ext3 defaults 1 2$})
+ expect(fstab_write.string).to match(%r{^#/dev/sdz1 /tmp/foo ext3 defaults 1 2$})
+ expect(fstab_write.string).not_to match(%r{^/dev/sdz1 /tmp/foo ext3 defaults 1 2$})
end
it "should disable only the last entry if enabled is true" do
- @current_resource.stub(:enabled).and_return(true)
+ allow(@current_resource).to receive(:enabled).and_return(true)
fstab_read = ["/dev/sdz1 /tmp/foo ext3 defaults 1 2\n",
"/dev/sdy1 /tmp/foo ext3 defaults 1 2\n",
"/dev/sdz1 /tmp/foo ext3 defaults 1 2\n",
"/dev/sdz1 /tmp/foobar ext3 defaults 1 2\n"]
fstab_write = StringIO.new
- ::File.stub(:readlines).with("/etc/fstab").and_return(fstab_read)
- ::File.stub(:open).with("/etc/fstab", "w").and_yield(fstab_write)
+ allow(::File).to receive(:readlines).with("/etc/fstab").and_return(fstab_read)
+ allow(::File).to receive(:open).with("/etc/fstab", "w").and_yield(fstab_write)
@provider.disable_fs
- fstab_write.string.should == "/dev/sdz1 /tmp/foo ext3 defaults 1 2\n" +
+ expect(fstab_write.string).to eq("/dev/sdz1 /tmp/foo ext3 defaults 1 2\n" +
"/dev/sdy1 /tmp/foo ext3 defaults 1 2\n" +
- "/dev/sdz1 /tmp/foobar ext3 defaults 1 2\n"
+ "/dev/sdz1 /tmp/foobar ext3 defaults 1 2\n")
end
it "should not disable if enabled is false" do
- @current_resource.stub(:enabled).and_return(false)
+ allow(@current_resource).to receive(:enabled).and_return(false)
- ::File.stub(:readlines).with("/etc/fstab").and_return([])
- ::File.should_not_receive(:open).and_yield(@fstab)
+ allow(::File).to receive(:readlines).with("/etc/fstab").and_return([])
+ expect(::File).not_to receive(:open).and_yield(@fstab)
@provider.disable_fs
end
diff --git a/spec/unit/provider/mount/solaris_spec.rb b/spec/unit/provider/mount/solaris_spec.rb
index 50ddfaa28d..9a9b09b531 100644
--- a/spec/unit/provider/mount/solaris_spec.rb
+++ b/spec/unit/provider/mount/solaris_spec.rb
@@ -92,37 +92,37 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
before do
stub_const("Chef::Provider::Mount::Solaris::VFSTAB", vfstab_file.path )
- provider.stub(:shell_out!).with("mount -v").and_return(OpenStruct.new(:stdout => mount_output))
- File.stub(:symlink?).with(device).and_return(false)
- File.stub(:exist?).and_call_original # Tempfile.open on ruby 1.8.7 calls File.exist?
- File.stub(:exist?).with(device).and_return(true)
- File.stub(:exist?).with(mountpoint).and_return(true)
+ allow(provider).to receive(:shell_out!).with("mount -v").and_return(OpenStruct.new(:stdout => mount_output))
+ allow(File).to receive(:symlink?).with(device).and_return(false)
+ allow(File).to receive(:exist?).and_call_original # Tempfile.open on ruby 1.8.7 calls File.exist?
+ allow(File).to receive(:exist?).with(device).and_return(true)
+ allow(File).to receive(:exist?).with(mountpoint).and_return(true)
expect(File).to_not receive(:exists?)
end
describe "#define_resource_requirements" do
before do
# we're not testing the actual actions so stub them all out
- [:mount_fs, :umount_fs, :remount_fs, :enable_fs, :disable_fs].each {|m| provider.stub(m) }
+ [:mount_fs, :umount_fs, :remount_fs, :enable_fs, :disable_fs].each {|m| allow(provider).to receive(m) }
end
it "run_action(:mount) should raise an error if the device does not exist" do
- File.stub(:exist?).with(device).and_return(false)
+ allow(File).to receive(:exist?).with(device).and_return(false)
expect { provider.run_action(:mount) }.to raise_error(Chef::Exceptions::Mount)
end
it "run_action(:remount) should raise an error if the device does not exist" do
- File.stub(:exist?).with(device).and_return(false)
+ allow(File).to receive(:exist?).with(device).and_return(false)
expect { provider.run_action(:remount) }.to raise_error(Chef::Exceptions::Mount)
end
it "run_action(:mount) should raise an error if the mountpoint does not exist" do
- File.stub(:exist?).with(mountpoint).and_return false
+ allow(File).to receive(:exist?).with(mountpoint).and_return false
expect { provider.run_action(:mount) }.to raise_error(Chef::Exceptions::Mount)
end
it "run_action(:remount) should raise an error if the mountpoint does not exist" do
- File.stub(:exist?).with(mountpoint).and_return false
+ allow(File).to receive(:exist?).with(mountpoint).and_return false
expect { provider.run_action(:remount) }.to raise_error(Chef::Exceptions::Mount)
end
@@ -160,31 +160,31 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
end
it "should set the name on the current_resource" do
- provider.current_resource.name.should == mountpoint
+ expect(provider.current_resource.name).to eq(mountpoint)
end
it "should set the mount_point on the current_resource" do
- provider.current_resource.mount_point.should == mountpoint
+ expect(provider.current_resource.mount_point).to eq(mountpoint)
end
it "should set the device on the current_resource" do
- provider.current_resource.device.should == device
+ expect(provider.current_resource.device).to eq(device)
end
it "should set the fsck_device on the current_resource" do
- provider.current_resource.fsck_device.should == fsck_device
+ expect(provider.current_resource.fsck_device).to eq(fsck_device)
end
it "should set the device_type on the current_resource" do
- provider.current_resource.device_type.should == device_type
+ expect(provider.current_resource.device_type).to eq(device_type)
end
it "should set the mounted status on the current_resource" do
- expect(provider.current_resource.mounted).to be_true
+ expect(provider.current_resource.mounted).to be_truthy
end
it "should set the enabled status on the current_resource" do
- expect(provider.current_resource.enabled).to be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
it "should set the fstype field on the current_resource" do
@@ -200,12 +200,12 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
end
it "should not throw an exception when the device does not exist - CHEF-1565" do
- File.stub(:exist?).with(device).and_return(false)
+ allow(File).to receive(:exist?).with(device).and_return(false)
expect { provider.load_current_resource }.to_not raise_error
end
it "should not throw an exception when the mount point does not exist" do
- File.stub(:exist?).with(mountpoint).and_return false
+ allow(File).to receive(:exist?).with(mountpoint).and_return false
expect { provider.load_current_resource }.to_not raise_error
end
end
@@ -258,7 +258,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:fsck_device) { "-" }
it "should work at some point in the future" do
- pending "SMBFS mounts on solaris look like they will need some future code work and more investigation"
+ skip "SMBFS mounts on solaris look like they will need some future code work and more investigation"
end
end
@@ -288,27 +288,27 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
end
it "should set the name on the current_resource" do
- provider.current_resource.name.should == mountpoint
+ expect(provider.current_resource.name).to eq(mountpoint)
end
it "should set the mount_point on the current_resource" do
- provider.current_resource.mount_point.should == mountpoint
+ expect(provider.current_resource.mount_point).to eq(mountpoint)
end
it "should set the device on the current_resource" do
- provider.current_resource.device.should == device
+ expect(provider.current_resource.device).to eq(device)
end
it "should set the device_type on the current_resource" do
- provider.current_resource.device_type.should == device_type
+ expect(provider.current_resource.device_type).to eq(device_type)
end
it "should set the mounted status on the current_resource" do
- expect(provider.current_resource.mounted).to be_true
+ expect(provider.current_resource.mounted).to be_truthy
end
it "should set the enabled status on the current_resource" do
- expect(provider.current_resource.enabled).to be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
it "should set the fstype field on the current_resource" do
@@ -322,7 +322,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should set the pass field on the current_resource" do
# is this correct or should it be nil?
#
- # vfstab man page says.
+ # vfstab man page says.
# "A - is used to indicate no entry in a field."
# 0 and - could mean different things for some file systems
expect(provider.current_resource.pass).to eql(0)
@@ -347,18 +347,18 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
}
before do
- File.should_receive(:symlink?).with(device).at_least(:once).and_return(true)
- File.should_receive(:readlink).with(device).at_least(:once).and_return(target)
+ expect(File).to receive(:symlink?).with(device).at_least(:once).and_return(true)
+ expect(File).to receive(:readlink).with(device).at_least(:once).and_return(target)
provider.load_current_resource()
end
it "should set mounted true if the symlink target of the device is found in the mounts list" do
- expect(provider.current_resource.mounted).to be_true
+ expect(provider.current_resource.mounted).to be_truthy
end
it "should set enabled true if the symlink target of the device is found in the vfstab" do
- expect(provider.current_resource.enabled).to be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
it "should have the correct mount options" do
@@ -384,18 +384,18 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
}
before do
- File.should_receive(:symlink?).with(device).at_least(:once).and_return(true)
- File.should_receive(:readlink).with(device).at_least(:once).and_return(target)
+ expect(File).to receive(:symlink?).with(device).at_least(:once).and_return(true)
+ expect(File).to receive(:readlink).with(device).at_least(:once).and_return(target)
provider.load_current_resource()
end
it "should set mounted true if the symlink target of the device is found in the mounts list" do
- expect(provider.current_resource.mounted).to be_true
+ expect(provider.current_resource.mounted).to be_truthy
end
it "should set enabled true if the symlink target of the device is found in the vfstab" do
- expect(provider.current_resource.enabled).to be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
it "should have the correct mount options" do
@@ -412,7 +412,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
}
it "should set mounted true" do
provider.load_current_resource()
- provider.current_resource.mounted.should be_true
+ expect(provider.current_resource.mounted).to be_truthy
end
end
@@ -425,7 +425,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
}
it "should set mounted false" do
provider.load_current_resource()
- provider.current_resource.mounted.should be_false
+ expect(provider.current_resource.mounted).to be_falsey
end
end
@@ -437,7 +437,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
}
it "should set mounted false" do
provider.load_current_resource()
- provider.current_resource.mounted.should be_false
+ expect(provider.current_resource.mounted).to be_falsey
end
end
@@ -449,7 +449,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
}
it "should set mounted false" do
provider.load_current_resource()
- provider.current_resource.mounted.should be_false
+ expect(provider.current_resource.mounted).to be_falsey
end
end
@@ -463,7 +463,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should set enabled to true" do
provider.load_current_resource
- provider.current_resource.enabled.should be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
end
@@ -477,7 +477,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should set enabled to true" do
provider.load_current_resource
- provider.current_resource.enabled.should be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
end
@@ -491,7 +491,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should set enabled to false" do
provider.load_current_resource
- provider.current_resource.enabled.should be_false
+ expect(provider.current_resource.enabled).to be_falsey
end
end
@@ -504,7 +504,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should set enabled to false" do
provider.load_current_resource
- provider.current_resource.enabled.should be_false
+ expect(provider.current_resource.enabled).to be_falsey
end
end
@@ -517,7 +517,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should set enabled to false" do
provider.load_current_resource
- provider.current_resource.enabled.should be_false
+ expect(provider.current_resource.enabled).to be_falsey
end
end
@@ -530,7 +530,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
it "should set enabled to false" do
provider.load_current_resource
- provider.current_resource.enabled.should be_false
+ expect(provider.current_resource.enabled).to be_falsey
end
end
end
@@ -538,28 +538,28 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
context "after the mount's state has been discovered" do
describe "mount_fs" do
it "should mount the filesystem" do
- provider.should_receive(:shell_out!).with("mount -F #{fstype} -o defaults #{device} #{mountpoint}")
+ expect(provider).to receive(:shell_out!).with("mount -F #{fstype} -o defaults #{device} #{mountpoint}")
provider.mount_fs()
end
it "should mount the filesystem with options if options were passed" do
options = "logging,noatime,largefiles,nosuid,rw,quota"
new_resource.options(options.split(/,/))
- provider.should_receive(:shell_out!).with("mount -F #{fstype} -o #{options} #{device} #{mountpoint}")
+ expect(provider).to receive(:shell_out!).with("mount -F #{fstype} -o #{options} #{device} #{mountpoint}")
provider.mount_fs()
end
it "should delete the 'noauto' magic option" do
options = "rw,noauto"
new_resource.options(%w{rw noauto})
- provider.should_receive(:shell_out!).with("mount -F #{fstype} -o rw #{device} #{mountpoint}")
+ expect(provider).to receive(:shell_out!).with("mount -F #{fstype} -o rw #{device} #{mountpoint}")
provider.mount_fs()
end
end
describe "umount_fs" do
it "should umount the filesystem if it is mounted" do
- provider.should_receive(:shell_out!).with("umount #{mountpoint}")
+ expect(provider).to receive(:shell_out!).with("umount #{mountpoint}")
provider.umount_fs()
end
end
@@ -567,7 +567,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
describe "remount_fs without options and do not mount at boot" do
it "should use mount -o remount" do
new_resource.options(%w{noauto})
- provider.should_receive(:shell_out!).with("mount -o remount #{new_resource.mount_point}")
+ expect(provider).to receive(:shell_out!).with("mount -o remount #{new_resource.mount_point}")
provider.remount_fs
end
end
@@ -575,7 +575,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
describe "remount_fs with options and do not mount at boot" do
it "should use mount -o remount,rw" do
new_resource.options(%w{rw noauto})
- provider.should_receive(:shell_out!).with("mount -o remount,rw #{new_resource.mount_point}")
+ expect(provider).to receive(:shell_out!).with("mount -o remount,rw #{new_resource.mount_point}")
provider.remount_fs
end
end
@@ -583,7 +583,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
describe "remount_fs with options and mount at boot" do
it "should use mount -o remount,rw" do
new_resource.options(%w{rw})
- provider.should_receive(:shell_out!).with("mount -o remount,rw #{new_resource.mount_point}")
+ expect(provider).to receive(:shell_out!).with("mount -o remount,rw #{new_resource.mount_point}")
provider.remount_fs
end
end
@@ -591,7 +591,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
describe "remount_fs without options and mount at boot" do
it "should use mount -o remount" do
new_resource.options([])
- provider.should_receive(:shell_out!).with("mount -o remount #{new_resource.mount_point}")
+ expect(provider).to receive(:shell_out!).with("mount -o remount #{new_resource.mount_point}")
provider.remount_fs
end
end
@@ -605,17 +605,17 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [other_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.load_current_resource
provider.enable_fs
end
it "should leave the other mountpoint alone" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(other_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(other_mount)}/)
end
it "should enable the mountpoint we care about" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(this_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(this_mount)}/)
end
end
@@ -629,17 +629,17 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [other_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.load_current_resource
provider.enable_fs
end
it "should leave the other mountpoint alone" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(other_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(other_mount)}/)
end
it "should enable the mountpoint we care about" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(this_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(this_mount)}/)
end
end
@@ -653,18 +653,18 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [existing_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.load_current_resource
provider.mount_options_unchanged?
provider.send(:vfstab_entry)
end
it "should detect a changed entry" do
- provider.mount_options_unchanged?.should == false
+ expect(provider.mount_options_unchanged?).to eq(false)
end
it "should change mount at boot to no" do
- provider.send(:vfstab_entry).should match(/^#{Regexp.escape(this_mount)}/)
+ expect(provider.send(:vfstab_entry)).to match(/^#{Regexp.escape(this_mount)}/)
end
end
@@ -678,18 +678,18 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [existing_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.load_current_resource
provider.mount_options_unchanged?
provider.send(:vfstab_entry)
end
it "should detect a changed entry" do
- provider.mount_options_unchanged?.should == false
+ expect(provider.mount_options_unchanged?).to eq(false)
end
it "should change mount at boot to yes" do
- provider.send(:vfstab_entry).should match(/^#{Regexp.escape(this_mount)}/)
+ expect(provider.send(:vfstab_entry)).to match(/^#{Regexp.escape(this_mount)}/)
end
end
@@ -703,18 +703,18 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [existing_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.load_current_resource
provider.mount_options_unchanged?
provider.send(:vfstab_entry)
end
it "should detect an unchanged entry" do
- provider.mount_options_unchanged?.should == true
+ expect(provider.mount_options_unchanged?).to eq(true)
end
it "should not change mount at boot" do
- provider.send(:vfstab_entry).should match(/^#{Regexp.escape(this_mount)}/)
+ expect(provider.send(:vfstab_entry)).to match(/^#{Regexp.escape(this_mount)}/)
end
end
@@ -728,18 +728,18 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [existing_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.load_current_resource
provider.mount_options_unchanged?
provider.send(:vfstab_entry)
end
it "should detect an unchanged entry" do
- provider.mount_options_unchanged?.should == true
+ expect(provider.mount_options_unchanged?).to eq(true)
end
it "should not change mount at boot" do
- provider.send(:vfstab_entry).should match(/^#{Regexp.escape(this_mount)}/)
+ expect(provider.send(:vfstab_entry)).to match(/^#{Regexp.escape(this_mount)}/)
end
end
end
@@ -753,16 +753,16 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [other_mount, this_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.disable_fs
end
it "should leave the other mountpoint alone" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(other_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(other_mount)}/)
end
it "should disable the mountpoint we care about" do
- IO.read(vfstab_file.path).should_not match(/^#{Regexp.escape(this_mount)}/)
+ expect(IO.read(vfstab_file.path)).not_to match(/^#{Regexp.escape(this_mount)}/)
end
end
@@ -776,20 +776,20 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [other_mount, this_mount, comment].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.disable_fs
end
it "should leave the other mountpoint alone" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(other_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(other_mount)}/)
end
it "should disable the mountpoint we care about" do
- IO.read(vfstab_file.path).should_not match(/^#{Regexp.escape(this_mount)}/)
+ expect(IO.read(vfstab_file.path)).not_to match(/^#{Regexp.escape(this_mount)}/)
end
it "should keep the comment" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(comment)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(comment)}/)
end
end
@@ -801,20 +801,20 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
let(:vfstab_file_contents) { [this_mount, other_mount, this_mount].join("\n") }
before do
- provider.stub(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
+ allow(provider).to receive(:etc_tempfile).and_yield(Tempfile.open("vfstab"))
provider.disable_fs
end
it "should leave the other mountpoint alone" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(other_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(other_mount)}/)
end
it "should still match the duplicated mountpoint" do
- IO.read(vfstab_file.path).should match(/^#{Regexp.escape(this_mount)}/)
+ expect(IO.read(vfstab_file.path)).to match(/^#{Regexp.escape(this_mount)}/)
end
it "should have removed the last line" do
- IO.read(vfstab_file.path).should eql( "#{this_mount}\n#{other_mount}\n" )
+ expect(IO.read(vfstab_file.path)).to eql( "#{this_mount}\n#{other_mount}\n" )
end
end
end
diff --git a/spec/unit/provider/mount/windows_spec.rb b/spec/unit/provider/mount/windows_spec.rb
index 80e7f1e695..467d923c6a 100644
--- a/spec/unit/provider/mount/windows_spec.rb
+++ b/spec/unit/provider/mount/windows_spec.rb
@@ -40,12 +40,12 @@ describe Chef::Provider::Mount::Windows do
@new_resource = Chef::Resource::Mount.new("X:")
@new_resource.device GUID
@current_resource = Chef::Resource::Mount.new("X:")
- Chef::Resource::Mount.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Mount).to receive(:new).and_return(@current_resource)
@net_use = double("Chef::Util::Windows::NetUse")
- Chef::Util::Windows::NetUse.stub(:new).and_return(@net_use)
+ allow(Chef::Util::Windows::NetUse).to receive(:new).and_return(@net_use)
@vol = double("Chef::Util::Windows::Volume")
- Chef::Util::Windows::Volume.stub(:new).and_return(@vol)
+ allow(Chef::Util::Windows::Volume).to receive(:new).and_return(@vol)
@provider = Chef::Provider::Mount::Windows.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
@@ -53,26 +53,26 @@ describe Chef::Provider::Mount::Windows do
describe "when loading the current resource" do
it "should set mounted true if the mount point is found" do
- @vol.stub(:device).and_return(@new_resource.device)
- @current_resource.should_receive(:mounted).with(true)
+ allow(@vol).to receive(:device).and_return(@new_resource.device)
+ expect(@current_resource).to receive(:mounted).with(true)
@provider.load_current_resource
end
it "should set mounted false if the mount point is not found" do
- @vol.stub(:device).and_raise(ArgumentError)
- @current_resource.should_receive(:mounted).with(false)
+ allow(@vol).to receive(:device).and_raise(ArgumentError)
+ expect(@current_resource).to receive(:mounted).with(false)
@provider.load_current_resource
end
describe "with a local device" do
before do
@new_resource.device GUID
- @vol.stub(:device).and_return(@new_resource.device)
- @net_use.stub(:device).and_raise(ArgumentError)
+ allow(@vol).to receive(:device).and_return(@new_resource.device)
+ allow(@net_use).to receive(:device).and_raise(ArgumentError)
end
it "should determine the device is a volume GUID" do
- @provider.should_receive(:is_volume).with(@new_resource.device).and_return(true)
+ expect(@provider).to receive(:is_volume).with(@new_resource.device).and_return(true)
@provider.load_current_resource
end
end
@@ -80,12 +80,12 @@ describe Chef::Provider::Mount::Windows do
describe "with a remote device" do
before do
@new_resource.device REMOTE
- @net_use.stub(:device).and_return(@new_resource.device)
- @vol.stub(:device).and_raise(ArgumentError)
+ allow(@net_use).to receive(:device).and_return(@new_resource.device)
+ allow(@vol).to receive(:device).and_raise(ArgumentError)
end
it "should determine the device is remote" do
- @provider.should_receive(:is_volume).with(@new_resource.device).and_return(false)
+ expect(@provider).to receive(:is_volume).with(@new_resource.device).and_return(false)
@provider.load_current_resource
end
end
@@ -93,13 +93,13 @@ describe Chef::Provider::Mount::Windows do
describe "when mounting a file system" do
before do
@new_resource.device GUID
- @vol.stub(:add)
- @vol.stub(:device).and_raise(ArgumentError)
+ allow(@vol).to receive(:add)
+ allow(@vol).to receive(:device).and_raise(ArgumentError)
@provider.load_current_resource
end
it "should mount the filesystem if it is not mounted" do
- @vol.should_receive(:add).with(:remote => @new_resource.device,
+ expect(@vol).to receive(:add).with(:remote => @new_resource.device,
:username => @new_resource.username,
:domainname => @new_resource.domain,
:password => @new_resource.password)
@@ -107,8 +107,8 @@ describe Chef::Provider::Mount::Windows do
end
it "should not mount the filesystem if it is mounted" do
- @vol.should_not_receive(:add)
- @current_resource.stub(:mounted).and_return(true)
+ expect(@vol).not_to receive(:add)
+ allow(@current_resource).to receive(:mounted).and_return(true)
@provider.mount_fs
end
end
@@ -116,20 +116,20 @@ describe Chef::Provider::Mount::Windows do
describe "when unmounting a file system" do
before do
@new_resource.device GUID
- @vol.stub(:delete)
- @vol.stub(:device).and_raise(ArgumentError)
+ allow(@vol).to receive(:delete)
+ allow(@vol).to receive(:device).and_raise(ArgumentError)
@provider.load_current_resource
end
it "should umount the filesystem if it is mounted" do
- @current_resource.stub(:mounted).and_return(true)
- @vol.should_receive(:delete)
+ allow(@current_resource).to receive(:mounted).and_return(true)
+ expect(@vol).to receive(:delete)
@provider.umount_fs
end
it "should not umount the filesystem if it is not mounted" do
- @current_resource.stub(:mounted).and_return(false)
- @vol.should_not_receive(:delete)
+ allow(@current_resource).to receive(:mounted).and_return(false)
+ expect(@vol).not_to receive(:delete)
@provider.umount_fs
end
end
diff --git a/spec/unit/provider/ohai_spec.rb b/spec/unit/provider/ohai_spec.rb
index 29c32e2690..45688cedb7 100644
--- a/spec/unit/provider/ohai_spec.rb
+++ b/spec/unit/provider/ohai_spec.rb
@@ -41,16 +41,16 @@ describe Chef::Provider::Ohai do
:newdata => "somevalue"
}
}
- mock_ohai.stub(:all_plugins).and_return(true)
- mock_ohai.stub(:data).and_return(mock_ohai[:data],
+ allow(mock_ohai).to receive(:all_plugins).and_return(true)
+ allow(mock_ohai).to receive(:data).and_return(mock_ohai[:data],
mock_ohai[:data2])
- Ohai::System.stub(:new).and_return(mock_ohai)
- Chef::Platform.stub(:find_platform_and_version).and_return({ "platform" => @platform,
+ allow(Ohai::System).to receive(:new).and_return(mock_ohai)
+ allow(Chef::Platform).to receive(:find_platform_and_version).and_return({ "platform" => @platform,
"platform_version" => @platform_version})
# Fake node with a dummy save
@node = Chef::Node.new
@node.name(@fqdn)
- @node.stub(:save).and_return(@node)
+ allow(@node).to receive(:save).and_return(@node)
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Ohai.new("ohai_reload")
@@ -67,18 +67,18 @@ describe Chef::Provider::Ohai do
end
it "applies updated ohai data to the node" do
- @node[:origdata].should == 'somevalue'
- @node[:newdata].should be_nil
+ expect(@node[:origdata]).to eq('somevalue')
+ expect(@node[:newdata]).to be_nil
@provider.run_action(:reload)
- @node[:origdata].should == 'somevalue'
- @node[:newdata].should == 'somevalue'
+ expect(@node[:origdata]).to eq('somevalue')
+ expect(@node[:newdata]).to eq('somevalue')
end
it "should reload a specific plugin and cause node to pick up new values" do
@new_resource.plugin "someplugin"
@provider.run_action(:reload)
- @node[:origdata].should == 'somevalue'
- @node[:newdata].should == 'somevalue'
+ expect(@node[:origdata]).to eq('somevalue')
+ expect(@node[:newdata]).to eq('somevalue')
end
end
end
diff --git a/spec/unit/provider/package/aix_spec.rb b/spec/unit/provider/package/aix_spec.rb
index 5d6e23302f..6908b1288d 100644
--- a/spec/unit/provider/package/aix_spec.rb
+++ b/spec/unit/provider/package/aix_spec.rb
@@ -28,7 +28,7 @@ describe Chef::Provider::Package::Aix do
@new_resource.source("/tmp/samba.base")
@provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context)
- ::File.stub(:exists?).and_return(true)
+ allow(::File).to receive(:exists?).and_return(true)
end
describe "assessing the current package status" do
@@ -40,118 +40,118 @@ describe Chef::Provider::Package::Aix do
end
it "should create a current resource with the name of new_resource" do
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.name.should == "samba.base"
+ expect(@provider.current_resource.name).to eq("samba.base")
end
it "should set the current resource bff package name to the new resource bff package name" do
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == "samba.base"
+ expect(@provider.current_resource.package_name).to eq("samba.base")
end
it "should raise an exception if a source is supplied but not found" do
- @provider.stub(:popen4).and_return(@status)
- ::File.stub(:exists?).and_return(false)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ allow(::File).to receive(:exists?).and_return(false)
@provider.define_resource_requirements
@provider.load_current_resource
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Package)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Package)
end
it "should get the source package version from lslpp if provided" do
@stdout = StringIO.new(@bffinfo)
@stdin, @stderr = StringIO.new, StringIO.new
- @provider.should_receive(:popen4).with("installp -L -d /tmp/samba.base").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.should_receive(:popen4).with("lslpp -lcq samba.base").and_return(@status)
+ expect(@provider).to receive(:popen4).with("installp -L -d /tmp/samba.base").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("lslpp -lcq samba.base").and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == "samba.base"
- @new_resource.version.should == "3.3.12.0"
+ expect(@provider.current_resource.package_name).to eq("samba.base")
+ expect(@new_resource.version).to eq("3.3.12.0")
end
it "should return the current version installed if found by lslpp" do
@stdout = StringIO.new(@bffinfo)
@stdin, @stderr = StringIO.new, StringIO.new
- @provider.should_receive(:popen4).with("installp -L -d /tmp/samba.base").and_return(@status)
- @provider.should_receive(:popen4).with("lslpp -lcq samba.base").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("installp -L -d /tmp/samba.base").and_return(@status)
+ expect(@provider).to receive(:popen4).with("lslpp -lcq samba.base").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.version.should == "3.3.12.0"
+ expect(@provider.current_resource.version).to eq("3.3.12.0")
end
it "should raise an exception if the source is not set but we are installing" do
@new_resource = Chef::Resource::Package.new("samba.base")
@provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
end
it "should raise an exception if installp/lslpp fails to run" do
@status = double("Status", :exitstatus => -1)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
end
it "should return a current resource with a nil version if the package is not found" do
@stdout = StringIO.new
- @provider.should_receive(:popen4).with("installp -L -d /tmp/samba.base").and_return(@status)
- @provider.should_receive(:popen4).with("lslpp -lcq samba.base").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("installp -L -d /tmp/samba.base").and_return(@status)
+ expect(@provider).to receive(:popen4).with("lslpp -lcq samba.base").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
end
describe "candidate_version" do
it "should return the candidate_version variable if already setup" do
@provider.candidate_version = "3.3.12.0"
- @provider.should_not_receive(:popen4)
+ expect(@provider).not_to receive(:popen4)
@provider.candidate_version
end
it "should lookup the candidate_version if the variable is not already set" do
@status = double("Status", :exitstatus => 0)
- @provider.should_receive(:popen4).and_return(@status)
+ expect(@provider).to receive(:popen4).and_return(@status)
@provider.candidate_version
end
it "should throw and exception if the exitstatus is not 0" do
@status = double("Status", :exitstatus => 1)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.candidate_version }.to raise_error(Chef::Exceptions::Package)
end
end
describe "install and upgrade" do
it "should run installp -aYF -d with the package source to install" do
- @provider.should_receive(:shell_out!).with("installp -aYF -d /tmp/samba.base samba.base")
+ expect(@provider).to receive(:shell_out!).with("installp -aYF -d /tmp/samba.base samba.base")
@provider.install_package("samba.base", "3.3.12.0")
end
it "should run when the package is a path to install" do
@new_resource = Chef::Resource::Package.new("/tmp/samba.base")
@provider = Chef::Provider::Package::Aix.new(@new_resource, @run_context)
- @new_resource.source.should == "/tmp/samba.base"
- @provider.should_receive(:shell_out!).with("installp -aYF -d /tmp/samba.base /tmp/samba.base")
+ expect(@new_resource.source).to eq("/tmp/samba.base")
+ expect(@provider).to receive(:shell_out!).with("installp -aYF -d /tmp/samba.base /tmp/samba.base")
@provider.install_package("/tmp/samba.base", "3.3.12.0")
end
it "should run installp with -eLogfile option." do
- @new_resource.stub(:options).and_return("-e/tmp/installp.log")
- @provider.should_receive(:shell_out!).with("installp -aYF -e/tmp/installp.log -d /tmp/samba.base samba.base")
+ allow(@new_resource).to receive(:options).and_return("-e/tmp/installp.log")
+ expect(@provider).to receive(:shell_out!).with("installp -aYF -e/tmp/installp.log -d /tmp/samba.base samba.base")
@provider.install_package("samba.base", "3.3.12.0")
end
end
describe "remove" do
it "should run installp -u samba.base to remove the package" do
- @provider.should_receive(:shell_out!).with("installp -u samba.base")
+ expect(@provider).to receive(:shell_out!).with("installp -u samba.base")
@provider.remove_package("samba.base", "3.3.12.0")
end
it "should run installp -u -e/tmp/installp.log with options -e/tmp/installp.log" do
- @new_resource.stub(:options).and_return("-e/tmp/installp.log")
- @provider.should_receive(:shell_out!).with("installp -u -e/tmp/installp.log samba.base")
+ allow(@new_resource).to receive(:options).and_return("-e/tmp/installp.log")
+ expect(@provider).to receive(:shell_out!).with("installp -u -e/tmp/installp.log samba.base")
@provider.remove_package("samba.base", "3.3.12.0")
end
diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb
index a94b248418..edca3e4c22 100644
--- a/spec/unit/provider/package/apt_spec.rb
+++ b/spec/unit/provider/package/apt_spec.rb
@@ -45,17 +45,17 @@ PKG_STATUS
describe "when loading current resource" do
it "should create a current resource with the name of the new_resource" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-cache policy #{@new_resource.package_name}",
:timeout => @timeout
).and_return(@shell_out)
@provider.load_current_resource
current_resource = @provider.current_resource
- current_resource.should be_a(Chef::Resource::Package)
- current_resource.name.should == "irssi"
- current_resource.package_name.should == "irssi"
- current_resource.version.should be_nil
+ expect(current_resource).to be_a(Chef::Resource::Package)
+ expect(current_resource.name).to eq("irssi")
+ expect(current_resource.package_name).to eq("irssi")
+ expect(current_resource.version).to be_nil
end
it "should set the installed version if package has one" do
@@ -71,10 +71,10 @@ sudo:
1.7.2p1-1ubuntu5 0
500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
INSTALLED
- @provider.should_receive(:shell_out!).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
@provider.load_current_resource
- @provider.current_resource.version.should == "1.7.2p1-1ubuntu5.3"
- @provider.candidate_version.should eql("1.7.2p1-1ubuntu5.3")
+ expect(@provider.current_resource.version).to eq("1.7.2p1-1ubuntu5.3")
+ expect(@provider.candidate_version).to eql("1.7.2p1-1ubuntu5.3")
end
# libmysqlclient-dev is a real package in newer versions of debian + ubuntu
@@ -88,7 +88,7 @@ libmysqlclient15-dev:
Version table:
VPKG_STDOUT
virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-cache policy libmysqlclient15-dev",
:timeout => @timeout
).and_return(virtual_package)
@@ -111,7 +111,7 @@ libmysqlclient-dev 5.1.41-3ubuntu12.10
libmysqlclient-dev 5.1.41-3ubuntu12
SHOWPKG_STDOUT
showpkg = double(:stdout => showpkg_out,:exitstatus => 0)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-cache showpkg libmysqlclient15-dev",
:timeout => @timeout
).and_return(showpkg)
@@ -129,7 +129,7 @@ libmysqlclient-dev:
500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
RPKG_STDOUT
real_package = double(:stdout => real_package_out,:exitstatus => 0)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-cache policy libmysqlclient-dev",
:timeout => @timeout
).and_return(real_package)
@@ -145,7 +145,7 @@ mp3-decoder:
Version table:
VPKG_STDOUT
virtual_package = double(:stdout => virtual_package_out,:exitstatus => 0)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-cache policy mp3-decoder",
:timeout => @timeout
).and_return(virtual_package)
@@ -171,20 +171,20 @@ mpg321 0.2.10.6
mpg123 1.12.1-0ubuntu1
SHOWPKG_STDOUT
showpkg = double(:stdout => showpkg_out,:exitstatus => 0)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-cache showpkg mp3-decoder",
:timeout => @timeout
).and_return(showpkg)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
end
it "should run apt-cache policy with the default_release option, if there is one and provider is explicitly defined" do
@new_resource = Chef::Resource::AptPackage.new("irssi", @run_context)
@provider = Chef::Provider::Package::Apt.new(@new_resource, @run_context)
- @new_resource.stub(:default_release).and_return("lenny-backports")
- @new_resource.stub(:provider).and_return("Chef::Provider::Package::Apt")
- @provider.should_receive(:shell_out!).with(
+ allow(@new_resource).to receive(:default_release).and_return("lenny-backports")
+ allow(@new_resource).to receive(:provider).and_return("Chef::Provider::Package::Apt")
+ expect(@provider).to receive(:shell_out!).with(
"apt-cache -o APT::Default-Release=lenny-backports policy irssi",
:timeout => @timeout
).and_return(@shell_out)
@@ -194,7 +194,7 @@ SHOWPKG_STDOUT
it "raises an exception if a source is specified (CHEF-5113)" do
@new_resource.source "pluto"
@provider.define_resource_requirements
- @provider.should_receive(:shell_out!).with("apt-cache policy irssi", {:timeout=>900}).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).with("apt-cache policy irssi", {:timeout=>900}).and_return(@shell_out)
expect { @provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
end
end
@@ -207,7 +207,7 @@ SHOWPKG_STDOUT
describe "install_package" do
it "should run apt-get install with the package name and version" do
- @provider.should_receive(:shell_out!). with(
+ expect(@provider).to receive(:shell_out!). with(
"apt-get -q -y install irssi=0.8.12-7",
:env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil},
:timeout => @timeout
@@ -216,7 +216,7 @@ SHOWPKG_STDOUT
end
it "should run apt-get install with the package name and version and options if specified" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-get -q -y --force-yes install irssi=0.8.12-7",
:env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil },
:timeout => @timeout
@@ -229,10 +229,10 @@ SHOWPKG_STDOUT
@new_resource = nil
@new_resource = Chef::Resource::AptPackage.new("irssi", @run_context)
@new_resource.default_release("lenny-backports")
-
+ @new_resource.provider = @provider
@provider.new_resource = @new_resource
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-get -q -y -o APT::Default-Release=lenny-backports install irssi=0.8.12-7",
:env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil },
:timeout => @timeout
@@ -245,7 +245,7 @@ SHOWPKG_STDOUT
describe Chef::Provider::Package::Apt, "upgrade_package" do
it "should run install_package with the name and version" do
- @provider.should_receive(:install_package).with("irssi", "0.8.12-7")
+ expect(@provider).to receive(:install_package).with("irssi", "0.8.12-7")
@provider.upgrade_package("irssi", "0.8.12-7")
end
end
@@ -253,7 +253,7 @@ SHOWPKG_STDOUT
describe Chef::Provider::Package::Apt, "remove_package" do
it "should run apt-get remove with the package name" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-get -q -y remove irssi",
:env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil},
:timeout => @timeout
@@ -262,7 +262,7 @@ SHOWPKG_STDOUT
end
it "should run apt-get remove with the package name and options if specified" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-get -q -y --force-yes remove irssi",
:env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil },
:timeout => @timeout
@@ -276,7 +276,7 @@ SHOWPKG_STDOUT
describe "when purging a package" do
it "should run apt-get purge with the package name" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-get -q -y purge irssi",
:env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil },
:timeout => @timeout
@@ -285,7 +285,7 @@ SHOWPKG_STDOUT
end
it "should run apt-get purge with the package name and options if specified" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-get -q -y --force-yes purge irssi",
:env => { "DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil },
:timeout => @timeout
@@ -298,14 +298,14 @@ SHOWPKG_STDOUT
describe "when preseeding a package" do
before(:each) do
- @provider.stub(:get_preseed_file).and_return("/tmp/irssi-0.8.12-7.seed")
+ allow(@provider).to receive(:get_preseed_file).and_return("/tmp/irssi-0.8.12-7.seed")
end
it "should get the full path to the preseed response file" do
- @provider.should_receive(:get_preseed_file).with("irssi", "0.8.12-7").and_return("/tmp/irssi-0.8.12-7.seed")
+ expect(@provider).to receive(:get_preseed_file).with("irssi", "0.8.12-7").and_return("/tmp/irssi-0.8.12-7.seed")
file = @provider.get_preseed_file("irssi", "0.8.12-7")
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"debconf-set-selections /tmp/irssi-0.8.12-7.seed",
:env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil},
:timeout => @timeout
@@ -315,7 +315,7 @@ SHOWPKG_STDOUT
end
it "should run debconf-set-selections on the preseed file if it has changed" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"debconf-set-selections /tmp/irssi-0.8.12-7.seed",
:env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil},
:timeout => @timeout
@@ -325,18 +325,18 @@ SHOWPKG_STDOUT
end
it "should not run debconf-set-selections if the preseed file has not changed" do
- @provider.stub(:check_package_state)
+ allow(@provider).to receive(:check_package_state)
@current_resource.version "0.8.11"
@new_resource.response_file "/tmp/file"
- @provider.stub(:get_preseed_file).and_return(false)
- @provider.should_not_receive(:shell_out!)
+ allow(@provider).to receive(:get_preseed_file).and_return(false)
+ expect(@provider).not_to receive(:shell_out!)
@provider.run_action(:reconfig)
end
end
describe "when reconfiguring a package" do
it "should run dpkg-reconfigure package" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"dpkg-reconfigure irssi",
:env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil },
:timeout => @timeout
@@ -348,7 +348,7 @@ SHOWPKG_STDOUT
describe "when installing a virtual package" do
it "should install the package without specifying a version" do
@provider.is_virtual_package = true
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"apt-get -q -y install libmysqlclient-dev",
:env => {"DEBIAN_FRONTEND" => "noninteractive", "LC_ALL" => nil },
:timeout => @timeout
diff --git a/spec/unit/provider/package/dpkg_spec.rb b/spec/unit/provider/package/dpkg_spec.rb
index 439a42daa3..fdd9e50c8e 100644
--- a/spec/unit/provider/package/dpkg_spec.rb
+++ b/spec/unit/provider/package/dpkg_spec.rb
@@ -33,32 +33,32 @@ describe Chef::Provider::Package::Dpkg do
@status = double("Status", :exitstatus => 0)
@stderr = StringIO.new
@pid = double("PID")
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
- ::File.stub(:exists?).and_return(true)
+ allow(::File).to receive(:exists?).and_return(true)
end
describe "when loading the current resource state" do
it "should create a current resource with the name of the new_resource" do
@provider.load_current_resource
- @provider.current_resource.package_name.should == "wget"
+ expect(@provider.current_resource.package_name).to eq("wget")
end
it "should raise an exception if a source is supplied but not found" do
@provider.load_current_resource
@provider.define_resource_requirements
- ::File.stub(:exists?).and_return(false)
- lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package)
+ allow(::File).to receive(:exists?).and_return(false)
+ expect { @provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
end
describe 'gets the source package version from dpkg-deb' do
def check_version(version)
@stdout = StringIO.new("wget\t#{version}")
- @provider.stub(:popen4).with("dpkg-deb -W #{@new_resource.source}").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).with("dpkg-deb -W #{@new_resource.source}").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == "wget"
- @new_resource.version.should == version
+ expect(@provider.current_resource.package_name).to eq("wget")
+ expect(@new_resource.version).to eq(version)
end
it 'if short version provided' do
@@ -80,9 +80,9 @@ describe Chef::Provider::Package::Dpkg do
it "gets the source package name from dpkg-deb correctly when the package name has `-', `+' or `.' characters" do
@stdout = StringIO.new("f.o.o-pkg++2\t1.11.4-1ubuntu1")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == "f.o.o-pkg++2"
+ expect(@provider.current_resource.package_name).to eq("f.o.o-pkg++2")
end
it "should raise an exception if the source is not set but we are installing" do
@@ -90,7 +90,7 @@ describe Chef::Provider::Package::Dpkg do
@provider.new_resource = @new_resource
@provider.define_resource_requirements
@provider.load_current_resource
- lambda { @provider.run_action(:install)}.should raise_error(Chef::Exceptions::Package)
+ expect { @provider.run_action(:install)}.to raise_error(Chef::Exceptions::Package)
end
it "should return the current version installed if found by dpkg" do
@@ -107,22 +107,22 @@ Config-Version: 1.11.4-1ubuntu1
Depends: libc6 (>= 2.8~20080505), libssl0.9.8 (>= 0.9.8f-5)
Conflicts: wget-ssl
DPKG_S
- @provider.stub(:popen4).with("dpkg -s wget").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).with("dpkg -s wget").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.version.should == "1.11.4-1ubuntu1"
+ expect(@provider.current_resource.version).to eq("1.11.4-1ubuntu1")
end
it "should raise an exception if dpkg fails to run" do
@status = double("Status", :exitstatus => -1)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
end
end
describe Chef::Provider::Package::Dpkg, "install and upgrade" do
it "should run dpkg -i with the package source" do
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -i /tmp/wget_1.11.4-1ubuntu1_amd64.deb"
)
@provider.install_package("wget", "1.11.4-1ubuntu1")
@@ -131,7 +131,7 @@ DPKG_S
it "should run dpkg -i if the package is a path and the source is nil" do
@new_resource = Chef::Resource::Package.new("/tmp/wget_1.11.4-1ubuntu1_amd64.deb")
@provider = Chef::Provider::Package::Dpkg.new(@new_resource, @run_context)
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -i /tmp/wget_1.11.4-1ubuntu1_amd64.deb"
)
@provider.install_package("/tmp/wget_1.11.4-1ubuntu1_amd64.deb", "1.11.4-1ubuntu1")
@@ -140,55 +140,55 @@ DPKG_S
it "should run dpkg -i if the package is a path and the source is nil for an upgrade" do
@new_resource = Chef::Resource::Package.new("/tmp/wget_1.11.4-1ubuntu1_amd64.deb")
@provider = Chef::Provider::Package::Dpkg.new(@new_resource, @run_context)
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -i /tmp/wget_1.11.4-1ubuntu1_amd64.deb"
)
@provider.upgrade_package("/tmp/wget_1.11.4-1ubuntu1_amd64.deb", "1.11.4-1ubuntu1")
end
it "should run dpkg -i with the package source and options if specified" do
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -i --force-yes /tmp/wget_1.11.4-1ubuntu1_amd64.deb"
)
- @new_resource.stub(:options).and_return("--force-yes")
+ allow(@new_resource).to receive(:options).and_return("--force-yes")
@provider.install_package("wget", "1.11.4-1ubuntu1")
end
it "should upgrade by running install_package" do
- @provider.should_receive(:install_package).with("wget", "1.11.4-1ubuntu1")
+ expect(@provider).to receive(:install_package).with("wget", "1.11.4-1ubuntu1")
@provider.upgrade_package("wget", "1.11.4-1ubuntu1")
end
end
describe Chef::Provider::Package::Dpkg, "remove and purge" do
it "should run dpkg -r to remove the package" do
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -r wget"
)
@provider.remove_package("wget", "1.11.4-1ubuntu1")
end
it "should run dpkg -r to remove the package with options if specified" do
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -r --force-yes wget"
)
- @new_resource.stub(:options).and_return("--force-yes")
+ allow(@new_resource).to receive(:options).and_return("--force-yes")
@provider.remove_package("wget", "1.11.4-1ubuntu1")
end
it "should run dpkg -P to purge the package" do
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -P wget"
)
@provider.purge_package("wget", "1.11.4-1ubuntu1")
end
it "should run dpkg -P to purge the package with options if specified" do
- @provider.should_receive(:run_noninteractive).with(
+ expect(@provider).to receive(:run_noninteractive).with(
"dpkg -P --force-yes wget"
)
- @new_resource.stub(:options).and_return("--force-yes")
+ allow(@new_resource).to receive(:options).and_return("--force-yes")
@provider.purge_package("wget", "1.11.4-1ubuntu1")
end
diff --git a/spec/unit/provider/package/easy_install_spec.rb b/spec/unit/provider/package/easy_install_spec.rb
index 87cbabcc19..221ec8fdfc 100644
--- a/spec/unit/provider/package/easy_install_spec.rb
+++ b/spec/unit/provider/package/easy_install_spec.rb
@@ -30,79 +30,79 @@ describe Chef::Provider::Package::EasyInstall do
@current_resource.version('1.8d')
@provider = Chef::Provider::Package::EasyInstall.new(@new_resource, @run_context)
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@stdin = StringIO.new
@stdout = StringIO.new
@status = double("Status", :exitstatus => 0)
@stderr = StringIO.new
@pid = 2342
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
end
describe "easy_install_binary_path" do
it "should return a Chef::Provider::EasyInstall object" do
provider = Chef::Provider::Package::EasyInstall.new(@node, @new_resource)
- provider.should be_a_kind_of(Chef::Provider::Package::EasyInstall)
+ expect(provider).to be_a_kind_of(Chef::Provider::Package::EasyInstall)
end
it "should set the current resources package name to the new resources package name" do
- $stdout.stub(:write)
- @current_resource.should_receive(:package_name).with(@new_resource.package_name)
+ allow($stdout).to receive(:write)
+ expect(@current_resource).to receive(:package_name).with(@new_resource.package_name)
@provider.load_current_resource
end
it "should return a relative path to easy_install if no easy_install_binary is given" do
- @provider.easy_install_binary_path.should eql("easy_install")
+ expect(@provider.easy_install_binary_path).to eql("easy_install")
end
it "should return a specific path to easy_install if a easy_install_binary is given" do
- @new_resource.should_receive(:easy_install_binary).and_return("/opt/local/bin/custom/easy_install")
- @provider.easy_install_binary_path.should eql("/opt/local/bin/custom/easy_install")
+ expect(@new_resource).to receive(:easy_install_binary).and_return("/opt/local/bin/custom/easy_install")
+ expect(@provider.easy_install_binary_path).to eql("/opt/local/bin/custom/easy_install")
end
end
describe "actions_on_package" do
it "should run easy_install with the package name and version" do
- @provider.should_receive(:run_command).with({
+ expect(@provider).to receive(:run_command).with({
:command => "easy_install \"boto==1.8d\""
})
@provider.install_package("boto", "1.8d")
end
it "should run easy_install with the package name and version and specified options" do
- @provider.should_receive(:run_command).with({
+ expect(@provider).to receive(:run_command).with({
:command => "easy_install --always-unzip \"boto==1.8d\""
})
- @new_resource.stub(:options).and_return("--always-unzip")
+ allow(@new_resource).to receive(:options).and_return("--always-unzip")
@provider.install_package("boto", "1.8d")
end
it "should run easy_install with the package name and version" do
- @provider.should_receive(:run_command).with({
+ expect(@provider).to receive(:run_command).with({
:command => "easy_install \"boto==1.8d\""
})
@provider.upgrade_package("boto", "1.8d")
end
it "should run easy_install -m with the package name and version" do
- @provider.should_receive(:run_command).with({
+ expect(@provider).to receive(:run_command).with({
:command => "easy_install -m boto"
})
@provider.remove_package("boto", "1.8d")
end
it "should run easy_install -m with the package name and version and specified options" do
- @provider.should_receive(:run_command).with({
+ expect(@provider).to receive(:run_command).with({
:command => "easy_install -x -m boto"
})
- @new_resource.stub(:options).and_return("-x")
+ allow(@new_resource).to receive(:options).and_return("-x")
@provider.remove_package("boto", "1.8d")
end
it "should run easy_install -m with the package name and version" do
- @provider.should_receive(:run_command).with({
+ expect(@provider).to receive(:run_command).with({
:command => "easy_install -m boto"
})
@provider.purge_package("boto", "1.8d")
diff --git a/spec/unit/provider/package/freebsd/pkg_spec.rb b/spec/unit/provider/package/freebsd/pkg_spec.rb
index 9b2493a4c5..f67161930f 100644
--- a/spec/unit/provider/package/freebsd/pkg_spec.rb
+++ b/spec/unit/provider/package/freebsd/pkg_spec.rb
@@ -30,35 +30,35 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
@provider = Chef::Provider::Package::Freebsd::Pkg.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- ::File.stub(:exist?).with('/usr/ports/Makefile').and_return(false)
+ allow(::File).to receive(:exist?).with('/usr/ports/Makefile').and_return(false)
end
describe "when determining the current package state" do
before do
- @provider.stub(:ports_candidate_version).and_return("4.3.6")
+ allow(@provider).to receive(:ports_candidate_version).and_return("4.3.6")
end
it "should create a current resource with the name of the new_resource" do
current_resource = Chef::Provider::Package::Freebsd::Pkg.new(@new_resource, @run_context).current_resource
- current_resource.name.should == "zsh"
+ expect(current_resource.name).to eq("zsh")
end
it "should return a version if the package is installed" do
- @provider.should_receive(:current_installed_version).and_return("4.3.6_7")
+ expect(@provider).to receive(:current_installed_version).and_return("4.3.6_7")
@provider.load_current_resource
- @current_resource.version.should == "4.3.6_7"
+ expect(@current_resource.version).to eq("4.3.6_7")
end
it "should return nil if the package is not installed" do
- @provider.should_receive(:current_installed_version).and_return(nil)
+ expect(@provider).to receive(:current_installed_version).and_return(nil)
@provider.load_current_resource
- @current_resource.version.should be_nil
+ expect(@current_resource.version).to be_nil
end
it "should return a candidate version if it exists" do
- @provider.should_receive(:current_installed_version).and_return(nil)
+ expect(@provider).to receive(:current_installed_version).and_return(nil)
@provider.load_current_resource
- @provider.candidate_version.should eql("4.3.6")
+ expect(@provider.candidate_version).to eql("4.3.6")
end
end
@@ -77,42 +77,42 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
it "should return the version number when it is installed" do
pkg_info = OpenStruct.new(:stdout => "zsh-4.3.6_7")
- @provider.should_receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(pkg_info)
+ expect(@provider).to receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(pkg_info)
#@provider.should_receive(:popen4).with('pkg_info -E "zsh*"').and_yield(@pid, @stdin, ["zsh-4.3.6_7"], @stderr).and_return(@status)
- @provider.stub(:package_name).and_return("zsh")
- @provider.current_installed_version.should == "4.3.6_7"
+ allow(@provider).to receive(:package_name).and_return("zsh")
+ expect(@provider.current_installed_version).to eq("4.3.6_7")
end
it "does not set the current version number when the package is not installed" do
pkg_info = OpenStruct.new(:stdout => "")
- @provider.should_receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(pkg_info)
- @provider.stub(:package_name).and_return("zsh")
- @provider.current_installed_version.should be_nil
+ expect(@provider).to receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(pkg_info)
+ allow(@provider).to receive(:package_name).and_return("zsh")
+ expect(@provider.current_installed_version).to be_nil
end
it "should return the port path for a valid port name" do
whereis = OpenStruct.new(:stdout => "zsh: /usr/ports/shells/zsh")
- @provider.should_receive(:shell_out!).with("whereis -s zsh", :env => nil).and_return(whereis)
+ expect(@provider).to receive(:shell_out!).with("whereis -s zsh", :env => nil).and_return(whereis)
#@provider.should_receive(:popen4).with("whereis -s zsh").and_yield(@pid, @stdin, ["zsh: /usr/ports/shells/zsh"], @stderr).and_return(@status)
- @provider.stub(:port_name).and_return("zsh")
- @provider.port_path.should == "/usr/ports/shells/zsh"
+ allow(@provider).to receive(:port_name).and_return("zsh")
+ expect(@provider.port_path).to eq("/usr/ports/shells/zsh")
end
# Not happy with the form of these tests as they are far too closely tied to the implementation and so very fragile.
it "should return the ports candidate version when given a valid port path" do
- @provider.stub(:port_path).and_return("/usr/ports/shells/zsh")
+ allow(@provider).to receive(:port_path).and_return("/usr/ports/shells/zsh")
make_v = OpenStruct.new(:stdout => "4.3.6\n", :exitstatus => 0)
- @provider.should_receive(:shell_out!).with("make -V PORTVERSION", {:cwd=>"/usr/ports/shells/zsh", :returns=>[0, 1], :env=>nil}).and_return(make_v)
- @provider.ports_candidate_version.should == "4.3.6"
+ expect(@provider).to receive(:shell_out!).with("make -V PORTVERSION", {:cwd=>"/usr/ports/shells/zsh", :returns=>[0, 1], :env=>nil}).and_return(make_v)
+ expect(@provider.ports_candidate_version).to eq("4.3.6")
end
it "should figure out the package name when we have ports" do
- ::File.stub(:exist?).with('/usr/ports/Makefile').and_return(true)
- @provider.stub(:port_path).and_return("/usr/ports/shells/zsh")
+ allow(::File).to receive(:exist?).with('/usr/ports/Makefile').and_return(true)
+ allow(@provider).to receive(:port_path).and_return("/usr/ports/shells/zsh")
make_v = OpenStruct.new(:stdout => "zsh-4.3.6_7\n", :exitstatus => 0)
- @provider.should_receive(:shell_out!).with("make -V PKGNAME", {:cwd=>"/usr/ports/shells/zsh", :env=>nil, :returns=>[0, 1]}).and_return(make_v)
+ expect(@provider).to receive(:shell_out!).with("make -V PKGNAME", {:cwd=>"/usr/ports/shells/zsh", :env=>nil, :returns=>[0, 1]}).and_return(make_v)
#@provider.should_receive(:ports_makefile_variable_value).with("PKGNAME").and_return("zsh-4.3.6_7")
- @provider.package_name.should == "zsh"
+ expect(@provider.package_name).to eq("zsh")
end
end
@@ -121,13 +121,13 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
@cmd_result = OpenStruct.new(:status => true)
@provider.current_resource = @current_resource
- @provider.stub(:package_name).and_return("zsh")
- @provider.stub(:latest_link_name).and_return("zsh")
- @provider.stub(:port_path).and_return("/usr/ports/shells/zsh")
+ allow(@provider).to receive(:package_name).and_return("zsh")
+ allow(@provider).to receive(:latest_link_name).and_return("zsh")
+ allow(@provider).to receive(:port_path).and_return("/usr/ports/shells/zsh")
end
it "should run pkg_add -r with the package name" do
- @provider.should_receive(:shell_out!).with("pkg_add -r zsh", :env => nil).and_return(@cmd_result)
+ expect(@provider).to receive(:shell_out!).with("pkg_add -r zsh", :env => nil).and_return(@cmd_result)
@provider.install_package("zsh", "4.3.6_7")
end
end
@@ -142,15 +142,15 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
it "should figure out the port path from the package_name using whereis" do
whereis = OpenStruct.new(:stdout => "zsh: /usr/ports/shells/zsh")
- @provider.should_receive(:shell_out!).with("whereis -s zsh", :env=>nil).and_return(whereis)
- @provider.port_path.should == "/usr/ports/shells/zsh"
+ expect(@provider).to receive(:shell_out!).with("whereis -s zsh", :env=>nil).and_return(whereis)
+ expect(@provider.port_path).to eq("/usr/ports/shells/zsh")
end
it "should use the package_name as the port path when it starts with /" do
new_resource = Chef::Resource::Package.new("/usr/ports/www/wordpress")
provider = Chef::Provider::Package::Freebsd::Pkg.new(new_resource, @run_context)
- provider.should_not_receive(:popen4)
- provider.port_path.should == "/usr/ports/www/wordpress"
+ expect(provider).not_to receive(:popen4)
+ expect(provider.port_path).to eq("/usr/ports/www/wordpress")
end
it "should use the package_name as a relative path from /usr/ports when it contains / but doesn't start with it" do
@@ -159,8 +159,8 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
# :cookbook_name => "xenoparadox")
new_resource = Chef::Resource::Package.new("www/wordpress")
provider = Chef::Provider::Package::Freebsd::Pkg.new(new_resource, @run_context)
- provider.should_not_receive(:popen4)
- provider.port_path.should == "/usr/ports/www/wordpress"
+ expect(provider).not_to receive(:popen4)
+ expect(provider.port_path).to eq("/usr/ports/www/wordpress")
end
end
@@ -170,15 +170,15 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
@current_resource = Chef::Resource::Package.new("ruby-iconv")
@provider = Chef::Provider::Package::Freebsd::Pkg.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @provider.stub(:port_path).and_return("/usr/ports/converters/ruby-iconv")
- @provider.stub(:package_name).and_return("ruby18-iconv")
- @provider.stub(:latest_link_name).and_return("ruby18-iconv")
+ allow(@provider).to receive(:port_path).and_return("/usr/ports/converters/ruby-iconv")
+ allow(@provider).to receive(:package_name).and_return("ruby18-iconv")
+ allow(@provider).to receive(:latest_link_name).and_return("ruby18-iconv")
@install_result = OpenStruct.new(:status => true)
end
it "should run pkg_add -r with the package name" do
- @provider.should_receive(:shell_out!).with("pkg_add -r ruby18-iconv", :env => nil).and_return(@install_result)
+ expect(@provider).to receive(:shell_out!).with("pkg_add -r ruby18-iconv", :env => nil).and_return(@install_result)
@provider.install_package("ruby-iconv", "1.0")
end
end
@@ -189,11 +189,11 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
@new_resource.version "4.3.6_7"
@current_resource.version "4.3.6_7"
@provider.current_resource = @current_resource
- @provider.stub(:package_name).and_return("zsh")
+ allow(@provider).to receive(:package_name).and_return("zsh")
end
it "should run pkg_delete with the package name and version" do
- @provider.should_receive(:shell_out!).with("pkg_delete zsh-4.3.6_7", :env => nil).and_return(@pkg_delete)
+ expect(@provider).to receive(:shell_out!).with("pkg_delete zsh-4.3.6_7", :env => nil).and_return(@pkg_delete)
@provider.remove_package("zsh", "4.3.6_7")
end
end
@@ -213,16 +213,16 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
it "should return the port path for a valid port name" do
whereis = OpenStruct.new(:stdout => "bonnie++: /usr/ports/benchmarks/bonnie++")
- @provider.should_receive(:shell_out!).with("whereis -s bonnie++", :env => nil).and_return(whereis)
- @provider.stub(:port_name).and_return("bonnie++")
- @provider.port_path.should == "/usr/ports/benchmarks/bonnie++"
+ expect(@provider).to receive(:shell_out!).with("whereis -s bonnie++", :env => nil).and_return(whereis)
+ allow(@provider).to receive(:port_name).and_return("bonnie++")
+ expect(@provider.port_path).to eq("/usr/ports/benchmarks/bonnie++")
end
it "should return the version number when it is installed" do
pkg_info = OpenStruct.new(:stdout => "bonnie++-1.96")
- @provider.should_receive(:shell_out!).with('pkg_info -E "bonnie++*"', :env => nil, :returns => [0,1]).and_return(pkg_info)
- @provider.stub(:package_name).and_return("bonnie++")
- @provider.current_installed_version.should == "1.96"
+ expect(@provider).to receive(:shell_out!).with('pkg_info -E "bonnie++*"', :env => nil, :returns => [0,1]).and_return(pkg_info)
+ allow(@provider).to receive(:package_name).and_return("bonnie++")
+ expect(@provider.current_installed_version).to eq("1.96")
end
end
@@ -249,11 +249,11 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
@current_resource = Chef::Resource::Package.new("perl5.8")
@provider = Chef::Provider::Package::Freebsd::Pkg.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @provider.stub(:package_name).and_return("perl")
- @provider.stub(:latest_link_name).and_return("perl")
+ allow(@provider).to receive(:package_name).and_return("perl")
+ allow(@provider).to receive(:latest_link_name).and_return("perl")
cmd = OpenStruct.new(:status => true)
- @provider.should_receive(:shell_out!).with("pkg_add -r perl", :env => nil).and_return(cmd)
+ expect(@provider).to receive(:shell_out!).with("pkg_add -r perl", :env => nil).and_return(cmd)
@provider.install_package("perl5.8", "5.8.8_1")
end
@@ -263,11 +263,11 @@ describe Chef::Provider::Package::Freebsd::Pkg, "load_current_resource" do
@current_resource = Chef::Resource::Package.new("mysql50-server")
@provider = Chef::Provider::Package::Freebsd::Pkg.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @provider.stub(:package_name).and_return("mysql-server")
- @provider.stub(:latest_link_name).and_return("mysql50-server")
+ allow(@provider).to receive(:package_name).and_return("mysql-server")
+ allow(@provider).to receive(:latest_link_name).and_return("mysql50-server")
cmd = OpenStruct.new(:status => true)
- @provider.should_receive(:shell_out!).with("pkg_add -r mysql50-server", :env=>nil).and_return(cmd)
+ expect(@provider).to receive(:shell_out!).with("pkg_add -r mysql50-server", :env=>nil).and_return(cmd)
@provider.install_package("mysql50-server", "5.0.45_1")
end
end
diff --git a/spec/unit/provider/package/freebsd/pkgng_spec.rb b/spec/unit/provider/package/freebsd/pkgng_spec.rb
index c3837a251b..0c1e89c7ab 100644
--- a/spec/unit/provider/package/freebsd/pkgng_spec.rb
+++ b/spec/unit/provider/package/freebsd/pkgng_spec.rb
@@ -33,46 +33,46 @@ describe Chef::Provider::Package::Freebsd::Port do
describe "initialization" do
it "should create a current resource with the name of the new resource" do
- @provider.current_resource.is_a?(Chef::Resource::Package).should be_true
- @provider.current_resource.name.should == 'zsh'
+ expect(@provider.current_resource.is_a?(Chef::Resource::Package)).to be_truthy
+ expect(@provider.current_resource.name).to eq('zsh')
end
end
describe "loading current resource" do
before(:each) do
- @provider.stub(:current_installed_version)
- @provider.stub(:candidate_version)
+ allow(@provider).to receive(:current_installed_version)
+ allow(@provider).to receive(:candidate_version)
end
it "should set the package name" do
@provider.load_current_resource
- @provider.current_resource.package_name.should == "zsh"
+ expect(@provider.current_resource.package_name).to eq("zsh")
end
it "should set the current version" do
- @provider.should_receive(:current_installed_version).and_return("5.0.2")
+ expect(@provider).to receive(:current_installed_version).and_return("5.0.2")
@provider.load_current_resource
- @provider.current_resource.version.should == "5.0.2"
+ expect(@provider.current_resource.version).to eq("5.0.2")
end
it "should set the candidate version" do
- @provider.should_receive(:candidate_version).and_return("5.0.5")
+ expect(@provider).to receive(:candidate_version).and_return("5.0.5")
@provider.load_current_resource
- @provider.instance_variable_get(:"@candidate_version").should == "5.0.5"
+ expect(@provider.instance_variable_get(:"@candidate_version")).to eq("5.0.5")
end
end
describe "determining current installed version" do
before(:each) do
- @provider.stub(:supports_pkgng?)
+ allow(@provider).to receive(:supports_pkgng?)
@pkg_info = OpenStruct.new(:stdout => "zsh-3.1.7\nVersion : 3.1.7\n")
end
it "should query pkg database" do
- @provider.should_receive(:shell_out!).with('pkg info "zsh"', :env => nil, :returns => [0,70]).and_return(@pkg_info)
- @provider.current_installed_version.should == "3.1.7"
+ expect(@provider).to receive(:shell_out!).with('pkg info "zsh"', :env => nil, :returns => [0,70]).and_return(@pkg_info)
+ expect(@provider.current_installed_version).to eq("3.1.7")
end
end
@@ -80,20 +80,20 @@ describe Chef::Provider::Package::Freebsd::Port do
describe "determining candidate version" do
it "should query repository" do
pkg_query = OpenStruct.new(:stdout => "5.0.5\n", :exitstatus => 0)
- @provider.should_receive(:shell_out!).with("pkg rquery '%v' zsh", :env => nil).and_return(pkg_query)
- @provider.candidate_version.should == "5.0.5"
+ expect(@provider).to receive(:shell_out!).with("pkg rquery '%v' zsh", :env => nil).and_return(pkg_query)
+ expect(@provider.candidate_version).to eq("5.0.5")
end
it "should query specified repository when given option" do
@provider.new_resource.options('-r LocalMirror') # This requires LocalMirror repo configuration.
pkg_query = OpenStruct.new(:stdout => "5.0.3\n", :exitstatus => 0)
- @provider.should_receive(:shell_out!).with("pkg rquery -r LocalMirror '%v' zsh", :env => nil).and_return(pkg_query)
- @provider.candidate_version.should == "5.0.3"
+ expect(@provider).to receive(:shell_out!).with("pkg rquery -r LocalMirror '%v' zsh", :env => nil).and_return(pkg_query)
+ expect(@provider.candidate_version).to eq("5.0.3")
end
it "should return candidate version from file when given a file" do
@provider.new_resource.source("/nas/pkg/repo/zsh-5.0.1.txz")
- @provider.candidate_version.should == "5.0.1"
+ expect(@provider.candidate_version).to eq("5.0.1")
end
end
@@ -105,7 +105,7 @@ describe Chef::Provider::Package::Freebsd::Port do
it "should handle package source from file" do
@provider.new_resource.source("/nas/pkg/repo/zsh-5.0.1.txz")
- @provider.should_receive(:shell_out!).
+ expect(@provider).to receive(:shell_out!).
with("pkg add /nas/pkg/repo/zsh-5.0.1.txz", :env => { 'LC_ALL' => nil }).
and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
@@ -113,21 +113,21 @@ describe Chef::Provider::Package::Freebsd::Port do
it "should handle package source over ftp or http" do
@provider.new_resource.source("http://repo.example.com/zsh-5.0.1.txz")
- @provider.should_receive(:shell_out!).
+ expect(@provider).to receive(:shell_out!).
with("pkg add http://repo.example.com/zsh-5.0.1.txz", :env => { 'LC_ALL' => nil }).
and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
end
it "should handle a package name" do
- @provider.should_receive(:shell_out!).
+ expect(@provider).to receive(:shell_out!).
with("pkg install -y zsh", :env => { 'LC_ALL' => nil }).and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
end
it "should handle a package name with a specified repo" do
@provider.new_resource.options('-r LocalMirror') # This requires LocalMirror repo configuration.
- @provider.should_receive(:shell_out!).
+ expect(@provider).to receive(:shell_out!).
with("pkg install -y -r LocalMirror zsh", :env => { 'LC_ALL' => nil }).and_return(@install_result)
@provider.install_package("zsh", "5.0.1")
end
@@ -140,14 +140,14 @@ describe Chef::Provider::Package::Freebsd::Port do
end
it "should call pkg delete" do
- @provider.should_receive(:shell_out!).
+ expect(@provider).to receive(:shell_out!).
with("pkg delete -y zsh-5.0.1", :env => nil).and_return(@install_result)
@provider.remove_package("zsh", "5.0.1")
end
it "should not include repo option in pkg delete" do
@provider.new_resource.options('-r LocalMirror') # This requires LocalMirror repo configuration.
- @provider.should_receive(:shell_out!).
+ expect(@provider).to receive(:shell_out!).
with("pkg delete -y zsh-5.0.1", :env => nil).and_return(@install_result)
@provider.remove_package("zsh", "5.0.1")
end
diff --git a/spec/unit/provider/package/freebsd/port_spec.rb b/spec/unit/provider/package/freebsd/port_spec.rb
index 8725e5440f..2e32e88f97 100644
--- a/spec/unit/provider/package/freebsd/port_spec.rb
+++ b/spec/unit/provider/package/freebsd/port_spec.rb
@@ -33,33 +33,33 @@ describe Chef::Provider::Package::Freebsd::Port do
describe "initialization" do
it "should create a current resource with the name of the new resource" do
- @provider.current_resource.is_a?(Chef::Resource::Package).should be_true
- @provider.current_resource.name.should == 'zsh'
+ expect(@provider.current_resource.is_a?(Chef::Resource::Package)).to be_truthy
+ expect(@provider.current_resource.name).to eq('zsh')
end
end
describe "loading current resource" do
before(:each) do
- @provider.stub(:current_installed_version)
- @provider.stub(:candidate_version)
+ allow(@provider).to receive(:current_installed_version)
+ allow(@provider).to receive(:candidate_version)
end
it "should set the package name" do
@provider.load_current_resource
- @provider.current_resource.package_name.should == "zsh"
+ expect(@provider.current_resource.package_name).to eq("zsh")
end
it "should set the current version" do
- @provider.should_receive(:current_installed_version).and_return("5.0.2")
+ expect(@provider).to receive(:current_installed_version).and_return("5.0.2")
@provider.load_current_resource
- @provider.current_resource.version.should == "5.0.2"
+ expect(@provider.current_resource.version).to eq("5.0.2")
end
it "should set the candidate version" do
- @provider.should_receive(:candidate_version).and_return("5.0.5")
+ expect(@provider).to receive(:candidate_version).and_return("5.0.5")
@provider.load_current_resource
- @provider.instance_variable_get(:"@candidate_version").should == "5.0.5"
+ expect(@provider.instance_variable_get(:"@candidate_version")).to eq("5.0.5")
end
end
@@ -70,27 +70,27 @@ describe Chef::Provider::Package::Freebsd::Port do
end
it "should check 'pkg_info' if system uses pkg_* tools" do
- @new_resource.stub(:supports_pkgng?)
- @new_resource.should_receive(:supports_pkgng?).and_return(false)
- @provider.should_receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(@pkg_info)
- @provider.current_installed_version.should == "3.1.7"
+ allow(@new_resource).to receive(:supports_pkgng?)
+ expect(@new_resource).to receive(:supports_pkgng?).and_return(false)
+ expect(@provider).to receive(:shell_out!).with('pkg_info -E "zsh*"', :env => nil, :returns => [0,1]).and_return(@pkg_info)
+ expect(@provider.current_installed_version).to eq("3.1.7")
end
it "should check 'pkg info' if make supports WITH_PKGNG if freebsd version is < 1000017" do
pkg_enabled = OpenStruct.new(:stdout => "yes\n")
[1000016, 1000000, 901503, 902506, 802511].each do |__freebsd_version|
@node.automatic_attrs[:os_version] = __freebsd_version
- @new_resource.should_receive(:shell_out!).with('make -V WITH_PKGNG', :env => nil).and_return(pkg_enabled)
- @provider.should_receive(:shell_out!).with('pkg info "zsh"', :env => nil, :returns => [0,70]).and_return(@pkg_info)
- @provider.current_installed_version.should == "3.1.7"
+ expect(@new_resource).to receive(:shell_out!).with('make -V WITH_PKGNG', :env => nil).and_return(pkg_enabled)
+ expect(@provider).to receive(:shell_out!).with('pkg info "zsh"', :env => nil, :returns => [0,70]).and_return(@pkg_info)
+ expect(@provider.current_installed_version).to eq("3.1.7")
end
end
it "should check 'pkg info' if the freebsd version is greater than or equal to 1000017" do
__freebsd_version = 1000017
@node.automatic_attrs[:os_version] = __freebsd_version
- @provider.should_receive(:shell_out!).with('pkg info "zsh"', :env => nil, :returns => [0,70]).and_return(@pkg_info)
- @provider.current_installed_version.should == "3.1.7"
+ expect(@provider).to receive(:shell_out!).with('pkg info "zsh"', :env => nil, :returns => [0,70]).and_return(@pkg_info)
+ expect(@provider.current_installed_version).to eq("3.1.7")
end
end
@@ -100,15 +100,15 @@ describe Chef::Provider::Package::Freebsd::Port do
end
it "should return candidate version if port exists" do
- ::File.stub(:exist?).with('/usr/ports/Makefile').and_return(true)
- @provider.stub(:port_dir).and_return('/usr/ports/shells/zsh')
- @provider.should_receive(:shell_out!).with("make -V PORTVERSION", :cwd => "/usr/ports/shells/zsh", :env => nil, :returns => [0,1]).
+ allow(::File).to receive(:exist?).with('/usr/ports/Makefile').and_return(true)
+ allow(@provider).to receive(:port_dir).and_return('/usr/ports/shells/zsh')
+ expect(@provider).to receive(:shell_out!).with("make -V PORTVERSION", :cwd => "/usr/ports/shells/zsh", :env => nil, :returns => [0,1]).
and_return(@port_version)
- @provider.candidate_version.should == "5.0.5"
+ expect(@provider.candidate_version).to eq("5.0.5")
end
it "should raise exception if ports tree not found" do
- ::File.stub(:exist?).with('/usr/ports/Makefile').and_return(false)
+ allow(::File).to receive(:exist?).with('/usr/ports/Makefile').and_return(false)
expect { @provider.candidate_version }.to raise_error(Chef::Exceptions::Package, "Ports collection could not be found")
end
end
@@ -116,24 +116,24 @@ describe Chef::Provider::Package::Freebsd::Port do
describe "determining port directory" do
it "should return name if package name is absolute path" do
- @provider.new_resource.stub(:package_name).and_return("/var/ports/shells/zsh")
- @provider.port_dir.should == "/var/ports/shells/zsh"
+ allow(@provider.new_resource).to receive(:package_name).and_return("/var/ports/shells/zsh")
+ expect(@provider.port_dir).to eq("/var/ports/shells/zsh")
end
it "should return full ports path given package name and category" do
- @provider.new_resource.stub(:package_name).and_return("shells/zsh")
- @provider.port_dir.should == "/usr/ports/shells/zsh"
+ allow(@provider.new_resource).to receive(:package_name).and_return("shells/zsh")
+ expect(@provider.port_dir).to eq("/usr/ports/shells/zsh")
end
it "should query system for path given just a name" do
whereis = OpenStruct.new(:stdout => "zsh: /usr/ports/shells/zsh\n")
- @provider.should_receive(:shell_out!).with("whereis -s zsh", :env => nil).and_return(whereis)
- @provider.port_dir.should == "/usr/ports/shells/zsh"
+ expect(@provider).to receive(:shell_out!).with("whereis -s zsh", :env => nil).and_return(whereis)
+ expect(@provider.port_dir).to eq("/usr/ports/shells/zsh")
end
it "should raise exception if not found" do
whereis = OpenStruct.new(:stdout => "zsh:\n")
- @provider.should_receive(:shell_out!).with("whereis -s zsh", :env => nil).and_return(whereis)
+ expect(@provider).to receive(:shell_out!).with("whereis -s zsh", :env => nil).and_return(whereis)
expect { @provider.port_dir }.to raise_error(Chef::Exceptions::Package, "Could not find port with the name zsh")
end
end
@@ -145,8 +145,8 @@ describe Chef::Provider::Package::Freebsd::Port do
end
it "should run make install in port directory" do
- @provider.stub(:port_dir).and_return("/usr/ports/shells/zsh")
- @provider.should_receive(:shell_out!).
+ allow(@provider).to receive(:port_dir).and_return("/usr/ports/shells/zsh")
+ expect(@provider).to receive(:shell_out!).
with("make -DBATCH install clean", :timeout => 1800, :cwd => "/usr/ports/shells/zsh", :env => nil).
and_return(@install_result)
@provider.install_package("zsh", "5.0.5")
@@ -160,8 +160,8 @@ describe Chef::Provider::Package::Freebsd::Port do
end
it "should run make deinstall in port directory" do
- @provider.stub(:port_dir).and_return("/usr/ports/shells/zsh")
- @provider.should_receive(:shell_out!).
+ allow(@provider).to receive(:port_dir).and_return("/usr/ports/shells/zsh")
+ expect(@provider).to receive(:shell_out!).
with("make deinstall", :timeout => 300, :cwd => "/usr/ports/shells/zsh", :env => nil).
and_return(@install_result)
@provider.remove_package("zsh", "5.0.5")
diff --git a/spec/unit/provider/package/ips_spec.rb b/spec/unit/provider/package/ips_spec.rb
index 07bca7f6d5..4e0afc46e9 100644
--- a/spec/unit/provider/package/ips_spec.rb
+++ b/spec/unit/provider/package/ips_spec.rb
@@ -28,7 +28,7 @@ describe Chef::Provider::Package::Ips do
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Package.new("crypto/gnupg", @run_context)
@current_resource = Chef::Resource::Package.new("crypto/gnupg", @run_context)
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider = Chef::Provider::Package::Ips.new(@new_resource, @run_context)
end
@@ -65,30 +65,30 @@ PKG_STATUS
context "when loading current resource" do
it "should create a current resource with the name of the new_resource" do
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
- Chef::Resource::Package.should_receive(:new).and_return(@current_resource)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
+ expect(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resources package name to the new resources package name" do
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
@provider.load_current_resource
- @current_resource.package_name.should == @new_resource.package_name
+ expect(@current_resource.package_name).to eq(@new_resource.package_name)
end
it "should run pkg info with the package name" do
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
@provider.load_current_resource
end
it "should set the installed version to nil on the current resource if package state is not installed" do
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
@provider.load_current_resource
- @current_resource.version.should be_nil
+ expect(@current_resource.version).to be_nil
end
it "should set the installed version if package has one" do
@@ -108,28 +108,28 @@ Packaging Date: October 19, 2011 09:14:50 AM
Size: 8.07 MB
FMRI: pkg://solaris/crypto/gnupg@2.0.17,5.11-0.175.0.0.0.2.537:20111019T091450Z
INSTALLED
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
@provider.load_current_resource
- @current_resource.version.should == "2.0.17"
+ expect(@current_resource.version).to eq("2.0.17")
end
it "should return the current resource" do
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote_output)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
end
context "when installing a package" do
it "should run pkg install with the package name and version" do
- @provider.should_receive(:shell_out).with("pkg install -q crypto/gnupg@2.0.17")
+ expect(@provider).to receive(:shell_out).with("pkg install -q crypto/gnupg@2.0.17")
@provider.install_package("crypto/gnupg", "2.0.17")
end
it "should run pkg install with the package name and version and options if specified" do
- @provider.should_receive(:shell_out).with("pkg --no-refresh install -q crypto/gnupg@2.0.17")
- @new_resource.stub(:options).and_return("--no-refresh")
+ expect(@provider).to receive(:shell_out).with("pkg --no-refresh install -q crypto/gnupg@2.0.17")
+ allow(@new_resource).to receive(:options).and_return("--no-refresh")
@provider.install_package("crypto/gnupg", "2.0.17")
end
@@ -147,11 +147,11 @@ Packaging Date: April 1, 2012 05:55:52 PM
Size: 2.57 MB
FMRI: pkg://omnios/security/sudo@1.8.4.1,5.11-0.151002:20120401T175552Z
PKG_STATUS
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local_output)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote)
@provider.load_current_resource
- @current_resource.version.should be_nil
- @provider.candidate_version.should eql("1.8.4.1")
+ expect(@current_resource.version).to be_nil
+ expect(@provider.candidate_version).to eql("1.8.4.1")
end
it "should not upgrade the package if it is already installed" do
@@ -188,20 +188,20 @@ Packaging Date: October 19, 2011 09:14:50 AM
FMRI: pkg://solaris/crypto/gnupg@2.0.18,5.11-0.175.0.0.0.2.537:20111019T091450Z
REMOTE
- @provider.should_receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local)
- @provider.should_receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote)
+ expect(@provider).to receive(:shell_out).with("pkg info #{@new_resource.package_name}").and_return(local)
+ expect(@provider).to receive(:shell_out!).with("pkg info -r #{@new_resource.package_name}").and_return(remote)
@provider.load_current_resource
- @provider.should_receive(:install_package).exactly(0).times
+ expect(@provider).to receive(:install_package).exactly(0).times
@provider.action_install
end
context "when accept_license is true" do
before do
- @new_resource.stub(:accept_license).and_return(true)
+ allow(@new_resource).to receive(:accept_license).and_return(true)
end
it "should run pkg install with the --accept flag" do
- @provider.should_receive(:shell_out).with("pkg install -q --accept crypto/gnupg@2.0.17")
+ expect(@provider).to receive(:shell_out).with("pkg install -q --accept crypto/gnupg@2.0.17")
@provider.install_package("crypto/gnupg", "2.0.17")
end
end
@@ -209,20 +209,20 @@ REMOTE
context "when upgrading a package" do
it "should run pkg install with the package name and version" do
- @provider.should_receive(:shell_out).with("pkg install -q crypto/gnupg@2.0.17")
+ expect(@provider).to receive(:shell_out).with("pkg install -q crypto/gnupg@2.0.17")
@provider.upgrade_package("crypto/gnupg", "2.0.17")
end
end
context "when uninstalling a package" do
it "should run pkg uninstall with the package name and version" do
- @provider.should_receive(:shell_out!).with("pkg uninstall -q crypto/gnupg@2.0.17")
+ expect(@provider).to receive(:shell_out!).with("pkg uninstall -q crypto/gnupg@2.0.17")
@provider.remove_package("crypto/gnupg", "2.0.17")
end
it "should run pkg uninstall with the package name and version and options if specified" do
- @provider.should_receive(:shell_out!).with("pkg --no-refresh uninstall -q crypto/gnupg@2.0.17")
- @new_resource.stub(:options).and_return("--no-refresh")
+ expect(@provider).to receive(:shell_out!).with("pkg --no-refresh uninstall -q crypto/gnupg@2.0.17")
+ allow(@new_resource).to receive(:options).and_return("--no-refresh")
@provider.remove_package("crypto/gnupg", "2.0.17")
end
end
diff --git a/spec/unit/provider/package/macports_spec.rb b/spec/unit/provider/package/macports_spec.rb
index 535a5d2459..23a8233c66 100644
--- a/spec/unit/provider/package/macports_spec.rb
+++ b/spec/unit/provider/package/macports_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Provider::Package::Macports do
@current_resource = Chef::Resource::Package.new("zsh")
@provider = Chef::Provider::Package::Macports.new(@new_resource, @run_context)
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@status = double("Status", :exitstatus => 0)
@stdin = StringIO.new
@@ -38,91 +38,91 @@ describe Chef::Provider::Package::Macports do
describe "load_current_resource" do
it "should create a current resource with the name of the new_resource" do
- @provider.should_receive(:current_installed_version).and_return(nil)
- @provider.should_receive(:macports_candidate_version).and_return("4.2.7")
+ expect(@provider).to receive(:current_installed_version).and_return(nil)
+ expect(@provider).to receive(:macports_candidate_version).and_return("4.2.7")
@provider.load_current_resource
- @provider.current_resource.name.should == "zsh"
+ expect(@provider.current_resource.name).to eq("zsh")
end
it "should create a current resource with the version if the package is installed" do
- @provider.should_receive(:macports_candidate_version).and_return("4.2.7")
- @provider.should_receive(:current_installed_version).and_return("4.2.7")
+ expect(@provider).to receive(:macports_candidate_version).and_return("4.2.7")
+ expect(@provider).to receive(:current_installed_version).and_return("4.2.7")
@provider.load_current_resource
- @provider.candidate_version.should == "4.2.7"
+ expect(@provider.candidate_version).to eq("4.2.7")
end
it "should create a current resource with a nil version if the package is not installed" do
- @provider.should_receive(:current_installed_version).and_return(nil)
- @provider.should_receive(:macports_candidate_version).and_return("4.2.7")
+ expect(@provider).to receive(:current_installed_version).and_return(nil)
+ expect(@provider).to receive(:macports_candidate_version).and_return("4.2.7")
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
it "should set a candidate version if one exists" do
- @provider.should_receive(:current_installed_version).and_return(nil)
- @provider.should_receive(:macports_candidate_version).and_return("4.2.7")
+ expect(@provider).to receive(:current_installed_version).and_return(nil)
+ expect(@provider).to receive(:macports_candidate_version).and_return("4.2.7")
@provider.load_current_resource
- @provider.candidate_version.should == "4.2.7"
+ expect(@provider.candidate_version).to eq("4.2.7")
end
end
describe "current_installed_version" do
it "should return the current version if the package is installed" do
- @stdout.should_receive(:read).and_return(<<EOF
+ expect(@stdout).to receive(:read).and_return(<<EOF
The following ports are currently installed:
openssl @0.9.8k_0 (active)
EOF
)
- @provider.should_receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.current_installed_version.should == "0.9.8k_0"
+ expect(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider.current_installed_version).to eq("0.9.8k_0")
end
it "should return nil if a package is not currently installed" do
- @stdout.should_receive(:read).and_return(" \n")
- @provider.should_receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.current_installed_version.should be_nil
+ expect(@stdout).to receive(:read).and_return(" \n")
+ expect(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider.current_installed_version).to be_nil
end
end
describe "macports_candidate_version" do
it "should return the latest available version of a given package" do
- @stdout.should_receive(:read).and_return("version: 4.2.7\n")
- @provider.should_receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.macports_candidate_version.should == "4.2.7"
+ expect(@stdout).to receive(:read).and_return("version: 4.2.7\n")
+ expect(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider.macports_candidate_version).to eq("4.2.7")
end
it "should return nil if there is no version for a given package" do
- @stdout.should_receive(:read).and_return("Error: port fadsfadsfads not found\n")
- @provider.should_receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.macports_candidate_version.should be_nil
+ expect(@stdout).to receive(:read).and_return("Error: port fadsfadsfads not found\n")
+ expect(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider.macports_candidate_version).to be_nil
end
end
describe "install_package" do
it "should run the port install command with the correct version" do
- @current_resource.should_receive(:version).and_return("4.1.6")
+ expect(@current_resource).to receive(:version).and_return("4.1.6")
@provider.current_resource = @current_resource
- @provider.should_receive(:shell_out!).with("port install zsh @4.2.7")
+ expect(@provider).to receive(:shell_out!).with("port install zsh @4.2.7")
@provider.install_package("zsh", "4.2.7")
end
it "should not do anything if a package already exists with the same version" do
- @current_resource.should_receive(:version).and_return("4.2.7")
+ expect(@current_resource).to receive(:version).and_return("4.2.7")
@provider.current_resource = @current_resource
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.install_package("zsh", "4.2.7")
end
it "should add options to the port command when specified" do
- @current_resource.should_receive(:version).and_return("4.1.6")
+ expect(@current_resource).to receive(:version).and_return("4.1.6")
@provider.current_resource = @current_resource
- @new_resource.stub(:options).and_return("-f")
- @provider.should_receive(:shell_out!).with("port -f install zsh @4.2.7")
+ allow(@new_resource).to receive(:options).and_return("-f")
+ expect(@provider).to receive(:shell_out!).with("port -f install zsh @4.2.7")
@provider.install_package("zsh", "4.2.7")
end
@@ -130,72 +130,72 @@ EOF
describe "purge_package" do
it "should run the port uninstall command with the correct version" do
- @provider.should_receive(:shell_out!).with("port uninstall zsh @4.2.7")
+ expect(@provider).to receive(:shell_out!).with("port uninstall zsh @4.2.7")
@provider.purge_package("zsh", "4.2.7")
end
it "should purge the currently active version if no explicit version is passed in" do
- @provider.should_receive(:shell_out!).with("port uninstall zsh")
+ expect(@provider).to receive(:shell_out!).with("port uninstall zsh")
@provider.purge_package("zsh", nil)
end
it "should add options to the port command when specified" do
- @new_resource.stub(:options).and_return("-f")
- @provider.should_receive(:shell_out!).with("port -f uninstall zsh @4.2.7")
+ allow(@new_resource).to receive(:options).and_return("-f")
+ expect(@provider).to receive(:shell_out!).with("port -f uninstall zsh @4.2.7")
@provider.purge_package("zsh", "4.2.7")
end
end
describe "remove_package" do
it "should run the port deactivate command with the correct version" do
- @provider.should_receive(:shell_out!).with("port deactivate zsh @4.2.7")
+ expect(@provider).to receive(:shell_out!).with("port deactivate zsh @4.2.7")
@provider.remove_package("zsh", "4.2.7")
end
it "should remove the currently active version if no explicit version is passed in" do
- @provider.should_receive(:shell_out!).with("port deactivate zsh")
+ expect(@provider).to receive(:shell_out!).with("port deactivate zsh")
@provider.remove_package("zsh", nil)
end
it "should add options to the port command when specified" do
- @new_resource.stub(:options).and_return("-f")
- @provider.should_receive(:shell_out!).with("port -f deactivate zsh @4.2.7")
+ allow(@new_resource).to receive(:options).and_return("-f")
+ expect(@provider).to receive(:shell_out!).with("port -f deactivate zsh @4.2.7")
@provider.remove_package("zsh", "4.2.7")
end
end
describe "upgrade_package" do
it "should run the port upgrade command with the correct version" do
- @current_resource.should_receive(:version).at_least(:once).and_return("4.1.6")
+ expect(@current_resource).to receive(:version).at_least(:once).and_return("4.1.6")
@provider.current_resource = @current_resource
- @provider.should_receive(:shell_out!).with("port upgrade zsh @4.2.7")
+ expect(@provider).to receive(:shell_out!).with("port upgrade zsh @4.2.7")
@provider.upgrade_package("zsh", "4.2.7")
end
it "should not run the port upgrade command if the version is already installed" do
- @current_resource.should_receive(:version).at_least(:once).and_return("4.2.7")
+ expect(@current_resource).to receive(:version).at_least(:once).and_return("4.2.7")
@provider.current_resource = @current_resource
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.upgrade_package("zsh", "4.2.7")
end
it "should call install_package if the package isn't currently installed" do
- @current_resource.should_receive(:version).at_least(:once).and_return(nil)
+ expect(@current_resource).to receive(:version).at_least(:once).and_return(nil)
@provider.current_resource = @current_resource
- @provider.should_receive(:install_package).and_return(true)
+ expect(@provider).to receive(:install_package).and_return(true)
@provider.upgrade_package("zsh", "4.2.7")
end
it "should add options to the port command when specified" do
- @new_resource.stub(:options).and_return("-f")
- @current_resource.should_receive(:version).at_least(:once).and_return("4.1.6")
+ allow(@new_resource).to receive(:options).and_return("-f")
+ expect(@current_resource).to receive(:version).at_least(:once).and_return("4.1.6")
@provider.current_resource = @current_resource
- @provider.should_receive(:shell_out!).with("port -f upgrade zsh @4.2.7")
+ expect(@provider).to receive(:shell_out!).with("port -f upgrade zsh @4.2.7")
@provider.upgrade_package("zsh", "4.2.7")
end
diff --git a/spec/unit/provider/package/openbsd_spec.rb b/spec/unit/provider/package/openbsd_spec.rb
new file mode 100644
index 0000000000..ee9c9e89fb
--- /dev/null
+++ b/spec/unit/provider/package/openbsd_spec.rb
@@ -0,0 +1,66 @@
+#
+# Author:: Scott Bonds (scott@ggr.com)
+# Copyright:: Copyright (c) 2014 Scott Bonds
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'ostruct'
+
+describe Chef::Provider::Package::Openbsd do
+
+ before(:each) do
+ @node = Chef::Node.new
+ @node.default['kernel'] = {'name' => 'OpenBSD', 'release' => '5.5', 'machine' => 'amd64'}
+ @events = Chef::EventDispatch::Dispatcher.new
+ @run_context = Chef::RunContext.new(@node, {}, @events)
+ ENV['PKG_PATH'] = nil
+ end
+
+ describe "install a package" do
+ before do
+ @name = 'ihavetoes'
+ @new_resource = Chef::Resource::Package.new(@name)
+ @current_resource = Chef::Resource::Package.new(@name)
+ @provider = Chef::Provider::Package::Openbsd.new(@new_resource, @run_context)
+ @provider.current_resource = @current_resource
+ end
+ it "should run the installation command" do
+ expect(@provider).to receive(:shell_out!).with(
+ "pkg_add -r #{@name}",
+ {:env => {"PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/"}}
+ ) {OpenStruct.new :status => true}
+ @provider.install_package(@name, nil)
+ end
+ end
+
+ describe "delete a package" do
+ before do
+ @name = 'ihavetoes'
+ @new_resource = Chef::Resource::Package.new(@name)
+ @current_resource = Chef::Resource::Package.new(@name)
+ @provider = Chef::Provider::Package::Openbsd.new(@new_resource, @run_context)
+ @provider.current_resource = @current_resource
+ end
+ it "should run the command to delete the installed package" do
+ expect(@provider).to receive(:shell_out!).with(
+ "pkg_delete #{@name}", :env=>nil
+ ) {OpenStruct.new :status => true}
+ @provider.remove_package(@name, nil)
+ end
+ end
+
+end
+
diff --git a/spec/unit/provider/package/pacman_spec.rb b/spec/unit/provider/package/pacman_spec.rb
index ed10513350..9fa5f9667c 100644
--- a/spec/unit/provider/package/pacman_spec.rb
+++ b/spec/unit/provider/package/pacman_spec.rb
@@ -28,8 +28,8 @@ describe Chef::Provider::Package::Pacman do
@status = double("Status", :exitstatus => 0)
@provider = Chef::Provider::Package::Pacman.new(@new_resource, @run_context)
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
- @provider.stub(:popen4).and_return(@status)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
+ allow(@provider).to receive(:popen4).and_return(@status)
@stdin = StringIO.new
@stdout = StringIO.new(<<-ERR)
error: package "nano" not found
@@ -40,29 +40,29 @@ ERR
describe "when determining the current package state" do
it "should create a current resource with the name of the new_resource" do
- Chef::Resource::Package.should_receive(:new).and_return(@current_resource)
+ expect(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resources package name to the new resources package name" do
- @current_resource.should_receive(:package_name).with(@new_resource.package_name)
+ expect(@current_resource).to receive(:package_name).with(@new_resource.package_name)
@provider.load_current_resource
end
it "should run pacman query with the package name" do
- @provider.should_receive(:popen4).with("pacman -Qi #{@new_resource.package_name}").and_return(@status)
+ expect(@provider).to receive(:popen4).with("pacman -Qi #{@new_resource.package_name}").and_return(@status)
@provider.load_current_resource
end
it "should read stdout on pacman" do
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @stdout.should_receive(:each).and_return(true)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@stdout).to receive(:each).and_return(true)
@provider.load_current_resource
end
it "should set the installed version to nil on the current resource if pacman installed version not exists" do
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @current_resource.should_receive(:version).with(nil).and_return(true)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@current_resource).to receive(:version).with(nil).and_return(true)
@provider.load_current_resource
end
@@ -88,16 +88,16 @@ Install Reason : Explicitly installed
Install Script : Yes
Description : Pico editor clone with enhancements
PACMAN
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @current_resource.version.should == "2.2.2-1"
+ expect(@current_resource.version).to eq("2.2.2-1")
end
it "should set the candidate version if pacman has one" do
- @stdout.stub(:each).and_yield("core nano 2.2.3-1")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@stdout).to receive(:each).and_yield("core nano 2.2.3-1")
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.candidate_version.should eql("2.2.3-1")
+ expect(@provider.candidate_version).to eql("2.2.3-1")
end
it "should use pacman.conf to determine valid repo names for package versions" do
@@ -119,45 +119,45 @@ Include = /etc/pacman.d/mirrorlist
Include = /etc/pacman.d/mirrorlist
PACMAN_CONF
- ::File.stub(:exists?).with("/etc/pacman.conf").and_return(true)
- ::File.stub(:read).with("/etc/pacman.conf").and_return(@pacman_conf)
- @stdout.stub(:each).and_yield("customrepo nano 1.2.3-4")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(::File).to receive(:exists?).with("/etc/pacman.conf").and_return(true)
+ allow(::File).to receive(:read).with("/etc/pacman.conf").and_return(@pacman_conf)
+ allow(@stdout).to receive(:each).and_yield("customrepo nano 1.2.3-4")
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.candidate_version.should eql("1.2.3-4")
+ expect(@provider.candidate_version).to eql("1.2.3-4")
end
it "should raise an exception if pacman fails" do
- @status.should_receive(:exitstatus).and_return(2)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
+ expect(@status).to receive(:exitstatus).and_return(2)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
end
it "should not raise an exception if pacman succeeds" do
- @status.should_receive(:exitstatus).and_return(0)
- lambda { @provider.load_current_resource }.should_not raise_error
+ expect(@status).to receive(:exitstatus).and_return(0)
+ expect { @provider.load_current_resource }.not_to raise_error
end
it "should raise an exception if pacman does not return a candidate version" do
- @stdout.stub(:each).and_yield("")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package)
+ allow(@stdout).to receive(:each).and_yield("")
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect { @provider.candidate_version }.to raise_error(Chef::Exceptions::Package)
end
it "should return the current resouce" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
end
describe Chef::Provider::Package::Pacman, "install_package" do
it "should run pacman install with the package name and version" do
- @provider.should_receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar nano")
+ expect(@provider).to receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar nano")
@provider.install_package("nano", "1.0")
end
it "should run pacman install with the package name and version and options if specified" do
- @provider.should_receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar --debug nano")
- @new_resource.stub(:options).and_return("--debug")
+ expect(@provider).to receive(:shell_out!).with("pacman --sync --noconfirm --noprogressbar --debug nano")
+ allow(@new_resource).to receive(:options).and_return("--debug")
@provider.install_package("nano", "1.0")
end
@@ -165,20 +165,20 @@ PACMAN_CONF
describe Chef::Provider::Package::Pacman, "upgrade_package" do
it "should run install_package with the name and version" do
- @provider.should_receive(:install_package).with("nano", "1.0")
+ expect(@provider).to receive(:install_package).with("nano", "1.0")
@provider.upgrade_package("nano", "1.0")
end
end
describe Chef::Provider::Package::Pacman, "remove_package" do
it "should run pacman remove with the package name" do
- @provider.should_receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar nano")
+ expect(@provider).to receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar nano")
@provider.remove_package("nano", "1.0")
end
it "should run pacman remove with the package name and options if specified" do
- @provider.should_receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar --debug nano")
- @new_resource.stub(:options).and_return("--debug")
+ expect(@provider).to receive(:shell_out!).with("pacman --remove --noconfirm --noprogressbar --debug nano")
+ allow(@new_resource).to receive(:options).and_return("--debug")
@provider.remove_package("nano", "1.0")
end
@@ -186,7 +186,7 @@ PACMAN_CONF
describe Chef::Provider::Package::Pacman, "purge_package" do
it "should run remove_package with the name and version" do
- @provider.should_receive(:remove_package).with("nano", "1.0")
+ expect(@provider).to receive(:remove_package).with("nano", "1.0")
@provider.purge_package("nano", "1.0")
end
diff --git a/spec/unit/provider/package/paludis_spec.rb b/spec/unit/provider/package/paludis_spec.rb
index 8387bb1252..4ed5dfc003 100644
--- a/spec/unit/provider/package/paludis_spec.rb
+++ b/spec/unit/provider/package/paludis_spec.rb
@@ -28,7 +28,7 @@ describe Chef::Provider::Package::Paludis do
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Package.new("net/ntp")
@current_resource = Chef::Resource::Package.new("net/ntp")
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider = Chef::Provider::Package::Paludis.new(@new_resource, @run_context)
@stdin = StringIO.new
@@ -47,19 +47,19 @@ PKG_STATUS
context "when loading current resource" do
it "should create a current resource with the name of the new_resource" do
- @provider.should_receive(:shell_out!).and_return(@shell_out)
- Chef::Resource::Package.should_receive(:new).and_return(@current_resource)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
+ expect(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resources package name to the new resources package name" do
- @provider.should_receive(:shell_out!).and_return(@shell_out)
- @current_resource.should_receive(:package_name).with(@new_resource.package_name)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
+ expect(@current_resource).to receive(:package_name).with(@new_resource.package_name)
@provider.load_current_resource
end
it "should run pkg info with the package name" do
- @provider.should_receive(:shell_out!).with("cave -L warning print-ids -M none -m \"#{@new_resource.package_name}\" -f \"%c/%p %v %r\n\"").and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).with("cave -L warning print-ids -M none -m \"#{@new_resource.package_name}\" -f \"%c/%p %v %r\n\"").and_return(@shell_out)
@provider.load_current_resource
end
@@ -72,28 +72,28 @@ user/ntp 0 accounts
user/ntp 0 installed-accounts
net/ntp 4.2.6_p5-r1 installed
INSTALLED
- @provider.should_receive(:shell_out!).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
@provider.load_current_resource
- @current_resource.version.should == "4.2.6_p5-r1"
- @provider.candidate_version.should eql("4.2.6_p5-r2")
+ expect(@current_resource.version).to eq("4.2.6_p5-r1")
+ expect(@provider.candidate_version).to eql("4.2.6_p5-r2")
end
it "should return the current resource" do
- @provider.should_receive(:shell_out!).and_return(@shell_out)
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
end
context "when installing a package" do
it "should run pkg install with the package name and version" do
- @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", {:timeout=>@new_resource.timeout})
+ expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", {:timeout=>@new_resource.timeout})
@provider.install_package("net/ntp", "4.2.6_p5-r2")
end
it "should run pkg install with the package name and version and options if specified" do
- @provider.should_receive(:shell_out!).with("cave -L warning resolve -x --preserve-world \"=net/ntp-4.2.6_p5-r2\"", {:timeout=>@new_resource.timeout})
- @new_resource.stub(:options).and_return("--preserve-world")
+ expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x --preserve-world \"=net/ntp-4.2.6_p5-r2\"", {:timeout=>@new_resource.timeout})
+ allow(@new_resource).to receive(:options).and_return("--preserve-world")
@provider.install_package("net/ntp", "4.2.6_p5-r2")
end
@@ -102,7 +102,7 @@ INSTALLED
sys-process/lsof 4.87 arbor
sys-process/lsof 4.87 x86_64
PKG_STATUS
- @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=sys-process/lsof-4.87\"", {:timeout=>@new_resource.timeout})
+ expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=sys-process/lsof-4.87\"", {:timeout=>@new_resource.timeout})
@provider.install_package("sys-process/lsof", "4.87")
end
@@ -111,23 +111,23 @@ PKG_STATUS
sys-process/lsof 4.87 arbor
sys-process/lsof 4.87 x86_64
PKG_STATUS
- @provider.should_receive(:shell_out!).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
@provider.load_current_resource
- @current_resource.version.should be_nil
- @provider.candidate_version.should eql("4.87")
+ expect(@current_resource.version).to be_nil
+ expect(@provider.candidate_version).to eql("4.87")
end
end
context "when upgrading a package" do
it "should run pkg install with the package name and version" do
- @provider.should_receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", {:timeout=>@new_resource.timeout})
+ expect(@provider).to receive(:shell_out!).with("cave -L warning resolve -x \"=net/ntp-4.2.6_p5-r2\"", {:timeout=>@new_resource.timeout})
@provider.upgrade_package("net/ntp", "4.2.6_p5-r2")
end
end
context "when uninstalling a package" do
it "should run pkg uninstall with the package name and version" do
- @provider.should_receive(:shell_out!).with("cave -L warning uninstall -x \"=net/ntp-4.2.6_p5-r2\"")
+ expect(@provider).to receive(:shell_out!).with("cave -L warning uninstall -x \"=net/ntp-4.2.6_p5-r2\"")
@provider.remove_package("net/ntp", "4.2.6_p5-r2")
end
diff --git a/spec/unit/provider/package/portage_spec.rb b/spec/unit/provider/package/portage_spec.rb
index 570f123168..f83eda45de 100644
--- a/spec/unit/provider/package/portage_spec.rb
+++ b/spec/unit/provider/package/portage_spec.rb
@@ -27,73 +27,73 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do
@current_resource = Chef::Resource::Package.new("dev-util/git")
@provider = Chef::Provider::Package::Portage.new(@new_resource, @run_context)
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
end
describe "when determining the current state of the package" do
it "should create a current resource with the name of new_resource" do
- ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"])
- Chef::Resource::Package.should_receive(:new).and_return(@current_resource)
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"])
+ expect(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resource package name to the new resource package name" do
- ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"])
- @current_resource.should_receive(:package_name).with(@new_resource.package_name)
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0"])
+ expect(@current_resource).to receive(:package_name).with(@new_resource.package_name)
@provider.load_current_resource
end
it "should return a current resource with the correct version if the package is found" do
- ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"])
@provider.load_current_resource
- @provider.current_resource.version.should == "1.0.0"
+ expect(@provider.current_resource.version).to eq("1.0.0")
end
it "should return a current resource with the correct version if the package is found with revision" do
- ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0-r1"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0-r1"])
@provider.load_current_resource
- @provider.current_resource.version.should == "1.0.0-r1"
+ expect(@provider.current_resource.version).to eq("1.0.0-r1")
end
it "should return a current resource with a nil version if the package is not found" do
- ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"])
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
it "should return a package name match from /var/db/pkg/* if a category isn't specified and a match is found" do
- ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-foobar-0.9", "/var/db/pkg/dev-util/git-1.0.0"])
@provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context)
@provider.load_current_resource
- @provider.current_resource.version.should == "1.0.0"
+ expect(@provider.current_resource.version).to eq("1.0.0")
end
it "should return a current resource with a nil version if a category isn't specified and a name match from /var/db/pkg/* is not found" do
- ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/notgit-1.0.0"])
@provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context)
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
it "should throw an exception if a category isn't specified and multiple packages are found" do
- ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"])
@provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
end
it "should return a current resource with a nil version if a category is specified and multiple packages are found" do
- ::Dir.stub(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/dev-util/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/funny-words/git-1.0.0"])
@provider = Chef::Provider::Package::Portage.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
it "should return a current resource with a nil version if a category is not specified and multiple packages from the same category are found" do
- ::Dir.stub(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/dev-util/git-1.0.1"])
+ allow(::Dir).to receive(:[]).with("/var/db/pkg/*/git-*").and_return(["/var/db/pkg/dev-util/git-1.0.0", "/var/db/pkg/dev-util/git-1.0.1"])
@provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context)
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
end
@@ -102,14 +102,14 @@ describe Chef::Provider::Package::Portage, "load_current_resource" do
describe Chef::Provider::Package::Portage, "candidate_version" do
it "should return the candidate_version variable if already set" do
@provider.candidate_version = "1.0.0"
- @provider.should_not_receive(:popen4)
+ expect(@provider).not_to receive(:popen4)
@provider.candidate_version
end
it "should throw an exception if the exitstatus is not 0" do
@status = double("Status", :exitstatus => 1)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.candidate_version }.to raise_error(Chef::Exceptions::Package)
end
it "should find the candidate_version if a category is specifed and there are no duplicates" do
@@ -144,8 +144,8 @@ Searching...
EOF
@status = double("Status", :exitstatus => 0)
- @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
- @provider.candidate_version.should == "1.6.0.6"
+ expect(@provider).to receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
+ expect(@provider.candidate_version).to eq("1.6.0.6")
end
it "should find the candidate_version if a category is not specifed and there are no duplicates" do
@@ -181,8 +181,8 @@ EOF
@status = double("Status", :exitstatus => 0)
@provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context)
- @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
- @provider.candidate_version.should == "1.6.0.6"
+ expect(@provider).to receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
+ expect(@provider.candidate_version).to eq("1.6.0.6")
end
it "should throw an exception if a category is not specified and there are duplicates" do
@@ -226,8 +226,8 @@ EOF
@status = double("Status", :exitstatus => 0)
@provider = Chef::Provider::Package::Portage.new(@new_resource_without_category, @run_context)
- @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
- lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package)
+ expect(@provider).to receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
+ expect { @provider.candidate_version }.to raise_error(Chef::Exceptions::Package)
end
it "should find the candidate_version if a category is specifed and there are category duplicates" do
@@ -271,25 +271,25 @@ EOF
@status = double("Status", :exitstatus => 0)
@provider = Chef::Provider::Package::Portage.new(@new_resource, @run_context)
- @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
- @provider.candidate_version.should == "1.6.0.6"
+ expect(@provider).to receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status)
+ expect(@provider.candidate_version).to eq("1.6.0.6")
end
end
describe Chef::Provider::Package::Portage, "install_package" do
it "should install a normally versioned package using portage" do
- @provider.should_receive(:shell_out!).with("emerge -g --color n --nospinner --quiet =dev-util/git-1.0.0")
+ expect(@provider).to receive(:shell_out!).with("emerge -g --color n --nospinner --quiet =dev-util/git-1.0.0")
@provider.install_package("dev-util/git", "1.0.0")
end
it "should install a tilde versioned package using portage" do
- @provider.should_receive(:shell_out!).with("emerge -g --color n --nospinner --quiet ~dev-util/git-1.0.0")
+ expect(@provider).to receive(:shell_out!).with("emerge -g --color n --nospinner --quiet ~dev-util/git-1.0.0")
@provider.install_package("dev-util/git", "~1.0.0")
end
it "should add options to the emerge command when specified" do
- @provider.should_receive(:shell_out!).with("emerge -g --color n --nospinner --quiet --oneshot =dev-util/git-1.0.0")
- @new_resource.stub(:options).and_return("--oneshot")
+ expect(@provider).to receive(:shell_out!).with("emerge -g --color n --nospinner --quiet --oneshot =dev-util/git-1.0.0")
+ allow(@new_resource).to receive(:options).and_return("--oneshot")
@provider.install_package("dev-util/git", "1.0.0")
end
@@ -297,12 +297,12 @@ EOF
describe Chef::Provider::Package::Portage, "remove_package" do
it "should un-emerge the package with no version specified" do
- @provider.should_receive(:shell_out!).with("emerge --unmerge --color n --nospinner --quiet dev-util/git")
+ expect(@provider).to receive(:shell_out!).with("emerge --unmerge --color n --nospinner --quiet dev-util/git")
@provider.remove_package("dev-util/git", nil)
end
it "should un-emerge the package with a version specified" do
- @provider.should_receive(:shell_out!).with("emerge --unmerge --color n --nospinner --quiet =dev-util/git-1.0.0")
+ expect(@provider).to receive(:shell_out!).with("emerge --unmerge --color n --nospinner --quiet =dev-util/git-1.0.0")
@provider.remove_package("dev-util/git", "1.0.0")
end
end
diff --git a/spec/unit/provider/package/rpm_spec.rb b/spec/unit/provider/package/rpm_spec.rb
index 9a96d829b8..2aceee59a5 100644
--- a/spec/unit/provider/package/rpm_spec.rb
+++ b/spec/unit/provider/package/rpm_spec.rb
@@ -30,55 +30,55 @@ describe Chef::Provider::Package::Rpm do
@provider = Chef::Provider::Package::Rpm.new(@new_resource, @run_context)
@status = double("Status", :exitstatus => 0)
- ::File.stub(:exists?).and_return(true)
+ allow(::File).to receive(:exists?).and_return(true)
end
describe "when determining the current state of the package" do
it "should create a current resource with the name of new_resource" do
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.name.should == "ImageMagick-c++"
+ expect(@provider.current_resource.name).to eq("ImageMagick-c++")
end
it "should set the current reource package name to the new resource package name" do
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == 'ImageMagick-c++'
+ expect(@provider.current_resource.package_name).to eq('ImageMagick-c++')
end
it "should raise an exception if a source is supplied but not found" do
- ::File.stub(:exists?).and_return(false)
- lambda { @provider.run_action(:any) }.should raise_error(Chef::Exceptions::Package)
+ allow(::File).to receive(:exists?).and_return(false)
+ expect { @provider.run_action(:any) }.to raise_error(Chef::Exceptions::Package)
end
it "should get the source package version from rpm if provided" do
@stdout = StringIO.new("ImageMagick-c++ 6.5.4.7-7.el6_5")
- @provider.should_receive(:popen4).with("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.should_receive(:popen4).with("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' ImageMagick-c++").and_return(@status)
+ expect(@provider).to receive(:popen4).with("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' ImageMagick-c++").and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == "ImageMagick-c++"
- @provider.new_resource.version.should == "6.5.4.7-7.el6_5"
+ expect(@provider.current_resource.package_name).to eq("ImageMagick-c++")
+ expect(@provider.new_resource.version).to eq("6.5.4.7-7.el6_5")
end
it "should return the current version installed if found by rpm" do
@stdout = StringIO.new("ImageMagick-c++ 6.5.4.7-7.el6_5")
- @provider.should_receive(:popen4).with("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm").and_return(@status)
- @provider.should_receive(:popen4).with("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' ImageMagick-c++").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm").and_return(@status)
+ expect(@provider).to receive(:popen4).with("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' ImageMagick-c++").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.version.should == "6.5.4.7-7.el6_5"
+ expect(@provider.current_resource.version).to eq("6.5.4.7-7.el6_5")
end
it "should raise an exception if the source is not set but we are installing" do
new_resource = Chef::Resource::Package.new("ImageMagick-c++")
provider = Chef::Provider::Package::Rpm.new(new_resource, @run_context)
- lambda { provider.run_action(:any) }.should raise_error(Chef::Exceptions::Package)
+ expect { provider.run_action(:any) }.to raise_error(Chef::Exceptions::Package)
end
it "should raise an exception if rpm fails to run" do
status = double("Status", :exitstatus => -1)
- @provider.stub(:popen4).and_return(status)
- lambda { @provider.run_action(:any) }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(status)
+ expect { @provider.run_action(:any) }.to raise_error(Chef::Exceptions::Package)
end
it "should not detect the package name as version when not installed" do
@@ -87,10 +87,10 @@ describe Chef::Provider::Package::Rpm do
@new_resource = Chef::Resource::Package.new("openssh-askpass")
@new_resource.source 'openssh-askpass'
@provider = Chef::Provider::Package::Rpm.new(@new_resource, @run_context)
- @provider.should_receive(:popen4).with("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' openssh-askpass").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.should_receive(:popen4).with("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' openssh-askpass").and_return(@status)
+ expect(@provider).to receive(:popen4).with("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' openssh-askpass").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' openssh-askpass").and_return(@status)
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
end
@@ -102,54 +102,54 @@ describe Chef::Provider::Package::Rpm do
describe "when installing or upgrading" do
it "should run rpm -i with the package source to install" do
- @provider.should_receive(:shell_out!).with("rpm -i /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
+ expect(@provider).to receive(:shell_out!).with("rpm -i /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider.install_package("ImageMagick-c++", "6.5.4.7-7.el6_5")
end
it "should run rpm -U with the package source to upgrade" do
@current_resource.version("21.4-19.el5")
- @provider.should_receive(:shell_out!).with("rpm -U /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
+ expect(@provider).to receive(:shell_out!).with("rpm -U /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider.upgrade_package("ImageMagick-c++", "6.5.4.7-7.el6_5")
end
it "should install package if missing and set to upgrade" do
@current_resource.version("ImageMagick-c++")
- @provider.should_receive(:shell_out!).with("rpm -U /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
+ expect(@provider).to receive(:shell_out!).with("rpm -U /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider.upgrade_package("ImageMagick-c++", "6.5.4.7-7.el6_5")
end
it "should install from a path when the package is a path and the source is nil" do
@new_resource = Chef::Resource::Package.new("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider = Chef::Provider::Package::Rpm.new(@new_resource, @run_context)
- @new_resource.source.should == "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm"
+ expect(@new_resource.source).to eq("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@current_resource = Chef::Resource::Package.new("ImageMagick-c++")
@provider.current_resource = @current_resource
- @provider.should_receive(:shell_out!).with("rpm -i /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
+ expect(@provider).to receive(:shell_out!).with("rpm -i /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider.install_package("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", "6.5.4.7-7.el6_5")
end
it "should uprgrade from a path when the package is a path and the source is nil" do
@new_resource = Chef::Resource::Package.new("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider = Chef::Provider::Package::Rpm.new(@new_resource, @run_context)
- @new_resource.source.should == "/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm"
+ expect(@new_resource.source).to eq("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@current_resource = Chef::Resource::Package.new("ImageMagick-c++")
@current_resource.version("21.4-19.el5")
@provider.current_resource = @current_resource
- @provider.should_receive(:shell_out!).with("rpm -U /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
+ expect(@provider).to receive(:shell_out!).with("rpm -U /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider.upgrade_package("/tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm", "6.5.4.7-7.el6_5")
end
it "installs with custom options specified in the resource" do
@provider.candidate_version = '11'
@new_resource.options("--dbpath /var/lib/rpm")
- @provider.should_receive(:shell_out!).with("rpm --dbpath /var/lib/rpm -i /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
+ expect(@provider).to receive(:shell_out!).with("rpm --dbpath /var/lib/rpm -i /tmp/ImageMagick-c++-6.5.4.7-7.el6_5.x86_64.rpm")
@provider.install_package(@new_resource.name, @provider.candidate_version)
end
end
describe "when removing the package" do
it "should run rpm -e to remove the package" do
- @provider.should_receive(:shell_out!).with("rpm -e ImageMagick-c++-6.5.4.7-7.el6_5")
+ expect(@provider).to receive(:shell_out!).with("rpm -e ImageMagick-c++-6.5.4.7-7.el6_5")
@provider.remove_package("ImageMagick-c++", "6.5.4.7-7.el6_5")
end
end
diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb
index f4d0cebf62..a3a4772229 100644
--- a/spec/unit/provider/package/rubygems_spec.rb
+++ b/spec/unit/provider/package/rubygems_spec.rb
@@ -39,23 +39,23 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
end
it "determines the gem paths from the in memory rubygems" do
- @gem_env.gem_paths.should == Gem.path
+ expect(@gem_env.gem_paths).to eq(Gem.path)
end
it "determines the installed versions of gems from Gem.source_index" do
gems = [gemspec('rspec-core', Gem::Version.new('1.2.9')), gemspec('rspec-core', Gem::Version.new('1.3.0'))]
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.8.0')
- Gem::Specification.should_receive(:find_all_by_name).with('rspec-core', Gem::Dependency.new('rspec-core').requirement).and_return(gems)
+ expect(Gem::Specification).to receive(:find_all_by_name).with('rspec-core', Gem::Dependency.new('rspec-core').requirement).and_return(gems)
else
- Gem.source_index.should_receive(:search).with(Gem::Dependency.new('rspec-core', nil)).and_return(gems)
+ expect(Gem.source_index).to receive(:search).with(Gem::Dependency.new('rspec-core', nil)).and_return(gems)
end
- @gem_env.installed_versions(Gem::Dependency.new('rspec-core', nil)).should == gems
+ expect(@gem_env.installed_versions(Gem::Dependency.new('rspec-core', nil))).to eq(gems)
end
it "determines the installed versions of gems from the source index (part2: the unmockening)" do
expected = ['rspec-core', Gem::Version.new(RSpec::Core::Version::STRING)]
actual = @gem_env.installed_versions(Gem::Dependency.new('rspec-core', nil)).map { |spec| [spec.name, spec.version] }
- actual.should include(expected)
+ expect(actual).to include(expected)
end
it "yields to a block with an alternate source list set" do
@@ -68,8 +68,8 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
end
rescue RuntimeError
end
- sources_in_block.should == %w{http://gems.example.org}
- Gem.sources.should == normal_sources
+ expect(sources_in_block).to eq(%w{http://gems.example.org})
+ expect(Gem.sources).to eq(normal_sources)
end
it "it doesnt alter the gem sources if none are set" do
@@ -82,29 +82,29 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
end
rescue RuntimeError
end
- sources_in_block.should == normal_sources
- Gem.sources.should == normal_sources
+ expect(sources_in_block).to eq(normal_sources)
+ expect(Gem.sources).to eq(normal_sources)
end
it "finds a matching gem candidate version" do
dep = Gem::Dependency.new('rspec', '>= 0')
dep_installer = Gem::DependencyInstaller.new
- @gem_env.stub(:dependency_installer).and_return(dep_installer)
- latest = [[gemspec("rspec", Gem::Version.new("1.3.0")), "http://rubygems.org/"]]
- dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(latest)
- @gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0')).should == Gem::Version.new('1.3.0')
+ allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
+ latest = [[gemspec("rspec", Gem::Version.new("1.3.0")), "https://rubygems.org/"]]
+ expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(latest)
+ expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0'))).to eq(Gem::Version.new('1.3.0'))
end
it "finds a matching gem candidate version on rubygems 2.0.0+" do
dep = Gem::Dependency.new('rspec', '>= 0')
dep_installer = Gem::DependencyInstaller.new
- @gem_env.stub(:dependency_installer).and_return(dep_installer)
+ allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
best_gem = double("best gem match", :spec => gemspec("rspec", Gem::Version.new("1.3.0")), :source => "https://rubygems.org")
available_set = double("Gem::AvailableSet test double")
- available_set.should_receive(:pick_best!)
- available_set.should_receive(:set).and_return([best_gem])
- dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(available_set)
- @gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0')).should == Gem::Version.new('1.3.0')
+ expect(available_set).to receive(:pick_best!)
+ expect(available_set).to receive(:set).and_return([best_gem])
+ expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(available_set)
+ expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0'))).to eq(Gem::Version.new('1.3.0'))
end
context "when rubygems was upgraded from 1.8->2.0" do
@@ -121,7 +121,8 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
Gem.const_set(:Format, Object.new)
@remove_gem_format = true
end
- Gem::Package.stub(:respond_to?).with(:open).and_return(false)
+ allow(Gem::Package).to receive(:respond_to?).and_call_original
+ allow(Gem::Package).to receive(:respond_to?).with(:open).and_return(false)
end
after do
@@ -132,8 +133,8 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
it "finds a matching gem candidate version on rubygems 2.0+ with some rubygems 1.8 code loaded" do
package = double("Gem::Package", :spec => "a gemspec from package")
- Gem::Package.should_receive(:new).with("/path/to/package.gem").and_return(package)
- @gem_env.spec_from_file("/path/to/package.gem").should == "a gemspec from package"
+ expect(Gem::Package).to receive(:new).with("/path/to/package.gem").and_return(package)
+ expect(@gem_env.spec_from_file("/path/to/package.gem")).to eq("a gemspec from package")
end
end
@@ -142,54 +143,54 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do
dep = Gem::Dependency.new('rspec', '>= 0')
latest = []
dep_installer = Gem::DependencyInstaller.new
- @gem_env.stub(:dependency_installer).and_return(dep_installer)
- dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(latest)
- @gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0')).should be_nil
+ allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
+ expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(latest)
+ expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>= 0'))).to be_nil
end
it "finds a matching candidate version from a .gem file when the path to the gem is supplied" do
location = CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem'
- @gem_env.candidate_version_from_file(Gem::Dependency.new('chef-integration-test', '>= 0'), location).should == Gem::Version.new('0.1.0')
- @gem_env.candidate_version_from_file(Gem::Dependency.new('chef-integration-test', '>= 0.2.0'), location).should be_nil
+ expect(@gem_env.candidate_version_from_file(Gem::Dependency.new('chef-integration-test', '>= 0'), location)).to eq(Gem::Version.new('0.1.0'))
+ expect(@gem_env.candidate_version_from_file(Gem::Dependency.new('chef-integration-test', '>= 0.2.0'), location)).to be_nil
end
it "finds a matching gem from a specific gemserver when explicit sources are given" do
dep = Gem::Dependency.new('rspec', '>= 0')
- latest = [[gemspec("rspec", Gem::Version.new("1.3.0")), "http://rubygems.org/"]]
+ latest = [[gemspec("rspec", Gem::Version.new("1.3.0")), "https://rubygems.org/"]]
- @gem_env.should_receive(:with_gem_sources).with('http://gems.example.com').and_yield
+ expect(@gem_env).to receive(:with_gem_sources).with('http://gems.example.com').and_yield
dep_installer = Gem::DependencyInstaller.new
- @gem_env.stub(:dependency_installer).and_return(dep_installer)
- dep_installer.should_receive(:find_gems_with_sources).with(dep).and_return(latest)
- @gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>=0'), 'http://gems.example.com').should == Gem::Version.new('1.3.0')
+ allow(@gem_env).to receive(:dependency_installer).and_return(dep_installer)
+ expect(dep_installer).to receive(:find_gems_with_sources).with(dep).and_return(latest)
+ expect(@gem_env.candidate_version_from_remote(Gem::Dependency.new('rspec', '>=0'), 'http://gems.example.com')).to eq(Gem::Version.new('1.3.0'))
end
it "installs a gem with a hash of options for the dependency installer" do
dep_installer = Gem::DependencyInstaller.new
- @gem_env.should_receive(:dependency_installer).with(:install_dir => '/foo/bar').and_return(dep_installer)
- @gem_env.should_receive(:with_gem_sources).with('http://gems.example.com').and_yield
- dep_installer.should_receive(:install).with(Gem::Dependency.new('rspec', '>= 0'))
+ expect(@gem_env).to receive(:dependency_installer).with(:install_dir => '/foo/bar').and_return(dep_installer)
+ expect(@gem_env).to receive(:with_gem_sources).with('http://gems.example.com').and_yield
+ expect(dep_installer).to receive(:install).with(Gem::Dependency.new('rspec', '>= 0'))
@gem_env.install(Gem::Dependency.new('rspec', '>= 0'), :install_dir => '/foo/bar', :sources => ['http://gems.example.com'])
end
it "builds an uninstaller for a gem with options set to avoid requiring user input" do
# default options for uninstaller should be:
# :ignore => true, :executables => true
- Gem::Uninstaller.should_receive(:new).with('rspec', :ignore => true, :executables => true)
+ expect(Gem::Uninstaller).to receive(:new).with('rspec', :ignore => true, :executables => true)
@gem_env.uninstaller('rspec')
end
it "uninstalls all versions of a gem" do
uninstaller = double('gem uninstaller')
- uninstaller.should_receive(:uninstall)
- @gem_env.should_receive(:uninstaller).with('rspec', :all => true).and_return(uninstaller)
+ expect(uninstaller).to receive(:uninstall)
+ expect(@gem_env).to receive(:uninstaller).with('rspec', :all => true).and_return(uninstaller)
@gem_env.uninstall('rspec')
end
it "uninstalls a specific version of a gem" do
uninstaller = double('gem uninstaller')
- uninstaller.should_receive(:uninstall)
- @gem_env.should_receive(:uninstaller).with('rspec', :version => '1.2.3').and_return(uninstaller)
+ expect(uninstaller).to receive(:uninstall)
+ expect(@gem_env).to receive(:uninstaller).with('rspec', :version => '1.2.3').and_return(uninstaller)
@gem_env.uninstall('rspec', '1.2.3')
end
@@ -207,35 +208,35 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do
it "determines the gem paths from shelling out to gem env" do
gem_env_output = ['/path/to/gems', '/another/path/to/gems'].join(File::PATH_SEPARATOR)
shell_out_result = OpenStruct.new(:stdout => gem_env_output)
- @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env gempath').and_return(shell_out_result)
- @gem_env.gem_paths.should == ['/path/to/gems', '/another/path/to/gems']
+ expect(@gem_env).to receive(:shell_out!).with('/usr/weird/bin/gem env gempath').and_return(shell_out_result)
+ expect(@gem_env.gem_paths).to eq(['/path/to/gems', '/another/path/to/gems'])
end
it "caches the gempaths by gem_binary" do
gem_env_output = ['/path/to/gems', '/another/path/to/gems'].join(File::PATH_SEPARATOR)
shell_out_result = OpenStruct.new(:stdout => gem_env_output)
- @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env gempath').and_return(shell_out_result)
+ expect(@gem_env).to receive(:shell_out!).with('/usr/weird/bin/gem env gempath').and_return(shell_out_result)
expected = ['/path/to/gems', '/another/path/to/gems']
- @gem_env.gem_paths.should == ['/path/to/gems', '/another/path/to/gems']
- Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache['/usr/weird/bin/gem'].should == expected
+ expect(@gem_env.gem_paths).to eq(['/path/to/gems', '/another/path/to/gems'])
+ expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache['/usr/weird/bin/gem']).to eq(expected)
end
it "uses the cached result for gem paths when available" do
gem_env_output = ['/path/to/gems', '/another/path/to/gems'].join(File::PATH_SEPARATOR)
shell_out_result = OpenStruct.new(:stdout => gem_env_output)
- @gem_env.should_not_receive(:shell_out!)
+ expect(@gem_env).not_to receive(:shell_out!)
expected = ['/path/to/gems', '/another/path/to/gems']
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.gempath_cache['/usr/weird/bin/gem']= expected
- @gem_env.gem_paths.should == ['/path/to/gems', '/another/path/to/gems']
+ expect(@gem_env.gem_paths).to eq(['/path/to/gems', '/another/path/to/gems'])
end
it "builds the gems source index from the gem paths" do
- @gem_env.stub(:gem_paths).and_return(['/path/to/gems', '/another/path/to/gems'])
+ allow(@gem_env).to receive(:gem_paths).and_return(['/path/to/gems', '/another/path/to/gems'])
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.8.0')
@gem_env.gem_specification
- Gem::Specification.dirs.should == [ '/path/to/gems/specifications', '/another/path/to/gems/specifications' ]
+ expect(Gem::Specification.dirs).to eq([ '/path/to/gems/specifications', '/another/path/to/gems/specifications' ])
else
- Gem::SourceIndex.should_receive(:from_gems_in).with('/path/to/gems/specifications', '/another/path/to/gems/specifications')
+ expect(Gem::SourceIndex).to receive(:from_gems_in).with('/path/to/gems/specifications', '/another/path/to/gems/specifications')
@gem_env.gem_source_index
end
end
@@ -244,17 +245,17 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do
gems = [gemspec('rspec', Gem::Version.new('1.2.9')), gemspec('rspec', Gem::Version.new('1.3.0'))]
rspec_dep = Gem::Dependency.new('rspec', nil)
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.8.0')
- @gem_env.stub(:gem_specification).and_return(Gem::Specification)
- @gem_env.gem_specification.should_receive(:find_all_by_name).with(rspec_dep.name, rspec_dep.requirement).and_return(gems)
+ allow(@gem_env).to receive(:gem_specification).and_return(Gem::Specification)
+ expect(@gem_env.gem_specification).to receive(:find_all_by_name).with(rspec_dep.name, rspec_dep.requirement).and_return(gems)
else
- @gem_env.stub(:gem_source_index).and_return(Gem.source_index)
- @gem_env.gem_source_index.should_receive(:search).with(rspec_dep).and_return(gems)
+ allow(@gem_env).to receive(:gem_source_index).and_return(Gem.source_index)
+ expect(@gem_env.gem_source_index).to receive(:search).with(rspec_dep).and_return(gems)
end
- @gem_env.installed_versions(Gem::Dependency.new('rspec', nil)).should == gems
+ expect(@gem_env.installed_versions(Gem::Dependency.new('rspec', nil))).to eq(gems)
end
it "determines the installed versions of gems from the source index (part2: the unmockening)" do
- $stdout.stub(:write)
+ allow($stdout).to receive(:write)
path_to_gem = if windows?
`where gem`.split[1]
else
@@ -264,7 +265,7 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do
gem_env = Chef::Provider::Package::Rubygems::AlternateGemEnvironment.new(path_to_gem)
expected = ['rspec-core', Gem::Version.new(RSpec::Core::Version::STRING)]
actual = gem_env.installed_versions(Gem::Dependency.new('rspec-core', nil)).map { |s| [s.name, s.version] }
- actual.should include(expected)
+ expect(actual).to include(expected)
end
it "detects when the target gem environment is the jruby platform" do
@@ -290,23 +291,23 @@ RubyGems Environment:
- "install" => "--env-shebang"
- "update" => "--env-shebang"
- "gem" => "--no-rdoc --no-ri"
- - :sources => ["http://rubygems.org/", "http://gems.github.com/"]
+ - :sources => ["https://rubygems.org/", "http://gems.github.com/"]
- REMOTE SOURCES:
- - http://rubygems.org/
+ - https://rubygems.org/
- http://gems.github.com/
JRUBY_GEM_ENV
- @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('jruby_gem_env', :stdout => gem_env_out))
+ expect(@gem_env).to receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('jruby_gem_env', :stdout => gem_env_out))
expected = ['ruby', Gem::Platform.new('universal-java-1.6')]
- @gem_env.gem_platforms.should == expected
+ expect(@gem_env.gem_platforms).to eq(expected)
# it should also cache the result
- Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache['/usr/weird/bin/gem'].should == expected
+ expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache['/usr/weird/bin/gem']).to eq(expected)
end
it "uses the cached result for gem platforms if available" do
- @gem_env.should_not_receive(:shell_out!)
+ expect(@gem_env).not_to receive(:shell_out!)
expected = ['ruby', Gem::Platform.new('universal-java-1.6')]
Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache['/usr/weird/bin/gem']= expected
- @gem_env.gem_platforms.should == expected
+ expect(@gem_env.gem_platforms).to eq(expected)
end
it "uses the current gem platforms when the target env is not jruby" do
@@ -331,15 +332,15 @@ RubyGems Environment:
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- - :sources => ["http://rubygems.org/", "http://gems.github.com/"]
+ - :sources => ["https://rubygems.org/", "http://gems.github.com/"]
- "gem" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- - http://rubygems.org/
+ - https://rubygems.org/
- http://gems.github.com/
RBX_GEM_ENV
- @gem_env.should_receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('rbx_gem_env', :stdout => gem_env_out))
- @gem_env.gem_platforms.should == Gem.platforms
- Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache['/usr/weird/bin/gem'].should == Gem.platforms
+ expect(@gem_env).to receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('rbx_gem_env', :stdout => gem_env_out))
+ expect(@gem_env.gem_platforms).to eq(Gem.platforms)
+ expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache['/usr/weird/bin/gem']).to eq(Gem.platforms)
end
it "yields to a block while masquerading as a different gems platform" do
@@ -352,8 +353,8 @@ RBX_GEM_ENV
end
rescue RuntimeError
end
- platforms_in_block.should == ['ruby', Gem::Platform.new('sparc64-java-1.7')]
- Gem.platforms.should == original_platforms
+ expect(platforms_in_block).to eq(['ruby', Gem::Platform.new('sparc64-java-1.7')])
+ expect(Gem.platforms).to eq(original_platforms)
end
end
@@ -369,7 +370,7 @@ describe Chef::Provider::Package::Rubygems do
@run_context = Chef::RunContext.new(@node, {}, @events)
# We choose detect omnibus via RbConfig::CONFIG['bindir'] in Chef::Provider::Package::Rubygems.new
- RbConfig::CONFIG.stub(:[]).with('bindir').and_return("/usr/bin/ruby")
+ allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return("/usr/bin/ruby")
@provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
end
@@ -378,7 +379,7 @@ describe Chef::Provider::Package::Rubygems do
it "target_version_already_installed? should return false so that we can search for candidates" do
@provider.load_current_resource
- @provider.target_version_already_installed?.should be_false
+ expect(@provider.target_version_already_installed?).to be_falsey
end
end
@@ -387,74 +388,74 @@ describe Chef::Provider::Package::Rubygems do
it "triggers a gem configuration load so a later one will not stomp its config values" do
# ugly, is there a better way?
- Gem.instance_variable_get(:@configuration).should_not be_nil
+ expect(Gem.instance_variable_get(:@configuration)).not_to be_nil
end
it "uses the CurrentGemEnvironment implementation when no gem_binary_path is provided" do
- @provider.gem_env.should be_a_kind_of(Chef::Provider::Package::Rubygems::CurrentGemEnvironment)
+ expect(@provider.gem_env).to be_a_kind_of(Chef::Provider::Package::Rubygems::CurrentGemEnvironment)
end
it "uses the AlternateGemEnvironment implementation when a gem_binary_path is provided" do
@new_resource.gem_binary('/usr/weird/bin/gem')
provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
- provider.gem_env.gem_binary_location.should == '/usr/weird/bin/gem'
+ expect(provider.gem_env.gem_binary_location).to eq('/usr/weird/bin/gem')
end
it "searches for a gem binary when running on Omnibus on Unix" do
platform_mock :unix do
- RbConfig::CONFIG.stub(:[]).with('bindir').and_return("/opt/chef/embedded/bin")
- ENV.stub(:[]).with('PATH').and_return("/usr/bin:/usr/sbin:/opt/chef/embedded/bin")
- File.stub(:exists?).with('/usr/bin/gem').and_return(false)
- File.stub(:exists?).with('/usr/sbin/gem').and_return(true)
- File.stub(:exists?).with('/opt/chef/embedded/bin/gem').and_return(true) # should not get here
+ allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return("/opt/chef/embedded/bin")
+ allow(ENV).to receive(:[]).with('PATH').and_return("/usr/bin:/usr/sbin:/opt/chef/embedded/bin")
+ allow(File).to receive(:exists?).with('/usr/bin/gem').and_return(false)
+ allow(File).to receive(:exists?).with('/usr/sbin/gem').and_return(true)
+ allow(File).to receive(:exists?).with('/opt/chef/embedded/bin/gem').and_return(true) # should not get here
provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
- provider.gem_env.gem_binary_location.should == '/usr/sbin/gem'
+ expect(provider.gem_env.gem_binary_location).to eq('/usr/sbin/gem')
end
end
it "searches for a gem binary when running on Omnibus on Windows" do
platform_mock :windows do
- RbConfig::CONFIG.stub(:[]).with('bindir').and_return("d:/opscode/chef/embedded/bin")
- ENV.stub(:[]).with('PATH').and_return('C:\windows\system32;C:\windows;C:\Ruby186\bin;d:\opscode\chef\embedded\bin')
- File.stub(:exists?).with('C:\\windows\\system32\\gem').and_return(false)
- File.stub(:exists?).with('C:\\windows\\gem').and_return(false)
- File.stub(:exists?).with('C:\\Ruby186\\bin\\gem').and_return(true)
- File.stub(:exists?).with('d:\\opscode\\chef\\bin\\gem').and_return(false) # should not get here
- File.stub(:exists?).with('d:\\opscode\\chef\\embedded\\bin\\gem').and_return(false) # should not get here
+ allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return("d:/opscode/chef/embedded/bin")
+ allow(ENV).to receive(:[]).with('PATH').and_return('C:\windows\system32;C:\windows;C:\Ruby186\bin;d:\opscode\chef\embedded\bin')
+ allow(File).to receive(:exists?).with('C:\\windows\\system32\\gem').and_return(false)
+ allow(File).to receive(:exists?).with('C:\\windows\\gem').and_return(false)
+ allow(File).to receive(:exists?).with('C:\\Ruby186\\bin\\gem').and_return(true)
+ allow(File).to receive(:exists?).with('d:\\opscode\\chef\\bin\\gem').and_return(false) # should not get here
+ allow(File).to receive(:exists?).with('d:\\opscode\\chef\\embedded\\bin\\gem').and_return(false) # should not get here
provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
- provider.gem_env.gem_binary_location.should == 'C:\Ruby186\bin\gem'
+ expect(provider.gem_env.gem_binary_location).to eq('C:\Ruby186\bin\gem')
end
end
it "smites you when you try to use a hash of install options with an explicit gem binary" do
@new_resource.gem_binary('/foo/bar')
@new_resource.options(:fail => :burger)
- lambda {Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)}.should raise_error(ArgumentError)
+ expect {Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)}.to raise_error(ArgumentError)
end
it "converts the new resource into a gem dependency" do
- @provider.gem_dependency.should == Gem::Dependency.new('rspec-core', @spec_version)
+ expect(@provider.gem_dependency).to eq(Gem::Dependency.new('rspec-core', @spec_version))
@new_resource.version('~> 1.2.0')
- @provider.gem_dependency.should == Gem::Dependency.new('rspec-core', '~> 1.2.0')
+ expect(@provider.gem_dependency).to eq(Gem::Dependency.new('rspec-core', '~> 1.2.0'))
end
describe "when determining the currently installed version" do
it "sets the current version to the version specified by the new resource if that version is installed" do
@provider.load_current_resource
- @provider.current_resource.version.should == @spec_version
+ expect(@provider.current_resource.version).to eq(@spec_version)
end
it "sets the current version to the highest installed version if the requested version is not installed" do
@new_resource.version('9000.0.2')
@provider.load_current_resource
- @provider.current_resource.version.should == @spec_version
+ expect(@provider.current_resource.version).to eq(@spec_version)
end
it "leaves the current version at nil if the package is not installed" do
@new_resource.package_name("no-such-gem-should-exist-with-this-name")
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
end
@@ -463,23 +464,23 @@ describe Chef::Provider::Package::Rubygems do
it "does not query for available versions when the current version is the target version" do
@provider.current_resource = @new_resource.dup
- @provider.candidate_version.should be_nil
+ expect(@provider.candidate_version).to be_nil
end
it "determines the candidate version by querying the remote gem servers" do
@new_resource.source('http://mygems.example.com')
version = Gem::Version.new(@spec_version)
- @provider.gem_env.should_receive(:candidate_version_from_remote).
+ expect(@provider.gem_env).to receive(:candidate_version_from_remote).
with(Gem::Dependency.new('rspec-core', @spec_version), "http://mygems.example.com").
and_return(version)
- @provider.candidate_version.should == @spec_version
+ expect(@provider.candidate_version).to eq(@spec_version)
end
it "parses the gem's specification if the requested source is a file" do
@new_resource.package_name('chef-integration-test')
@new_resource.version('>= 0')
@new_resource.source(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
- @provider.candidate_version.should == '0.1.0'
+ expect(@provider.candidate_version).to eq('0.1.0')
end
end
@@ -489,56 +490,56 @@ describe Chef::Provider::Package::Rubygems do
@current_resource = Chef::Resource::GemPackage.new('rspec-core')
@provider.current_resource = @current_resource
@gem_dep = Gem::Dependency.new('rspec-core', @spec_version)
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
end
describe "in the current gem environment" do
it "installs the gem via the gems api when no explicit options are used" do
- @provider.gem_env.should_receive(:install).with(@gem_dep, :sources => nil)
- @provider.action_install.should be_true
+ expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => nil)
+ expect(@provider.action_install).to be_truthy
end
it "installs the gem via the gems api when a remote source is provided" do
@new_resource.source('http://gems.example.org')
sources = ['http://gems.example.org']
- @provider.gem_env.should_receive(:install).with(@gem_dep, :sources => sources)
- @provider.action_install.should be_true
+ expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => sources)
+ expect(@provider.action_install).to be_truthy
end
it "installs the gem from file via the gems api when no explicit options are used" do
@new_resource.source(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
- @provider.gem_env.should_receive(:install).with(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
- @provider.action_install.should be_true
+ expect(@provider.gem_env).to receive(:install).with(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
+ expect(@provider.action_install).to be_truthy
end
it "installs the gem from file via the gems api when the package is a path and the source is nil" do
@new_resource = Chef::Resource::GemPackage.new(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
@provider = Chef::Provider::Package::Rubygems.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @new_resource.source.should == CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem'
- @provider.gem_env.should_receive(:install).with(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
- @provider.action_install.should be_true
+ expect(@new_resource.source).to eq(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
+ expect(@provider.gem_env).to receive(:install).with(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
+ expect(@provider.action_install).to be_truthy
end
# this catches 'gem_package "foo"' when "./foo" is a file in the cwd, and instead of installing './foo' it fetches the remote gem
it "installs the gem via the gems api, when the package has no file separator characters in it, but a matching file exists in cwd" do
- ::File.stub(:exists?).and_return(true)
+ allow(::File).to receive(:exists?).and_return(true)
@new_resource.package_name('rspec-core')
- @provider.gem_env.should_receive(:install).with(@gem_dep, :sources => nil)
- @provider.action_install.should be_true
+ expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => nil)
+ expect(@provider.action_install).to be_truthy
end
it "installs the gem by shelling out when options are provided as a String" do
@new_resource.options('-i /alt/install/location')
expected ="gem install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\" -i /alt/install/location"
- @provider.should_receive(:shell_out!).with(expected, :env => nil)
- @provider.action_install.should be_true
+ expect(@provider).to receive(:shell_out!).with(expected, :env => nil)
+ expect(@provider.action_install).to be_truthy
end
it "installs the gem via the gems api when options are given as a Hash" do
@new_resource.options(:install_dir => '/alt/install/location')
- @provider.gem_env.should_receive(:install).with(@gem_dep, :sources => nil, :install_dir => '/alt/install/location')
- @provider.action_install.should be_true
+ expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => nil, :install_dir => '/alt/install/location')
+ expect(@provider.action_install).to be_truthy
end
describe "at a specific version" do
@@ -547,24 +548,24 @@ describe Chef::Provider::Package::Rubygems do
end
it "installs the gem via the gems api" do
- @provider.gem_env.should_receive(:install).with(@gem_dep, :sources => nil)
- @provider.action_install.should be_true
+ expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => nil)
+ expect(@provider.action_install).to be_truthy
end
end
describe "at version specified with comparison operator" do
it "skips install if current version satisifies requested version" do
- @current_resource.stub(:version).and_return("2.3.3")
- @new_resource.stub(:version).and_return(">=2.3.0")
+ allow(@current_resource).to receive(:version).and_return("2.3.3")
+ allow(@new_resource).to receive(:version).and_return(">=2.3.0")
- @provider.gem_env.should_not_receive(:install)
+ expect(@provider.gem_env).not_to receive(:install)
@provider.action_install
end
it "allows user to specify gem version with fuzzy operator" do
- @current_resource.stub(:version).and_return("2.3.3")
- @new_resource.stub(:version).and_return("~>2.3.0")
+ allow(@current_resource).to receive(:version).and_return("2.3.3")
+ allow(@new_resource).to receive(:version).and_return("~>2.3.0")
- @provider.gem_env.should_not_receive(:install)
+ expect(@provider.gem_env).not_to receive(:install)
@provider.action_install
end
end
@@ -573,16 +574,16 @@ describe Chef::Provider::Package::Rubygems do
describe "in an alternate gem environment" do
it "installs the gem by shelling out to gem install" do
@new_resource.gem_binary('/usr/weird/bin/gem')
- @provider.should_receive(:shell_out!).with("/usr/weird/bin/gem install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\"", :env=>nil)
- @provider.action_install.should be_true
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install rspec-core -q --no-rdoc --no-ri -v \"#{@spec_version}\"", :env=>nil)
+ expect(@provider.action_install).to be_truthy
end
it "installs the gem from file by shelling out to gem install" do
@new_resource.gem_binary('/usr/weird/bin/gem')
@new_resource.source(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
@new_resource.version('>= 0')
- @provider.should_receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", :env=>nil)
- @provider.action_install.should be_true
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", :env=>nil)
+ expect(@provider.action_install).to be_truthy
end
it "installs the gem from file by shelling out to gem install when the package is a path and the source is nil" do
@@ -591,9 +592,9 @@ describe Chef::Provider::Package::Rubygems do
@provider.current_resource = @current_resource
@new_resource.gem_binary('/usr/weird/bin/gem')
@new_resource.version('>= 0')
- @new_resource.source.should == CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem'
- @provider.should_receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", :env=>nil)
- @provider.action_install.should be_true
+ expect(@new_resource.source).to eq(CHEF_SPEC_DATA + '/gems/chef-integration-test-0.1.0.gem')
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem install #{CHEF_SPEC_DATA}/gems/chef-integration-test-0.1.0.gem -q --no-rdoc --no-ri -v \">= 0\"", :env=>nil)
+ expect(@provider.action_install).to be_truthy
end
end
@@ -611,32 +612,32 @@ describe Chef::Provider::Package::Rubygems do
describe "in the current gem environment" do
it "uninstalls via the api when no explicit options are used" do
# pre-reqs for action_remove to actually remove the package:
- @provider.new_resource.version.should be_nil
- @provider.current_resource.version.should_not be_nil
+ expect(@provider.new_resource.version).to be_nil
+ expect(@provider.current_resource.version).not_to be_nil
# the behavior we're testing:
- @provider.gem_env.should_receive(:uninstall).with('rspec', nil)
+ expect(@provider.gem_env).to receive(:uninstall).with('rspec', nil)
@provider.action_remove
end
it "uninstalls via the api when options are given as a Hash" do
# pre-reqs for action_remove to actually remove the package:
- @provider.new_resource.version.should be_nil
- @provider.current_resource.version.should_not be_nil
+ expect(@provider.new_resource.version).to be_nil
+ expect(@provider.current_resource.version).not_to be_nil
# the behavior we're testing:
@new_resource.options(:install_dir => '/alt/install/location')
- @provider.gem_env.should_receive(:uninstall).with('rspec', nil, :install_dir => '/alt/install/location')
+ expect(@provider.gem_env).to receive(:uninstall).with('rspec', nil, :install_dir => '/alt/install/location')
@provider.action_remove
end
it "uninstalls via the gem command when options are given as a String" do
@new_resource.options('-i /alt/install/location')
- @provider.should_receive(:shell_out!).with("gem uninstall rspec -q -x -I -a -i /alt/install/location", :env=>nil)
+ expect(@provider).to receive(:shell_out!).with("gem uninstall rspec -q -x -I -a -i /alt/install/location", :env=>nil)
@provider.action_remove
end
it "uninstalls a specific version of a gem when a version is provided" do
@new_resource.version('1.2.3')
- @provider.gem_env.should_receive(:uninstall).with('rspec', '1.2.3')
+ expect(@provider.gem_env).to receive(:uninstall).with('rspec', '1.2.3')
@provider.action_remove
end
end
@@ -644,7 +645,7 @@ describe Chef::Provider::Package::Rubygems do
describe "in an alternate gem environment" do
it "uninstalls via the gem command" do
@new_resource.gem_binary('/usr/weird/bin/gem')
- @provider.should_receive(:shell_out!).with("/usr/weird/bin/gem uninstall rspec -q -x -I -a", :env=>nil)
+ expect(@provider).to receive(:shell_out!).with("/usr/weird/bin/gem uninstall rspec -q -x -I -a", :env=>nil)
@provider.action_remove
end
end
diff --git a/spec/unit/provider/package/smartos_spec.rb b/spec/unit/provider/package/smartos_spec.rb
index 1c690acbf5..db39589b85 100644
--- a/spec/unit/provider/package/smartos_spec.rb
+++ b/spec/unit/provider/package/smartos_spec.rb
@@ -31,7 +31,7 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
@status = double("Status", :exitstatus => 0)
@provider = Chef::Provider::Package::SmartOS.new(@new_resource, @run_context)
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@stdin = StringIO.new
@stdout = "varnish-2.1.5nb2\n"
@stderr = StringIO.new
@@ -42,28 +42,28 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
describe "when loading current resource" do
it "should create a current resource with the name of the new_resource" do
- @provider.should_receive(:shell_out!).and_return(@shell_out)
- Chef::Resource::Package.should_receive(:new).and_return(@current_resource)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
+ expect(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resource package name" do
- @provider.should_receive(:shell_out!).and_return(@shell_out)
- @current_resource.should_receive(:package_name).with(@new_resource.package_name)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
+ expect(@current_resource).to receive(:package_name).with(@new_resource.package_name)
@provider.load_current_resource
end
it "should set the installed version if it is installed" do
- @provider.should_receive(:shell_out!).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).and_return(@shell_out)
@provider.load_current_resource
- @current_resource.version.should == "2.1.5nb2"
+ expect(@current_resource.version).to eq("2.1.5nb2")
end
it "should set the installed version to nil if it's not installed" do
out = OpenStruct.new(:stdout => nil)
- @provider.should_receive(:shell_out!).and_return(out)
+ expect(@provider).to receive(:shell_out!).and_return(out)
@provider.load_current_resource
- @current_resource.version.should == nil
+ expect(@current_resource.version).to eq(nil)
end
@@ -72,18 +72,18 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
describe "candidate_version" do
it "should return the candidate_version variable if already setup" do
@provider.candidate_version = "2.1.1"
- @provider.should_not_receive(:shell_out!)
+ expect(@provider).not_to receive(:shell_out!)
@provider.candidate_version
end
it "should lookup the candidate_version if the variable is not already set" do
search = double()
- search.should_receive(:each_line).
+ expect(search).to receive(:each_line).
and_yield("something-varnish-1.1.1 something varnish like\n").
and_yield("varnish-2.3.4 actual varnish\n")
@shell_out = double('shell_out!', :stdout => search)
- @provider.should_receive(:shell_out!).with('/opt/local/bin/pkgin se varnish', :env => nil, :returns => [0,1]).and_return(@shell_out)
- @provider.candidate_version.should == "2.3.4"
+ expect(@provider).to receive(:shell_out!).with('/opt/local/bin/pkgin se varnish', :env => nil, :returns => [0,1]).and_return(@shell_out)
+ expect(@provider.candidate_version).to eq("2.3.4")
end
end
@@ -91,8 +91,8 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
it "run pkgin and install the package" do
out = OpenStruct.new(:stdout => nil)
- @provider.should_receive(:shell_out!).with("/opt/local/sbin/pkg_info -E \"varnish*\"", {:env => nil, :returns=>[0,1]}).and_return(@shell_out)
- @provider.should_receive(:shell_out!).with("/opt/local/bin/pkgin -y install varnish-2.1.5nb2", {:env=>nil}).and_return(out)
+ expect(@provider).to receive(:shell_out!).with("/opt/local/sbin/pkg_info -E \"varnish*\"", {:env => nil, :returns=>[0,1]}).and_return(@shell_out)
+ expect(@provider).to receive(:shell_out!).with("/opt/local/bin/pkgin -y install varnish-2.1.5nb2", {:env=>nil}).and_return(out)
@provider.load_current_resource
@provider.install_package("varnish", "2.1.5nb2")
end
diff --git a/spec/unit/provider/package/solaris_spec.rb b/spec/unit/provider/package/solaris_spec.rb
index d83ccbdf06..8438202576 100644
--- a/spec/unit/provider/package/solaris_spec.rb
+++ b/spec/unit/provider/package/solaris_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Provider::Package::Solaris do
@new_resource.source("/tmp/bash.pkg")
@provider = Chef::Provider::Package::Solaris.new(@new_resource, @run_context)
- ::File.stub(:exists?).and_return(true)
+ allow(::File).to receive(:exists?).and_return(true)
end
describe "assessing the current package status" do
@@ -50,119 +50,119 @@ PKGINFO
end
it "should create a current resource with the name of new_resource" do
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.name.should == "SUNWbash"
+ expect(@provider.current_resource.name).to eq("SUNWbash")
end
it "should set the current reource package name to the new resource package name" do
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == "SUNWbash"
+ expect(@provider.current_resource.package_name).to eq("SUNWbash")
end
it "should raise an exception if a source is supplied but not found" do
- @provider.stub(:popen4).and_return(@status)
- ::File.stub(:exists?).and_return(false)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ allow(::File).to receive(:exists?).and_return(false)
@provider.define_resource_requirements
@provider.load_current_resource
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Package)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Package)
end
it "should get the source package version from pkginfo if provided" do
@stdout = StringIO.new(@pkginfo)
@stdin, @stderr = StringIO.new, StringIO.new
- @provider.should_receive(:popen4).with("pkginfo -l -d /tmp/bash.pkg SUNWbash").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @provider.should_receive(:popen4).with("pkginfo -l SUNWbash").and_return(@status)
+ expect(@provider).to receive(:popen4).with("pkginfo -l -d /tmp/bash.pkg SUNWbash").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("pkginfo -l SUNWbash").and_return(@status)
@provider.load_current_resource
- @provider.current_resource.package_name.should == "SUNWbash"
- @new_resource.version.should == "11.10.0,REV=2005.01.08.05.16"
+ expect(@provider.current_resource.package_name).to eq("SUNWbash")
+ expect(@new_resource.version).to eq("11.10.0,REV=2005.01.08.05.16")
end
it "should return the current version installed if found by pkginfo" do
@stdout = StringIO.new(@pkginfo)
@stdin, @stderr = StringIO.new, StringIO.new
- @provider.should_receive(:popen4).with("pkginfo -l -d /tmp/bash.pkg SUNWbash").and_return(@status)
- @provider.should_receive(:popen4).with("pkginfo -l SUNWbash").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("pkginfo -l -d /tmp/bash.pkg SUNWbash").and_return(@status)
+ expect(@provider).to receive(:popen4).with("pkginfo -l SUNWbash").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.version.should == "11.10.0,REV=2005.01.08.05.16"
+ expect(@provider.current_resource.version).to eq("11.10.0,REV=2005.01.08.05.16")
end
it "should raise an exception if the source is not set but we are installing" do
@new_resource = Chef::Resource::Package.new("SUNWbash")
@provider = Chef::Provider::Package::Solaris.new(@new_resource, @run_context)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
end
it "should raise an exception if pkginfo fails to run" do
@status = double("Status", :exitstatus => -1)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
end
it "should return a current resource with a nil version if the package is not found" do
@stdout = StringIO.new
- @provider.should_receive(:popen4).with("pkginfo -l -d /tmp/bash.pkg SUNWbash").and_return(@status)
- @provider.should_receive(:popen4).with("pkginfo -l SUNWbash").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@provider).to receive(:popen4).with("pkginfo -l -d /tmp/bash.pkg SUNWbash").and_return(@status)
+ expect(@provider).to receive(:popen4).with("pkginfo -l SUNWbash").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
end
describe "candidate_version" do
it "should return the candidate_version variable if already setup" do
@provider.candidate_version = "11.10.0,REV=2005.01.08.05.16"
- @provider.should_not_receive(:popen4)
+ expect(@provider).not_to receive(:popen4)
@provider.candidate_version
end
it "should lookup the candidate_version if the variable is not already set" do
@status = double("Status", :exitstatus => 0)
- @provider.stub(:popen4).and_return(@status)
- @provider.should_receive(:popen4)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect(@provider).to receive(:popen4)
@provider.candidate_version
end
it "should throw and exception if the exitstatus is not 0" do
@status = double("Status", :exitstatus => 1)
- @provider.stub(:popen4).and_return(@status)
- lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package)
+ allow(@provider).to receive(:popen4).and_return(@status)
+ expect { @provider.candidate_version }.to raise_error(Chef::Exceptions::Package)
end
end
describe "install and upgrade" do
it "should run pkgadd -n -d with the package source to install" do
- @provider.should_receive(:shell_out!).with("pkgadd -n -d /tmp/bash.pkg all")
+ expect(@provider).to receive(:shell_out!).with("pkgadd -n -d /tmp/bash.pkg all")
@provider.install_package("SUNWbash", "11.10.0,REV=2005.01.08.05.16")
end
it "should run pkgadd -n -d when the package is a path to install" do
@new_resource = Chef::Resource::Package.new("/tmp/bash.pkg")
@provider = Chef::Provider::Package::Solaris.new(@new_resource, @run_context)
- @new_resource.source.should == "/tmp/bash.pkg"
- @provider.should_receive(:shell_out!).with("pkgadd -n -d /tmp/bash.pkg all")
+ expect(@new_resource.source).to eq("/tmp/bash.pkg")
+ expect(@provider).to receive(:shell_out!).with("pkgadd -n -d /tmp/bash.pkg all")
@provider.install_package("/tmp/bash.pkg", "11.10.0,REV=2005.01.08.05.16")
end
it "should run pkgadd -n -a /tmp/myadmin -d with the package options -a /tmp/myadmin" do
- @new_resource.stub(:options).and_return("-a /tmp/myadmin")
- @provider.should_receive(:shell_out!).with("pkgadd -n -a /tmp/myadmin -d /tmp/bash.pkg all")
+ allow(@new_resource).to receive(:options).and_return("-a /tmp/myadmin")
+ expect(@provider).to receive(:shell_out!).with("pkgadd -n -a /tmp/myadmin -d /tmp/bash.pkg all")
@provider.install_package("SUNWbash", "11.10.0,REV=2005.01.08.05.16")
end
end
describe "remove" do
it "should run pkgrm -n to remove the package" do
- @provider.should_receive(:shell_out!).with("pkgrm -n SUNWbash")
+ expect(@provider).to receive(:shell_out!).with("pkgrm -n SUNWbash")
@provider.remove_package("SUNWbash", "11.10.0,REV=2005.01.08.05.16")
end
it "should run pkgrm -n -a /tmp/myadmin with options -a /tmp/myadmin" do
- @new_resource.stub(:options).and_return("-a /tmp/myadmin")
- @provider.should_receive(:shell_out!).with("pkgrm -n -a /tmp/myadmin SUNWbash")
+ allow(@new_resource).to receive(:options).and_return("-a /tmp/myadmin")
+ expect(@provider).to receive(:shell_out!).with("pkgrm -n -a /tmp/myadmin SUNWbash")
@provider.remove_package("SUNWbash", "11.10.0,REV=2005.01.08.05.16")
end
diff --git a/spec/unit/provider/package/windows/msi_spec.rb b/spec/unit/provider/package/windows/msi_spec.rb
index c8a63ad066..e539bbbb79 100644
--- a/spec/unit/provider/package/windows/msi_spec.rb
+++ b/spec/unit/provider/package/windows/msi_spec.rb
@@ -37,15 +37,15 @@ describe Chef::Provider::Package::Windows::MSI, :windows_only do
describe "installed_version" do
it "returns the installed version" do
- provider.stub(:get_product_property).and_return("{23170F69-40C1-2702-0920-000001000000}")
- provider.stub(:get_installed_version).with("{23170F69-40C1-2702-0920-000001000000}").and_return("3.14159.1337.42")
+ allow(provider).to receive(:get_product_property).and_return("{23170F69-40C1-2702-0920-000001000000}")
+ allow(provider).to receive(:get_installed_version).with("{23170F69-40C1-2702-0920-000001000000}").and_return("3.14159.1337.42")
expect(provider.installed_version).to eql("3.14159.1337.42")
end
end
describe "package_version" do
it "returns the version of a package" do
- provider.stub(:get_product_property).with(/calculator.msi$/, "ProductVersion").and_return(42)
+ allow(provider).to receive(:get_product_property).with(/calculator.msi$/, "ProductVersion").and_return(42)
expect(provider.package_version).to eql(42)
end
end
diff --git a/spec/unit/provider/package/windows_spec.rb b/spec/unit/provider/package/windows_spec.rb
index b4ababb243..d402113d72 100644
--- a/spec/unit/provider/package/windows_spec.rb
+++ b/spec/unit/provider/package/windows_spec.rb
@@ -27,8 +27,8 @@ describe Chef::Provider::Package::Windows, :windows_only do
describe "load_current_resource" do
before(:each) do
- Chef::Util::PathHelper.stub(:validate_path)
- provider.stub(:package_provider).and_return(double('package_provider',
+ allow(Chef::Util::PathHelper).to receive(:validate_path)
+ allow(provider).to receive(:package_provider).and_return(double('package_provider',
:installed_version => "1.0", :package_version => "2.0"))
end
@@ -56,20 +56,20 @@ describe Chef::Provider::Package::Windows, :windows_only do
describe "package_provider" do
it "sets the package provider to MSI if the the installer type is :msi" do
- provider.stub(:installer_type).and_return(:msi)
+ allow(provider).to receive(:installer_type).and_return(:msi)
expect(provider.package_provider).to be_a(Chef::Provider::Package::Windows::MSI)
end
it "raises an error if the installer_type is unknown" do
- provider.stub(:installer_type).and_return(:apt_for_windows)
+ allow(provider).to receive(:installer_type).and_return(:apt_for_windows)
expect { provider.package_provider }.to raise_error
end
end
describe "installer_type" do
it "it returns @installer_type if it is set" do
- provider.new_resource.installer_type("downeaster")
- expect(provider.installer_type).to eql("downeaster")
+ provider.new_resource.installer_type(:downeaster)
+ expect(provider.installer_type).to eql(:downeaster)
end
it "sets installer_type to msi if the source ends in .msi" do
diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb
index 9b3b6b60e0..0d2a44f3ae 100644
--- a/spec/unit/provider/package/yum_spec.rb
+++ b/spec/unit/provider/package/yum_spec.rb
@@ -37,7 +37,7 @@ describe Chef::Provider::Package::Yum do
:package_repository => "base",
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@pid = double("PID")
end
@@ -45,32 +45,32 @@ describe Chef::Provider::Package::Yum do
describe "when loading the current system state" do
it "should create a current resource with the name of the new_resource" do
@provider.load_current_resource
- @provider.current_resource.name.should == "cups"
+ expect(@provider.current_resource.name).to eq("cups")
end
it "should set the current resources package name to the new resources package name" do
@provider.load_current_resource
- @provider.current_resource.package_name.should == "cups"
+ expect(@provider.current_resource.package_name).to eq("cups")
end
it "should set the installed version to nil on the current resource if no installed package" do
- @yum_cache.stub(:installed_version).and_return(nil)
+ allow(@yum_cache).to receive(:installed_version).and_return(nil)
@provider.load_current_resource
- @provider.current_resource.version.should be_nil
+ expect(@provider.current_resource.version).to be_nil
end
it "should set the installed version if yum has one" do
@provider.load_current_resource
- @provider.current_resource.version.should == "1.2.4-11.18.el5"
+ expect(@provider.current_resource.version).to eq("1.2.4-11.18.el5")
end
it "should set the candidate version if yum info has one" do
@provider.load_current_resource
- @provider.candidate_version.should eql("1.2.4-11.18.el5_2.3")
+ expect(@provider.candidate_version).to eql("1.2.4-11.18.el5_2.3")
end
it "should return the current resouce" do
- @provider.load_current_resource.should eql(@provider.current_resource)
+ expect(@provider.load_current_resource).to eql(@provider.current_resource)
end
describe "when arch in package_name" do
@@ -79,11 +79,11 @@ describe Chef::Provider::Package::Yum do
@yum_cache = double(
'Chef::Provider::Yum::YumCache'
)
- @yum_cache.stub(:installed_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:installed_version) do |package_name, arch|
# nothing installed for package_name/new_package_name
nil
end
- @yum_cache.stub(:candidate_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:candidate_version) do |package_name, arch|
if package_name == "testing.noarch" || package_name == "testing.more.noarch"
nil
# candidate for new_package_name
@@ -91,21 +91,21 @@ describe Chef::Provider::Package::Yum do
"1.1"
end
end
- @yum_cache.stub(:package_available?).and_return(true)
- @yum_cache.stub(:disable_extra_repo_control).and_return(true)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(@yum_cache).to receive(:package_available?).and_return(true)
+ allow(@yum_cache).to receive(:disable_extra_repo_control).and_return(true)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.new_resource.package_name.should == "testing"
- @provider.new_resource.arch.should == "noarch"
- @provider.arch.should == "noarch"
+ expect(@provider.new_resource.package_name).to eq("testing")
+ expect(@provider.new_resource.arch).to eq("noarch")
+ expect(@provider.arch).to eq("noarch")
@new_resource = Chef::Resource::YumPackage.new('testing.more.noarch')
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.new_resource.package_name.should == "testing.more"
- @provider.new_resource.arch.should == "noarch"
- @provider.arch.should == "noarch"
+ expect(@provider.new_resource.package_name).to eq("testing.more")
+ expect(@provider.new_resource.arch).to eq("noarch")
+ expect(@provider.arch).to eq("noarch")
end
it "should not set the arch when an existing package_name is found" do
@@ -113,7 +113,7 @@ describe Chef::Provider::Package::Yum do
@yum_cache = double(
'Chef::Provider::Yum::YumCache'
)
- @yum_cache.stub(:installed_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:installed_version) do |package_name, arch|
# installed for package_name
if package_name == "testing.beta3" || package_name == "testing.beta3.more"
"1.1"
@@ -121,26 +121,26 @@ describe Chef::Provider::Package::Yum do
nil
end
end
- @yum_cache.stub(:candidate_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:candidate_version) do |package_name, arch|
# no candidate for package_name/new_package_name
nil
end
- @yum_cache.stub(:package_available?).and_return(true)
- @yum_cache.stub(:disable_extra_repo_control).and_return(true)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(@yum_cache).to receive(:package_available?).and_return(true)
+ allow(@yum_cache).to receive(:disable_extra_repo_control).and_return(true)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
# annoying side effect of the fun stub'ing above
@provider.load_current_resource
- @provider.new_resource.package_name.should == "testing.beta3"
- @provider.new_resource.arch.should == nil
- @provider.arch.should == nil
+ expect(@provider.new_resource.package_name).to eq("testing.beta3")
+ expect(@provider.new_resource.arch).to eq(nil)
+ expect(@provider.arch).to eq(nil)
@new_resource = Chef::Resource::YumPackage.new('testing.beta3.more')
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.new_resource.package_name.should == "testing.beta3.more"
- @provider.new_resource.arch.should == nil
- @provider.arch.should == nil
+ expect(@provider.new_resource.package_name).to eq("testing.beta3.more")
+ expect(@provider.new_resource.arch).to eq(nil)
+ expect(@provider.arch).to eq(nil)
end
it "should not set the arch when no existing package_name or new_package_name+new_arch is found" do
@@ -148,29 +148,29 @@ describe Chef::Provider::Package::Yum do
@yum_cache = double(
'Chef::Provider::Yum::YumCache'
)
- @yum_cache.stub(:installed_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:installed_version) do |package_name, arch|
# nothing installed for package_name/new_package_name
nil
end
- @yum_cache.stub(:candidate_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:candidate_version) do |package_name, arch|
# no candidate for package_name/new_package_name
nil
end
- @yum_cache.stub(:package_available?).and_return(true)
- @yum_cache.stub(:disable_extra_repo_control).and_return(true)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(@yum_cache).to receive(:package_available?).and_return(true)
+ allow(@yum_cache).to receive(:disable_extra_repo_control).and_return(true)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.new_resource.package_name.should == "testing.beta3"
- @provider.new_resource.arch.should == nil
- @provider.arch.should == nil
+ expect(@provider.new_resource.package_name).to eq("testing.beta3")
+ expect(@provider.new_resource.arch).to eq(nil)
+ expect(@provider.arch).to eq(nil)
@new_resource = Chef::Resource::YumPackage.new('testing.beta3.more')
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.new_resource.package_name.should == "testing.beta3.more"
- @provider.new_resource.arch.should == nil
- @provider.arch.should == nil
+ expect(@provider.new_resource.package_name).to eq("testing.beta3.more")
+ expect(@provider.new_resource.arch).to eq(nil)
+ expect(@provider.arch).to eq(nil)
end
it "should ensure it doesn't clobber an existing arch if passed" do
@@ -179,11 +179,11 @@ describe Chef::Provider::Package::Yum do
@yum_cache = double(
'Chef::Provider::Yum::YumCache'
)
- @yum_cache.stub(:installed_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:installed_version) do |package_name, arch|
# nothing installed for package_name/new_package_name
nil
end
- @yum_cache.stub(:candidate_version) do |package_name, arch|
+ allow(@yum_cache).to receive(:candidate_version) do |package_name, arch|
if package_name == "testing.noarch"
nil
# candidate for new_package_name
@@ -191,43 +191,43 @@ describe Chef::Provider::Package::Yum do
"1.1"
end
end.and_return("something")
- @yum_cache.stub(:package_available?).and_return(true)
- @yum_cache.stub(:disable_extra_repo_control).and_return(true)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(@yum_cache).to receive(:package_available?).and_return(true)
+ allow(@yum_cache).to receive(:disable_extra_repo_control).and_return(true)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.new_resource.package_name.should == "testing.i386"
- @provider.new_resource.arch.should == "x86_64"
+ expect(@provider.new_resource.package_name).to eq("testing.i386")
+ expect(@provider.new_resource.arch).to eq("x86_64")
end
end
it "should flush the cache if :before is true" do
- @new_resource.stub(:flush_cache).and_return({:after => false, :before => true})
- @yum_cache.should_receive(:reload).once
+ allow(@new_resource).to receive(:flush_cache).and_return({:after => false, :before => true})
+ expect(@yum_cache).to receive(:reload).once
@provider.load_current_resource
end
it "should flush the cache if :before is false" do
- @new_resource.stub(:flush_cache).and_return({:after => false, :before => false})
- @yum_cache.should_not_receive(:reload)
+ allow(@new_resource).to receive(:flush_cache).and_return({:after => false, :before => false})
+ expect(@yum_cache).not_to receive(:reload)
@provider.load_current_resource
end
it "should detect --enablerepo or --disablerepo when passed among options, collect them preserving order and notify the yum cache" do
- @new_resource.stub(:options).and_return("--stuff --enablerepo=foo --otherthings --disablerepo=a,b,c --enablerepo=bar")
- @yum_cache.should_receive(:enable_extra_repo_control).with("--enablerepo=foo --disablerepo=a,b,c --enablerepo=bar")
+ allow(@new_resource).to receive(:options).and_return("--stuff --enablerepo=foo --otherthings --disablerepo=a,b,c --enablerepo=bar")
+ expect(@yum_cache).to receive(:enable_extra_repo_control).with("--enablerepo=foo --disablerepo=a,b,c --enablerepo=bar")
@provider.load_current_resource
end
it "should let the yum cache know extra repos are disabled if --enablerepo or --disablerepo aren't among options" do
- @new_resource.stub(:options).and_return("--stuff --otherthings")
- @yum_cache.should_receive(:disable_extra_repo_control)
+ allow(@new_resource).to receive(:options).and_return("--stuff --otherthings")
+ expect(@yum_cache).to receive(:disable_extra_repo_control)
@provider.load_current_resource
end
it "should let the yum cache know extra repos are disabled if options aren't set" do
- @new_resource.stub(:options).and_return(nil)
- @yum_cache.should_receive(:disable_extra_repo_control)
+ allow(@new_resource).to receive(:options).and_return(nil)
+ expect(@yum_cache).to receive(:disable_extra_repo_control)
@provider.load_current_resource
end
@@ -242,12 +242,12 @@ describe Chef::Provider::Package::Yum do
:version_available? => true,
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
pkg = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "1.2.4-11.18.el5", "x86_64", [])
- @yum_cache.should_receive(:packages_from_require).and_return([pkg])
+ expect(@yum_cache).to receive(:packages_from_require).and_return([pkg])
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @new_resource.package_name.should == "test-package"
+ expect(@new_resource.package_name).to eq("test-package")
end
it "should search provides if package name can't be found, warn about multiple matches, but use the first one" do
@@ -261,14 +261,14 @@ describe Chef::Provider::Package::Yum do
:version_available? => true,
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
pkg_x = Chef::Provider::Package::Yum::RPMPackage.new("test-package-x", "1.2.4-11.18.el5", "x86_64", [])
pkg_y = Chef::Provider::Package::Yum::RPMPackage.new("test-package-y", "1.2.6-11.3.el5", "i386", [])
- @yum_cache.should_receive(:packages_from_require).and_return([pkg_x, pkg_y])
- Chef::Log.should_receive(:warn).exactly(1).times.with(%r{matched multiple Provides})
+ expect(@yum_cache).to receive(:packages_from_require).and_return([pkg_x, pkg_y])
+ expect(Chef::Log).to receive(:warn).exactly(1).times.with(%r{matched multiple Provides})
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @new_resource.package_name.should == "test-package-x"
+ expect(@new_resource.package_name).to eq("test-package-x")
end
it "should search provides if no package is available - if no match in installed provides then load the complete set" do
@@ -282,9 +282,9 @@ describe Chef::Provider::Package::Yum do
:version_available? => true,
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
- @yum_cache.should_receive(:packages_from_require).twice.and_return([])
- @yum_cache.should_receive(:reload_provides)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
+ expect(@yum_cache).to receive(:packages_from_require).twice.and_return([])
+ expect(@yum_cache).to receive(:reload_provides)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
end
@@ -300,14 +300,14 @@ describe Chef::Provider::Package::Yum do
:version_available? => true,
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
- @yum_cache.should_receive(:packages_from_require).once.and_return([])
- @yum_cache.should_not_receive(:reload_provides)
+ expect(@yum_cache).to receive(:packages_from_require).once.and_return([])
+ expect(@yum_cache).not_to receive(:reload_provides)
@new_resource.action(:remove)
@provider.load_current_resource
- @yum_cache.should_receive(:packages_from_require).once.and_return([])
- @yum_cache.should_not_receive(:reload_provides)
+ expect(@yum_cache).to receive(:packages_from_require).once.and_return([])
+ expect(@yum_cache).not_to receive(:reload_provides)
@new_resource.action(:purge)
@provider.load_current_resource
end
@@ -324,27 +324,27 @@ describe Chef::Provider::Package::Yum do
:version_available? => true,
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
- @yum_cache.should_receive(:packages_from_require).twice.and_return([])
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
+ expect(@yum_cache).to receive(:packages_from_require).twice.and_return([])
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @new_resource.package_name.should == "cups"
+ expect(@new_resource.package_name).to eq("cups")
end
end
describe "when installing a package" do
it "should run yum install with the package name and version" do
@provider.load_current_resource
- Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1)
- @provider.should_receive(:yum_command).with(
+ allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1)
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y install emacs-1.0"
)
@provider.install_package("emacs", "1.0")
end
it "should run yum localinstall if given a path to an rpm" do
- @new_resource.stub(:source).and_return("/tmp/emacs-21.4-20.el5.i386.rpm")
- @provider.should_receive(:yum_command).with(
+ allow(@new_resource).to receive(:source).and_return("/tmp/emacs-21.4-20.el5.i386.rpm")
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y localinstall /tmp/emacs-21.4-20.el5.i386.rpm"
)
@provider.install_package("emacs", "21.4-20.el5")
@@ -352,10 +352,10 @@ describe Chef::Provider::Package::Yum do
it "should run yum localinstall if given a path to an rpm as the package" do
@new_resource = Chef::Resource::Package.new("/tmp/emacs-21.4-20.el5.i386.rpm")
- ::File.stub(:exists?).and_return(true)
+ allow(::File).to receive(:exists?).and_return(true)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
- @new_resource.source.should == "/tmp/emacs-21.4-20.el5.i386.rpm"
- @provider.should_receive(:yum_command).with(
+ expect(@new_resource.source).to eq("/tmp/emacs-21.4-20.el5.i386.rpm")
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y localinstall /tmp/emacs-21.4-20.el5.i386.rpm"
)
@provider.install_package("/tmp/emacs-21.4-20.el5.i386.rpm", "21.4-20.el5")
@@ -363,9 +363,9 @@ describe Chef::Provider::Package::Yum do
it "should run yum install with the package name, version and arch" do
@provider.load_current_resource
- @new_resource.stub(:arch).and_return("i386")
- Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1)
- @provider.should_receive(:yum_command).with(
+ allow(@new_resource).to receive(:arch).and_return("i386")
+ allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1)
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y install emacs-21.4-20.el5.i386"
)
@provider.install_package("emacs", "21.4-20.el5")
@@ -374,9 +374,9 @@ describe Chef::Provider::Package::Yum do
it "installs the package with the options given in the resource" do
@provider.load_current_resource
@provider.candidate_version = '11'
- @new_resource.stub(:options).and_return("--disablerepo epmd")
- Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1)
- @provider.should_receive(:yum_command).with(
+ allow(@new_resource).to receive(:options).and_return("--disablerepo epmd")
+ allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1)
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y --disablerepo epmd install cups-11"
)
@provider.install_package(@new_resource.name, @provider.candidate_version)
@@ -393,13 +393,13 @@ describe Chef::Provider::Package::Yum do
:version_available? => nil,
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
- lambda { @provider.install_package("lolcats", "0.99") }.should raise_error(Chef::Exceptions::Package, %r{Version .* not found})
+ expect { @provider.install_package("lolcats", "0.99") }.to raise_error(Chef::Exceptions::Package, %r{Version .* not found})
end
it "should raise an exception if candidate version is older than the installed version and allow_downgrade is false" do
- @new_resource.stub(:allow_downgrade).and_return(false)
+ allow(@new_resource).to receive(:allow_downgrade).and_return(false)
@yum_cache = double(
'Chef::Provider::Yum::YumCache',
:reload_installed => true,
@@ -411,10 +411,10 @@ describe Chef::Provider::Package::Yum do
:allow_multi_install => [ "kernel" ],
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- lambda { @provider.install_package("cups", "1.2.4-11.15.el5") }.should raise_error(Chef::Exceptions::Package, %r{is newer than candidate package})
+ expect { @provider.install_package("cups", "1.2.4-11.15.el5") }.to raise_error(Chef::Exceptions::Package, %r{is newer than candidate package})
end
it "should not raise an exception if candidate version is older than the installed version and the package is list in yum's installonlypkg option" do
@@ -430,17 +430,17 @@ describe Chef::Provider::Package::Yum do
:package_repository => "base",
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.should_receive(:yum_command).with(
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y install cups-1.2.4-11.15.el5"
)
@provider.install_package("cups", "1.2.4-11.15.el5")
end
it "should run yum downgrade if candidate version is older than the installed version and allow_downgrade is true" do
- @new_resource.stub(:allow_downgrade).and_return(true)
+ allow(@new_resource).to receive(:allow_downgrade).and_return(true)
@yum_cache = double(
'Chef::Provider::Yum::YumCache',
:reload_installed => true,
@@ -453,34 +453,34 @@ describe Chef::Provider::Package::Yum do
:package_repository => "base",
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- @provider.should_receive(:yum_command).with(
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y downgrade cups-1.2.4-11.15.el5"
)
@provider.install_package("cups", "1.2.4-11.15.el5")
end
it "should run yum install then flush the cache if :after is true" do
- @new_resource.stub(:flush_cache).and_return({:after => true, :before => false})
+ allow(@new_resource).to receive(:flush_cache).and_return({:after => true, :before => false})
@provider.load_current_resource
- Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1)
- @provider.should_receive(:yum_command).with(
+ allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1)
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y install emacs-1.0"
)
- @yum_cache.should_receive(:reload).once
+ expect(@yum_cache).to receive(:reload).once
@provider.install_package("emacs", "1.0")
end
it "should run yum install then not flush the cache if :after is false" do
- @new_resource.stub(:flush_cache).and_return({:after => false, :before => false})
+ allow(@new_resource).to receive(:flush_cache).and_return({:after => false, :before => false})
@provider.load_current_resource
- Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1)
- @provider.should_receive(:yum_command).with(
+ allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1)
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y install emacs-1.0"
)
- @yum_cache.should_not_receive(:reload)
+ expect(@yum_cache).not_to receive(:reload)
@provider.install_package("emacs", "1.0")
end
end
@@ -489,8 +489,8 @@ describe Chef::Provider::Package::Yum do
it "should run yum install if the package is installed and a version is given" do
@provider.load_current_resource
@provider.candidate_version = '11'
- Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1)
- @provider.should_receive(:yum_command).with(
+ allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1)
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y install cups-11"
)
@provider.upgrade_package(@new_resource.name, @provider.candidate_version)
@@ -500,8 +500,8 @@ describe Chef::Provider::Package::Yum do
@provider.load_current_resource
@current_resource = Chef::Resource::Package.new('cups')
@provider.candidate_version = '11'
- Chef::Provider::Package::Yum::RPMUtils.stub(:rpmvercmp).and_return(-1)
- @provider.should_receive(:yum_command).with(
+ allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1)
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y install cups-11"
)
@provider.upgrade_package(@new_resource.name, @provider.candidate_version)
@@ -519,19 +519,19 @@ describe Chef::Provider::Package::Yum do
:allow_multi_install => [ "kernel" ],
:disable_extra_repo_control => true
)
- Chef::Provider::Package::Yum::YumCache.stub(:instance).and_return(@yum_cache)
+ allow(Chef::Provider::Package::Yum::YumCache).to receive(:instance).and_return(@yum_cache)
@provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context)
@provider.load_current_resource
- lambda { @provider.upgrade_package("cups", "1.2.4-11.15.el5") }.should raise_error(Chef::Exceptions::Package, %r{is newer than candidate package})
+ expect { @provider.upgrade_package("cups", "1.2.4-11.15.el5") }.to raise_error(Chef::Exceptions::Package, %r{is newer than candidate package})
end
# Test our little workaround, some crossover into Chef::Provider::Package territory
it "should call action_upgrade in the parent if the current resource version is nil" do
- @yum_cache.stub(:installed_version).and_return(nil)
+ allow(@yum_cache).to receive(:installed_version).and_return(nil)
@provider.load_current_resource
@current_resource = Chef::Resource::Package.new('cups')
@provider.candidate_version = '11'
- @provider.should_receive(:upgrade_package).with(
+ expect(@provider).to receive(:upgrade_package).with(
"cups",
"11"
)
@@ -542,7 +542,7 @@ describe Chef::Provider::Package::Yum do
@provider.load_current_resource
@current_resource = Chef::Resource::Package.new('cups')
@provider.candidate_version = nil
- @provider.should_not_receive(:upgrade_package)
+ expect(@provider).not_to receive(:upgrade_package)
@provider.action_upgrade
end
@@ -550,7 +550,7 @@ describe Chef::Provider::Package::Yum do
@provider.load_current_resource
@current_resource = Chef::Resource::Package.new('cups')
@provider.candidate_version = '11'
- @provider.should_receive(:upgrade_package).with(
+ expect(@provider).to receive(:upgrade_package).with(
"cups",
"11"
)
@@ -558,26 +558,26 @@ describe Chef::Provider::Package::Yum do
end
it "should not call action_upgrade in the parent if the candidate is older" do
- @yum_cache.stub(:installed_version).and_return("12")
+ allow(@yum_cache).to receive(:installed_version).and_return("12")
@provider.load_current_resource
@current_resource = Chef::Resource::Package.new('cups')
@provider.candidate_version = '11'
- @provider.should_not_receive(:upgrade_package)
+ expect(@provider).not_to receive(:upgrade_package)
@provider.action_upgrade
end
end
describe "when removing a package" do
it "should run yum remove with the package name" do
- @provider.should_receive(:yum_command).with(
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y remove emacs-1.0"
)
@provider.remove_package("emacs", "1.0")
end
it "should run yum remove with the package name and arch" do
- @new_resource.stub(:arch).and_return("x86_64")
- @provider.should_receive(:yum_command).with(
+ allow(@new_resource).to receive(:arch).and_return("x86_64")
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y remove emacs-1.0.x86_64"
)
@provider.remove_package("emacs", "1.0")
@@ -586,7 +586,7 @@ describe Chef::Provider::Package::Yum do
describe "when purging a package" do
it "should run yum remove with the package name" do
- @provider.should_receive(:yum_command).with(
+ expect(@provider).to receive(:yum_command).with(
"yum -d0 -e0 -y remove emacs-1.0"
)
@provider.purge_package("emacs", "1.0")
@@ -596,8 +596,8 @@ describe Chef::Provider::Package::Yum do
describe "when running yum" do
it "should run yum once if it exits with a return code of 0" do
@status = double("Status", :exitstatus => 0)
- @provider.stub(:output_of_command).and_return([@status, "", ""])
- @provider.should_receive(:output_of_command).once.with(
+ allow(@provider).to receive(:output_of_command).and_return([@status, "", ""])
+ expect(@provider).to receive(:output_of_command).once.with(
"yum -d0 -e0 -y install emacs-1.0",
{:timeout => Chef::Config[:yum_timeout]}
)
@@ -606,34 +606,34 @@ describe Chef::Provider::Package::Yum do
it "should run yum once if it exits with a return code > 0 and no scriptlet failures" do
@status = double("Status", :exitstatus => 2)
- @provider.stub(:output_of_command).and_return([@status, "failure failure", "problem problem"])
- @provider.should_receive(:output_of_command).once.with(
+ allow(@provider).to receive(:output_of_command).and_return([@status, "failure failure", "problem problem"])
+ expect(@provider).to receive(:output_of_command).once.with(
"yum -d0 -e0 -y install emacs-1.0",
{:timeout => Chef::Config[:yum_timeout]}
)
- lambda { @provider.yum_command("yum -d0 -e0 -y install emacs-1.0") }.should raise_error(Chef::Exceptions::Exec)
+ expect { @provider.yum_command("yum -d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec)
end
it "should run yum once if it exits with a return code of 1 and %pre scriptlet failures" do
@status = double("Status", :exitstatus => 1)
- @provider.stub(:output_of_command).and_return([@status, "error: %pre(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""])
- @provider.should_receive(:output_of_command).once.with(
+ allow(@provider).to receive(:output_of_command).and_return([@status, "error: %pre(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""])
+ expect(@provider).to receive(:output_of_command).once.with(
"yum -d0 -e0 -y install emacs-1.0",
{:timeout => Chef::Config[:yum_timeout]}
)
# will still raise an exception, can't stub out the subsequent call
- lambda { @provider.yum_command("yum -d0 -e0 -y install emacs-1.0") }.should raise_error(Chef::Exceptions::Exec)
+ expect { @provider.yum_command("yum -d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec)
end
it "should run yum twice if it exits with a return code of 1 and %post scriptlet failures" do
@status = double("Status", :exitstatus => 1)
- @provider.stub(:output_of_command).and_return([@status, "error: %post(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""])
- @provider.should_receive(:output_of_command).twice.with(
+ allow(@provider).to receive(:output_of_command).and_return([@status, "error: %post(demo-1-1.el5.centos.x86_64) scriptlet failed, exit status 2", ""])
+ expect(@provider).to receive(:output_of_command).twice.with(
"yum -d0 -e0 -y install emacs-1.0",
{:timeout => Chef::Config[:yum_timeout]}
)
# will still raise an exception, can't stub out the subsequent call
- lambda { @provider.yum_command("yum -d0 -e0 -y install emacs-1.0") }.should raise_error(Chef::Exceptions::Exec)
+ expect { @provider.yum_command("yum -d0 -e0 -y install emacs-1.0") }.to raise_error(Chef::Exceptions::Exec)
end
end
end
@@ -650,7 +650,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "9:1.7.3", [ 9, "1.7.3", nil ] ],
[ "15:20020927", [ 15, "20020927", nil ] ]
].each do |x, y|
- @rpmutils.version_parse(x).should == y
+ expect(@rpmutils.version_parse(x)).to eq(y)
end
end
@@ -660,7 +660,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "-1:1.7.3", [ nil, nil, "1:1.7.3" ] ],
[ "-:20020927", [ nil, nil, ":20020927" ] ]
].each do |x, y|
- @rpmutils.version_parse(x).should == y
+ expect(@rpmutils.version_parse(x)).to eq(y)
end
end
@@ -670,7 +670,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "1.7.3", [ nil, "1.7.3", nil ] ],
[ "20020927", [ nil, "20020927", nil ] ]
].each do |x, y|
- @rpmutils.version_parse(x).should == y
+ expect(@rpmutils.version_parse(x)).to eq(y)
end
end
@@ -680,7 +680,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "0001.7.3", [ nil, "0001.7.3", nil ] ],
[ "20020927,3", [ nil, "20020927,3", nil ] ]
].each do |x, y|
- @rpmutils.version_parse(x).should == y
+ expect(@rpmutils.version_parse(x)).to eq(y)
end
end
@@ -690,7 +690,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "1.7.3-1jpp.2.el5", [ nil, "1.7.3", "1jpp.2.el5" ] ],
[ "20020927-46.el5", [ nil, "20020927", "46.el5" ] ]
].each do |x, y|
- @rpmutils.version_parse(x).should == y
+ expect(@rpmutils.version_parse(x)).to eq(y)
end
end
@@ -700,7 +700,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "-1jpp.2.el5", [ nil, nil, "1jpp.2.el5" ] ],
[ "-0020020927-46.el5", [ nil, "-0020020927", "46.el5" ] ]
].each do |x, y|
- @rpmutils.version_parse(x).should == y
+ expect(@rpmutils.version_parse(x)).to eq(y)
end
end
end
@@ -757,7 +757,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "0.0.1aa", "0.0.1aa", 0 ],
[ "0.0.1a", "0.0.1aa", -1 ],
].each do |x, y, result|
- @rpmutils.rpmvercmp(x,y).should == result
+ expect(@rpmutils.rpmvercmp(x,y)).to eq(result)
end
end
@@ -776,43 +776,43 @@ describe Chef::Provider::Package::Yum::RPMUtils do
[ "", "", 0 ],
[ "", "1.0.1", -1 ]
].each do |x, y, result|
- @rpmutils.rpmvercmp(x,y).should == result
+ expect(@rpmutils.rpmvercmp(x,y)).to eq(result)
end
end
it "tests isalnum good input" do
[ 'a', 'z', 'A', 'Z', '0', '9' ].each do |t|
- @rpmutils.isalnum(t).should == true
+ expect(@rpmutils.isalnum(t)).to eq(true)
end
end
it "tests isalnum bad input" do
[ '-', '.', '!', '^', ':', '_' ].each do |t|
- @rpmutils.isalnum(t).should == false
+ expect(@rpmutils.isalnum(t)).to eq(false)
end
end
it "tests isalpha good input" do
[ 'a', 'z', 'A', 'Z', ].each do |t|
- @rpmutils.isalpha(t).should == true
+ expect(@rpmutils.isalpha(t)).to eq(true)
end
end
it "tests isalpha bad input" do
[ '0', '9', '-', '.', '!', '^', ':', '_' ].each do |t|
- @rpmutils.isalpha(t).should == false
+ expect(@rpmutils.isalpha(t)).to eq(false)
end
end
it "tests isdigit good input" do
[ '0', '9', ].each do |t|
- @rpmutils.isdigit(t).should == true
+ expect(@rpmutils.isdigit(t)).to eq(true)
end
end
it "tests isdigit bad input" do
[ 'A', 'z', '-', '.', '!', '^', ':', '_' ].each do |t|
- @rpmutils.isdigit(t).should == false
+ expect(@rpmutils.isdigit(t)).to eq(false)
end
end
end
@@ -826,15 +826,15 @@ describe Chef::Provider::Package::Yum::RPMVersion do
end
it "should expose evr (name-version-release) available" do
- @rpmv.e.should == 1
- @rpmv.v.should == "1.6.5"
- @rpmv.r.should == "9.36.el5"
+ expect(@rpmv.e).to eq(1)
+ expect(@rpmv.v).to eq("1.6.5")
+ expect(@rpmv.r).to eq("9.36.el5")
- @rpmv.evr.should == "1:1.6.5-9.36.el5"
+ expect(@rpmv.evr).to eq("1:1.6.5-9.36.el5")
end
it "should output a version-release string" do
- @rpmv.to_s.should == "1.6.5-9.36.el5"
+ expect(@rpmv.to_s).to eq("1.6.5-9.36.el5")
end
end
@@ -844,34 +844,34 @@ describe Chef::Provider::Package::Yum::RPMVersion do
end
it "should expose evr (name-version-release) available" do
- @rpmv.e.should == 1
- @rpmv.v.should == "1.6.5"
- @rpmv.r.should == "9.36.el5"
+ expect(@rpmv.e).to eq(1)
+ expect(@rpmv.v).to eq("1.6.5")
+ expect(@rpmv.r).to eq("9.36.el5")
- @rpmv.evr.should == "1:1.6.5-9.36.el5"
+ expect(@rpmv.evr).to eq("1:1.6.5-9.36.el5")
end
it "should output a version-release string" do
- @rpmv.to_s.should == "1.6.5-9.36.el5"
+ expect(@rpmv.to_s).to eq("1.6.5-9.36.el5")
end
end
it "should raise an error unless passed 1 or 3 args" do
- lambda {
+ expect {
Chef::Provider::Package::Yum::RPMVersion.new()
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMVersion.new("1:1.6.5-9.36.el5")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
Chef::Provider::Package::Yum::RPMVersion.new("1:1.6.5-9.36.el5", "extra")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMVersion.new("1", "1.6.5", "9.36.el5")
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
Chef::Provider::Package::Yum::RPMVersion.new("1", "1.6.5", "9.36.el5", "extra")
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
# thanks version_class_spec.rb!
@@ -898,9 +898,9 @@ describe Chef::Provider::Package::Yum::RPMVersion do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller)
lg = Chef::Provider::Package::Yum::RPMVersion.new(larger)
- sm.should be < lg
- lg.should be > sm
- sm.should_not == lg
+ expect(sm).to be < lg
+ expect(lg).to be > sm
+ expect(sm).not_to eq(lg)
end
end
@@ -924,9 +924,9 @@ describe Chef::Provider::Package::Yum::RPMVersion do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller)
lg = Chef::Provider::Package::Yum::RPMVersion.new(larger)
- sm.should be < lg
- lg.should be > sm
- sm.should_not == lg
+ expect(sm).to be < lg
+ expect(lg).to be > sm
+ expect(sm).not_to eq(lg)
end
end
@@ -941,7 +941,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller)
lg = Chef::Provider::Package::Yum::RPMVersion.new(larger)
- sm.should be == lg
+ expect(sm).to eq(lg)
end
end
@@ -956,7 +956,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller)
lg = Chef::Provider::Package::Yum::RPMVersion.new(larger)
- sm.should be == lg
+ expect(sm).to eq(lg)
end
end
end
@@ -980,9 +980,9 @@ describe Chef::Provider::Package::Yum::RPMVersion do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller)
lg = Chef::Provider::Package::Yum::RPMVersion.new(larger)
- sm.partial_compare(lg).should be == -1
- lg.partial_compare(sm).should be == 1
- sm.partial_compare(lg).should_not be == 0
+ expect(sm.partial_compare(lg)).to eq(-1)
+ expect(lg.partial_compare(sm)).to eq(1)
+ expect(sm.partial_compare(lg)).not_to eq(0)
end
end
@@ -997,7 +997,7 @@ describe Chef::Provider::Package::Yum::RPMVersion do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMVersion.new(smaller)
lg = Chef::Provider::Package::Yum::RPMVersion.new(larger)
- sm.partial_compare(lg).should be == 0
+ expect(sm.partial_compare(lg)).to eq(0)
end
end
end
@@ -1011,18 +1011,18 @@ describe Chef::Provider::Package::Yum::RPMPackage do
end
it "should expose nevra (name-epoch-version-release-arch) available" do
- @rpm.name.should == "testing"
- @rpm.version.e.should == 1
- @rpm.version.v.should == "1.6.5"
- @rpm.version.r.should == "9.36.el5"
- @rpm.arch.should == "x86_64"
+ expect(@rpm.name).to eq("testing")
+ expect(@rpm.version.e).to eq(1)
+ expect(@rpm.version.v).to eq("1.6.5")
+ expect(@rpm.version.r).to eq("9.36.el5")
+ expect(@rpm.arch).to eq("x86_64")
- @rpm.nevra.should == "testing-1:1.6.5-9.36.el5.x86_64"
- @rpm.to_s.should == @rpm.nevra
+ expect(@rpm.nevra).to eq("testing-1:1.6.5-9.36.el5.x86_64")
+ expect(@rpm.to_s).to eq(@rpm.nevra)
end
it "should always have at least one provide, itself" do
- @rpm.provides.size.should == 1
+ expect(@rpm.provides.size).to eq(1)
@rpm.provides[0].name == "testing"
@rpm.provides[0].version.evr == "1:1.6.5-9.36.el5"
@rpm.provides[0].flag == :==
@@ -1035,18 +1035,18 @@ describe Chef::Provider::Package::Yum::RPMPackage do
end
it "should expose nevra (name-epoch-version-release-arch) available" do
- @rpm.name.should == "testing"
- @rpm.version.e.should == 1
- @rpm.version.v.should == "1.6.5"
- @rpm.version.r.should == "9.36.el5"
- @rpm.arch.should == "x86_64"
+ expect(@rpm.name).to eq("testing")
+ expect(@rpm.version.e).to eq(1)
+ expect(@rpm.version.v).to eq("1.6.5")
+ expect(@rpm.version.r).to eq("9.36.el5")
+ expect(@rpm.arch).to eq("x86_64")
- @rpm.nevra.should == "testing-1:1.6.5-9.36.el5.x86_64"
- @rpm.to_s.should == @rpm.nevra
+ expect(@rpm.nevra).to eq("testing-1:1.6.5-9.36.el5.x86_64")
+ expect(@rpm.to_s).to eq(@rpm.nevra)
end
it "should always have at least one provide, itself" do
- @rpm.provides.size.should == 1
+ expect(@rpm.provides.size).to eq(1)
@rpm.provides[0].name == "testing"
@rpm.provides[0].version.evr == "1:1.6.5-9.36.el5"
@rpm.provides[0].flag == :==
@@ -1054,30 +1054,30 @@ describe Chef::Provider::Package::Yum::RPMPackage do
end
it "should raise an error unless passed 4 or 6 args" do
- lambda {
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new()
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new("testing")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new("testing", "1:1.6.5-9.36.el5")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new("testing", "1:1.6.5-9.36.el5", "x86_64")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new("testing", "1:1.6.5-9.36.el5", "x86_64", [])
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new("testing", "1", "1.6.5", "9.36.el5", "x86_64")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new("testing", "1", "1.6.5", "9.36.el5", "x86_64", [])
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
Chef::Provider::Package::Yum::RPMPackage.new("testing", "1", "1.6.5", "9.36.el5", "x86_64", [], "extra")
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
describe "<=>" do
@@ -1096,9 +1096,9 @@ describe Chef::Provider::Package::Yum::RPMPackage do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMPackage.new(smaller, "0:0.0.1-1", "x86_64", [])
lg = Chef::Provider::Package::Yum::RPMPackage.new(larger, "0:0.0.1-1", "x86_64", [])
- sm.should be < lg
- lg.should be > sm
- sm.should_not == lg
+ expect(sm).to be < lg
+ expect(lg).to be > sm
+ expect(sm).not_to eq(lg)
end
end
@@ -1113,9 +1113,9 @@ describe Chef::Provider::Package::Yum::RPMPackage do
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "0:0.0.1-1", smaller, [])
lg = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "0:0.0.1-1", larger, [])
- sm.should be < lg
- lg.should be > sm
- sm.should_not == lg
+ expect(sm).to be < lg
+ expect(lg).to be > sm
+ expect(sm).not_to eq(lg)
end
end
end
@@ -1132,31 +1132,31 @@ describe Chef::Provider::Package::Yum::RPMDbPackage do
describe "initialize" do
it "should return a Chef::Provider::Package::Yum::RPMDbPackage object" do
- @rpm_x.should be_kind_of(Chef::Provider::Package::Yum::RPMDbPackage)
+ expect(@rpm_x).to be_kind_of(Chef::Provider::Package::Yum::RPMDbPackage)
end
end
describe "available" do
it "should return true" do
- @rpm_x.available.should be == true
- @rpm_y.available.should be == true
- @rpm_z.available.should be == false
+ expect(@rpm_x.available).to eq(true)
+ expect(@rpm_y.available).to eq(true)
+ expect(@rpm_z.available).to eq(false)
end
end
describe "installed" do
it "should return true" do
- @rpm_x.installed.should be == false
- @rpm_y.installed.should be == true
- @rpm_z.installed.should be == true
+ expect(@rpm_x.installed).to eq(false)
+ expect(@rpm_y.installed).to eq(true)
+ expect(@rpm_z.installed).to eq(true)
end
end
describe "repoid" do
it "should return the source repository repoid" do
- @rpm_x.repoid.should be == "base"
- @rpm_y.repoid.should be == "extras"
- @rpm_z.repoid.should be == "other"
+ expect(@rpm_x.repoid).to eq("base")
+ expect(@rpm_y.repoid).to eq("extras")
+ expect(@rpm_z.repoid).to eq("other")
end
end
end
@@ -1168,11 +1168,11 @@ describe Chef::Provider::Package::Yum::RPMDependency do
end
it "should expose name, version, flag available" do
- @rpmdep.name.should == "testing"
- @rpmdep.version.e.should == 1
- @rpmdep.version.v.should == "1.6.5"
- @rpmdep.version.r.should == "9.36.el5"
- @rpmdep.flag.should == :==
+ expect(@rpmdep.name).to eq("testing")
+ expect(@rpmdep.version.e).to eq(1)
+ expect(@rpmdep.version.v).to eq("1.6.5")
+ expect(@rpmdep.version.r).to eq("9.36.el5")
+ expect(@rpmdep.flag).to eq(:==)
end
end
@@ -1182,67 +1182,67 @@ describe Chef::Provider::Package::Yum::RPMDependency do
end
it "should expose name, version, flag available" do
- @rpmdep.name.should == "testing"
- @rpmdep.version.e.should == 1
- @rpmdep.version.v.should == "1.6.5"
- @rpmdep.version.r.should == "9.36.el5"
- @rpmdep.flag.should == :==
+ expect(@rpmdep.name).to eq("testing")
+ expect(@rpmdep.version.e).to eq(1)
+ expect(@rpmdep.version.v).to eq("1.6.5")
+ expect(@rpmdep.version.r).to eq("9.36.el5")
+ expect(@rpmdep.flag).to eq(:==)
end
end
it "should raise an error unless passed 3 or 5 args" do
- lambda {
+ expect {
Chef::Provider::Package::Yum::RPMDependency.new()
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMDependency.new("testing")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMDependency.new("testing", "1:1.6.5-9.36.el5")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMDependency.new("testing", "1:1.6.5-9.36.el5", :==)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
Chef::Provider::Package::Yum::RPMDependency.new("testing", "1:1.6.5-9.36.el5", :==, "extra")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
Chef::Provider::Package::Yum::RPMDependency.new("testing", "1", "1.6.5", "9.36.el5", :==)
- }.should_not raise_error
- lambda {
+ }.not_to raise_error
+ expect {
Chef::Provider::Package::Yum::RPMDependency.new("testing", "1", "1.6.5", "9.36.el5", :==, "extra")
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
describe "parse" do
it "should parse a name, flag, version string into a valid RPMDependency object" do
@rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing >= 1:1.6.5-9.36.el5")
- @rpmdep.name.should == "testing"
- @rpmdep.version.e.should == 1
- @rpmdep.version.v.should == "1.6.5"
- @rpmdep.version.r.should == "9.36.el5"
- @rpmdep.flag.should == :>=
+ expect(@rpmdep.name).to eq("testing")
+ expect(@rpmdep.version.e).to eq(1)
+ expect(@rpmdep.version.v).to eq("1.6.5")
+ expect(@rpmdep.version.r).to eq("9.36.el5")
+ expect(@rpmdep.flag).to eq(:>=)
end
it "should parse a name into a valid RPMDependency object" do
@rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing")
- @rpmdep.name.should == "testing"
- @rpmdep.version.e.should == nil
- @rpmdep.version.v.should == nil
- @rpmdep.version.r.should == nil
- @rpmdep.flag.should == :==
+ expect(@rpmdep.name).to eq("testing")
+ expect(@rpmdep.version.e).to eq(nil)
+ expect(@rpmdep.version.v).to eq(nil)
+ expect(@rpmdep.version.r).to eq(nil)
+ expect(@rpmdep.flag).to eq(:==)
end
it "should parse an invalid string into the name of a RPMDependency object" do
@rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing blah >")
- @rpmdep.name.should == "testing blah >"
- @rpmdep.version.e.should == nil
- @rpmdep.version.v.should == nil
- @rpmdep.version.r.should == nil
- @rpmdep.flag.should == :==
+ expect(@rpmdep.name).to eq("testing blah >")
+ expect(@rpmdep.version.e).to eq(nil)
+ expect(@rpmdep.version.v).to eq(nil)
+ expect(@rpmdep.version.r).to eq(nil)
+ expect(@rpmdep.flag).to eq(:==)
end
it "should parse various valid flags" do
@@ -1255,7 +1255,7 @@ describe Chef::Provider::Package::Yum::RPMDependency do
[ "<", :< ]
].each do |before, after|
@rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing #{before} 1:1.1-1")
- @rpmdep.flag.should == after
+ expect(@rpmdep.flag).to eq(after)
end
end
@@ -1269,8 +1269,8 @@ describe Chef::Provider::Package::Yum::RPMDependency do
[ "~", :== ]
].each do |before, after|
@rpmdep = Chef::Provider::Package::Yum::RPMDependency.parse("testing #{before} 1:1.1-1")
- @rpmdep.name.should == "testing #{before} 1:1.1-1"
- @rpmdep.flag.should == after
+ expect(@rpmdep.name).to eq("testing #{before} 1:1.1-1")
+ expect(@rpmdep.flag).to eq(after)
end
end
end
@@ -1279,12 +1279,12 @@ describe Chef::Provider::Package::Yum::RPMDependency do
it "should raise an error unless a RPMDependency is passed" do
@rpmprovide = Chef::Provider::Package::Yum::RPMDependency.new("testing", "1:1.6.5-9.36.el5", :==)
@rpmrequire = Chef::Provider::Package::Yum::RPMDependency.new("testing", "1:1.6.5-9.36.el5", :>=)
- lambda {
+ expect {
@rpmprovide.satisfy?("hi")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
@rpmprovide.satisfy?(@rpmrequire)
- }.should_not raise_error
+ }.not_to raise_error
end
it "should validate dependency satisfaction logic for standard examples" do
@@ -1326,8 +1326,8 @@ describe Chef::Provider::Package::Yum::RPMDependency do
@rpmprovide = Chef::Provider::Package::Yum::RPMDependency.parse(prov)
@rpmrequire = Chef::Provider::Package::Yum::RPMDependency.parse(req)
- @rpmprovide.satisfy?(@rpmrequire).should == result
- @rpmrequire.satisfy?(@rpmprovide).should == result
+ expect(@rpmprovide.satisfy?(@rpmrequire)).to eq(result)
+ expect(@rpmrequire.satisfy?(@rpmprovide)).to eq(result)
end
end
end
@@ -1358,89 +1358,89 @@ describe Chef::Provider::Package::Yum::RPMDb do
describe "initialize" do
it "should return a Chef::Provider::Package::Yum::RPMDb object" do
- @rpmdb.should be_kind_of(Chef::Provider::Package::Yum::RPMDb)
+ expect(@rpmdb).to be_kind_of(Chef::Provider::Package::Yum::RPMDb)
end
end
describe "push" do
it "should accept an RPMDbPackage object through pushing" do
- lambda { @rpmdb.push(@rpm_w) }.should_not raise_error
+ expect { @rpmdb.push(@rpm_w) }.not_to raise_error
end
it "should accept multiple RPMDbPackage object through pushing" do
- lambda { @rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z) }.should_not raise_error
+ expect { @rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z) }.not_to raise_error
end
it "should only accept an RPMDbPackage object" do
- lambda { @rpmdb.push("string") }.should raise_error
+ expect { @rpmdb.push("string") }.to raise_error
end
it "should add the package to the package db" do
@rpmdb.push(@rpm_w)
- @rpmdb["test-package-b"].should_not be == nil
+ expect(@rpmdb["test-package-b"]).not_to eq(nil)
end
it "should add conditionally add the package to the available list" do
- @rpmdb.available_size.should be == 0
+ expect(@rpmdb.available_size).to eq(0)
@rpmdb.push(@rpm_v, @rpm_w)
- @rpmdb.available_size.should be == 1
+ expect(@rpmdb.available_size).to eq(1)
end
it "should add conditionally add the package to the installed list" do
- @rpmdb.installed_size.should be == 0
+ expect(@rpmdb.installed_size).to eq(0)
@rpmdb.push(@rpm_w, @rpm_x)
- @rpmdb.installed_size.should be == 1
+ expect(@rpmdb.installed_size).to eq(1)
end
it "should have a total of 2 packages in the RPMDb" do
- @rpmdb.size.should be == 0
+ expect(@rpmdb.size).to eq(0)
@rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z)
- @rpmdb.size.should be == 2
+ expect(@rpmdb.size).to eq(2)
end
it "should keep the Array unique when a duplicate is pushed" do
@rpmdb.push(@rpm_z, @rpm_z_mirror)
- @rpmdb["test-package-c"].size.should be == 1
+ expect(@rpmdb["test-package-c"].size).to eq(1)
end
it "should register the package provides in the provides index" do
@rpmdb.push(@rpm_v, @rpm_w, @rpm_z)
- @rpmdb.lookup_provides("test-package-a")[0].should be == @rpm_v
- @rpmdb.lookup_provides("config(test)")[0].should be == @rpm_z
- @rpmdb.lookup_provides("libz.so.1()(64bit)")[0].should be == @rpm_v
- @rpmdb.lookup_provides("libz.so.1()(64bit)")[1].should be == @rpm_z
+ expect(@rpmdb.lookup_provides("test-package-a")[0]).to eq(@rpm_v)
+ expect(@rpmdb.lookup_provides("config(test)")[0]).to eq(@rpm_z)
+ expect(@rpmdb.lookup_provides("libz.so.1()(64bit)")[0]).to eq(@rpm_v)
+ expect(@rpmdb.lookup_provides("libz.so.1()(64bit)")[1]).to eq(@rpm_z)
end
end
describe "<<" do
it "should accept an RPMPackage object through the << operator" do
- lambda { @rpmdb << @rpm_w }.should_not raise_error
+ expect { @rpmdb << @rpm_w }.not_to raise_error
end
end
describe "lookup" do
it "should return an Array of RPMPackage objects by index" do
@rpmdb << @rpm_w
- @rpmdb.lookup("test-package-b").should be_kind_of(Array)
+ expect(@rpmdb.lookup("test-package-b")).to be_kind_of(Array)
end
end
describe "[]" do
it "should return an Array of RPMPackage objects though the [index] operator" do
@rpmdb << @rpm_w
- @rpmdb["test-package-b"].should be_kind_of(Array)
+ expect(@rpmdb["test-package-b"]).to be_kind_of(Array)
end
it "should return an Array of 3 RPMPackage objects" do
@rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z)
- @rpmdb["test-package-b"].size.should be == 3
+ expect(@rpmdb["test-package-b"].size).to eq(3)
end
it "should return an Array of RPMPackage objects sorted from newest to oldest" do
@rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z)
- @rpmdb["test-package-b"][0].should be == @rpm_y
- @rpmdb["test-package-b"][1].should be == @rpm_x
- @rpmdb["test-package-b"][2].should be == @rpm_w
+ expect(@rpmdb["test-package-b"][0]).to eq(@rpm_y)
+ expect(@rpmdb["test-package-b"][1]).to eq(@rpm_x)
+ expect(@rpmdb["test-package-b"][2]).to eq(@rpm_w)
end
end
@@ -1448,57 +1448,57 @@ describe Chef::Provider::Package::Yum::RPMDb do
it "should return an Array of RPMPackage objects by index" do
@rpmdb << @rpm_z
x = @rpmdb.lookup_provides("config(test)")
- x.should be_kind_of(Array)
- x[0].should be == @rpm_z
+ expect(x).to be_kind_of(Array)
+ expect(x[0]).to eq(@rpm_z)
end
end
describe "clear" do
it "should clear the RPMDb" do
- @rpmdb.should_receive(:clear_available).once
- @rpmdb.should_receive(:clear_installed).once
+ expect(@rpmdb).to receive(:clear_available).once
+ expect(@rpmdb).to receive(:clear_installed).once
@rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z)
- @rpmdb.size.should_not be == 0
- @rpmdb.lookup_provides("config(test)").should be_kind_of(Array)
+ expect(@rpmdb.size).not_to eq(0)
+ expect(@rpmdb.lookup_provides("config(test)")).to be_kind_of(Array)
@rpmdb.clear
- @rpmdb.lookup_provides("config(test)").should be == nil
- @rpmdb.size.should be == 0
+ expect(@rpmdb.lookup_provides("config(test)")).to eq(nil)
+ expect(@rpmdb.size).to eq(0)
end
end
describe "clear_available" do
it "should clear the available list" do
@rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z)
- @rpmdb.available_size.should_not be == 0
+ expect(@rpmdb.available_size).not_to eq(0)
@rpmdb.clear_available
- @rpmdb.available_size.should be == 0
+ expect(@rpmdb.available_size).to eq(0)
end
end
describe "available?" do
it "should return true if a package is available" do
- @rpmdb.available?(@rpm_w).should be == false
+ expect(@rpmdb.available?(@rpm_w)).to eq(false)
@rpmdb.push(@rpm_v, @rpm_w)
- @rpmdb.available?(@rpm_v).should be == false
- @rpmdb.available?(@rpm_w).should be == true
+ expect(@rpmdb.available?(@rpm_v)).to eq(false)
+ expect(@rpmdb.available?(@rpm_w)).to eq(true)
end
end
describe "clear_installed" do
it "should clear the installed list" do
@rpmdb.push(@rpm_w, @rpm_x, @rpm_y, @rpm_z)
- @rpmdb.installed_size.should_not be == 0
+ expect(@rpmdb.installed_size).not_to eq(0)
@rpmdb.clear_installed
- @rpmdb.installed_size.should be == 0
+ expect(@rpmdb.installed_size).to eq(0)
end
end
describe "installed?" do
it "should return true if a package is installed" do
- @rpmdb.installed?(@rpm_w).should be == false
+ expect(@rpmdb.installed?(@rpm_w)).to eq(false)
@rpmdb.push(@rpm_w, @rpm_x)
- @rpmdb.installed?(@rpm_w).should be == true
- @rpmdb.installed?(@rpm_x).should be == false
+ expect(@rpmdb.installed?(@rpm_w)).to eq(true)
+ expect(@rpmdb.installed?(@rpm_x)).to eq(false)
end
end
@@ -1506,12 +1506,12 @@ describe Chef::Provider::Package::Yum::RPMDb do
it "should raise an error unless a RPMDependency is passed" do
@rpmprovide = Chef::Provider::Package::Yum::RPMDependency.new("testing", "1:1.6.5-9.36.el5", :==)
@rpmrequire = Chef::Provider::Package::Yum::RPMDependency.new("testing", "1:1.6.5-9.36.el5", :>=)
- lambda {
+ expect {
@rpmdb.whatprovides("hi")
- }.should raise_error(ArgumentError)
- lambda {
+ }.to raise_error(ArgumentError)
+ expect {
@rpmdb.whatprovides(@rpmrequire)
- }.should_not raise_error
+ }.not_to raise_error
end
it "should return an Array of packages statisfying a RPMDependency" do
@@ -1519,14 +1519,14 @@ describe Chef::Provider::Package::Yum::RPMDb do
@rpmrequire = Chef::Provider::Package::Yum::RPMDependency.parse("test-package-a >= 1.6.5")
x = @rpmdb.whatprovides(@rpmrequire)
- x.should be_kind_of(Array)
- x[0].should be == @rpm_v
+ expect(x).to be_kind_of(Array)
+ expect(x[0]).to eq(@rpm_v)
@rpmrequire = Chef::Provider::Package::Yum::RPMDependency.parse("libz.so.1()(64bit)")
x = @rpmdb.whatprovides(@rpmrequire)
- x.should be_kind_of(Array)
- x[0].should be == @rpm_v
- x[1].should be == @rpm_z
+ expect(x).to be_kind_of(Array)
+ expect(x[0]).to eq(@rpm_v)
+ expect(x[1]).to eq(@rpm_z)
end
end
@@ -1592,18 +1592,18 @@ EOF
Chef::Provider::Package::Yum::YumCache.reset_instance
@yc = Chef::Provider::Package::Yum::YumCache.instance
# load valid data
- @yc.stub(:shell_out!).and_return(@status)
+ allow(@yc).to receive(:shell_out!).and_return(@status)
end
describe "initialize" do
it "should return a Chef::Provider::Package::Yum::YumCache object" do
- @yc.should be_kind_of(Chef::Provider::Package::Yum::YumCache)
+ expect(@yc).to be_kind_of(Chef::Provider::Package::Yum::YumCache)
end
it "should register reload for start of Chef::Client runs" do
Chef::Provider::Package::Yum::YumCache.reset_instance
- Chef::Client.should_receive(:when_run_starts) do |&b|
- b.should_not be_nil
+ expect(Chef::Client).to receive(:when_run_starts) do |&b|
+ expect(b).not_to be_nil
end
@yc = Chef::Provider::Package::Yum::YumCache.instance
end
@@ -1611,7 +1611,7 @@ EOF
describe "refresh" do
it "should implicitly call yum-dump.py only once by default after being instantiated" do
- @yc.should_receive(:shell_out!).once
+ expect(@yc).to receive(:shell_out!).once
@yc.installed_version("zlib")
@yc.reset
@yc.installed_version("zlib")
@@ -1619,226 +1619,226 @@ EOF
it "should run yum-dump.py using the system python when next_refresh is for :all" do
@yc.reload
- @yc.should_receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --installed-provides --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
+ expect(@yc).to receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --installed-provides --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
@yc.refresh
end
it "should run yum-dump.py with the installed flag when next_refresh is for :installed" do
@yc.reload_installed
- @yc.should_receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --installed --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
+ expect(@yc).to receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --installed --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
@yc.refresh
end
it "should run yum-dump.py with the all-provides flag when next_refresh is for :provides" do
@yc.reload_provides
- @yc.should_receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --all-provides --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
+ expect(@yc).to receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --all-provides --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
@yc.refresh
end
it "should pass extra_repo_control args to yum-dump.py" do
@yc.enable_extra_repo_control("--enablerepo=foo --disablerepo=bar")
- @yc.should_receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --installed-provides --enablerepo=foo --disablerepo=bar --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
+ expect(@yc).to receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --installed-provides --enablerepo=foo --disablerepo=bar --yum-lock-timeout 30$}, :timeout=>Chef::Config[:yum_timeout])
@yc.refresh
end
it "should pass extra_repo_control args and configured yum lock timeout to yum-dump.py" do
Chef::Config[:yum_lock_timeout] = 999
@yc.enable_extra_repo_control("--enablerepo=foo --disablerepo=bar")
- @yc.should_receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --installed-provides --enablerepo=foo --disablerepo=bar --yum-lock-timeout 999$}, :timeout=>Chef::Config[:yum_timeout])
+ expect(@yc).to receive(:shell_out!).with(%r{^/usr/bin/python .*/yum-dump.py --options --installed-provides --enablerepo=foo --disablerepo=bar --yum-lock-timeout 999$}, :timeout=>Chef::Config[:yum_timeout])
@yc.refresh
end
it "should warn about invalid data with too many separators" do
@status = double("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_bad_separators, :stderr => @stderr)
- @yc.stub(:shell_out!).and_return(@status)
- Chef::Log.should_receive(:warn).exactly(3).times.with(%r{Problem parsing})
+ allow(@yc).to receive(:shell_out!).and_return(@status)
+ expect(Chef::Log).to receive(:warn).exactly(3).times.with(%r{Problem parsing})
@yc.refresh
end
it "should warn about invalid data with an incorrect type" do
@status = double("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_bad_type, :stderr => @stderr)
- @yc.stub(:shell_out!).and_return(@status)
- Chef::Log.should_receive(:warn).exactly(2).times.with(%r{Problem parsing})
+ allow(@yc).to receive(:shell_out!).and_return(@status)
+ expect(Chef::Log).to receive(:warn).exactly(2).times.with(%r{Problem parsing})
@yc.refresh
end
it "should warn about no output from yum-dump.py" do
@status = double("Status", :exitstatus => 0, :stdin => @stdin, :stdout => @stdout_no_output, :stderr => @stderr)
- @yc.stub(:shell_out!).and_return(@status)
- Chef::Log.should_receive(:warn).exactly(1).times.with(%r{no output from yum-dump.py})
+ allow(@yc).to receive(:shell_out!).and_return(@status)
+ expect(Chef::Log).to receive(:warn).exactly(1).times.with(%r{no output from yum-dump.py})
@yc.refresh
end
it "should raise exception yum-dump.py exits with a non zero status" do
@status = double("Status", :exitstatus => 1, :stdin => @stdin, :stdout => @stdout_no_output, :stderr => @stderr)
- @yc.stub(:shell_out!).and_return(@status)
- lambda { @yc.refresh}.should raise_error(Chef::Exceptions::Package, %r{CentOS-Base.repo, line: 12})
+ allow(@yc).to receive(:shell_out!).and_return(@status)
+ expect { @yc.refresh}.to raise_error(Chef::Exceptions::Package, %r{CentOS-Base.repo, line: 12})
end
it "should parse type 'i' into an installed state for a package" do
- @yc.available_version("erlang-mochiweb").should be == nil
- @yc.installed_version("erlang-mochiweb").should_not be == nil
+ expect(@yc.available_version("erlang-mochiweb")).to eq(nil)
+ expect(@yc.installed_version("erlang-mochiweb")).not_to eq(nil)
end
it "should parse type 'a' into an available state for a package" do
- @yc.available_version("znc").should_not be == nil
- @yc.installed_version("znc").should be == nil
+ expect(@yc.available_version("znc")).not_to eq(nil)
+ expect(@yc.installed_version("znc")).to eq(nil)
end
it "should parse type 'r' into an installed and available states for a package" do
- @yc.available_version("zip").should_not be == nil
- @yc.installed_version("zip").should_not be == nil
+ expect(@yc.available_version("zip")).not_to eq(nil)
+ expect(@yc.installed_version("zip")).not_to eq(nil)
end
it "should parse installonlypkgs from yum-dump.py options output" do
- @yc.allow_multi_install.should be == %w{kernel kernel-bigmem kernel-enterprise}
+ expect(@yc.allow_multi_install).to eq(%w{kernel kernel-bigmem kernel-enterprise})
end
end
describe "installed_version" do
it "should take one or two arguments" do
- lambda { @yc.installed_version("zip") }.should_not raise_error
- lambda { @yc.installed_version("zip", "i386") }.should_not raise_error
- lambda { @yc.installed_version("zip", "i386", "extra") }.should raise_error(ArgumentError)
+ expect { @yc.installed_version("zip") }.not_to raise_error
+ expect { @yc.installed_version("zip", "i386") }.not_to raise_error
+ expect { @yc.installed_version("zip", "i386", "extra") }.to raise_error(ArgumentError)
end
it "should return version-release for matching package regardless of arch" do
- @yc.installed_version("zip", "x86_64").should be == "2.31-2.el5"
- @yc.installed_version("zip", nil).should be == "2.31-2.el5"
+ expect(@yc.installed_version("zip", "x86_64")).to eq("2.31-2.el5")
+ expect(@yc.installed_version("zip", nil)).to eq("2.31-2.el5")
end
it "should return version-release for matching package and arch" do
- @yc.installed_version("zip", "x86_64").should be == "2.31-2.el5"
- @yc.installed_version("zisofs-tools", "i386").should be == nil
+ expect(@yc.installed_version("zip", "x86_64")).to eq("2.31-2.el5")
+ expect(@yc.installed_version("zisofs-tools", "i386")).to eq(nil)
end
it "should return nil for an unmatched package" do
- @yc.installed_version(nil, nil).should be == nil
- @yc.installed_version("test1", nil).should be == nil
- @yc.installed_version("test2", "x86_64").should be == nil
+ expect(@yc.installed_version(nil, nil)).to eq(nil)
+ expect(@yc.installed_version("test1", nil)).to eq(nil)
+ expect(@yc.installed_version("test2", "x86_64")).to eq(nil)
end
end
describe "available_version" do
it "should take one or two arguments" do
- lambda { @yc.available_version("zisofs-tools") }.should_not raise_error
- lambda { @yc.available_version("zisofs-tools", "i386") }.should_not raise_error
- lambda { @yc.available_version("zisofs-tools", "i386", "extra") }.should raise_error(ArgumentError)
+ expect { @yc.available_version("zisofs-tools") }.not_to raise_error
+ expect { @yc.available_version("zisofs-tools", "i386") }.not_to raise_error
+ expect { @yc.available_version("zisofs-tools", "i386", "extra") }.to raise_error(ArgumentError)
end
it "should return version-release for matching package regardless of arch" do
- @yc.available_version("zip", "x86_64").should be == "2.31-2.el5"
- @yc.available_version("zip", nil).should be == "2.31-2.el5"
+ expect(@yc.available_version("zip", "x86_64")).to eq("2.31-2.el5")
+ expect(@yc.available_version("zip", nil)).to eq("2.31-2.el5")
end
it "should return version-release for matching package and arch" do
- @yc.available_version("zip", "x86_64").should be == "2.31-2.el5"
- @yc.available_version("zisofs-tools", "i386").should be == nil
+ expect(@yc.available_version("zip", "x86_64")).to eq("2.31-2.el5")
+ expect(@yc.available_version("zisofs-tools", "i386")).to eq(nil)
end
it "should return nil for an unmatched package" do
- @yc.available_version(nil, nil).should be == nil
- @yc.available_version("test1", nil).should be == nil
- @yc.available_version("test2", "x86_64").should be == nil
+ expect(@yc.available_version(nil, nil)).to eq(nil)
+ expect(@yc.available_version("test1", nil)).to eq(nil)
+ expect(@yc.available_version("test2", "x86_64")).to eq(nil)
end
end
describe "version_available?" do
it "should take two or three arguments" do
- lambda { @yc.version_available?("zisofs-tools") }.should raise_error(ArgumentError)
- lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error
- lambda { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error
+ expect { @yc.version_available?("zisofs-tools") }.to raise_error(ArgumentError)
+ expect { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2") }.not_to raise_error
+ expect { @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.not_to raise_error
end
it "should return true if our package-version-arch is available" do
- @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64").should be == true
+ expect(@yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "x86_64")).to eq(true)
end
it "should return true if our package-version, no arch, is available" do
- @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", nil).should be == true
- @yc.version_available?("zisofs-tools", "1.0.6-3.2.2").should be == true
+ expect(@yc.version_available?("zisofs-tools", "1.0.6-3.2.2", nil)).to eq(true)
+ expect(@yc.version_available?("zisofs-tools", "1.0.6-3.2.2")).to eq(true)
end
it "should return false if our package-version-arch isn't available" do
- @yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "pretend").should be == false
- @yc.version_available?("zisofs-tools", "pretend", "x86_64").should be == false
- @yc.version_available?("pretend", "1.0.6-3.2.2", "x86_64").should be == false
+ expect(@yc.version_available?("zisofs-tools", "1.0.6-3.2.2", "pretend")).to eq(false)
+ expect(@yc.version_available?("zisofs-tools", "pretend", "x86_64")).to eq(false)
+ expect(@yc.version_available?("pretend", "1.0.6-3.2.2", "x86_64")).to eq(false)
end
it "should return false if our package-version, no arch, isn't available" do
- @yc.version_available?("zisofs-tools", "pretend", nil).should be == false
- @yc.version_available?("zisofs-tools", "pretend").should be == false
- @yc.version_available?("pretend", "1.0.6-3.2.2").should be == false
+ expect(@yc.version_available?("zisofs-tools", "pretend", nil)).to eq(false)
+ expect(@yc.version_available?("zisofs-tools", "pretend")).to eq(false)
+ expect(@yc.version_available?("pretend", "1.0.6-3.2.2")).to eq(false)
end
end
describe "package_repository" do
it "should take two or three arguments" do
- lambda { @yc.package_repository("zisofs-tools") }.should raise_error(ArgumentError)
- lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2") }.should_not raise_error
- lambda { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.should_not raise_error
+ expect { @yc.package_repository("zisofs-tools") }.to raise_error(ArgumentError)
+ expect { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2") }.not_to raise_error
+ expect { @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "x86_64") }.not_to raise_error
end
it "should return repoid for package-version-arch" do
- @yc.package_repository("zlib-devel", "1.2.3-3", "i386").should be == "extras"
- @yc.package_repository("zlib-devel", "1.2.3-3", "x86_64").should be == "base"
+ expect(@yc.package_repository("zlib-devel", "1.2.3-3", "i386")).to eq("extras")
+ expect(@yc.package_repository("zlib-devel", "1.2.3-3", "x86_64")).to eq("base")
end
it "should return repoid for package-version, no arch" do
- @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", nil).should be == "extras"
- @yc.package_repository("zisofs-tools", "1.0.6-3.2.2").should be == "extras"
+ expect(@yc.package_repository("zisofs-tools", "1.0.6-3.2.2", nil)).to eq("extras")
+ expect(@yc.package_repository("zisofs-tools", "1.0.6-3.2.2")).to eq("extras")
end
it "should return nil when no match for package-version-arch" do
- @yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "pretend").should be == nil
- @yc.package_repository("zisofs-tools", "pretend", "x86_64").should be == nil
- @yc.package_repository("pretend", "1.0.6-3.2.2", "x86_64").should be == nil
+ expect(@yc.package_repository("zisofs-tools", "1.0.6-3.2.2", "pretend")).to eq(nil)
+ expect(@yc.package_repository("zisofs-tools", "pretend", "x86_64")).to eq(nil)
+ expect(@yc.package_repository("pretend", "1.0.6-3.2.2", "x86_64")).to eq(nil)
end
it "should return nil when no match for package-version, no arch" do
- @yc.package_repository("zisofs-tools", "pretend", nil).should be == nil
- @yc.package_repository("zisofs-tools", "pretend").should be == nil
- @yc.package_repository("pretend", "1.0.6-3.2.2").should be == nil
+ expect(@yc.package_repository("zisofs-tools", "pretend", nil)).to eq(nil)
+ expect(@yc.package_repository("zisofs-tools", "pretend")).to eq(nil)
+ expect(@yc.package_repository("pretend", "1.0.6-3.2.2")).to eq(nil)
end
end
describe "reset" do
it "should empty the installed and available packages RPMDb" do
- @yc.available_version("zip", "x86_64").should be == "2.31-2.el5"
- @yc.installed_version("zip", "x86_64").should be == "2.31-2.el5"
+ expect(@yc.available_version("zip", "x86_64")).to eq("2.31-2.el5")
+ expect(@yc.installed_version("zip", "x86_64")).to eq("2.31-2.el5")
@yc.reset
- @yc.available_version("zip", "x86_64").should be == nil
- @yc.installed_version("zip", "x86_64").should be == nil
+ expect(@yc.available_version("zip", "x86_64")).to eq(nil)
+ expect(@yc.installed_version("zip", "x86_64")).to eq(nil)
end
end
describe "package_available?" do
it "should return true a package name is available" do
- @yc.package_available?("zisofs-tools").should be == true
- @yc.package_available?("moo").should be == false
- @yc.package_available?(nil).should be == false
+ expect(@yc.package_available?("zisofs-tools")).to eq(true)
+ expect(@yc.package_available?("moo")).to eq(false)
+ expect(@yc.package_available?(nil)).to eq(false)
end
it "should return true a package name + arch is available" do
- @yc.package_available?("zlib-devel.i386").should be == true
- @yc.package_available?("zisofs-tools.x86_64").should be == true
- @yc.package_available?("znc-test.beta1.x86_64").should be == true
- @yc.package_available?("znc-test.beta1").should be == true
- @yc.package_available?("znc-test.test.beta1").should be == true
- @yc.package_available?("moo.i386").should be == false
- @yc.package_available?("zisofs-tools.beta").should be == false
- @yc.package_available?("znc-test.test").should be == false
+ expect(@yc.package_available?("zlib-devel.i386")).to eq(true)
+ expect(@yc.package_available?("zisofs-tools.x86_64")).to eq(true)
+ expect(@yc.package_available?("znc-test.beta1.x86_64")).to eq(true)
+ expect(@yc.package_available?("znc-test.beta1")).to eq(true)
+ expect(@yc.package_available?("znc-test.test.beta1")).to eq(true)
+ expect(@yc.package_available?("moo.i386")).to eq(false)
+ expect(@yc.package_available?("zisofs-tools.beta")).to eq(false)
+ expect(@yc.package_available?("znc-test.test")).to eq(false)
end
end
describe "enable_extra_repo_control" do
it "should set @extra_repo_control to arg" do
@yc.enable_extra_repo_control("--enablerepo=test")
- @yc.extra_repo_control.should be == "--enablerepo=test"
+ expect(@yc.extra_repo_control).to eq("--enablerepo=test")
end
it "should call reload once when set to flag cache for update" do
- @yc.should_receive(:reload).once
+ expect(@yc).to receive(:reload).once
@yc.enable_extra_repo_control("--enablerepo=test")
@yc.enable_extra_repo_control("--enablerepo=test")
end
@@ -1848,13 +1848,13 @@ EOF
it "should set @extra_repo_control to nil" do
@yc.enable_extra_repo_control("--enablerepo=test")
@yc.disable_extra_repo_control
- @yc.extra_repo_control.should be == nil
+ expect(@yc.extra_repo_control).to eq(nil)
end
it "should call reload once when cleared to flag cache for update" do
- @yc.should_receive(:reload).once
+ expect(@yc).to receive(:reload).once
@yc.enable_extra_repo_control("--enablerepo=test")
- @yc.should_receive(:reload).once
+ expect(@yc).to receive(:reload).once
@yc.disable_extra_repo_control
@yc.disable_extra_repo_control
end
diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb
index 87f02d7794..17d99640e6 100644
--- a/spec/unit/provider/package/zypper_spec.rb
+++ b/spec/unit/provider/package/zypper_spec.rb
@@ -30,84 +30,84 @@ describe Chef::Provider::Package::Zypper do
@status = double("Status", :exitstatus => 0)
@provider = Chef::Provider::Package::Zypper.new(@new_resource, @run_context)
- Chef::Resource::Package.stub(:new).and_return(@current_resource)
- @provider.stub(:popen4).and_return(@status)
+ allow(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
+ allow(@provider).to receive(:popen4).and_return(@status)
@stderr = StringIO.new
@stdout = StringIO.new
@pid = double("PID")
- @provider.stub(:`).and_return("2.0")
+ allow(@provider).to receive(:`).and_return("2.0")
end
describe "when loading the current package state" do
it "should create a current resource with the name of the new_resource" do
- Chef::Resource::Package.should_receive(:new).and_return(@current_resource)
+ expect(Chef::Resource::Package).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resources package name to the new resources package name" do
- @current_resource.should_receive(:package_name).with(@new_resource.package_name)
+ expect(@current_resource).to receive(:package_name).with(@new_resource.package_name)
@provider.load_current_resource
end
it "should run zypper info with the package name" do
- @provider.should_receive(:popen4).with("zypper --non-interactive info #{@new_resource.package_name}").and_return(@status)
+ expect(@provider).to receive(:popen4).with("zypper --non-interactive info #{@new_resource.package_name}").and_return(@status)
@provider.load_current_resource
end
it "should set the installed version to nil on the current resource if zypper info installed version is (none)" do
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @current_resource.should_receive(:version).with(nil).and_return(true)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@current_resource).to receive(:version).with(nil).and_return(true)
@provider.load_current_resource
end
it "should set the installed version if zypper info has one" do
@stdout = StringIO.new("Version: 1.0\nInstalled: Yes\n")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
- @current_resource.should_receive(:version).with("1.0").and_return(true)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ expect(@current_resource).to receive(:version).with("1.0").and_return(true)
@provider.load_current_resource
end
it "should set the candidate version if zypper info has one" do
@stdout = StringIO.new("Version: 1.0\nInstalled: No\nStatus: out-of-date (version 0.9 installed)")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @provider.candidate_version.should eql("1.0")
+ expect(@provider.candidate_version).to eql("1.0")
end
it "should raise an exception if zypper info fails" do
- @status.should_receive(:exitstatus).and_return(1)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
+ expect(@status).to receive(:exitstatus).and_return(1)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
end
it "should not raise an exception if zypper info succeeds" do
- @status.should_receive(:exitstatus).and_return(0)
- lambda { @provider.load_current_resource }.should_not raise_error
+ expect(@status).to receive(:exitstatus).and_return(0)
+ expect { @provider.load_current_resource }.not_to raise_error
end
it "should return the current resouce" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
end
describe "install_package" do
it "should run zypper install with the package name and version" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(true)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive install --auto-agree-with-licenses emacs=1.0")
@provider.install_package("emacs", "1.0")
end
it "should run zypper install without gpg checks" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(false)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks install "+
"--auto-agree-with-licenses emacs=1.0")
@provider.install_package("emacs", "1.0")
end
it "should warn about gpg checks on zypper install" do
- Chef::Log.should_receive(:warn).with(
+ expect(Chef::Log).to receive(:warn).with(
/All packages will be installed without gpg signature checks/)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks install "+
"--auto-agree-with-licenses emacs=1.0")
@provider.install_package("emacs", "1.0")
@@ -116,28 +116,28 @@ describe Chef::Provider::Package::Zypper do
describe "upgrade_package" do
it "should run zypper update with the package name and version" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(true)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive install --auto-agree-with-licenses emacs=1.0")
@provider.upgrade_package("emacs", "1.0")
end
it "should run zypper update without gpg checks" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(false)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks install "+
"--auto-agree-with-licenses emacs=1.0")
@provider.upgrade_package("emacs", "1.0")
end
it "should warn about gpg checks on zypper upgrade" do
- Chef::Log.should_receive(:warn).with(
+ expect(Chef::Log).to receive(:warn).with(
/All packages will be installed without gpg signature checks/)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks install "+
"--auto-agree-with-licenses emacs=1.0")
@provider.upgrade_package("emacs", "1.0")
end
it "should run zypper upgrade without gpg checks" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks install "+
"--auto-agree-with-licenses emacs=1.0")
@@ -149,8 +149,8 @@ describe Chef::Provider::Package::Zypper do
context "when package version is not explicitly specified" do
it "should run zypper remove with the package name" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(true)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive remove emacs")
@provider.remove_package("emacs", nil)
end
@@ -158,21 +158,21 @@ describe Chef::Provider::Package::Zypper do
context "when package version is explicitly specified" do
it "should run zypper remove with the package name" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(true)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive remove emacs=1.0")
@provider.remove_package("emacs", "1.0")
end
it "should run zypper remove without gpg checks" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(false)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks remove emacs=1.0")
@provider.remove_package("emacs", "1.0")
end
it "should warn about gpg checks on zypper remove" do
- Chef::Log.should_receive(:warn).with(
+ expect(Chef::Log).to receive(:warn).with(
/All packages will be installed without gpg signature checks/)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks remove emacs=1.0")
@provider.remove_package("emacs", "1.0")
@@ -182,20 +182,20 @@ describe Chef::Provider::Package::Zypper do
describe "purge_package" do
it "should run remove_package with the name and version" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0")
@provider.purge_package("emacs", "1.0")
end
it "should run zypper purge without gpg checks" do
- Chef::Config.stub(:[]).with(:zypper_check_gpg).and_return(false)
- @provider.should_receive(:shell_out!).with(
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0")
@provider.purge_package("emacs", "1.0")
end
it "should warn about gpg checks on zypper purge" do
- Chef::Log.should_receive(:warn).with(
+ expect(Chef::Log).to receive(:warn).with(
/All packages will be installed without gpg signature checks/)
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0")
@provider.purge_package("emacs", "1.0")
end
@@ -203,12 +203,12 @@ describe Chef::Provider::Package::Zypper do
describe "on an older zypper" do
before(:each) do
- @provider.stub(:`).and_return("0.11.6")
+ allow(@provider).to receive(:`).and_return("0.11.6")
end
describe "install_package" do
it "should run zypper install with the package name and version" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs")
@provider.install_package("emacs", "1.0")
end
@@ -216,7 +216,7 @@ describe Chef::Provider::Package::Zypper do
describe "upgrade_package" do
it "should run zypper update with the package name and version" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs")
@provider.upgrade_package("emacs", "1.0")
end
@@ -224,7 +224,7 @@ describe Chef::Provider::Package::Zypper do
describe "remove_package" do
it "should run zypper remove with the package name" do
- @provider.should_receive(:shell_out!).with(
+ expect(@provider).to receive(:shell_out!).with(
"zypper --no-gpg-checks remove -y emacs")
@provider.remove_package("emacs", "1.0")
end
diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb
index 375a0d0646..2aeaf717e6 100644
--- a/spec/unit/provider/package_spec.rb
+++ b/spec/unit/provider/package_spec.rb
@@ -34,80 +34,80 @@ describe Chef::Provider::Package do
describe "when installing a package" do
before(:each) do
@provider.current_resource = @current_resource
- @provider.stub(:install_package).and_return(true)
+ allow(@provider).to receive(:install_package).and_return(true)
end
it "should raise a Chef::Exceptions::Package if no version is specified, and no candidate is available" do
@provider.candidate_version = nil
- lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package)
+ expect { @provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
end
it "should call preseed_package if a response_file is given" do
@new_resource.response_file("foo")
- @provider.should_receive(:get_preseed_file).with(
+ expect(@provider).to receive(:get_preseed_file).with(
@new_resource.name,
@provider.candidate_version
).and_return("/var/cache/preseed-test")
- @provider.should_receive(:preseed_package).with(
+ expect(@provider).to receive(:preseed_package).with(
"/var/cache/preseed-test"
).and_return(true)
@provider.run_action(:install)
end
it "should not call preseed_package if a response_file is not given" do
- @provider.should_not_receive(:preseed_package)
+ expect(@provider).not_to receive(:preseed_package)
@provider.run_action(:install)
end
it "should install the package at the candidate_version if it is not already installed" do
- @provider.should_receive(:install_package).with(
+ expect(@provider).to receive(:install_package).with(
@new_resource.name,
@provider.candidate_version
).and_return(true)
@provider.run_action(:install)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should install the package at the version specified if it is not already installed" do
@new_resource.version("1.0")
- @provider.should_receive(:install_package).with(
+ expect(@provider).to receive(:install_package).with(
@new_resource.name,
@new_resource.version
).and_return(true)
@provider.run_action(:install)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should install the package at the version specified if a different version is installed" do
@new_resource.version("1.0")
- @current_resource.stub(:version).and_return("0.99")
- @provider.should_receive(:install_package).with(
+ allow(@current_resource).to receive(:version).and_return("0.99")
+ expect(@provider).to receive(:install_package).with(
@new_resource.name,
@new_resource.version
).and_return(true)
@provider.run_action(:install)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should not install the package if it is already installed and no version is specified" do
@current_resource.version("1.0")
- @provider.should_not_receive(:install_package)
+ expect(@provider).not_to receive(:install_package)
@provider.run_action(:install)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should not install the package if it is already installed at the version specified" do
@current_resource.version("1.0")
@new_resource.version("1.0")
- @provider.should_not_receive(:install_package)
+ expect(@provider).not_to receive(:install_package)
@provider.run_action(:install)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should call the candidate_version accessor only once if the package is already installed and no version is specified" do
@current_resource.version("1.0")
- @provider.stub(:candidate_version).and_return("1.0")
+ allow(@provider).to receive(:candidate_version).and_return("1.0")
@provider.run_action(:install)
end
@@ -119,220 +119,220 @@ describe Chef::Provider::Package do
it "should set the resource to updated if it installs the package" do
@provider.run_action(:install)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "when upgrading the package" do
before(:each) do
- @provider.stub(:upgrade_package).and_return(true)
+ allow(@provider).to receive(:upgrade_package).and_return(true)
end
it "should upgrade the package if the current version is not the candidate version" do
- @provider.should_receive(:upgrade_package).with(
+ expect(@provider).to receive(:upgrade_package).with(
@new_resource.name,
@provider.candidate_version
).and_return(true)
@provider.run_action(:upgrade)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should set the resource to updated if it installs the package" do
@provider.run_action(:upgrade)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not install the package if the current version is the candidate version" do
@current_resource.version "1.0"
- @provider.should_not_receive(:upgrade_package)
+ expect(@provider).not_to receive(:upgrade_package)
@provider.run_action(:upgrade)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should print the word 'uninstalled' if there was no original version" do
- @current_resource.stub(:version).and_return(nil)
- Chef::Log.should_receive(:info).with("package[emacs] upgraded from uninstalled to 1.0")
+ allow(@current_resource).to receive(:version).and_return(nil)
+ expect(Chef::Log).to receive(:info).with("package[emacs] upgraded from uninstalled to 1.0")
@provider.run_action(:upgrade)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should raise a Chef::Exceptions::Package if current version and candidate are nil" do
- @current_resource.stub(:version).and_return(nil)
+ allow(@current_resource).to receive(:version).and_return(nil)
@provider.candidate_version = nil
- lambda { @provider.run_action(:upgrade) }.should raise_error(Chef::Exceptions::Package)
+ expect { @provider.run_action(:upgrade) }.to raise_error(Chef::Exceptions::Package)
end
it "should not install the package if candidate version is nil" do
@current_resource.version "1.0"
@provider.candidate_version = nil
- @provider.should_not_receive(:upgrade_package)
+ expect(@provider).not_to receive(:upgrade_package)
@provider.run_action(:upgrade)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
end
describe "When removing the package" do
before(:each) do
- @provider.stub(:remove_package).and_return(true)
+ allow(@provider).to receive(:remove_package).and_return(true)
@current_resource.version '1.4.2'
end
it "should remove the package if it is installed" do
- @provider.should be_removing_package
- @provider.should_receive(:remove_package).with('emacs', nil)
+ expect(@provider).to be_removing_package
+ expect(@provider).to receive(:remove_package).with('emacs', nil)
@provider.run_action(:remove)
- @new_resource.should be_updated
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated
+ expect(@new_resource).to be_updated_by_last_action
end
it "should remove the package at a specific version if it is installed at that version" do
@new_resource.version "1.4.2"
- @provider.should be_removing_package
- @provider.should_receive(:remove_package).with('emacs', '1.4.2')
+ expect(@provider).to be_removing_package
+ expect(@provider).to receive(:remove_package).with('emacs', '1.4.2')
@provider.run_action(:remove)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should not remove the package at a specific version if it is not installed at that version" do
@new_resource.version "1.0"
- @provider.should_not be_removing_package
- @provider.should_not_receive(:remove_package)
+ expect(@provider).not_to be_removing_package
+ expect(@provider).not_to receive(:remove_package)
@provider.run_action(:remove)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should not remove the package if it is not installed" do
- @provider.should_not_receive(:remove_package)
- @current_resource.stub(:version).and_return(nil)
+ expect(@provider).not_to receive(:remove_package)
+ allow(@current_resource).to receive(:version).and_return(nil)
@provider.run_action(:remove)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should set the resource to updated if it removes the package" do
@provider.run_action(:remove)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "When purging the package" do
before(:each) do
- @provider.stub(:purge_package).and_return(true)
+ allow(@provider).to receive(:purge_package).and_return(true)
@current_resource.version '1.4.2'
end
it "should purge the package if it is installed" do
- @provider.should be_removing_package
- @provider.should_receive(:purge_package).with('emacs', nil)
+ expect(@provider).to be_removing_package
+ expect(@provider).to receive(:purge_package).with('emacs', nil)
@provider.run_action(:purge)
- @new_resource.should be_updated
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated
+ expect(@new_resource).to be_updated_by_last_action
end
it "should purge the package at a specific version if it is installed at that version" do
@new_resource.version "1.4.2"
- @provider.should be_removing_package
- @provider.should_receive(:purge_package).with('emacs', '1.4.2')
+ expect(@provider).to be_removing_package
+ expect(@provider).to receive(:purge_package).with('emacs', '1.4.2')
@provider.run_action(:purge)
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated_by_last_action
end
it "should not purge the package at a specific version if it is not installed at that version" do
@new_resource.version "1.0"
- @provider.should_not be_removing_package
- @provider.should_not_receive(:purge_package)
+ expect(@provider).not_to be_removing_package
+ expect(@provider).not_to receive(:purge_package)
@provider.run_action(:purge)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should not purge the package if it is not installed" do
@current_resource.instance_variable_set(:@version, nil)
- @provider.should_not be_removing_package
+ expect(@provider).not_to be_removing_package
- @provider.should_not_receive(:purge_package)
+ expect(@provider).not_to receive(:purge_package)
@provider.run_action(:purge)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should set the resource to updated if it purges the package" do
@provider.run_action(:purge)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "when reconfiguring the package" do
before(:each) do
- @provider.stub(:reconfig_package).and_return(true)
+ allow(@provider).to receive(:reconfig_package).and_return(true)
end
it "should info log, reconfigure the package and update the resource" do
- @current_resource.stub(:version).and_return('1.0')
- @new_resource.stub(:response_file).and_return(true)
- @provider.should_receive(:get_preseed_file).and_return('/var/cache/preseed-test')
- @provider.stub(:preseed_package).and_return(true)
- @provider.stub(:reconfig_package).and_return(true)
- Chef::Log.should_receive(:info).with("package[emacs] reconfigured")
- @provider.should_receive(:reconfig_package)
+ allow(@current_resource).to receive(:version).and_return('1.0')
+ allow(@new_resource).to receive(:response_file).and_return(true)
+ expect(@provider).to receive(:get_preseed_file).and_return('/var/cache/preseed-test')
+ allow(@provider).to receive(:preseed_package).and_return(true)
+ allow(@provider).to receive(:reconfig_package).and_return(true)
+ expect(Chef::Log).to receive(:info).with("package[emacs] reconfigured")
+ expect(@provider).to receive(:reconfig_package)
@provider.run_action(:reconfig)
- @new_resource.should be_updated
- @new_resource.should be_updated_by_last_action
+ expect(@new_resource).to be_updated
+ expect(@new_resource).to be_updated_by_last_action
end
it "should debug log and not reconfigure the package if the package is not installed" do
- @current_resource.stub(:version).and_return(nil)
- Chef::Log.should_receive(:debug).with("package[emacs] is NOT installed - nothing to do")
- @provider.should_not_receive(:reconfig_package)
+ allow(@current_resource).to receive(:version).and_return(nil)
+ expect(Chef::Log).to receive(:debug).with("package[emacs] is NOT installed - nothing to do")
+ expect(@provider).not_to receive(:reconfig_package)
@provider.run_action(:reconfig)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should debug log and not reconfigure the package if no response_file is given" do
- @current_resource.stub(:version).and_return('1.0')
- @new_resource.stub(:response_file).and_return(nil)
- Chef::Log.should_receive(:debug).with("package[emacs] no response_file provided - nothing to do")
- @provider.should_not_receive(:reconfig_package)
+ allow(@current_resource).to receive(:version).and_return('1.0')
+ allow(@new_resource).to receive(:response_file).and_return(nil)
+ expect(Chef::Log).to receive(:debug).with("package[emacs] no response_file provided - nothing to do")
+ expect(@provider).not_to receive(:reconfig_package)
@provider.run_action(:reconfig)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
it "should debug log and not reconfigure the package if the response_file has not changed" do
- @current_resource.stub(:version).and_return('1.0')
- @new_resource.stub(:response_file).and_return(true)
- @provider.should_receive(:get_preseed_file).and_return(false)
- @provider.stub(:preseed_package).and_return(false)
- Chef::Log.should_receive(:debug).with("package[emacs] preseeding has not changed - nothing to do")
- @provider.should_not_receive(:reconfig_package)
+ allow(@current_resource).to receive(:version).and_return('1.0')
+ allow(@new_resource).to receive(:response_file).and_return(true)
+ expect(@provider).to receive(:get_preseed_file).and_return(false)
+ allow(@provider).to receive(:preseed_package).and_return(false)
+ expect(Chef::Log).to receive(:debug).with("package[emacs] preseeding has not changed - nothing to do")
+ expect(@provider).not_to receive(:reconfig_package)
@provider.run_action(:reconfig)
- @new_resource.should_not be_updated_by_last_action
+ expect(@new_resource).not_to be_updated_by_last_action
end
end
describe "when running commands to be implemented by subclasses" do
it "should raises UnsupportedAction for install" do
- lambda { @provider.install_package('emacs', '1.4.2') }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.install_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should raises UnsupportedAction for upgrade" do
- lambda { @provider.upgrade_package('emacs', '1.4.2') }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.upgrade_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should raises UnsupportedAction for remove" do
- lambda { @provider.remove_package('emacs', '1.4.2') }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.remove_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should raises UnsupportedAction for purge" do
- lambda { @provider.purge_package('emacs', '1.4.2') }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.purge_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should raise UnsupportedAction for preseed_package" do
preseed_file = "/tmp/sun-jdk-package-preseed-file.seed"
- lambda { @provider.preseed_package(preseed_file) }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.preseed_package(preseed_file) }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should raise UnsupportedAction for reconfig" do
- lambda { @provider.reconfig_package('emacs', '1.4.2') }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.reconfig_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
end
@@ -358,29 +358,29 @@ describe Chef::Provider::Package do
describe "creating the cookbook file resource to fetch the response file" do
before do
- Chef::FileCache.should_receive(:create_cache_path).with('preseed/java').and_return("/tmp/preseed/java")
+ expect(Chef::FileCache).to receive(:create_cache_path).with('preseed/java').and_return("/tmp/preseed/java")
end
it "sets the preseed resource's runcontext to its own run context" do
- Chef::FileCache.stub(:create_cache_path).and_return("/tmp/preseed/java")
- @provider.preseed_resource('java', '6').run_context.should_not be_nil
- @provider.preseed_resource('java', '6').run_context.should equal(@provider.run_context)
+ allow(Chef::FileCache).to receive(:create_cache_path).and_return("/tmp/preseed/java")
+ expect(@provider.preseed_resource('java', '6').run_context).not_to be_nil
+ expect(@provider.preseed_resource('java', '6').run_context).to equal(@provider.run_context)
end
it "should set the cookbook name of the remote file to the new resources cookbook name" do
- @provider.preseed_resource('java', '6').cookbook_name.should == 'java'
+ expect(@provider.preseed_resource('java', '6').cookbook_name).to eq('java')
end
it "should set remote files source to the new resources response file" do
- @provider.preseed_resource('java', '6').source.should == 'java.response'
+ expect(@provider.preseed_resource('java', '6').source).to eq('java.response')
end
it "should never back up the cached response file" do
- @provider.preseed_resource('java', '6').backup.should be_false
+ expect(@provider.preseed_resource('java', '6').backup).to be_falsey
end
it "sets the install path of the resource to $file_cache/$cookbook/$pkg_name-$pkg_version.seed" do
- @provider.preseed_resource('java', '6').path.should == '/tmp/preseed/java/java-6.seed'
+ expect(@provider.preseed_resource('java', '6').path).to eq('/tmp/preseed/java/java-6.seed')
end
end
@@ -397,7 +397,7 @@ describe Chef::Provider::Package do
@response_file_resource.source('java.response')
- @provider.should_receive(:preseed_resource).with('java', '6').and_return(@response_file_resource)
+ expect(@provider).to receive(:preseed_resource).with('java', '6').and_return(@response_file_resource)
end
after do
@@ -405,20 +405,20 @@ describe Chef::Provider::Package do
end
it "creates the preseed file in the cache" do
- @response_file_resource.should_receive(:run_action).with(:create)
+ expect(@response_file_resource).to receive(:run_action).with(:create)
@provider.get_preseed_file("java", "6")
end
it "returns the path to the response file if the response file was updated" do
- @provider.get_preseed_file("java", "6").should == @response_file_destination
+ expect(@provider.get_preseed_file("java", "6")).to eq(@response_file_destination)
end
it "should return false if the response file has not been updated" do
@response_file_resource.updated_by_last_action(false)
- @response_file_resource.should_not be_updated_by_last_action
+ expect(@response_file_resource).not_to be_updated_by_last_action
# don't let the response_file_resource set updated to true
- @response_file_resource.should_receive(:run_action).with(:create)
- @provider.get_preseed_file("java", "6").should be(false)
+ expect(@response_file_resource).to receive(:run_action).with(:create)
+ expect(@provider.get_preseed_file("java", "6")).to be(false)
end
end
diff --git a/spec/unit/provider/powershell_spec.rb b/spec/unit/provider/powershell_spec.rb
index 33c402836b..60dbcf80b0 100644
--- a/spec/unit/provider/powershell_spec.rb
+++ b/spec/unit/provider/powershell_spec.rb
@@ -32,7 +32,7 @@ describe Chef::Provider::PowershellScript, "action_run" do
end
it "should set the -File flag as the last flag" do
- @provider.flags.split(' ').pop.should == "-File"
+ expect(@provider.flags.split(' ').pop).to eq("-File")
end
end
diff --git a/spec/unit/provider/registry_key_spec.rb b/spec/unit/provider/registry_key_spec.rb
index 2cfbcf98f1..79811fdab8 100644
--- a/spec/unit/provider/registry_key_spec.rb
+++ b/spec/unit/provider/registry_key_spec.rb
@@ -31,9 +31,9 @@ shared_examples_for "a registry key" do
@provider = Chef::Provider::RegistryKey.new(@new_resource, @run_context)
- @provider.stub(:running_on_windows!).and_return(true)
+ allow(@provider).to receive(:running_on_windows!).and_return(true)
@double_registry = double(Chef::Win32::Registry)
- @provider.stub(:registry).and_return(@double_registry)
+ allow(@provider).to receive(:registry).and_return(@double_registry)
end
describe "when first created" do
@@ -42,36 +42,36 @@ shared_examples_for "a registry key" do
describe "executing load_current_resource" do
describe "when the key exists" do
before(:each) do
- @double_registry.should_receive(:key_exists?).with(keyname).and_return(true)
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval2 )
+ expect(@double_registry).to receive(:key_exists?).with(keyname).and_return(true)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval2 )
@provider.load_current_resource
end
it "should set the key of the current resource to the key of the new resource" do
- @provider.current_resource.key.should == @new_resource.key
+ expect(@provider.current_resource.key).to eq(@new_resource.key)
end
it "should set the architecture of the current resource to the architecture of the new resource" do
- @provider.current_resource.architecture.should == @new_resource.architecture
+ expect(@provider.current_resource.architecture).to eq(@new_resource.architecture)
end
it "should set the recursive flag of the current resource to the recursive flag of the new resource" do
- @provider.current_resource.recursive.should == @new_resource.recursive
+ expect(@provider.current_resource.recursive).to eq(@new_resource.recursive)
end
it "should set the unscrubbed values of the current resource to the values it got from the registry" do
- @provider.current_resource.unscrubbed_values.should == [ testval2 ]
+ expect(@provider.current_resource.unscrubbed_values).to eq([ testval2 ])
end
end
describe "when the key does not exist" do
before(:each) do
- @double_registry.should_receive(:key_exists?).with(keyname).and_return(false)
+ expect(@double_registry).to receive(:key_exists?).with(keyname).and_return(false)
@provider.load_current_resource
end
it "should set the values in the current resource to empty array" do
- @provider.current_resource.values.should == []
+ expect(@provider.current_resource.values).to eq([])
end
end
end
@@ -79,29 +79,29 @@ shared_examples_for "a registry key" do
describe "action_create" do
context "when the key exists" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(true)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(true)
end
it "should do nothing if the key and the value both exist" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1 )
- @double_registry.should_not_receive(:set_value)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1 )
+ expect(@double_registry).not_to receive(:set_value)
@provider.load_current_resource
@provider.action_create
end
it "should create the value if the key exists but the value does not" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval2 )
- @double_registry.should_receive(:set_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval2 )
+ expect(@double_registry).to receive(:set_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_create
end
it "should set the value if the key exists but the data does not match" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1_wrong_data )
- @double_registry.should_receive(:set_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1_wrong_data )
+ expect(@double_registry).to receive(:set_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_create
end
it "should set the value if the key exists but the type does not match" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1_wrong_type )
- @double_registry.should_receive(:set_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1_wrong_type )
+ expect(@double_registry).to receive(:set_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_create
end
@@ -109,30 +109,30 @@ shared_examples_for "a registry key" do
context "when the key exists and the values in the new resource are empty" do
it "when a value is in the key, it should do nothing" do
@provider.new_resource.values([])
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(true)
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1 )
- @double_registry.should_not_receive(:create_key)
- @double_registry.should_not_receive(:set_value)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(true)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1 )
+ expect(@double_registry).not_to receive(:create_key)
+ expect(@double_registry).not_to receive(:set_value)
@provider.load_current_resource
@provider.action_create
end
it "when no value is in the key, it should do nothing" do
@provider.new_resource.values([])
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(true)
- @double_registry.should_receive(:get_values).with(keyname).and_return( nil )
- @double_registry.should_not_receive(:create_key)
- @double_registry.should_not_receive(:set_value)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(true)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( nil )
+ expect(@double_registry).not_to receive(:create_key)
+ expect(@double_registry).not_to receive(:set_value)
@provider.load_current_resource
@provider.action_create
end
end
context "when the key does not exist" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(false)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(false)
end
it "should create the key and the value" do
- @double_registry.should_receive(:create_key).with(keyname, false)
- @double_registry.should_receive(:set_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:create_key).with(keyname, false)
+ expect(@double_registry).to receive(:set_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_create
end
@@ -140,9 +140,9 @@ shared_examples_for "a registry key" do
context "when the key does not exist and the values in the new resource are empty" do
it "should create the key" do
@new_resource.values([])
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(false)
- @double_registry.should_receive(:create_key).with(keyname, false)
- @double_registry.should_not_receive(:set_value)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(false)
+ expect(@double_registry).to receive(:create_key).with(keyname, false)
+ expect(@double_registry).not_to receive(:set_value)
@provider.load_current_resource
@provider.action_create
end
@@ -152,40 +152,40 @@ shared_examples_for "a registry key" do
describe "action_create_if_missing" do
context "when the key exists" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(true)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(true)
end
it "should do nothing if the key and the value both exist" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1 )
- @double_registry.should_not_receive(:set_value)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1 )
+ expect(@double_registry).not_to receive(:set_value)
@provider.load_current_resource
@provider.action_create_if_missing
end
it "should create the value if the key exists but the value does not" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval2 )
- @double_registry.should_receive(:set_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval2 )
+ expect(@double_registry).to receive(:set_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_create_if_missing
end
it "should not set the value if the key exists but the data does not match" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1_wrong_data )
- @double_registry.should_not_receive(:set_value)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1_wrong_data )
+ expect(@double_registry).not_to receive(:set_value)
@provider.load_current_resource
@provider.action_create_if_missing
end
it "should not set the value if the key exists but the type does not match" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1_wrong_type )
- @double_registry.should_not_receive(:set_value)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1_wrong_type )
+ expect(@double_registry).not_to receive(:set_value)
@provider.load_current_resource
@provider.action_create_if_missing
end
end
context "when the key does not exist" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(false)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(false)
end
it "should create the key and the value" do
- @double_registry.should_receive(:create_key).with(keyname, false)
- @double_registry.should_receive(:set_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:create_key).with(keyname, false)
+ expect(@double_registry).to receive(:set_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_create_if_missing
end
@@ -195,39 +195,39 @@ shared_examples_for "a registry key" do
describe "action_delete" do
context "when the key exists" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(true)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(true)
end
it "deletes the value when the value exists" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1 )
- @double_registry.should_receive(:delete_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1 )
+ expect(@double_registry).to receive(:delete_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_delete
end
it "deletes the value when the value exists, but the type is wrong" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1_wrong_type )
- @double_registry.should_receive(:delete_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1_wrong_type )
+ expect(@double_registry).to receive(:delete_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_delete
end
it "deletes the value when the value exists, but the data is wrong" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1_wrong_data )
- @double_registry.should_receive(:delete_value).with(keyname, testval1)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1_wrong_data )
+ expect(@double_registry).to receive(:delete_value).with(keyname, testval1)
@provider.load_current_resource
@provider.action_delete
end
it "does not delete the value when the value does not exist" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval2 )
- @double_registry.should_not_receive(:delete_value)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval2 )
+ expect(@double_registry).not_to receive(:delete_value)
@provider.load_current_resource
@provider.action_delete
end
end
context "when the key does not exist" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(false)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(false)
end
it "does nothing" do
- @double_registry.should_not_receive(:delete_value)
+ expect(@double_registry).not_to receive(:delete_value)
@provider.load_current_resource
@provider.action_delete
end
@@ -237,21 +237,21 @@ shared_examples_for "a registry key" do
describe "action_delete_key" do
context "when the key exists" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(true)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(true)
end
it "deletes the key" do
- @double_registry.should_receive(:get_values).with(keyname).and_return( testval1 )
- @double_registry.should_receive(:delete_key).with(keyname, false)
+ expect(@double_registry).to receive(:get_values).with(keyname).and_return( testval1 )
+ expect(@double_registry).to receive(:delete_key).with(keyname, false)
@provider.load_current_resource
@provider.action_delete_key
end
end
context "when the key does not exist" do
before(:each) do
- @double_registry.should_receive(:key_exists?).twice.with(keyname).and_return(false)
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(false)
end
it "does nothing" do
- @double_registry.should_not_receive(:delete_key)
+ expect(@double_registry).not_to receive(:delete_key)
@provider.load_current_resource
@provider.action_delete_key
end
diff --git a/spec/unit/provider/remote_directory_spec.rb b/spec/unit/provider/remote_directory_spec.rb
index b986e2c8ad..4434714ebc 100644
--- a/spec/unit/provider/remote_directory_spec.rb
+++ b/spec/unit/provider/remote_directory_spec.rb
@@ -27,7 +27,7 @@ end
describe Chef::Provider::RemoteDirectory do
before do
- Chef::FileAccessControl.any_instance.stub(:set_all)
+ allow_any_instance_of(Chef::FileAccessControl).to receive(:set_all)
@resource = Chef::Resource::RemoteDirectory.new(File.join(Dir.tmpdir, "tafty"))
# in CHEF_SPEC_DATA/cookbooks/openldap/files/default/remotedir
@@ -80,11 +80,11 @@ describe Chef::Provider::RemoteDirectory do
it "configures access control on intermediate directorys" do
directory_resource = @provider.send(:resource_for_directory, File.join(Dir.tmpdir, "intermediate_dir"))
- directory_resource.path.should == File.join(Dir.tmpdir, "intermediate_dir")
- directory_resource.mode.should == "0750"
- directory_resource.group.should == "wheel"
- directory_resource.owner.should == "root"
- directory_resource.recursive.should be_true
+ expect(directory_resource.path).to eq(File.join(Dir.tmpdir, "intermediate_dir"))
+ expect(directory_resource.mode).to eq("0750")
+ expect(directory_resource.group).to eq("wheel")
+ expect(directory_resource.owner).to eq("root")
+ expect(directory_resource.recursive).to be_truthy
end
it "configures access control on files in the directory" do
@@ -92,12 +92,12 @@ describe Chef::Provider::RemoteDirectory do
cookbook_file = @provider.send(:cookbook_file_resource,
"/target/destination/path.txt",
"relative/source/path.txt")
- cookbook_file.cookbook_name.should == "berlin_style_tasty_cupcakes"
- cookbook_file.source.should == "remotedir_root/relative/source/path.txt"
- cookbook_file.mode.should == "0640"
- cookbook_file.group.should == "staff"
- cookbook_file.owner.should == "toor"
- cookbook_file.backup.should == 23
+ expect(cookbook_file.cookbook_name).to eq("berlin_style_tasty_cupcakes")
+ expect(cookbook_file.source).to eq("remotedir_root/relative/source/path.txt")
+ expect(cookbook_file.mode).to eq("0640")
+ expect(cookbook_file.group).to eq("staff")
+ expect(cookbook_file.owner).to eq("toor")
+ expect(cookbook_file.backup).to eq(23)
end
end
@@ -116,17 +116,17 @@ describe Chef::Provider::RemoteDirectory do
it "creates the toplevel directory without error " do
@resource.recursive(false)
@provider.run_action(:create)
- ::File.exist?(@destination_dir).should be_true
+ expect(::File.exist?(@destination_dir)).to be_truthy
end
it "transfers the directory with all contents" do
@provider.run_action(:create)
- ::File.exist?(@destination_dir + '/remote_dir_file1.txt').should be_true
- ::File.exist?(@destination_dir + '/remote_dir_file2.txt').should be_true
- ::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file1.txt').should be_true
- ::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file2.txt').should be_true
- ::File.exist?(@destination_dir + '/remotesubdir/.a_dotfile').should be_true
- ::File.exist?(@destination_dir + '/.a_dotdir/.a_dotfile_in_a_dotdir').should be_true
+ expect(::File.exist?(@destination_dir + '/remote_dir_file1.txt')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/remote_dir_file2.txt')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file1.txt')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file2.txt')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/remotesubdir/.a_dotfile')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/.a_dotdir/.a_dotfile_in_a_dotdir')).to be_truthy
end
describe "only if it is missing" do
@@ -141,8 +141,8 @@ describe Chef::Provider::RemoteDirectory do
@provider.run_action(:create_if_missing)
- file1md5.eql?(Digest::MD5.hexdigest(File.read(@destination_dir + '/remote_dir_file1.txt'))).should be_true
- subdirfile1md5.eql?(Digest::MD5.hexdigest(File.read(@destination_dir + '/remotesubdir/remote_subdir_file1.txt'))).should be_true
+ expect(file1md5.eql?(Digest::MD5.hexdigest(File.read(@destination_dir + '/remote_dir_file1.txt')))).to be_truthy
+ expect(subdirfile1md5.eql?(Digest::MD5.hexdigest(File.read(@destination_dir + '/remotesubdir/remote_subdir_file1.txt')))).to be_truthy
end
end
@@ -155,13 +155,13 @@ describe Chef::Provider::RemoteDirectory do
FileUtils.touch(@destination_dir + '/remotesubdir/marked_for_death_again.txt')
@provider.run_action(:create)
- ::File.exist?(@destination_dir + '/remote_dir_file1.txt').should be_true
- ::File.exist?(@destination_dir + '/remote_dir_file2.txt').should be_true
- ::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file1.txt').should be_true
- ::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file2.txt').should be_true
+ expect(::File.exist?(@destination_dir + '/remote_dir_file1.txt')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/remote_dir_file2.txt')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file1.txt')).to be_truthy
+ expect(::File.exist?(@destination_dir + '/remotesubdir/remote_subdir_file2.txt')).to be_truthy
- ::File.exist?(@destination_dir + '/marked_for_death.txt').should be_false
- ::File.exist?(@destination_dir + '/remotesubdir/marked_for_death_again.txt').should be_false
+ expect(::File.exist?(@destination_dir + '/marked_for_death.txt')).to be_falsey
+ expect(::File.exist?(@destination_dir + '/remotesubdir/marked_for_death_again.txt')).to be_falsey
end
it "removes files in subdirectories before files above" do
@@ -172,10 +172,10 @@ describe Chef::Provider::RemoteDirectory do
FileUtils.touch(@destination_dir + '/a/multiply/nested/baz.txt')
FileUtils.touch(@destination_dir + '/a/multiply/nested/directory/qux.txt')
@provider.run_action(:create)
- ::File.exist?(@destination_dir + '/a/foo.txt').should be_false
- ::File.exist?(@destination_dir + '/a/multiply/bar.txt').should be_false
- ::File.exist?(@destination_dir + '/a/multiply/nested/baz.txt').should be_false
- ::File.exist?(@destination_dir + '/a/multiply/nested/directory/qux.txt').should be_false
+ expect(::File.exist?(@destination_dir + '/a/foo.txt')).to be_falsey
+ expect(::File.exist?(@destination_dir + '/a/multiply/bar.txt')).to be_falsey
+ expect(::File.exist?(@destination_dir + '/a/multiply/nested/baz.txt')).to be_falsey
+ expect(::File.exist?(@destination_dir + '/a/multiply/nested/directory/qux.txt')).to be_falsey
end
it "removes directory symlinks properly", :not_supported_on_win2k3 do
@@ -188,12 +188,12 @@ describe Chef::Provider::RemoteDirectory do
Dir.mktmpdir do |tmp_dir|
begin
@fclass.file_class.symlink(tmp_dir.dup, symlinked_dir_path)
- ::File.exist?(symlinked_dir_path).should be_true
+ expect(::File.exist?(symlinked_dir_path)).to be_truthy
@provider.run_action
- ::File.exist?(symlinked_dir_path).should be_false
- ::File.exist?(tmp_dir).should be_true
+ expect(::File.exist?(symlinked_dir_path)).to be_falsey
+ expect(::File.exist?(tmp_dir)).to be_truthy
rescue Chef::Exceptions::Win32APIError => e
pending "This must be run as an Administrator to create symlinks"
end
@@ -212,8 +212,8 @@ describe Chef::Provider::RemoteDirectory do
file1md5 = Digest::MD5.hexdigest(::File.read(@destination_dir + '/remote_dir_file1.txt'))
subdirfile1md5 = Digest::MD5.hexdigest(::File.read(@destination_dir + '/remotesubdir/remote_subdir_file1.txt'))
@provider.run_action(:create)
- file1md5.eql?(Digest::MD5.hexdigest(::File.read(@destination_dir + '/remote_dir_file1.txt'))).should be_true
- subdirfile1md5.eql?(Digest::MD5.hexdigest(::File.read(@destination_dir + '/remotesubdir/remote_subdir_file1.txt'))).should be_true
+ expect(file1md5.eql?(Digest::MD5.hexdigest(::File.read(@destination_dir + '/remote_dir_file1.txt')))).to be_truthy
+ expect(subdirfile1md5.eql?(Digest::MD5.hexdigest(::File.read(@destination_dir + '/remotesubdir/remote_subdir_file1.txt')))).to be_truthy
end
end
diff --git a/spec/unit/provider/remote_file/cache_control_data_spec.rb b/spec/unit/provider/remote_file/cache_control_data_spec.rb
index 8a849d9d7d..11f2af3edc 100644
--- a/spec/unit/provider/remote_file/cache_control_data_spec.rb
+++ b/spec/unit/provider/remote_file/cache_control_data_spec.rb
@@ -44,21 +44,21 @@ describe Chef::Provider::RemoteFile::CacheControlData do
context "when loading data for an unknown URI" do
before do
- Chef::FileCache.should_receive(:load).with(cache_path).and_raise(Chef::Exceptions::FileNotFound, "nope")
+ expect(Chef::FileCache).to receive(:load).with(cache_path).and_raise(Chef::Exceptions::FileNotFound, "nope")
end
context "and there is no current copy of the file" do
let(:current_file_checksum) { nil }
it "returns empty cache control data" do
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
end
end
it "returns empty cache control data" do
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
end
context "and the URI contains a password" do
@@ -89,15 +89,15 @@ describe Chef::Provider::RemoteFile::CacheControlData do
end
before do
- Chef::FileCache.should_receive(:load).with(cache_path).and_return(cache_json_data)
+ expect(Chef::FileCache).to receive(:load).with(cache_path).and_return(cache_json_data)
end
context "and there is no on-disk copy of the file" do
let(:current_file_checksum) { nil }
it "returns empty cache control data" do
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
end
end
@@ -105,16 +105,16 @@ describe Chef::Provider::RemoteFile::CacheControlData do
let(:current_file_checksum) { "e2a8938cc31754f6c067b35aab1d0d4864272e9bf8504536ef3e79ebf8432305" }
it "returns empty cache control data" do
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
end
end
context "and the cached checksum matches the on-disk copy" do
it "populates the cache control data" do
- cache_control_data.etag.should == etag
- cache_control_data.mtime.should == mtime
+ expect(cache_control_data.etag).to eq(etag)
+ expect(cache_control_data.mtime).to eq(mtime)
end
end
@@ -122,16 +122,16 @@ describe Chef::Provider::RemoteFile::CacheControlData do
let(:cache_json_data) { '{"foo",,"bar" []}' }
it "returns empty cache control data" do
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
end
context "and it still is valid JSON" do
let(:cache_json_data) { '' }
it "returns empty cache control data" do
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
end
end
end
@@ -162,12 +162,12 @@ describe Chef::Provider::RemoteFile::CacheControlData do
# so we can't count on the order of the keys in the json format.
json_data = cache_control_data.json_data
- Chef::JSONCompat.from_json(json_data).should == expected_serialization_data
+ expect(Chef::JSONCompat.from_json(json_data)).to eq(expected_serialization_data)
end
it "writes data to the cache" do
json_data = cache_control_data.json_data
- Chef::FileCache.should_receive(:store).with(cache_path, json_data)
+ expect(Chef::FileCache).to receive(:store).with(cache_path, json_data)
cache_control_data.save
end
@@ -178,7 +178,7 @@ describe Chef::Provider::RemoteFile::CacheControlData do
it "writes the data to the cache with a sanitized path name" do
json_data = cache_control_data.json_data
- Chef::FileCache.should_receive(:store).with(cache_path, json_data)
+ expect(Chef::FileCache).to receive(:store).with(cache_path, json_data)
cache_control_data.save
end
end
@@ -199,18 +199,18 @@ describe Chef::Provider::RemoteFile::CacheControlData do
it "truncates the file cache path to 102 characters" do
normalized_cache_path = cache_control_data.send('sanitized_cache_file_basename')
- Chef::FileCache.should_receive(:store).with("remote_file/" + normalized_cache_path, cache_control_data.json_data)
+ expect(Chef::FileCache).to receive(:store).with("remote_file/" + normalized_cache_path, cache_control_data.json_data)
cache_control_data.save
- normalized_cache_path.length.should == CACHE_FILE_PATH_LIMIT
+ expect(normalized_cache_path.length).to eq(CACHE_FILE_PATH_LIMIT)
end
it "uses a file cache path that starts with the first #{CACHE_FILE_TRUNCATED_FRIENDLY_FILE_NAME_LENGTH} characters of the URI" do
normalized_cache_path = cache_control_data.send('sanitized_cache_file_basename')
- truncated_file_cache_path.length.should == CACHE_FILE_TRUNCATED_FRIENDLY_FILE_NAME_LENGTH
- normalized_cache_path.start_with?(truncated_file_cache_path).should == true
+ expect(truncated_file_cache_path.length).to eq(CACHE_FILE_TRUNCATED_FRIENDLY_FILE_NAME_LENGTH)
+ expect(normalized_cache_path.start_with?(truncated_file_cache_path)).to eq(true)
end
end
diff --git a/spec/unit/provider/remote_file/content_spec.rb b/spec/unit/provider/remote_file/content_spec.rb
index 4ee33aeefb..ce18d23a09 100644
--- a/spec/unit/provider/remote_file/content_spec.rb
+++ b/spec/unit/provider/remote_file/content_spec.rb
@@ -47,31 +47,31 @@ describe Chef::Provider::RemoteFile::Content do
describe "when the checksum of the current_resource matches the checksum set on the resource" do
before do
- new_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
- current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
+ allow(new_resource).to receive(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
+ allow(current_resource).to receive(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
end
it "should return nil for the tempfile" do
- content.tempfile.should be_nil
+ expect(content.tempfile).to be_nil
end
it "should not call any fetcher" do
- Chef::Provider::RemoteFile::Fetcher.should_not_receive(:for_resource)
+ expect(Chef::Provider::RemoteFile::Fetcher).not_to receive(:for_resource)
end
end
describe "when the checksum of the current_resource is a partial match for the checksum set on the resource" do
before do
- new_resource.stub(:checksum).and_return("0fd012fd")
- current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
+ allow(new_resource).to receive(:checksum).and_return("0fd012fd")
+ allow(current_resource).to receive(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
end
it "should return nil for the tempfile" do
- content.tempfile.should be_nil
+ expect(content.tempfile).to be_nil
end
it "should not call any fetcher" do
- Chef::Provider::RemoteFile::Fetcher.should_not_receive(:for_resource)
+ expect(Chef::Provider::RemoteFile::Fetcher).not_to receive(:for_resource)
end
end
@@ -79,17 +79,17 @@ describe Chef::Provider::RemoteFile::Content do
before do
# FIXME: test one or the other nil, test both not nil and not equal, abuse the regexp a little
@uri = double("URI")
- URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri)
+ expect(URI).to receive(:parse).with(new_resource.source[0]).and_return(@uri)
end
describe "when the fetcher returns nil for the tempfile" do
before do
http_fetcher = double("Chef::Provider::RemoteFile::HTTP", :fetch => nil)
- Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
+ expect(Chef::Provider::RemoteFile::Fetcher).to receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
end
it "should return nil for the tempfile" do
- content.tempfile.should be_nil
+ expect(content.tempfile).to be_nil
end
end
@@ -100,43 +100,43 @@ describe Chef::Provider::RemoteFile::Content do
let(:http_fetcher) { double("Chef::Provider::RemoteFile::HTTP", :fetch => tempfile) }
before do
- Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
+ expect(Chef::Provider::RemoteFile::Fetcher).to receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
end
it "should return the tempfile object to the caller" do
- content.tempfile.should == tempfile
+ expect(content.tempfile).to eq(tempfile)
end
end
end
describe "when the checksum are both nil" do
before do
- new_resource.checksum.should be_nil
- current_resource.checksum.should be_nil
+ expect(new_resource.checksum).to be_nil
+ expect(current_resource.checksum).to be_nil
end
it_behaves_like "the resource needs fetching"
end
describe "when the current_resource checksum is nil" do
before do
- new_resource.stub(:checksum).and_return("fd012fd")
- current_resource.stub(:checksum).and_return(nil)
+ allow(new_resource).to receive(:checksum).and_return("fd012fd")
+ allow(current_resource).to receive(:checksum).and_return(nil)
end
it_behaves_like "the resource needs fetching"
end
describe "when the new_resource checksum is nil" do
before do
- new_resource.stub(:checksum).and_return(nil)
- current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
+ allow(new_resource).to receive(:checksum).and_return(nil)
+ allow(current_resource).to receive(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
end
it_behaves_like "the resource needs fetching"
end
describe "when the checksums are a partial match, but not to the leading portion" do
before do
- new_resource.stub(:checksum).and_return("fd012fd")
- current_resource.stub(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
+ allow(new_resource).to receive(:checksum).and_return("fd012fd")
+ allow(current_resource).to receive(:checksum).and_return("0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa")
end
it_behaves_like "the resource needs fetching"
end
@@ -144,17 +144,17 @@ describe Chef::Provider::RemoteFile::Content do
describe "when the fetcher throws an exception" do
before do
- new_resource.stub(:checksum).and_return(nil)
- current_resource.stub(:checksum).and_return(nil)
+ allow(new_resource).to receive(:checksum).and_return(nil)
+ allow(current_resource).to receive(:checksum).and_return(nil)
@uri = double("URI")
- URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri)
+ expect(URI).to receive(:parse).with(new_resource.source[0]).and_return(@uri)
http_fetcher = double("Chef::Provider::RemoteFile::HTTP")
- http_fetcher.should_receive(:fetch).and_raise(Errno::ECONNREFUSED)
- Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
+ expect(http_fetcher).to receive(:fetch).and_raise(Errno::ECONNREFUSED)
+ expect(Chef::Provider::RemoteFile::Fetcher).to receive(:for_resource).with(@uri, new_resource, current_resource).and_return(http_fetcher)
end
it "should propagate the error back to the caller" do
- lambda { content.tempfile }.should raise_error(Errno::ECONNREFUSED)
+ expect { content.tempfile }.to raise_error(Errno::ECONNREFUSED)
end
end
@@ -184,15 +184,15 @@ describe Chef::Provider::RemoteFile::Content do
].each do |exception|
describe "with an exception of #{exception}" do
before do
- new_resource.stub(:checksum).and_return(nil)
- current_resource.stub(:checksum).and_return(nil)
+ allow(new_resource).to receive(:checksum).and_return(nil)
+ allow(current_resource).to receive(:checksum).and_return(nil)
@uri0 = double("URI0")
@uri1 = double("URI1")
- URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri0)
- URI.should_receive(:parse).with(new_resource.source[1]).and_return(@uri1)
+ expect(URI).to receive(:parse).with(new_resource.source[0]).and_return(@uri0)
+ expect(URI).to receive(:parse).with(new_resource.source[1]).and_return(@uri1)
@http_fetcher_throws_exception = double("Chef::Provider::RemoteFile::HTTP")
- @http_fetcher_throws_exception.should_receive(:fetch).at_least(:once).and_raise(create_exception(exception))
- Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri0, new_resource, current_resource).and_return(@http_fetcher_throws_exception)
+ expect(@http_fetcher_throws_exception).to receive(:fetch).at_least(:once).and_raise(create_exception(exception))
+ expect(Chef::Provider::RemoteFile::Fetcher).to receive(:for_resource).with(@uri0, new_resource, current_resource).and_return(@http_fetcher_throws_exception)
end
describe "the second url should succeed" do
@@ -200,26 +200,26 @@ describe Chef::Provider::RemoteFile::Content do
@tempfile = double("Tempfile")
mtime = Time.now
http_fetcher_works = double("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile)
- Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri1, new_resource, current_resource).and_return(http_fetcher_works)
+ expect(Chef::Provider::RemoteFile::Fetcher).to receive(:for_resource).with(@uri1, new_resource, current_resource).and_return(http_fetcher_works)
end
it "should return a valid tempfile" do
- content.tempfile.should == @tempfile
+ expect(content.tempfile).to eq(@tempfile)
end
it "should not mutate the new_resource" do
content.tempfile
- new_resource.source.length.should == 2
+ expect(new_resource.source.length).to eq(2)
end
end
describe "when both urls fail" do
before do
- Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri1, new_resource, current_resource).and_return(@http_fetcher_throws_exception)
+ expect(Chef::Provider::RemoteFile::Fetcher).to receive(:for_resource).with(@uri1, new_resource, current_resource).and_return(@http_fetcher_throws_exception)
end
it "should propagate the error back to the caller" do
- lambda { content.tempfile }.should raise_error(exception)
+ expect { content.tempfile }.to raise_error(exception)
end
end
end
@@ -229,24 +229,24 @@ describe Chef::Provider::RemoteFile::Content do
describe "when there is an array of sources and the first succeeds" do
let(:source) { [ "http://opscode.com/seattle.txt", "http://opscode.com/nyc.txt" ] }
before do
- new_resource.stub(:checksum).and_return(nil)
- current_resource.stub(:checksum).and_return(nil)
+ allow(new_resource).to receive(:checksum).and_return(nil)
+ allow(current_resource).to receive(:checksum).and_return(nil)
@uri0 = double("URI0")
- URI.should_receive(:parse).with(new_resource.source[0]).and_return(@uri0)
- URI.should_not_receive(:parse).with(new_resource.source[1])
+ expect(URI).to receive(:parse).with(new_resource.source[0]).and_return(@uri0)
+ expect(URI).not_to receive(:parse).with(new_resource.source[1])
@tempfile = double("Tempfile")
mtime = Time.now
http_fetcher_works = double("Chef::Provider::RemoteFile::HTTP", :fetch => @tempfile)
- Chef::Provider::RemoteFile::Fetcher.should_receive(:for_resource).with(@uri0, new_resource, current_resource).and_return(http_fetcher_works)
+ expect(Chef::Provider::RemoteFile::Fetcher).to receive(:for_resource).with(@uri0, new_resource, current_resource).and_return(http_fetcher_works)
end
it "should return a valid tempfile" do
- content.tempfile.should == @tempfile
+ expect(content.tempfile).to eq(@tempfile)
end
it "should not mutate the new_resource" do
content.tempfile
- new_resource.source.length.should == 2
+ expect(new_resource.source.length).to eq(2)
end
end
diff --git a/spec/unit/provider/remote_file/fetcher_spec.rb b/spec/unit/provider/remote_file/fetcher_spec.rb
index b5594b50e6..c049848fbf 100644
--- a/spec/unit/provider/remote_file/fetcher_spec.rb
+++ b/spec/unit/provider/remote_file/fetcher_spec.rb
@@ -27,47 +27,47 @@ describe Chef::Provider::RemoteFile::Fetcher do
describe "when passed an http url" do
let(:uri) { double("uri", :scheme => "http" ) }
before do
- Chef::Provider::RemoteFile::HTTP.should_receive(:new).and_return(fetcher_instance)
+ expect(Chef::Provider::RemoteFile::HTTP).to receive(:new).and_return(fetcher_instance)
end
it "returns an http fetcher" do
- described_class.for_resource(uri, new_resource, current_resource).should == fetcher_instance
+ expect(described_class.for_resource(uri, new_resource, current_resource)).to eq(fetcher_instance)
end
end
describe "when passed an https url" do
let(:uri) { double("uri", :scheme => "https" ) }
before do
- Chef::Provider::RemoteFile::HTTP.should_receive(:new).and_return(fetcher_instance)
+ expect(Chef::Provider::RemoteFile::HTTP).to receive(:new).and_return(fetcher_instance)
end
it "returns an http fetcher" do
- described_class.for_resource(uri, new_resource, current_resource).should == fetcher_instance
+ expect(described_class.for_resource(uri, new_resource, current_resource)).to eq(fetcher_instance)
end
end
describe "when passed an ftp url" do
let(:uri) { double("uri", :scheme => "ftp" ) }
before do
- Chef::Provider::RemoteFile::FTP.should_receive(:new).and_return(fetcher_instance)
+ expect(Chef::Provider::RemoteFile::FTP).to receive(:new).and_return(fetcher_instance)
end
it "returns an ftp fetcher" do
- described_class.for_resource(uri, new_resource, current_resource).should == fetcher_instance
+ expect(described_class.for_resource(uri, new_resource, current_resource)).to eq(fetcher_instance)
end
end
describe "when passed a file url" do
let(:uri) { double("uri", :scheme => "file" ) }
before do
- Chef::Provider::RemoteFile::LocalFile.should_receive(:new).and_return(fetcher_instance)
+ expect(Chef::Provider::RemoteFile::LocalFile).to receive(:new).and_return(fetcher_instance)
end
it "returns a localfile fetcher" do
- described_class.for_resource(uri, new_resource, current_resource).should == fetcher_instance
+ expect(described_class.for_resource(uri, new_resource, current_resource)).to eq(fetcher_instance)
end
end
describe "when passed a url we do not recognize" do
let(:uri) { double("uri", :scheme => "xyzzy" ) }
it "throws an ArgumentError exception" do
- lambda { described_class.for_resource(uri, new_resource, current_resource) }.should raise_error(ArgumentError)
+ expect { described_class.for_resource(uri, new_resource, current_resource) }.to raise_error(ArgumentError)
end
end
diff --git a/spec/unit/provider/remote_file/ftp_spec.rb b/spec/unit/provider/remote_file/ftp_spec.rb
index b393912ef9..dbbddd8e84 100644
--- a/spec/unit/provider/remote_file/ftp_spec.rb
+++ b/spec/unit/provider/remote_file/ftp_spec.rb
@@ -39,13 +39,13 @@ describe Chef::Provider::RemoteFile::FTP do
let(:ftp) do
ftp = double(Net::FTP, { })
- ftp.stub(:connect)
- ftp.stub(:login)
- ftp.stub(:voidcmd)
- ftp.stub(:mtime).and_return(Time.now)
- ftp.stub(:getbinaryfile)
- ftp.stub(:close)
- ftp.stub(:passive=)
+ allow(ftp).to receive(:connect)
+ allow(ftp).to receive(:login)
+ allow(ftp).to receive(:voidcmd)
+ allow(ftp).to receive(:mtime).and_return(Time.now)
+ allow(ftp).to receive(:getbinaryfile)
+ allow(ftp).to receive(:close)
+ allow(ftp).to receive(:passive=)
ftp
end
@@ -53,49 +53,49 @@ describe Chef::Provider::RemoteFile::FTP do
let(:tempfile) do
t = StringIO.new
- t.stub(:path).and_return(tempfile_path)
+ allow(t).to receive(:path).and_return(tempfile_path)
t
end
let(:uri) { URI.parse("ftp://opscode.com/seattle.txt") }
before(:each) do
- Net::FTP.stub(:new).with().and_return(ftp)
- Tempfile.stub(:new).and_return(tempfile)
+ allow(Net::FTP).to receive(:new).with(no_args).and_return(ftp)
+ allow(Tempfile).to receive(:new).and_return(tempfile)
end
describe "when first created" do
it "throws an argument exception when no path is given" do
uri.path = ""
- lambda { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.should raise_error(ArgumentError)
+ expect { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.to raise_error(ArgumentError)
end
it "throws an argument exception when only a / is given" do
uri.path = "/"
- lambda { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.should raise_error(ArgumentError)
+ expect { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.to raise_error(ArgumentError)
end
it "throws an argument exception when no filename is given" do
uri.path = "/the/whole/path/"
- lambda { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.should raise_error(ArgumentError)
+ expect { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.to raise_error(ArgumentError)
end
it "throws an argument exception when the typecode is invalid" do
uri.typecode = "d"
- lambda { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.should raise_error(ArgumentError)
+ expect { Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource) }.to raise_error(ArgumentError)
end
it "does not use passive mode when new_resource sets ftp_active_mode to true" do
new_resource.ftp_active_mode(true)
fetcher = Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource)
- fetcher.use_passive_mode?.should be_false
+ expect(fetcher.use_passive_mode?).to be_falsey
end
it "uses passive mode when new_resource sets ftp_active_mode to false" do
new_resource.ftp_active_mode(false)
fetcher = Chef::Provider::RemoteFile::FTP.new(uri, new_resource, current_resource)
- fetcher.use_passive_mode?.should be_true
+ expect(fetcher.use_passive_mode?).to be_truthy
end
end
@@ -112,24 +112,24 @@ describe Chef::Provider::RemoteFile::FTP do
end
it "should connect to the host from the uri on the default port 21" do
- ftp.should_receive(:connect).with("opscode.com", 21)
+ expect(ftp).to receive(:connect).with("opscode.com", 21)
fetcher.fetch
end
it "should set passive true when ftp_active_mode is false" do
new_resource.ftp_active_mode(false)
- ftp.should_receive(:passive=).with(true)
+ expect(ftp).to receive(:passive=).with(true)
fetcher.fetch
end
it "should set passive false when ftp_active_mode is false" do
new_resource.ftp_active_mode(true)
- ftp.should_receive(:passive=).with(false)
+ expect(ftp).to receive(:passive=).with(false)
fetcher.fetch
end
it "should use anonymous ftp when no userinfo is provided" do
- ftp.should_receive(:login).with("anonymous", nil)
+ expect(ftp).to receive(:login).with("anonymous", nil)
fetcher.fetch
end
@@ -138,7 +138,7 @@ describe Chef::Provider::RemoteFile::FTP do
it "should connect on an alternate port when one is provided" do
uri = URI.parse("ftp://opscode.com:8021/seattle.txt")
- ftp.should_receive(:connect).with("opscode.com", 8021)
+ expect(ftp).to receive(:connect).with("opscode.com", 8021)
fetcher.fetch
end
@@ -148,7 +148,7 @@ describe Chef::Provider::RemoteFile::FTP do
let(:uri) { URI.parse("ftp://the_user:the_password@opscode.com/seattle.txt") }
it "should use authenticated ftp when userinfo is provided" do
- ftp.should_receive(:login).with("the_user", "the_password")
+ expect(ftp).to receive(:login).with("the_user", "the_password")
fetcher.fetch
end
end
@@ -157,7 +157,7 @@ describe Chef::Provider::RemoteFile::FTP do
let(:uri) { URI.parse("ftp://the_user:the_password@opscode.com/seattle.txt;type=a") }
it "fetches the file with ascii typecode set" do
- ftp.should_receive(:voidcmd).with("TYPE A").once
+ expect(ftp).to receive(:voidcmd).with("TYPE A").once
fetcher.fetch
end
@@ -167,7 +167,7 @@ describe Chef::Provider::RemoteFile::FTP do
let(:uri) { URI.parse("ftp://the_user:the_password@opscode.com/seattle.txt;type=i") }
it "should accept image for the typecode" do
- ftp.should_receive(:voidcmd).with("TYPE I").once
+ expect(ftp).to receive(:voidcmd).with("TYPE I").once
fetcher.fetch
end
@@ -177,10 +177,10 @@ describe Chef::Provider::RemoteFile::FTP do
let(:uri) { URI.parse("ftp://opscode.com/the/whole/path/seattle.txt") }
it "should fetch the file from the correct path" do
- ftp.should_receive(:voidcmd).with("CWD the").once
- ftp.should_receive(:voidcmd).with("CWD whole").once
- ftp.should_receive(:voidcmd).with("CWD path").once
- ftp.should_receive(:getbinaryfile).with("seattle.txt", tempfile.path)
+ expect(ftp).to receive(:voidcmd).with("CWD the").once
+ expect(ftp).to receive(:voidcmd).with("CWD whole").once
+ expect(ftp).to receive(:voidcmd).with("CWD path").once
+ expect(ftp).to receive(:getbinaryfile).with("seattle.txt", tempfile.path)
fetcher.fetch
end
@@ -193,7 +193,7 @@ describe Chef::Provider::RemoteFile::FTP do
it "should return a tempfile in the result" do
result = fetcher.fetch
- result.should equal(tempfile)
+ expect(result).to equal(tempfile)
end
end
@@ -207,10 +207,10 @@ describe Chef::Provider::RemoteFile::FTP do
it "fetches the file via the proxy" do
current_socks_server = ENV["SOCKS_SERVER"]
- ENV.should_receive(:[]=).with("SOCKS_SERVER", "socks5://bill:ted@socks.example.com:5000").ordered
- ENV.should_receive(:[]=).with("SOCKS_SERVER", current_socks_server).ordered
+ expect(ENV).to receive(:[]=).with("SOCKS_SERVER", "socks5://bill:ted@socks.example.com:5000").ordered
+ expect(ENV).to receive(:[]=).with("SOCKS_SERVER", current_socks_server).ordered
result = fetcher.fetch
- result.should equal(tempfile)
+ expect(result).to equal(tempfile)
end
end
diff --git a/spec/unit/provider/remote_file/http_spec.rb b/spec/unit/provider/remote_file/http_spec.rb
index 951d9f0a05..d9cfaa15eb 100644
--- a/spec/unit/provider/remote_file/http_spec.rb
+++ b/spec/unit/provider/remote_file/http_spec.rb
@@ -48,11 +48,11 @@ describe Chef::Provider::RemoteFile::HTTP do
context "and there is no valid cache control data for this URI on disk" do
before do
- Chef::Provider::RemoteFile::CacheControlData.should_receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data)
+ expect(Chef::Provider::RemoteFile::CacheControlData).to receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data)
end
it "does not add conditional GET headers" do
- fetcher.conditional_get_headers.should == {}
+ expect(fetcher.conditional_get_headers).to eq({})
end
context "and the resource specifies custom headers" do
@@ -61,7 +61,7 @@ describe Chef::Provider::RemoteFile::HTTP do
end
it "has the user-specified custom headers" do
- fetcher.headers.should == {"x-myapp-header" => "custom-header-value"}
+ expect(fetcher.headers).to eq({"x-myapp-header" => "custom-header-value"})
end
end
@@ -79,7 +79,7 @@ describe Chef::Provider::RemoteFile::HTTP do
cache_control_data.etag = etag
cache_control_data.mtime = mtime
- Chef::Provider::RemoteFile::CacheControlData.should_receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data)
+ expect(Chef::Provider::RemoteFile::CacheControlData).to receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data)
end
context "and no conditional get features are enabled" do
@@ -88,7 +88,7 @@ describe Chef::Provider::RemoteFile::HTTP do
end
it "does not add headers to the request" do
- fetcher.headers.should == {}
+ expect(fetcher.headers).to eq({})
end
end
@@ -99,8 +99,8 @@ describe Chef::Provider::RemoteFile::HTTP do
it "adds If-None-Match and If-Modified-Since headers to the request" do
headers = fetcher.headers
- headers["if-none-match"].should == etag
- headers["if-modified-since"].should == mtime
+ expect(headers["if-none-match"]).to eq(etag)
+ expect(headers["if-modified-since"]).to eq(mtime)
end
context "and custom headers are provided" do
@@ -111,13 +111,13 @@ describe Chef::Provider::RemoteFile::HTTP do
end
it "preserves non-conflicting headers" do
- fetcher.headers["x-myapp-header"].should == "app-specific-header"
+ expect(fetcher.headers["x-myapp-header"]).to eq("app-specific-header")
end
it "prefers user-supplied cache control headers" do
headers = fetcher.headers
- headers["if-none-match"].should == "custom-etag"
- headers["if-modified-since"].should == "custom-last-modified"
+ expect(headers["if-none-match"]).to eq("custom-etag")
+ expect(headers["if-modified-since"]).to eq("custom-last-modified")
end
end
@@ -131,8 +131,8 @@ describe Chef::Provider::RemoteFile::HTTP do
it "only adds If-None-Match headers to the request" do
headers = fetcher.headers
- headers["if-none-match"].should == etag
- headers.should_not have_key("if-modified-since")
+ expect(headers["if-none-match"]).to eq(etag)
+ expect(headers).not_to have_key("if-modified-since")
end
end
@@ -144,8 +144,8 @@ describe Chef::Provider::RemoteFile::HTTP do
it "only adds If-Modified-Since headers to the request" do
headers = fetcher.headers
- headers["if-modified-since"].should == mtime
- headers.should_not have_key("if-none-match")
+ expect(headers["if-modified-since"]).to eq(mtime)
+ expect(headers).not_to have_key("if-none-match")
end
end
end
@@ -165,17 +165,17 @@ describe Chef::Provider::RemoteFile::HTTP do
let(:rest) do
rest = double(Chef::HTTP::Simple)
- rest.stub(:streaming_request).and_return(tempfile)
- rest.stub(:last_response).and_return(last_response)
+ allow(rest).to receive(:streaming_request).and_return(tempfile)
+ allow(rest).to receive(:last_response).and_return(last_response)
rest
end
before do
new_resource.headers({})
new_resource.use_last_modified(false)
- Chef::Provider::RemoteFile::CacheControlData.should_receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data)
+ expect(Chef::Provider::RemoteFile::CacheControlData).to receive(:load_and_validate).with(uri, current_resource_checksum).and_return(cache_control_data)
- Chef::HTTP::Simple.should_receive(:new).with(*expected_http_args).and_return(rest)
+ expect(Chef::HTTP::Simple).to receive(:new).with(*expected_http_args).and_return(rest)
end
@@ -183,8 +183,8 @@ describe Chef::Provider::RemoteFile::HTTP do
it "should return a nil tempfile for a 304 HTTPNotModifed" do
# Streaming request returns nil for 304 errors
- rest.stub(:streaming_request).and_return(nil)
- fetcher.fetch.should be_nil
+ allow(rest).to receive(:streaming_request).and_return(nil)
+ expect(fetcher.fetch).to be_nil
end
end
@@ -194,25 +194,25 @@ describe Chef::Provider::RemoteFile::HTTP do
let(:fetched_content_checksum) { "e2a8938cc31754f6c067b35aab1d0d4864272e9bf8504536ef3e79ebf8432305" }
before do
- cache_control_data.should_receive(:save)
- Chef::Digester.should_receive(:checksum_for_file).with(tempfile_path).and_return(fetched_content_checksum)
+ expect(cache_control_data).to receive(:save)
+ expect(Chef::Digester).to receive(:checksum_for_file).with(tempfile_path).and_return(fetched_content_checksum)
end
it "should return a tempfile" do
result = fetcher.fetch
- result.should == tempfile
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
- cache_control_data.checksum.should == fetched_content_checksum
+ expect(result).to eq(tempfile)
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
+ expect(cache_control_data.checksum).to eq(fetched_content_checksum)
end
context "and the response does not contain an etag" do
let(:last_response) { {"etag" => nil} }
it "does not include an etag in the result" do
fetcher.fetch
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
- cache_control_data.checksum.should == fetched_content_checksum
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
+ expect(cache_control_data.checksum).to eq(fetched_content_checksum)
end
end
@@ -221,9 +221,9 @@ describe Chef::Provider::RemoteFile::HTTP do
it "includes the etag value in the response" do
fetcher.fetch
- cache_control_data.etag.should == "abc123"
- cache_control_data.mtime.should be_nil
- cache_control_data.checksum.should == fetched_content_checksum
+ expect(cache_control_data.etag).to eq("abc123")
+ expect(cache_control_data.mtime).to be_nil
+ expect(cache_control_data.checksum).to eq(fetched_content_checksum)
end
end
@@ -234,9 +234,9 @@ describe Chef::Provider::RemoteFile::HTTP do
# RFC 2616 suggests that servers that do not set a Date header do not
# have a reliable clock, so no use in making them deal with dates.
fetcher.fetch
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
- cache_control_data.checksum.should == fetched_content_checksum
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
+ expect(cache_control_data.checksum).to eq(fetched_content_checksum)
end
end
@@ -248,8 +248,8 @@ describe Chef::Provider::RemoteFile::HTTP do
it "sets the mtime to the Last-Modified time in the response" do
fetcher.fetch
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should == last_response["last_modified"]
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to eq(last_response["last_modified"])
end
end
@@ -260,9 +260,9 @@ describe Chef::Provider::RemoteFile::HTTP do
it "sets the mtime to the Date in the response" do
fetcher.fetch
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should == last_response["date"]
- cache_control_data.checksum.should == fetched_content_checksum
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to eq(last_response["date"])
+ expect(cache_control_data.checksum).to eq(fetched_content_checksum)
end
end
@@ -288,11 +288,11 @@ describe Chef::Provider::RemoteFile::HTTP do
# This is intended to provide insurance that refactoring of the parent
# context does not negate the value of this particular example.
Chef::HTTP::Simple.new(*expected_http_args)
- Chef::HTTP::Simple.should_receive(:new).once.with(*expected_http_args).and_return(rest)
+ expect(Chef::HTTP::Simple).to receive(:new).once.with(*expected_http_args).and_return(rest)
fetcher.fetch
- cache_control_data.etag.should be_nil
- cache_control_data.mtime.should be_nil
- cache_control_data.checksum.should == fetched_content_checksum
+ expect(cache_control_data.etag).to be_nil
+ expect(cache_control_data.mtime).to be_nil
+ expect(cache_control_data.checksum).to eq(fetched_content_checksum)
end
end
end
diff --git a/spec/unit/provider/remote_file/local_file_spec.rb b/spec/unit/provider/remote_file/local_file_spec.rb
index b65c917c44..b33d82f624 100644
--- a/spec/unit/provider/remote_file/local_file_spec.rb
+++ b/spec/unit/provider/remote_file/local_file_spec.rb
@@ -30,21 +30,21 @@ describe Chef::Provider::RemoteFile::LocalFile do
describe "when given local unix path" do
let(:uri) { URI.parse("file:///nyan_cat.png") }
it "returns a correct unix path" do
- fetcher.fix_windows_path(uri.path).should == "/nyan_cat.png"
+ expect(fetcher.fix_windows_path(uri.path)).to eq("/nyan_cat.png")
end
end
describe "when given local windows path" do
let(:uri) { URI.parse("file:///z:/windows/path/file.txt") }
it "returns a valid windows local path" do
- fetcher.fix_windows_path(uri.path).should == "z:/windows/path/file.txt"
+ expect(fetcher.fix_windows_path(uri.path)).to eq("z:/windows/path/file.txt")
end
end
describe "when given unc windows path" do
let(:uri) { URI.parse("file:////server/share/windows/path/file.txt") }
it "returns a valid windows unc path" do
- fetcher.fix_windows_path(uri.path).should == "//server/share/windows/path/file.txt"
+ expect(fetcher.fix_windows_path(uri.path)).to eq("//server/share/windows/path/file.txt")
end
end
end
@@ -52,11 +52,11 @@ describe Chef::Provider::RemoteFile::LocalFile do
context "when first created" do
it "stores the uri it is passed" do
- fetcher.uri.should == uri
+ expect(fetcher.uri).to eq(uri)
end
it "stores the new_resource" do
- fetcher.new_resource.should == new_resource
+ expect(fetcher.new_resource).to eq(new_resource)
end
end
@@ -71,12 +71,12 @@ describe Chef::Provider::RemoteFile::LocalFile do
end
it "stages the local file to a temporary file" do
- Chef::FileContentManagement::Tempfile.should_receive(:new).with(new_resource).and_return(chef_tempfile)
- ::FileUtils.should_receive(:cp).with(uri.path, tempfile.path)
- tempfile.should_receive(:close)
+ expect(Chef::FileContentManagement::Tempfile).to receive(:new).with(new_resource).and_return(chef_tempfile)
+ expect(::FileUtils).to receive(:cp).with(uri.path, tempfile.path)
+ expect(tempfile).to receive(:close)
result = fetcher.fetch
- result.should == tempfile
+ expect(result).to eq(tempfile)
end
end
diff --git a/spec/unit/provider/remote_file_spec.rb b/spec/unit/provider/remote_file_spec.rb
index 3fa3866743..de4a897847 100644
--- a/spec/unit/provider/remote_file_spec.rb
+++ b/spec/unit/provider/remote_file_spec.rb
@@ -47,13 +47,13 @@ describe Chef::Provider::RemoteFile do
subject(:provider) do
provider = described_class.new(resource, run_context)
- provider.stub(:content).and_return(content)
- provider.stub(:update_new_resource_checksum).and_return(nil) # Otherwise it doesn't behave like a File provider
+ allow(provider).to receive(:content).and_return(content)
+ allow(provider).to receive(:update_new_resource_checksum).and_return(nil) # Otherwise it doesn't behave like a File provider
provider
end
before do
- Chef::FileCache.stub(:load).with("remote_file/#{resource.name}").and_raise(Chef::Exceptions::FileNotFound)
+ allow(Chef::FileCache).to receive(:load).with("remote_file/#{resource.name}").and_raise(Chef::Exceptions::FileNotFound)
end
it_behaves_like Chef::Provider::File
diff --git a/spec/unit/provider/route_spec.rb b/spec/unit/provider/route_spec.rb
index 2a6d48c79e..ff68eea895 100644
--- a/spec/unit/provider/route_spec.rb
+++ b/spec/unit/provider/route_spec.rb
@@ -36,14 +36,14 @@ describe Chef::Provider::Route do
describe Chef::Provider::Route, "hex2ip" do
it "should return nil if ip address is invalid" do
- @provider.hex2ip('foo').should be_nil # does not even look like an ip
- @provider.hex2ip('ABCDEFGH').should be_nil # 8 chars, but invalid
+ expect(@provider.hex2ip('foo')).to be_nil # does not even look like an ip
+ expect(@provider.hex2ip('ABCDEFGH')).to be_nil # 8 chars, but invalid
end
it "should return quad-dotted notation for a valid IP" do
- @provider.hex2ip('01234567').should == '103.69.35.1'
- @provider.hex2ip('0064a8c0').should == '192.168.100.0'
- @provider.hex2ip('00FFFFFF').should == '255.255.255.0'
+ expect(@provider.hex2ip('01234567')).to eq('103.69.35.1')
+ expect(@provider.hex2ip('0064a8c0')).to eq('192.168.100.0')
+ expect(@provider.hex2ip('00FFFFFF')).to eq('255.255.255.0')
end
end
@@ -55,158 +55,158 @@ describe Chef::Provider::Route do
routing_table = "Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT\n" +
"eth0 0064A8C0 0984A8C0 0003 0 0 0 00FFFFFF 0 0 0\n"
route_file = StringIO.new(routing_table)
- File.stub(:open).with("/proc/net/route", "r").and_return(route_file)
+ allow(File).to receive(:open).with("/proc/net/route", "r").and_return(route_file)
end
it "should set is_running to false when a route is not detected" do
resource = Chef::Resource::Route.new('10.10.10.0/24')
- resource.stub(:gateway).and_return("10.0.0.1")
- resource.stub(:device).and_return("eth0")
+ allow(resource).to receive(:gateway).and_return("10.0.0.1")
+ allow(resource).to receive(:device).and_return("eth0")
provider = Chef::Provider::Route.new(resource, @run_context)
provider.load_current_resource
- provider.is_running.should be_false
+ expect(provider.is_running).to be_falsey
end
it "should detect existing routes and set is_running attribute correctly" do
resource = Chef::Resource::Route.new('192.168.100.0/24')
- resource.stub(:gateway).and_return("192.168.132.9")
- resource.stub(:device).and_return("eth0")
+ allow(resource).to receive(:gateway).and_return("192.168.132.9")
+ allow(resource).to receive(:device).and_return("eth0")
provider = Chef::Provider::Route.new(resource, @run_context)
provider.load_current_resource
- provider.is_running.should be_true
+ expect(provider.is_running).to be_truthy
end
it "should use gateway value when matching routes" do
resource = Chef::Resource::Route.new('192.168.100.0/24')
- resource.stub(:gateway).and_return("10.10.10.10")
- resource.stub(:device).and_return("eth0")
+ allow(resource).to receive(:gateway).and_return("10.10.10.10")
+ allow(resource).to receive(:device).and_return("eth0")
provider = Chef::Provider::Route.new(resource, @run_context)
provider.load_current_resource
- provider.is_running.should be_false
+ expect(provider.is_running).to be_falsey
end
end
end
describe Chef::Provider::Route, "action_add" do
it "should add the route if it does not exist" do
- @provider.stub(:run_command).and_return(true)
- @current_resource.stub(:gateway).and_return(nil)
- @provider.should_receive(:generate_command).once.with(:add)
- @provider.should_receive(:generate_config)
+ allow(@provider).to receive(:run_command).and_return(true)
+ allow(@current_resource).to receive(:gateway).and_return(nil)
+ expect(@provider).to receive(:generate_command).once.with(:add)
+ expect(@provider).to receive(:generate_config)
@provider.run_action(:add)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not add the route if it exists" do
- @provider.stub(:run_command).and_return(true)
- @provider.stub(:is_running).and_return(true)
- @provider.should_not_receive(:generate_command).with(:add)
- @provider.should_receive(:generate_config)
+ allow(@provider).to receive(:run_command).and_return(true)
+ allow(@provider).to receive(:is_running).and_return(true)
+ expect(@provider).not_to receive(:generate_command).with(:add)
+ expect(@provider).to receive(:generate_config)
@provider.run_action(:add)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
it "should not delete config file for :add action (CHEF-3332)" do
@node.automatic_attrs[:platform] = 'centos'
route_file = StringIO.new
- File.should_receive(:new).and_return(route_file)
+ expect(File).to receive(:new).and_return(route_file)
@resource_add = Chef::Resource::Route.new('192.168.1.0/24 via 192.168.0.1')
@run_context.resource_collection << @resource_add
- @provider.stub(:run_command).and_return(true)
+ allow(@provider).to receive(:run_command).and_return(true)
@resource_add.action(:add)
@provider.run_action(:add)
- route_file.string.split("\n").should have(1).items
- route_file.string.should match(/^192\.168\.1\.0\/24 via 192\.168\.0\.1$/)
+ expect(route_file.string.split("\n").size).to eq(1)
+ expect(route_file.string).to match(/^192\.168\.1\.0\/24 via 192\.168\.0\.1$/)
end
end
describe Chef::Provider::Route, "action_delete" do
it "should delete the route if it exists" do
- @provider.stub(:run_command).and_return(true)
- @provider.should_receive(:generate_command).once.with(:delete)
- @provider.stub(:is_running).and_return(true)
+ allow(@provider).to receive(:run_command).and_return(true)
+ expect(@provider).to receive(:generate_command).once.with(:delete)
+ allow(@provider).to receive(:is_running).and_return(true)
@provider.run_action(:delete)
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not delete the route if it does not exist" do
- @current_resource.stub(:gateway).and_return(nil)
- @provider.stub(:run_command).and_return(true)
- @provider.should_not_receive(:generate_command).with(:add)
+ allow(@current_resource).to receive(:gateway).and_return(nil)
+ allow(@provider).to receive(:run_command).and_return(true)
+ expect(@provider).not_to receive(:generate_command).with(:add)
@provider.run_action(:delete)
- @new_resource.should_not be_updated
+ expect(@new_resource).not_to be_updated
end
end
describe Chef::Provider::Route, "generate_command for action_add" do
it "should include a netmask when a one is specified" do
- @new_resource.stub(:netmask).and_return('255.255.0.0')
- @provider.generate_command(:add).should match(/\/\d{1,2}\s/)
+ allow(@new_resource).to receive(:netmask).and_return('255.255.0.0')
+ expect(@provider.generate_command(:add)).to match(/\/\d{1,2}\s/)
end
it "should not include a netmask when a one is specified" do
- @new_resource.stub(:netmask).and_return(nil)
- @provider.generate_command(:add).should_not match(/\/\d{1,2}\s/)
+ allow(@new_resource).to receive(:netmask).and_return(nil)
+ expect(@provider.generate_command(:add)).not_to match(/\/\d{1,2}\s/)
end
it "should include ' via $gateway ' when a gateway is specified" do
- @provider.generate_command(:add).should match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
+ expect(@provider.generate_command(:add)).to match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
end
it "should not include ' via $gateway ' when a gateway is not specified" do
- @new_resource.stub(:gateway).and_return(nil)
- @provider.generate_command(:add).should_not match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
+ allow(@new_resource).to receive(:gateway).and_return(nil)
+ expect(@provider.generate_command(:add)).not_to match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
end
end
describe Chef::Provider::Route, "generate_command for action_delete" do
it "should include a netmask when a one is specified" do
- @new_resource.stub(:netmask).and_return('255.255.0.0')
- @provider.generate_command(:delete).should match(/\/\d{1,2}\s/)
+ allow(@new_resource).to receive(:netmask).and_return('255.255.0.0')
+ expect(@provider.generate_command(:delete)).to match(/\/\d{1,2}\s/)
end
it "should not include a netmask when a one is specified" do
- @new_resource.stub(:netmask).and_return(nil)
- @provider.generate_command(:delete).should_not match(/\/\d{1,2}\s/)
+ allow(@new_resource).to receive(:netmask).and_return(nil)
+ expect(@provider.generate_command(:delete)).not_to match(/\/\d{1,2}\s/)
end
it "should include ' via $gateway ' when a gateway is specified" do
- @provider.generate_command(:delete).should match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
+ expect(@provider.generate_command(:delete)).to match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
end
it "should not include ' via $gateway ' when a gateway is not specified" do
- @new_resource.stub(:gateway).and_return(nil)
- @provider.generate_command(:delete).should_not match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
+ allow(@new_resource).to receive(:gateway).and_return(nil)
+ expect(@provider.generate_command(:delete)).not_to match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\s/)
end
end
describe Chef::Provider::Route, "config_file_contents for action_add" do
it "should include a netmask when a one is specified" do
- @new_resource.stub(:netmask).and_return('255.255.0.0')
- @provider.config_file_contents(:add, { :target => @new_resource.target, :netmask => @new_resource.netmask}).should match(/\/\d{1,2}.*\n$/)
+ allow(@new_resource).to receive(:netmask).and_return('255.255.0.0')
+ expect(@provider.config_file_contents(:add, { :target => @new_resource.target, :netmask => @new_resource.netmask})).to match(/\/\d{1,2}.*\n$/)
end
it "should not include a netmask when a one is specified" do
- @provider.config_file_contents(:add, { :target => @new_resource.target}).should_not match(/\/\d{1,2}.*\n$/)
+ expect(@provider.config_file_contents(:add, { :target => @new_resource.target})).not_to match(/\/\d{1,2}.*\n$/)
end
it "should include ' via $gateway ' when a gateway is specified" do
- @provider.config_file_contents(:add, { :target => @new_resource.target, :gateway => @new_resource.gateway}).should match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\n/)
+ expect(@provider.config_file_contents(:add, { :target => @new_resource.target, :gateway => @new_resource.gateway})).to match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\n/)
end
it "should not include ' via $gateway ' when a gateway is not specified" do
- @provider.generate_command(:add).should_not match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\n/)
+ expect(@provider.generate_command(:add)).not_to match(/\svia\s#{Regexp.escape(@new_resource.gateway.to_s)}\n/)
end
end
describe Chef::Provider::Route, "config_file_contents for action_delete" do
it "should return an empty string" do
- @provider.config_file_contents(:delete).should match(/^$/)
+ expect(@provider.config_file_contents(:delete)).to match(/^$/)
end
end
@@ -216,7 +216,7 @@ describe Chef::Provider::Route do
@node.automatic_attrs[:platform] = platform
route_file = StringIO.new
- File.should_receive(:new).with("/etc/sysconfig/network-scripts/route-eth0", "w").and_return(route_file)
+ expect(File).to receive(:new).with("/etc/sysconfig/network-scripts/route-eth0", "w").and_return(route_file)
#Chef::Log.should_receive(:debug).with("route[10.0.0.10] writing route.eth0\n10.0.0.10 via 10.0.0.9\n")
@run_context.resource_collection << @new_resource
@provider.generate_config
@@ -227,17 +227,17 @@ describe Chef::Provider::Route do
@node.automatic_attrs[:platform] = 'centos'
route_file = StringIO.new
- File.should_receive(:new).and_return(route_file)
+ expect(File).to receive(:new).and_return(route_file)
@run_context.resource_collection << Chef::Resource::Route.new('192.168.1.0/24 via 192.168.0.1')
@run_context.resource_collection << Chef::Resource::Route.new('192.168.2.0/24 via 192.168.0.1')
@run_context.resource_collection << Chef::Resource::Route.new('192.168.3.0/24 via 192.168.0.1')
@provider.action = :add
@provider.generate_config
- route_file.string.split("\n").should have(3).items
- route_file.string.should match(/^192\.168\.1\.0\/24 via 192\.168\.0\.1$/)
- route_file.string.should match(/^192\.168\.2\.0\/24 via 192\.168\.0\.1$/)
- route_file.string.should match(/^192\.168\.3\.0\/24 via 192\.168\.0\.1$/)
+ expect(route_file.string.split("\n").size).to eq(3)
+ expect(route_file.string).to match(/^192\.168\.1\.0\/24 via 192\.168\.0\.1$/)
+ expect(route_file.string).to match(/^192\.168\.2\.0\/24 via 192\.168\.0\.1$/)
+ expect(route_file.string).to match(/^192\.168\.3\.0\/24 via 192\.168\.0\.1$/)
end
end
end
diff --git a/spec/unit/provider/ruby_block_spec.rb b/spec/unit/provider/ruby_block_spec.rb
index 6e5c9a638b..266c943367 100644
--- a/spec/unit/provider/ruby_block_spec.rb
+++ b/spec/unit/provider/ruby_block_spec.rb
@@ -31,16 +31,16 @@ describe Chef::Provider::RubyBlock, "initialize" do
it "should call the block and flag the resource as updated" do
@provider.run_action(:run)
- $evil_global_evil_laugh.should == :mwahahaha
- @new_resource.should be_updated
+ expect($evil_global_evil_laugh).to eq(:mwahahaha)
+ expect(@new_resource).to be_updated
end
it "accepts `create' as an alias for `run'" do
# SEE ALSO: CHEF-3500
# "create" used to be the default action, it was renamed.
@provider.run_action(:create)
- $evil_global_evil_laugh.should == :mwahahaha
- @new_resource.should be_updated
+ expect($evil_global_evil_laugh).to eq(:mwahahaha)
+ expect(@new_resource).to be_updated
end
end
diff --git a/spec/unit/provider/script_spec.rb b/spec/unit/provider/script_spec.rb
index d072eddd04..4979475b79 100644
--- a/spec/unit/provider/script_spec.rb
+++ b/spec/unit/provider/script_spec.rb
@@ -30,44 +30,44 @@ describe Chef::Provider::Script, "action_run" do
@provider = Chef::Provider::Script.new(@new_resource, @run_context)
@script_file = StringIO.new
- @script_file.stub(:path).and_return('/tmp/the_script_file')
+ allow(@script_file).to receive(:path).and_return('/tmp/the_script_file')
- @provider.stub(:shell_out!).and_return(true)
+ allow(@provider).to receive(:shell_out!).and_return(true)
end
it "creates a temporary file to store the script" do
- @provider.script_file.should be_an_instance_of(Tempfile)
+ expect(@provider.script_file).to be_an_instance_of(Tempfile)
end
it "unlinks the tempfile when finished" do
tempfile_path = @provider.script_file.path
@provider.unlink_script_file
- File.exist?(tempfile_path).should be_false
+ expect(File.exist?(tempfile_path)).to be_falsey
end
it "sets the owner and group for the script file" do
@new_resource.user 'toor'
@new_resource.group 'wheel'
- @provider.stub(:script_file).and_return(@script_file)
- FileUtils.should_receive(:chown).with('toor', 'wheel', "/tmp/the_script_file")
+ allow(@provider).to receive(:script_file).and_return(@script_file)
+ expect(FileUtils).to receive(:chown).with('toor', 'wheel', "/tmp/the_script_file")
@provider.set_owner_and_group
end
context "with the script file set to the correct owner and group" do
before do
- @provider.stub(:set_owner_and_group)
- @provider.stub(:script_file).and_return(@script_file)
+ allow(@provider).to receive(:set_owner_and_group)
+ allow(@provider).to receive(:script_file).and_return(@script_file)
end
describe "when writing the script to the file" do
it "should put the contents of the script in the temp file" do
@provider.action_run
@script_file.rewind
- @script_file.string.should == "$| = 1; print 'i like beans'\n"
+ expect(@script_file.string).to eq("$| = 1; print 'i like beans'\n")
end
it "closes before executing the script and unlinks it when finished" do
@provider.action_run
- @script_file.should be_closed
+ expect(@script_file).to be_closed
end
end
@@ -75,7 +75,7 @@ describe Chef::Provider::Script, "action_run" do
describe "when running the script" do
it 'should set the command to "interpreter" "tempfile"' do
@provider.action_run
- @new_resource.command.should == '"perl" "/tmp/the_script_file"'
+ expect(@new_resource.command).to eq('"perl" "/tmp/the_script_file"')
end
describe "with flags set on the resource" do
@@ -85,7 +85,7 @@ describe Chef::Provider::Script, "action_run" do
it "should set the command to 'interpreter flags tempfile'" do
@provider.action_run
- @new_resource.command.should == '"perl" -f "/tmp/the_script_file"'
+ expect(@new_resource.command).to eq('"perl" -f "/tmp/the_script_file"')
end
end
diff --git a/spec/unit/provider/service/aix_service_spec.rb b/spec/unit/provider/service/aix_service_spec.rb
new file mode 100644
index 0000000000..796661145b
--- /dev/null
+++ b/spec/unit/provider/service/aix_service_spec.rb
@@ -0,0 +1,181 @@
+#
+# Author:: Kaustubh <kaustubh@clogeny.com>
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+
+describe Chef::Provider::Service::Aix do
+ before(:each) do
+ @node = Chef::Node.new
+ @events = Chef::EventDispatch::Dispatcher.new
+ @run_context = Chef::RunContext.new(@node, {}, @events)
+
+ @new_resource = Chef::Resource::Service.new("chef")
+ @current_resource = Chef::Resource::Service.new("chef")
+
+ @provider = Chef::Provider::Service::Aix.new(@new_resource, @run_context)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
+ end
+
+ describe "load current resource" do
+ it "should create a current resource with the name of the new resource and determine the status" do
+ @status = double("Status", :exitstatus => 0, :stdout => @stdout)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+
+ expect(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
+ expect(@current_resource).to receive(:service_name).with("chef")
+ expect(@provider).to receive(:determine_current_status!)
+
+ @provider.load_current_resource
+ end
+ end
+
+ describe "determine current status" do
+ context "when the service is active" do
+ before do
+ @status = double("Status", :exitstatus => 0, :stdout => "chef chef 12345 active\n")
+ end
+
+ it "current resource is running" do
+ expect(@provider).to receive(:shell_out!).with("lssrc -a | grep -w chef").and_return(@status)
+ expect(@provider).to receive(:is_resource_group?).with(["chef chef 12345 active"])
+
+ @provider.load_current_resource
+ expect(@current_resource.running).to be_truthy
+ end
+ end
+
+ context "when the service is inoprative" do
+ before do
+ @status = double("Status", :exitstatus => 0, :stdout => "chef chef inoperative\n")
+ end
+
+ it "current resource is not running" do
+ expect(@provider).to receive(:shell_out!).with("lssrc -a | grep -w chef").and_return(@status)
+ expect(@provider).to receive(:is_resource_group?).with(["chef chef inoperative"])
+
+ @provider.load_current_resource
+ expect(@current_resource.running).to be_falsey
+ end
+ end
+ end
+
+ describe "is resource group" do
+ context "when there are mutiple subsystems associated with group" do
+ before do
+ @status = double("Status", :exitstatus => 0, :stdout => "chef1 chef 12345 active\nchef2 chef 12334 active\nchef3 chef inoperative")
+ end
+
+ it "service is a group" do
+ expect(@provider).to receive(:shell_out!).with("lssrc -a | grep -w chef").and_return(@status)
+ @provider.load_current_resource
+ expect(@provider.instance_eval("@is_resource_group")).to be_truthy
+ end
+ end
+
+ context "when there is a single subsystem in the group" do
+ before do
+ @status = double("Status", :exitstatus => 0, :stdout => "chef1 chef inoperative\n")
+ end
+
+ it "service is a group" do
+ expect(@provider).to receive(:shell_out!).with("lssrc -a | grep -w chef").and_return(@status)
+ @provider.load_current_resource
+ expect(@provider.instance_eval("@is_resource_group")).to be_truthy
+ end
+ end
+
+ context "when there service is a subsytem" do
+ before do
+ @status = double("Status", :exitstatus => 0, :stdout => "chef chef123 inoperative\n")
+ end
+
+ it "service is a subsystem" do
+ expect(@provider).to receive(:shell_out!).with("lssrc -a | grep -w chef").and_return(@status)
+ @provider.load_current_resource
+ expect(@provider.instance_eval("@is_resource_group")).to be_falsey
+ end
+ end
+ end
+
+ describe "when starting the service" do
+ before do
+ @new_resource.service_name "apache"
+ end
+
+ it "should call the start command for groups" do
+ @provider.instance_eval('@is_resource_group = true')
+ expect(@provider).to receive(:shell_out!).with("startsrc -g #{@new_resource.service_name}")
+
+ @provider.start_service
+ end
+
+ it "should call the start command for subsystem" do
+ expect(@provider).to receive(:shell_out!).with("startsrc -s #{@new_resource.service_name}")
+
+ @provider.start_service
+ end
+ end
+
+ describe "when stopping a service" do
+ before do
+ @new_resource.service_name "apache"
+ end
+
+ it "should call the stop command for groups" do
+ @provider.instance_eval('@is_resource_group = true')
+ expect(@provider).to receive(:shell_out!).with("stopsrc -g #{@new_resource.service_name}")
+
+ @provider.stop_service
+ end
+
+ it "should call the stop command for subsystem" do
+ expect(@provider).to receive(:shell_out!).with("stopsrc -s #{@new_resource.service_name}")
+
+ @provider.stop_service
+ end
+ end
+
+ describe "when reloading a service" do
+ before do
+ @new_resource.service_name "apache"
+ end
+
+ it "should call the reload command for groups" do
+ @provider.instance_eval('@is_resource_group = true')
+ expect(@provider).to receive(:shell_out!).with("refresh -g #{@new_resource.service_name}")
+
+ @provider.reload_service
+ end
+
+ it "should call the reload command for subsystem" do
+ expect(@provider).to receive(:shell_out!).with("refresh -s #{@new_resource.service_name}")
+
+ @provider.reload_service
+ end
+ end
+
+ describe "when restarting the service" do
+ it "should call stop service followed by start service" do
+ expect(@provider).to receive(:stop_service)
+ expect(@provider).to receive(:start_service)
+
+ @provider.restart_service
+ end
+ end
+end
+
diff --git a/spec/unit/provider/service/aixinit_service_spec.rb b/spec/unit/provider/service/aixinit_service_spec.rb
new file mode 100644
index 0000000000..e4c9faa8b4
--- /dev/null
+++ b/spec/unit/provider/service/aixinit_service_spec.rb
@@ -0,0 +1,269 @@
+#
+# Author:: kaustubh (<kaustubh@clogeny.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+
+describe Chef::Provider::Service::AixInit do
+ before(:each) do
+ @node = Chef::Node.new
+ @node.automatic_attrs[:command] = {:ps => 'fuuuu'}
+ @events = Chef::EventDispatch::Dispatcher.new
+ @run_context = Chef::RunContext.new(@node, {}, @events)
+
+ @new_resource = Chef::Resource::Service.new("chef")
+ @provider = Chef::Provider::Service::AixInit.new(@new_resource, @run_context)
+
+ @current_resource = Chef::Resource::Service.new("chef")
+ @provider.current_resource = @current_resource
+
+ @pid, @stdin, @stdout, @stderr = nil, nil, nil, nil
+ end
+
+ describe "load_current_resource" do
+ it "sets current resource attributes" do
+ expect(@provider).to receive(:set_current_resource_attributes)
+
+ @provider.load_current_resource
+ end
+ end
+
+ describe "action_enable" do
+ shared_examples_for "the service is up to date" do
+ it "does not enable the service" do
+ expect(@provider).not_to receive(:enable_service)
+ @provider.action_enable
+ @provider.set_updated_status
+ expect(@provider.new_resource).not_to be_updated
+ end
+ end
+
+ shared_examples_for "the service is not up to date" do
+ it "enables the service and sets the resource as updated" do
+ expect(@provider).to receive(:enable_service).and_return(true)
+ @provider.action_enable
+ @provider.set_updated_status
+ expect(@provider.new_resource).to be_updated
+ end
+ end
+
+ context "when the service is disabled" do
+ before do
+ @current_resource.enabled(false)
+ end
+
+ it_behaves_like "the service is not up to date"
+ end
+
+ context "when the service is enabled" do
+ before do
+ @current_resource.enabled(true)
+ @current_resource.priority(80)
+ end
+
+ context "and the service sets no priority" do
+ it_behaves_like "the service is up to date"
+ end
+
+ context "and the service requests the same priority as is set" do
+ before do
+ @new_resource.priority(80)
+ end
+ it_behaves_like "the service is up to date"
+ end
+
+ context "and the service requests a different priority than is set" do
+ before do
+ @new_resource.priority(20)
+ end
+ it_behaves_like "the service is not up to date"
+ end
+ end
+ end
+
+ describe "enable_service" do
+ before do
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).and_return([])
+ end
+
+ context "when the service doesn't set a priority" do
+ it "creates symlink with status S" do
+ expect(@provider).to receive(:create_symlink).with(2,'S','')
+
+ @provider.enable_service
+ end
+ end
+
+ context "when the service sets a simple priority (integer)" do
+ before do
+ @new_resource.priority(75)
+ end
+
+ it "creates a symlink with status S and a priority" do
+ expect(@provider).to receive(:create_symlink).with(2,'S',75)
+
+ @provider.enable_service
+ end
+ end
+
+ context "when the service sets complex priorities (hash)" do
+ before do
+ priority = {2 => [:start, 20], 3 => [:stop, 10]}
+ @new_resource.priority(priority)
+ end
+
+ it "create symlink with status start (S) or stop (K) and a priority " do
+ expect(@provider).to receive(:create_symlink).with(2,'S',20)
+ expect(@provider).to receive(:create_symlink).with(3,'K',10)
+
+ @provider.enable_service
+ end
+ end
+ end
+
+ describe "disable_service" do
+ before do
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).and_return([])
+ end
+
+ context "when the service doesn't set a priority" do
+ it "creates symlinks with status stop (K)" do
+ expect(@provider).to receive(:create_symlink).with(2,'K','')
+
+ @provider.disable_service
+ end
+ end
+
+ context "when the service sets a simple priority (integer)" do
+ before do
+ @new_resource.priority(75)
+ end
+
+ it "create symlink with status stop (k) and a priority " do
+ expect(@provider).to receive(:create_symlink).with(2,'K',25)
+
+ @provider.disable_service
+ end
+ end
+
+ context "when the service sets complex priorities (hash)" do
+ before do
+ @priority = {2 => [:start, 20], 3 => [:stop, 10]}
+ @new_resource.priority(@priority)
+ end
+
+ it "create symlink with status stop (k) and a priority " do
+ expect(@provider).to receive(:create_symlink).with(3,'K',90)
+
+ @provider.disable_service
+ end
+ end
+ end
+
+ describe "set_current_resource_attributes" do
+ context "when rc2.d contains only start script" do
+ before do
+ files = ["/etc/rc.d/rc2.d/S20apache"]
+
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]chef"]).and_return(files)
+ end
+
+ it "the service is enabled" do
+ expect(@provider.current_resource).to receive(:enabled).with(true)
+ expect(@provider.current_resource).to receive(:priority).with(20)
+
+ @provider.set_current_resource_attributes
+ end
+ end
+
+ context "when rc2.d contains only stop script" do
+ before do
+ files = ["/etc/rc.d/rc2.d/K20apache"]
+ @priority = {2 => [:stop, 20]}
+
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]chef"]).and_return(files)
+ end
+ it "the service is not enabled" do
+ expect(@provider.current_resource).to receive(:enabled).with(false)
+ expect(@provider.current_resource).to receive(:priority).with(@priority)
+
+ @provider.set_current_resource_attributes
+ end
+ end
+
+ context "when rc2.d contains both start and stop scripts" do
+ before do
+ @files = ["/etc/rc.d/rc2.d/S20apache", "/etc/rc.d/rc2.d/K80apache"]
+ @priority = {2 => [:start, 20], 2 => [:stop, 80]}
+
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]chef"]).and_return(@files)
+ end
+ it "the service is enabled" do
+ expect(@current_resource).to receive(:enabled).with(true)
+ expect(@current_resource).to receive(:priority).with(@priority)
+
+ @provider.set_current_resource_attributes
+ end
+ end
+
+ context "when rc2.d contains only start script (without priority)" do
+ before do
+ files = ["/etc/rc.d/rc2.d/Sapache"]
+
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).and_return(files)
+ end
+
+ it "the service is enabled" do
+ expect(@provider.current_resource).to receive(:enabled).with(true)
+ expect(@provider.current_resource).to receive(:priority).with('')
+
+ @provider.set_current_resource_attributes
+ end
+ end
+
+ context "when rc2.d contains only stop script (without priority)" do
+ before do
+ files = ["/etc/rc.d/rc2.d/Kapache"]
+ @priority = {2 => [:stop, '']}
+
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).and_return(files)
+ end
+ it "the service is not enabled" do
+ expect(@provider.current_resource).to receive(:enabled).with(false)
+ expect(@provider.current_resource).to receive(:priority).with(@priority)
+
+ @provider.set_current_resource_attributes
+ end
+ end
+
+ context "when rc2.d contains both start and stop scripts" do
+ before do
+ files = ["/etc/rc.d/rc2.d/Sapache", "/etc/rc.d/rc2.d/Kapache"]
+ @priority = {2 => [:start, ''], 2 => [:stop, '']}
+
+ allow(Dir).to receive(:glob).with(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).and_return(files)
+ end
+ it "the service is enabled" do
+ expect(@current_resource).to receive(:enabled).with(true)
+ expect(@current_resource).to receive(:priority).with(@priority)
+
+ @provider.set_current_resource_attributes
+ end
+ end
+ end
+end
+
diff --git a/spec/unit/provider/service/arch_service_spec.rb b/spec/unit/provider/service/arch_service_spec.rb
index 38ed74cdee..49be0e274c 100644
--- a/spec/unit/provider/service/arch_service_spec.rb
+++ b/spec/unit/provider/service/arch_service_spec.rb
@@ -37,15 +37,15 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
@provider = Chef::Provider::Service::Arch.new(@new_resource, @run_context)
- ::File.stub(:exists?).with("/etc/rc.conf").and_return(true)
- ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network apache sshd)")
+ allow(::File).to receive(:exists?).with("/etc/rc.conf").and_return(true)
+ allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network apache sshd)")
end
describe "when first created" do
it "should set the current resources service name to the new resources service name" do
- @provider.stub(:shell_out).and_return(OpenStruct.new(:exitstatus => 0, :stdout => ""))
+ allow(@provider).to receive(:shell_out).and_return(OpenStruct.new(:exitstatus => 0, :stdout => ""))
@provider.load_current_resource
- @provider.current_resource.service_name.should == 'chef'
+ expect(@provider.current_resource.service_name).to eq('chef')
end
end
@@ -55,26 +55,26 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
end
it "should run '/etc/rc.d/service_name status'" do
- @provider.should_receive(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 0))
+ expect(@provider).to receive(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 0))
@provider.load_current_resource
end
it "should set running to true if the status command returns 0" do
- @provider.stub(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 0))
+ allow(@provider).to receive(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 0))
@provider.load_current_resource
- @provider.current_resource.running.should be_true
+ expect(@provider.current_resource.running).to be_truthy
end
it "should set running to false if the status command returns anything except 0" do
- @provider.stub(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 1))
+ allow(@provider).to receive(:shell_out).with("/etc/rc.d/chef status").and_return(OpenStruct.new(:exitstatus => 1))
@provider.load_current_resource
- @provider.current_resource.running.should be_false
+ expect(@provider.current_resource.running).to be_falsey
end
it "should set running to false if the status command raises" do
- @provider.stub(:shell_out).with("/etc/rc.d/chef status").and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ allow(@provider).to receive(:shell_out).with("/etc/rc.d/chef status").and_raise(Mixlib::ShellOut::ShellCommandFailed)
@provider.load_current_resource
- @provider.current_resource.running.should be_false
+ expect(@provider.current_resource.running).to be_falsey
end
end
@@ -85,7 +85,7 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
end
it "should run the services status command if one has been specified" do
- @provider.should_receive(:shell_out).with("/etc/rc.d/chefhasmonkeypants status").and_return(OpenStruct.new(:exitstatus => 0))
+ expect(@provider).to receive(:shell_out).with("/etc/rc.d/chefhasmonkeypants status").and_return(OpenStruct.new(:exitstatus => 0))
@provider.load_current_resource
end
@@ -95,24 +95,24 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
@node.automatic_attrs[:command] = {:ps => nil}
@provider.define_resource_requirements
@provider.action = :start
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should raise error if the node has an empty ps attribute and no other means to get status" do
@node.automatic_attrs[:command] = {:ps => ""}
@provider.define_resource_requirements
@provider.action = :start
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should fail if file /etc/rc.conf does not exist" do
- ::File.stub(:exists?).with("/etc/rc.conf").and_return(false)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Service)
+ allow(::File).to receive(:exists?).with("/etc/rc.conf").and_return(false)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Service)
end
it "should fail if file /etc/rc.conf does not contain DAEMONS array" do
- ::File.stub(:read).with("/etc/rc.conf").and_return("")
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Service)
+ allow(::File).to receive(:read).with("/etc/rc.conf").and_return("")
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Service)
end
describe "when discovering service status with ps" do
@@ -123,7 +123,7 @@ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
DEFAULT_PS
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@node.automatic_attrs[:command] = {:ps => "ps -ef"}
end
@@ -133,29 +133,29 @@ DEFAULT_PS
aj 7842 5057 0 21:26 pts/2 00:00:06 chef
aj 7842 5057 0 21:26 pts/2 00:00:06 poos
RUNNING_PS
- @status.stub(:stdout).and_return(@stdout)
+ allow(@status).to receive(:stdout).and_return(@stdout)
@provider.load_current_resource
- @provider.current_resource.running.should be_true
+ expect(@provider.current_resource.running).to be_truthy
end
it "determines the service is not running when it does not appear in ps" do
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @provider.current_resource.running.should be_false
+ expect(@provider.current_resource.running).to be_falsey
end
it "should raise an exception if ps fails" do
- @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ allow(@provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
@provider.load_current_resource
@provider.action = :start
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
it "should return existing entries in DAEMONS array" do
- ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network !apache ssh)")
- @provider.daemons.should == ['network', '!apache', 'ssh']
+ allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network !apache ssh)")
+ expect(@provider.daemons).to eq(['network', '!apache', 'ssh'])
end
context "when the current service status is known" do
@@ -179,8 +179,8 @@ RUNNING_PS
# end
it "should add chef to DAEMONS array" do
- ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network)")
- @provider.should_receive(:update_daemons).with(['network', 'chef'])
+ allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network)")
+ expect(@provider).to receive(:update_daemons).with(['network', 'chef'])
@provider.enable_service()
end
end
@@ -200,8 +200,8 @@ RUNNING_PS
# end
it "should remove chef from DAEMONS array" do
- ::File.stub(:read).with("/etc/rc.conf").and_return("DAEMONS=(network chef)")
- @provider.should_receive(:update_daemons).with(['network', '!chef'])
+ allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network chef)")
+ expect(@provider).to receive(:update_daemons).with(['network', '!chef'])
@provider.disable_service()
end
end
@@ -221,13 +221,13 @@ RUNNING_PS
# end
it "should call the start command if one is specified" do
- @new_resource.stub(:start_command).and_return("/etc/rc.d/chef startyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/chef startyousillysally")
+ allow(@new_resource).to receive(:start_command).and_return("/etc/rc.d/chef startyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/chef startyousillysally")
@provider.start_service()
end
it "should call '/etc/rc.d/service_name start' if no start command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} start")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} start")
@provider.start_service()
end
end
@@ -247,13 +247,13 @@ RUNNING_PS
# end
it "should call the stop command if one is specified" do
- @new_resource.stub(:stop_command).and_return("/etc/rc.d/chef itoldyoutostop")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/chef itoldyoutostop")
+ allow(@new_resource).to receive(:stop_command).and_return("/etc/rc.d/chef itoldyoutostop")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/chef itoldyoutostop")
@provider.stop_service()
end
it "should call '/etc/rc.d/service_name stop' if no stop command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} stop")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} stop")
@provider.stop_service()
end
end
@@ -274,21 +274,21 @@ RUNNING_PS
# end
it "should call 'restart' on the service_name if the resource supports it" do
- @new_resource.stub(:supports).and_return({:restart => true})
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} restart")
+ allow(@new_resource).to receive(:supports).and_return({:restart => true})
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} restart")
@provider.restart_service()
end
it "should call the restart_command if one has been specified" do
- @new_resource.stub(:restart_command).and_return("/etc/rc.d/chef restartinafire")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} restartinafire")
+ allow(@new_resource).to receive(:restart_command).and_return("/etc/rc.d/chef restartinafire")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} restartinafire")
@provider.restart_service()
end
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
- @provider.should_receive(:stop_service)
- @provider.should_receive(:sleep).with(1)
- @provider.should_receive(:start_service)
+ expect(@provider).to receive(:stop_service)
+ expect(@provider).to receive(:sleep).with(1)
+ expect(@provider).to receive(:start_service)
@provider.restart_service()
end
end
@@ -309,14 +309,14 @@ RUNNING_PS
# end
it "should call 'reload' on the service if it supports it" do
- @new_resource.stub(:supports).and_return({:reload => true})
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} reload")
+ allow(@new_resource).to receive(:supports).and_return({:reload => true})
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} reload")
@provider.reload_service()
end
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
- @new_resource.stub(:reload_command).and_return("/etc/rc.d/chef lollerpants")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} lollerpants")
+ allow(@new_resource).to receive(:reload_command).and_return("/etc/rc.d/chef lollerpants")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/rc.d/#{@new_resource.service_name} lollerpants")
@provider.reload_service()
end
end
diff --git a/spec/unit/provider/service/debian_service_spec.rb b/spec/unit/provider/service/debian_service_spec.rb
index 3e60857cbf..a4667e8ce8 100644
--- a/spec/unit/provider/service/debian_service_spec.rb
+++ b/spec/unit/provider/service/debian_service_spec.rb
@@ -36,17 +36,17 @@ describe Chef::Provider::Service::Debian do
describe "load_current_resource" do
it "ensures /usr/sbin/update-rc.d is available" do
- File.should_receive(:exists?).with("/usr/sbin/update-rc.d") .and_return(false)
+ expect(File).to receive(:exists?).with("/usr/sbin/update-rc.d") .and_return(false)
@provider.define_resource_requirements
- lambda {
+ expect {
@provider.process_resource_requirements
- }.should raise_error(Chef::Exceptions::Service)
+ }.to raise_error(Chef::Exceptions::Service)
end
context "when update-rc.d shows init linked to rc*.d/" do
before do
- @provider.stub(:assert_update_rcd_available)
+ allow(@provider).to receive(:assert_update_rcd_available)
result = <<-UPDATE_RC_D_SUCCESS
Removing any system startup links for /etc/init.d/chef ...
@@ -62,55 +62,55 @@ describe Chef::Provider::Service::Debian do
@stdout = StringIO.new(result)
@stderr = StringIO.new
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is enabled" do
- @provider.service_currently_enabled?(@provider.get_priority).should be_true
+ expect(@provider.service_currently_enabled?(@provider.get_priority)).to be_truthy
end
it "stores the 'enabled' state" do
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- @provider.load_current_resource.should equal(@current_resource)
- @current_resource.enabled.should be_true
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
+ expect(@provider.load_current_resource).to equal(@current_resource)
+ expect(@current_resource.enabled).to be_truthy
end
end
context "when update-rc.d shows init isn't linked to rc*.d/" do
before do
- @provider.stub(:assert_update_rcd_available)
+ allow(@provider).to receive(:assert_update_rcd_available)
@status = double("Status", :exitstatus => 0)
@stdout = StringIO.new(
" Removing any system startup links for /etc/init.d/chef ...")
@stderr = StringIO.new
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is disabled" do
- @provider.service_currently_enabled?(@provider.get_priority).should be_false
+ expect(@provider.service_currently_enabled?(@provider.get_priority)).to be_falsey
end
it "stores the 'disabled' state" do
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- @provider.load_current_resource.should equal(@current_resource)
- @current_resource.enabled.should be_false
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
+ expect(@provider.load_current_resource).to equal(@current_resource)
+ expect(@current_resource.enabled).to be_falsey
end
end
context "when update-rc.d fails" do
before do
@status = double("Status", :exitstatus => -1)
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
end
it "raises an error" do
@provider.define_resource_requirements
- lambda {
+ expect {
@provider.process_resource_requirements
- }.should raise_error(Chef::Exceptions::Service)
+ }.to raise_error(Chef::Exceptions::Service)
end
end
@@ -196,49 +196,49 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop
context "on #{model}" do
context "when update-rc.d shows init linked to rc*.d/" do
before do
- @provider.stub(:assert_update_rcd_available)
+ allow(@provider).to receive(:assert_update_rcd_available)
@stdout = StringIO.new(expected_results["linked"]["stdout"])
@stderr = StringIO.new(expected_results["linked"]["stderr"])
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is enabled" do
- @provider.service_currently_enabled?(@provider.get_priority).should be_true
+ expect(@provider.service_currently_enabled?(@provider.get_priority)).to be_truthy
end
it "stores the 'enabled' state" do
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- @provider.load_current_resource.should equal(@current_resource)
- @current_resource.enabled.should be_true
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
+ expect(@provider.load_current_resource).to equal(@current_resource)
+ expect(@current_resource.enabled).to be_truthy
end
it "stores the start/stop priorities of the service" do
@provider.load_current_resource
- @provider.current_resource.priority.should == expected_results["linked"]["priorities"]
+ expect(@provider.current_resource.priority).to eq(expected_results["linked"]["priorities"])
end
end
context "when update-rc.d shows init isn't linked to rc*.d/" do
before do
- @provider.stub(:assert_update_rcd_available)
+ allow(@provider).to receive(:assert_update_rcd_available)
@stdout = StringIO.new(expected_results["not linked"]["stdout"])
@stderr = StringIO.new(expected_results["not linked"]["stderr"])
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is disabled" do
- @provider.service_currently_enabled?(@provider.get_priority).should be_false
+ expect(@provider.service_currently_enabled?(@provider.get_priority)).to be_falsey
end
it "stores the 'disabled' state" do
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- @provider.load_current_resource.should equal(@current_resource)
- @current_resource.enabled.should be_false
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
+ expect(@provider.load_current_resource).to equal(@current_resource)
+ expect(@current_resource.enabled).to be_falsey
end
end
end
@@ -249,19 +249,19 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop
describe "action_enable" do
shared_examples_for "the service is up to date" do
it "does not enable the service" do
- @provider.should_not_receive(:enable_service)
+ expect(@provider).not_to receive(:enable_service)
@provider.action_enable
@provider.set_updated_status
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
end
shared_examples_for "the service is not up to date" do
it "enables the service and sets the resource as updated" do
- @provider.should_receive(:enable_service).and_return(true)
+ expect(@provider).to receive(:enable_service).and_return(true)
@provider.action_enable
@provider.set_updated_status
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
end
@@ -301,7 +301,7 @@ insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop
def expect_commands(provider, commands)
commands.each do |command|
- provider.should_receive(:shell_out!).with(command)
+ expect(provider).to receive(:shell_out!).with(command)
end
end
diff --git a/spec/unit/provider/service/freebsd_service_spec.rb b/spec/unit/provider/service/freebsd_service_spec.rb
index eb55fac820..91d2d8e063 100644
--- a/spec/unit/provider/service/freebsd_service_spec.rb
+++ b/spec/unit/provider/service/freebsd_service_spec.rb
@@ -172,14 +172,14 @@ PS_SAMPLE
it "should set running to true" do
allow(provider).to receive(:shell_out!).and_return(status)
provider.determine_current_status!
- expect(current_resource.running).to be_true
+ expect(current_resource.running).to be_truthy
end
end
it "should set running to false if the regex doesn't match" do
allow(provider).to receive(:shell_out!).and_return(status)
provider.determine_current_status!
- expect(current_resource.running).to be_false
+ expect(current_resource.running).to be_falsey
end
it "should set running to nil if ps fails" do
diff --git a/spec/unit/provider/service/gentoo_service_spec.rb b/spec/unit/provider/service/gentoo_service_spec.rb
index 022a73cc9a..c08982acc3 100644
--- a/spec/unit/provider/service/gentoo_service_spec.rb
+++ b/spec/unit/provider/service/gentoo_service_spec.rb
@@ -29,72 +29,72 @@ describe Chef::Provider::Service::Gentoo do
@current_resource = Chef::Resource::Service.new("chef")
@provider = Chef::Provider::Service::Gentoo.new(@new_resource, @run_context)
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out).and_return(@status)
- File.stub(:exists?).with("/etc/init.d/chef").and_return(true)
- File.stub(:exists?).with("/sbin/rc-update").and_return(true)
- File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(false)
- File.stub(:readable?).with("/etc/runlevels/default/chef").and_return(false)
+ allow(@provider).to receive(:shell_out).and_return(@status)
+ allow(File).to receive(:exists?).with("/etc/init.d/chef").and_return(true)
+ allow(File).to receive(:exists?).with("/sbin/rc-update").and_return(true)
+ allow(File).to receive(:exists?).with("/etc/runlevels/default/chef").and_return(false)
+ allow(File).to receive(:readable?).with("/etc/runlevels/default/chef").and_return(false)
end
# new test: found_enabled state
#
describe "load_current_resource" do
it "should raise Chef::Exceptions::Service if /sbin/rc-update does not exist" do
- File.should_receive(:exists?).with("/sbin/rc-update").and_return(false)
+ expect(File).to receive(:exists?).with("/sbin/rc-update").and_return(false)
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should track when service file is not found in /etc/runlevels" do
@provider.load_current_resource
- @provider.instance_variable_get("@found_script").should be_false
+ expect(@provider.instance_variable_get("@found_script")).to be_falsey
end
it "should track when service file is found in /etc/runlevels/**/" do
- Dir.stub(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"])
+ allow(Dir).to receive(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"])
@provider.load_current_resource
- @provider.instance_variable_get("@found_script").should be_true
+ expect(@provider.instance_variable_get("@found_script")).to be_truthy
end
describe "when detecting the service enable state" do
describe "and the glob returns a default service script file" do
before do
- Dir.stub(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"])
+ allow(Dir).to receive(:glob).with("/etc/runlevels/**/chef").and_return(["/etc/runlevels/default/chef"])
end
describe "and the file exists and is readable" do
before do
- File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(true)
- File.stub(:readable?).with("/etc/runlevels/default/chef").and_return(true)
+ allow(File).to receive(:exists?).with("/etc/runlevels/default/chef").and_return(true)
+ allow(File).to receive(:readable?).with("/etc/runlevels/default/chef").and_return(true)
end
it "should set enabled to true" do
@provider.load_current_resource
- @current_resource.enabled.should be_true
+ expect(@current_resource.enabled).to be_truthy
end
end
describe "and the file exists but is not readable" do
before do
- File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(true)
- File.stub(:readable?).with("/etc/runlevels/default/chef").and_return(false)
+ allow(File).to receive(:exists?).with("/etc/runlevels/default/chef").and_return(true)
+ allow(File).to receive(:readable?).with("/etc/runlevels/default/chef").and_return(false)
end
it "should set enabled to false" do
@provider.load_current_resource
- @current_resource.enabled.should be_false
+ expect(@current_resource.enabled).to be_falsey
end
end
describe "and the file does not exist" do
before do
- File.stub(:exists?).with("/etc/runlevels/default/chef").and_return(false)
- File.stub(:readable?).with("/etc/runlevels/default/chef").and_return("foobarbaz")
+ allow(File).to receive(:exists?).with("/etc/runlevels/default/chef").and_return(false)
+ allow(File).to receive(:readable?).with("/etc/runlevels/default/chef").and_return("foobarbaz")
end
it "should set enabled to false" do
@provider.load_current_resource
- @current_resource.enabled.should be_false
+ expect(@current_resource.enabled).to be_falsey
end
end
@@ -103,39 +103,39 @@ describe Chef::Provider::Service::Gentoo do
end
it "should return the current_resource" do
- @provider.load_current_resource.should == @current_resource
+ expect(@provider.load_current_resource).to eq(@current_resource)
end
it "should support the status command automatically" do
@provider.load_current_resource
- @new_resource.supports[:status].should be_true
+ expect(@new_resource.supports[:status]).to be_truthy
end
it "should support the restart command automatically" do
@provider.load_current_resource
- @new_resource.supports[:restart].should be_true
+ expect(@new_resource.supports[:restart]).to be_truthy
end
it "should not support the reload command automatically" do
@provider.load_current_resource
- @new_resource.supports[:reload].should_not be_true
+ expect(@new_resource.supports[:reload]).not_to be_truthy
end
end
describe "action_methods" do
- before(:each) { @provider.stub(:load_current_resource).and_return(@current_resource) }
+ before(:each) { allow(@provider).to receive(:load_current_resource).and_return(@current_resource) }
describe Chef::Provider::Service::Gentoo, "enable_service" do
it "should call rc-update add *service* default" do
- @provider.should_receive(:shell_out!).with("/sbin/rc-update add chef default")
+ expect(@provider).to receive(:shell_out!).with("/sbin/rc-update add chef default")
@provider.enable_service()
end
end
describe Chef::Provider::Service::Gentoo, "disable_service" do
it "should call rc-update del *service* default" do
- @provider.should_receive(:shell_out!).with("/sbin/rc-update del chef default")
+ expect(@provider).to receive(:shell_out!).with("/sbin/rc-update del chef default")
@provider.disable_service()
end
end
diff --git a/spec/unit/provider/service/init_service_spec.rb b/spec/unit/provider/service/init_service_spec.rb
index b523f6d3a9..827a4261e1 100644
--- a/spec/unit/provider/service/init_service_spec.rb
+++ b/spec/unit/provider/service/init_service_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Provider::Service::Init, "load_current_resource" do
@current_resource = Chef::Resource::Service.new("chef")
@provider = Chef::Provider::Service::Init.new(@new_resource, @run_context)
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@stdout = StringIO.new(<<-PS)
aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
@@ -38,17 +38,17 @@ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
PS
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
end
it "should create a current resource with the name of the new resource" do
@provider.load_current_resource
- @provider.current_resource.should equal(@current_resource)
+ expect(@provider.current_resource).to equal(@current_resource)
end
it "should set the current resources service name to the new resources service name" do
@provider.load_current_resource
- @current_resource.service_name.should == 'chef'
+ expect(@current_resource.service_name).to eq('chef')
end
describe "when the service supports status" do
@@ -57,37 +57,37 @@ PS
end
it "should run '/etc/init.d/service_name status'" do
- @provider.should_receive(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
+ expect(@provider).to receive(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
end
it "should set running to true if the status command returns 0" do
- @provider.stub(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
+ allow(@provider).to receive(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_true
+ expect(@current_resource.running).to be_truthy
end
it "should set running to false if the status command returns anything except 0" do
- @status.stub(:exitstatus).and_return(1)
- @provider.stub(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
+ allow(@status).to receive(:exitstatus).and_return(1)
+ allow(@provider).to receive(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
it "should set running to false if the status command raises" do
- @provider.stub(:shell_out).and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ allow(@provider).to receive(:shell_out).and_raise(Mixlib::ShellOut::ShellCommandFailed)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
end
describe "when a status command has been specified" do
before do
- @new_resource.stub(:status_command).and_return("/etc/init.d/chefhasmonkeypants status")
+ allow(@new_resource).to receive(:status_command).and_return("/etc/init.d/chefhasmonkeypants status")
end
it "should run the services status command if one has been specified" do
- @provider.should_receive(:shell_out).with("/etc/init.d/chefhasmonkeypants status").and_return(@status)
+ expect(@provider).to receive(:shell_out).with("/etc/init.d/chefhasmonkeypants status").and_return(@status)
@provider.load_current_resource
end
@@ -95,12 +95,12 @@ PS
describe "when an init command has been specified" do
before do
- @new_resource.stub(:init_command).and_return("/opt/chef-server/service/erchef")
+ allow(@new_resource).to receive(:init_command).and_return("/opt/chef-server/service/erchef")
@provider = Chef::Provider::Service::Init.new(@new_resource, @run_context)
end
it "should use the init_command if one has been specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/opt/chef-server/service/erchef start")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/opt/chef-server/service/erchef start")
@provider.start_service
end
@@ -113,7 +113,7 @@ PS
@provider.load_current_resource
@provider.action = :start
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should raise an error if the node has an empty ps attribute" do
@@ -121,14 +121,14 @@ PS
@provider.load_current_resource
@provider.action = :start
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
describe "when we have a 'ps' attribute" do
it "should shell_out! the node's ps command" do
- @provider.should_receive(:shell_out!).and_return(@status)
+ expect(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
end
@@ -137,39 +137,39 @@ PS
aj 7842 5057 0 21:26 pts/2 00:00:06 chef
aj 7842 5057 0 21:26 pts/2 00:00:06 poos
RUNNING_PS
- @status.stub(:stdout).and_return(@stdout)
+ allow(@status).to receive(:stdout).and_return(@stdout)
@provider.load_current_resource
- @current_resource.running.should be_true
+ expect(@current_resource.running).to be_truthy
end
it "should set running to false if the regex doesn't match" do
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
it "should raise an exception if ps fails" do
- @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ allow(@provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
@provider.load_current_resource
@provider.action = :start
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
it "should return the current resource" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
describe "when starting the service" do
it "should call the start command if one is specified" do
@new_resource.start_command("/etc/init.d/chef startyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef startyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef startyousillysally")
@provider.start_service()
end
it "should call '/etc/init.d/service_name start' if no start command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} start")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} start")
@provider.start_service()
end
end
@@ -177,12 +177,12 @@ RUNNING_PS
describe Chef::Provider::Service::Init, "stop_service" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/etc/init.d/chef itoldyoutostop")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef itoldyoutostop")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef itoldyoutostop")
@provider.stop_service()
end
it "should call '/etc/init.d/service_name stop' if no stop command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} stop")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} stop")
@provider.stop_service()
end
end
@@ -190,20 +190,20 @@ RUNNING_PS
describe "when restarting a service" do
it "should call 'restart' on the service_name if the resource supports it" do
@new_resource.supports({:restart => true})
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} restart")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} restart")
@provider.restart_service()
end
it "should call the restart_command if one has been specified" do
@new_resource.restart_command("/etc/init.d/chef restartinafire")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} restartinafire")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/#{@new_resource.service_name} restartinafire")
@provider.restart_service()
end
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
- @provider.should_receive(:stop_service)
- @provider.should_receive(:sleep).with(1)
- @provider.should_receive(:start_service)
+ expect(@provider).to receive(:stop_service)
+ expect(@provider).to receive(:sleep).with(1)
+ expect(@provider).to receive(:start_service)
@provider.restart_service()
end
end
@@ -211,13 +211,13 @@ RUNNING_PS
describe "when reloading a service" do
it "should call 'reload' on the service if it supports it" do
@new_resource.supports({:reload => true})
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef reload")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef reload")
@provider.reload_service()
end
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
@new_resource.reload_command("/etc/init.d/chef lollerpants")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef lollerpants")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef lollerpants")
@provider.reload_service()
end
end
@@ -225,11 +225,11 @@ RUNNING_PS
describe "when a custom command has been specified" do
before do
@new_resource.start_command("/etc/init.d/chef startyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef startyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/chef startyousillysally")
end
it "should still pass all why run assertions" do
- lambda { @provider.run_action(:start) }.should_not raise_error
+ expect { @provider.run_action(:start) }.not_to raise_error
end
end
end
diff --git a/spec/unit/provider/service/insserv_service_spec.rb b/spec/unit/provider/service/insserv_service_spec.rb
index 9ed03b519f..3799daebb4 100644
--- a/spec/unit/provider/service/insserv_service_spec.rb
+++ b/spec/unit/provider/service/insserv_service_spec.rb
@@ -30,29 +30,29 @@ describe Chef::Provider::Service::Insserv do
@provider = Chef::Provider::Service::Insserv.new(@new_resource, @run_context)
@status = double("Process::Status mock", :exitstatus => 0, :stdout => "")
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
end
describe "load_current_resource" do
describe "when startup links exist" do
before do
- Dir.stub(:glob).with("/etc/rc**/S*initgrediant").and_return(["/etc/rc5.d/S18initgrediant", "/etc/rc2.d/S18initgrediant", "/etc/rc4.d/S18initgrediant", "/etc/rc3.d/S18initgrediant"])
+ allow(Dir).to receive(:glob).with("/etc/rc**/S*initgrediant").and_return(["/etc/rc5.d/S18initgrediant", "/etc/rc2.d/S18initgrediant", "/etc/rc4.d/S18initgrediant", "/etc/rc3.d/S18initgrediant"])
end
it "sets the current enabled status to true" do
@provider.load_current_resource
- @provider.current_resource.enabled.should be_true
+ expect(@provider.current_resource.enabled).to be_truthy
end
end
describe "when startup links do not exist" do
before do
- Dir.stub(:glob).with("/etc/rc**/S*initgrediant").and_return([])
+ allow(Dir).to receive(:glob).with("/etc/rc**/S*initgrediant").and_return([])
end
it "sets the current enabled status to false" do
@provider.load_current_resource
- @provider.current_resource.enabled.should be_false
+ expect(@provider.current_resource.enabled).to be_falsey
end
end
@@ -60,15 +60,15 @@ describe Chef::Provider::Service::Insserv do
describe "enable_service" do
it "should call insserv and create the default links" do
- @provider.should_receive(:shell_out!).with("/sbin/insserv -r -f #{@new_resource.service_name}")
- @provider.should_receive(:shell_out!).with("/sbin/insserv -d -f #{@new_resource.service_name}")
+ expect(@provider).to receive(:shell_out!).with("/sbin/insserv -r -f #{@new_resource.service_name}")
+ expect(@provider).to receive(:shell_out!).with("/sbin/insserv -d -f #{@new_resource.service_name}")
@provider.enable_service
end
end
describe "disable_service" do
it "should call insserv and remove the links" do
- @provider.should_receive(:shell_out!).with("/sbin/insserv -r -f #{@new_resource.service_name}")
+ expect(@provider).to receive(:shell_out!).with("/sbin/insserv -r -f #{@new_resource.service_name}")
@provider.disable_service
end
end
diff --git a/spec/unit/provider/service/invokercd_service_spec.rb b/spec/unit/provider/service/invokercd_service_spec.rb
index d8a9851837..81588c80e5 100644
--- a/spec/unit/provider/service/invokercd_service_spec.rb
+++ b/spec/unit/provider/service/invokercd_service_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Provider::Service::Invokercd, "load_current_resource" do
@current_resource = Chef::Resource::Service.new("chef")
@provider = Chef::Provider::Service::Invokercd.new(@new_resource, @run_context)
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@stdout = StringIO.new(<<-PS)
aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
@@ -38,17 +38,17 @@ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
aj 8119 6041 0 21:34 pts/3 00:00:03 vi init_service_spec.rb
PS
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
end
it "should create a current resource with the name of the new resource" do
@provider.load_current_resource
- @provider.current_resource.should equal(@current_resource)
+ expect(@provider.current_resource).to equal(@current_resource)
end
it "should set the current resources service name to the new resources service name" do
@provider.load_current_resource
- @current_resource.service_name.should == 'chef'
+ expect(@current_resource.service_name).to eq('chef')
end
describe "when the service supports status" do
@@ -57,37 +57,37 @@ PS
end
it "should run '/usr/sbin/invoke-rc.d service_name status'" do
- @provider.should_receive(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status)
+ expect(@provider).to receive(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
end
it "should set running to true if the status command returns 0" do
- @provider.stub(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status)
+ allow(@provider).to receive(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_true
+ expect(@current_resource.running).to be_truthy
end
it "should set running to false if the status command returns anything except 0" do
- @status.stub(:exitstatus).and_return(1)
- @provider.stub(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status)
+ allow(@status).to receive(:exitstatus).and_return(1)
+ allow(@provider).to receive(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
it "should set running to false if the status command raises" do
- @provider.stub(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ allow(@provider).to receive(:shell_out).with("/usr/sbin/invoke-rc.d #{@current_resource.service_name} status").and_raise(Mixlib::ShellOut::ShellCommandFailed)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
end
describe "when a status command has been specified" do
before do
- @new_resource.stub(:status_command).and_return("/usr/sbin/invoke-rc.d chefhasmonkeypants status")
+ allow(@new_resource).to receive(:status_command).and_return("/usr/sbin/invoke-rc.d chefhasmonkeypants status")
end
it "should run the services status command if one has been specified" do
- @provider.should_receive(:shell_out).with("/usr/sbin/invoke-rc.d chefhasmonkeypants status").and_return(@status)
+ expect(@provider).to receive(:shell_out).with("/usr/sbin/invoke-rc.d chefhasmonkeypants status").and_return(@status)
@provider.load_current_resource
end
@@ -98,14 +98,14 @@ PS
@node.automatic_attrs[:command] = {:ps => nil}
@provider.action = :start
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should raise error if the node has an empty ps attribute and no other means to get status" do
@node.automatic_attrs[:command] = {:ps => ""}
@provider.action = :start
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
@@ -113,7 +113,7 @@ PS
describe "when we have a 'ps' attribute" do
it "should shell_out! the node's ps command" do
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.should_receive(:shell_out!).with(@node[:command][:ps]).and_return(@status)
+ expect(@provider).to receive(:shell_out!).with(@node[:command][:ps]).and_return(@status)
@provider.load_current_resource
end
@@ -123,40 +123,40 @@ aj 7842 5057 0 21:26 pts/2 00:00:06 chef
aj 7842 5057 0 21:26 pts/2 00:00:06 poos
RUNNING_PS
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.should_receive(:shell_out!).and_return(@status)
+ expect(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_true
+ expect(@current_resource.running).to be_truthy
end
it "should set running to false if the regex doesn't match" do
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.should_receive(:shell_out!).and_return(@status)
+ expect(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
it "should raise an exception if ps fails" do
- @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ allow(@provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
@provider.action = :start
@provider.load_current_resource
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
it "should return the current resource" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
describe "when starting the service" do
it "should call the start command if one is specified" do
@new_resource.start_command("/usr/sbin/invoke-rc.d chef startyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef startyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef startyousillysally")
@provider.start_service()
end
it "should call '/usr/sbin/invoke-rc.d service_name start' if no start command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} start")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} start")
@provider.start_service()
end
end
@@ -164,12 +164,12 @@ RUNNING_PS
describe Chef::Provider::Service::Invokercd, "stop_service" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/usr/sbin/invoke-rc.d chef itoldyoutostop")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef itoldyoutostop")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef itoldyoutostop")
@provider.stop_service()
end
it "should call '/usr/sbin/invoke-rc.d service_name stop' if no stop command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} stop")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} stop")
@provider.stop_service()
end
end
@@ -177,20 +177,20 @@ RUNNING_PS
describe "when restarting a service" do
it "should call 'restart' on the service_name if the resource supports it" do
@new_resource.supports({:restart => true})
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} restart")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} restart")
@provider.restart_service()
end
it "should call the restart_command if one has been specified" do
@new_resource.restart_command("/usr/sbin/invoke-rc.d chef restartinafire")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} restartinafire")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} restartinafire")
@provider.restart_service()
end
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
- @provider.should_receive(:stop_service)
- @provider.should_receive(:sleep).with(1)
- @provider.should_receive(:start_service)
+ expect(@provider).to receive(:stop_service)
+ expect(@provider).to receive(:sleep).with(1)
+ expect(@provider).to receive(:start_service)
@provider.restart_service()
end
end
@@ -198,13 +198,13 @@ RUNNING_PS
describe "when reloading a service" do
it "should call 'reload' on the service if it supports it" do
@new_resource.supports({:reload => true})
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef reload")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef reload")
@provider.reload_service()
end
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
@new_resource.reload_command("/usr/sbin/invoke-rc.d chef lollerpants")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef lollerpants")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/invoke-rc.d chef lollerpants")
@provider.reload_service()
end
end
diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb
index c5df1e0637..fb751592df 100644
--- a/spec/unit/provider/service/macosx_spec.rb
+++ b/spec/unit/provider/service/macosx_spec.rb
@@ -22,21 +22,21 @@ describe Chef::Provider::Service::Macosx do
describe ".gather_plist_dirs" do
context "when HOME directory is set" do
before do
- ENV.stub(:[]).with('HOME').and_return("/User/someuser")
+ allow(ENV).to receive(:[]).with('HOME').and_return("/User/someuser")
end
it "includes users's LaunchAgents folder" do
- described_class.gather_plist_dirs.should include("#{ENV['HOME']}/Library/LaunchAgents")
+ expect(described_class.gather_plist_dirs).to include("#{ENV['HOME']}/Library/LaunchAgents")
end
end
context "when HOME directory is not set" do
before do
- ENV.stub(:[]).with('HOME').and_return(nil)
+ allow(ENV).to receive(:[]).with('HOME').and_return(nil)
end
it "doesn't include user's LaunchAgents folder" do
- described_class.gather_plist_dirs.should_not include("~/Library/LaunchAgents")
+ expect(described_class.gather_plist_dirs).not_to include("~/Library/LaunchAgents")
end
end
end
@@ -60,20 +60,20 @@ XML
["redis-server", "io.redis.redis-server"].each do |service_name|
before do
- Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], [])
- provider.stub(:shell_out!).
+ allow(Dir).to receive(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], [])
+ allow(provider).to receive(:shell_out!).
with("launchctl list", {:group => 1001, :user => 101}).
and_return(double("Status", :stdout => launchctl_stdout))
- provider.stub(:shell_out).
+ allow(provider).to receive(:shell_out).
with(/launchctl list /,
{:group => nil, :user => nil}).
and_return(double("Status",
:stdout => launchctl_stdout, :exitstatus => 0))
- provider.stub(:shell_out!).
+ allow(provider).to receive(:shell_out!).
with(/plutil -convert xml1 -o/).
and_return(double("Status", :stdout => plutil_stdout))
- File.stub(:stat).and_return(double("stat", :gid => 1001, :uid => 101))
+ allow(File).to receive(:stat).and_return(double("stat", :gid => 1001, :uid => 101))
end
context "#{service_name}" do
@@ -95,26 +95,26 @@ XML
end
before do
- Dir.stub(:glob).and_return([])
- provider.stub(:shell_out!).
+ allow(Dir).to receive(:glob).and_return([])
+ allow(provider).to receive(:shell_out!).
with(/plutil -convert xml1 -o/).
and_raise(Mixlib::ShellOut::ShellCommandFailed)
end
it "works for action :nothing" do
- lambda { run_resource_setup_for_action(:nothing) }.should_not raise_error
+ expect { run_resource_setup_for_action(:nothing) }.not_to raise_error
end
it "works for action :start" do
- lambda { run_resource_setup_for_action(:start) }.should_not raise_error
+ expect { run_resource_setup_for_action(:start) }.not_to raise_error
end
it "errors if action is :enable" do
- lambda { run_resource_setup_for_action(:enable) }.should raise_error(Chef::Exceptions::Service)
+ expect { run_resource_setup_for_action(:enable) }.to raise_error(Chef::Exceptions::Service)
end
it "errors if action is :disable" do
- lambda { run_resource_setup_for_action(:disable) }.should raise_error(Chef::Exceptions::Service)
+ expect { run_resource_setup_for_action(:disable) }.to raise_error(Chef::Exceptions::Service)
end
end
@@ -130,11 +130,11 @@ XML
end
it "sets resource running state to true" do
- provider.current_resource.running.should be_true
+ expect(provider.current_resource.running).to be_truthy
end
it "sets resouce enabled state to true" do
- provider.current_resource.enabled.should be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
end
@@ -146,10 +146,10 @@ XML
SVC_LIST
before do
- Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], [])
+ allow(Dir).to receive(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], [])
end
it "should throw an exception when reload action is attempted" do
- lambda {provider.run_action(:reload)}.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect {provider.run_action(:reload)}.to raise_error(Chef::Exceptions::UnsupportedAction)
end
end
context "when launchctl returns empty service pid" do
@@ -164,11 +164,11 @@ SVC_LIST
end
it "sets resource running state to false" do
- provider.current_resource.running.should be_false
+ expect(provider.current_resource.running).to be_falsey
end
it "sets resouce enabled state to true" do
- provider.current_resource.enabled.should be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
end
@@ -180,65 +180,65 @@ SVC_LIST
it "sets service running state to false" do
provider.load_current_resource
- provider.current_resource.running.should be_false
+ expect(provider.current_resource.running).to be_falsey
end
context "and plist for service is not available" do
before do
- Dir.stub(:glob).and_return([])
+ allow(Dir).to receive(:glob).and_return([])
provider.load_current_resource
end
it "sets resouce enabled state to false" do
- provider.current_resource.enabled.should be_false
+ expect(provider.current_resource.enabled).to be_falsey
end
end
context "and plist for service is available" do
before do
- Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], [])
+ allow(Dir).to receive(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist"], [])
provider.load_current_resource
end
it "sets resouce enabled state to true" do
- provider.current_resource.enabled.should be_true
+ expect(provider.current_resource.enabled).to be_truthy
end
end
describe "and several plists match service name" do
it "throws exception" do
- Dir.stub(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist",
+ allow(Dir).to receive(:glob).and_return(["/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist",
"/Users/wtf/something.plist"])
provider.load_current_resource
provider.define_resource_requirements
- lambda { provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
end
end
describe "#start_service" do
before do
- Chef::Resource::Service.stub(:new).and_return(current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(current_resource)
provider.load_current_resource
- current_resource.stub(:running).and_return(false)
+ allow(current_resource).to receive(:running).and_return(false)
end
it "calls the start command if one is specified and service is not running" do
- new_resource.stub(:start_command).and_return("cowsay dirty")
+ allow(new_resource).to receive(:start_command).and_return("cowsay dirty")
- provider.should_receive(:shell_out_with_systems_locale!).with("cowsay dirty")
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("cowsay dirty")
provider.start_service
end
it "shows warning message if service is already running" do
- current_resource.stub(:running).and_return(true)
- Chef::Log.should_receive(:debug).with("service[#{service_name}] already running, not starting")
+ allow(current_resource).to receive(:running).and_return(true)
+ expect(Chef::Log).to receive(:debug).with("service[#{service_name}] already running, not starting")
provider.start_service
end
it "starts service via launchctl if service found" do
- provider.should_receive(:shell_out_with_systems_locale!).
+ expect(provider).to receive(:shell_out_with_systems_locale!).
with("launchctl load -w '/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist'",
:group => 1001, :user => 101).
and_return(0)
@@ -249,28 +249,28 @@ SVC_LIST
describe "#stop_service" do
before do
- Chef::Resource::Service.stub(:new).and_return(current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(current_resource)
provider.load_current_resource
- current_resource.stub(:running).and_return(true)
+ allow(current_resource).to receive(:running).and_return(true)
end
it "calls the stop command if one is specified and service is running" do
- new_resource.stub(:stop_command).and_return("kill -9 123")
+ allow(new_resource).to receive(:stop_command).and_return("kill -9 123")
- provider.should_receive(:shell_out_with_systems_locale!).with("kill -9 123")
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("kill -9 123")
provider.stop_service
end
it "shows warning message if service is not running" do
- current_resource.stub(:running).and_return(false)
- Chef::Log.should_receive(:debug).with("service[#{service_name}] not running, not stopping")
+ allow(current_resource).to receive(:running).and_return(false)
+ expect(Chef::Log).to receive(:debug).with("service[#{service_name}] not running, not stopping")
provider.stop_service
end
it "stops the service via launchctl if service found" do
- provider.should_receive(:shell_out_with_systems_locale!).
+ expect(provider).to receive(:shell_out_with_systems_locale!).
with("launchctl unload '/Users/igor/Library/LaunchAgents/io.redis.redis-server.plist'",
:group => 1001, :user => 101).
and_return(0)
@@ -281,23 +281,23 @@ SVC_LIST
describe "#restart_service" do
before do
- Chef::Resource::Service.stub(:new).and_return(current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(current_resource)
provider.load_current_resource
- current_resource.stub(:running).and_return(true)
- provider.stub(:sleep)
+ allow(current_resource).to receive(:running).and_return(true)
+ allow(provider).to receive(:sleep)
end
it "issues a command if given" do
- new_resource.stub(:restart_command).and_return("reload that thing")
+ allow(new_resource).to receive(:restart_command).and_return("reload that thing")
- provider.should_receive(:shell_out_with_systems_locale!).with("reload that thing")
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("reload that thing")
provider.restart_service
end
it "stops and then starts service" do
- provider.should_receive(:stop_service)
- provider.should_receive(:start_service);
+ expect(provider).to receive(:stop_service)
+ expect(provider).to receive(:start_service);
provider.restart_service
end
diff --git a/spec/unit/provider/service/redhat_spec.rb b/spec/unit/provider/service/redhat_spec.rb
index 8cc6fb6549..73cfec8a6f 100644
--- a/spec/unit/provider/service/redhat_spec.rb
+++ b/spec/unit/provider/service/redhat_spec.rb
@@ -21,22 +21,22 @@ require 'ostruct'
shared_examples_for "define_resource_requirements_common" do
it "should raise an error if /sbin/chkconfig does not exist" do
- File.stub(:exists?).with("/sbin/chkconfig").and_return(false)
- @provider.stub(:shell_out).with("/sbin/service chef status").and_raise(Errno::ENOENT)
- @provider.stub(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_raise(Errno::ENOENT)
+ allow(File).to receive(:exists?).with("/sbin/chkconfig").and_return(false)
+ allow(@provider).to receive(:shell_out).with("/sbin/service chef status").and_raise(Errno::ENOENT)
+ allow(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_raise(Errno::ENOENT)
@provider.load_current_resource
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should not raise an error if the service exists but is not added to any runlevels" do
status = double("Status", :exitstatus => 0, :stdout => "" , :stderr => "")
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
+ expect(@provider).to receive(:shell_out).with("/sbin/service chef status").and_return(status)
chkconfig = double("Chkconfig", :exitstatus => 0, :stdout => "", :stderr => "service chef supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add chef')")
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
+ expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
@provider.load_current_resource
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
end
@@ -54,8 +54,8 @@ describe "Chef::Provider::Service::Redhat" do
@provider = Chef::Provider::Service::Redhat.new(@new_resource, @run_context)
@provider.action = :start
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- File.stub(:exists?).with("/sbin/chkconfig").and_return(true)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
+ allow(File).to receive(:exists?).with("/sbin/chkconfig").and_return(true)
end
describe "while not in why run mode" do
@@ -66,22 +66,22 @@ describe "Chef::Provider::Service::Redhat" do
describe "load current resource" do
it "sets the current enabled status to true if the service is enabled for any run level" do
status = double("Status", :exitstatus => 0, :stdout => "" , :stderr => "")
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
+ expect(@provider).to receive(:shell_out).with("/sbin/service chef status").and_return(status)
chkconfig = double("Chkconfig", :exitstatus => 0, :stdout => "chef 0:off 1:off 2:off 3:off 4:off 5:on 6:off", :stderr => "")
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
- @provider.instance_variable_get("@service_missing").should be_false
+ expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
+ expect(@provider.instance_variable_get("@service_missing")).to be_falsey
@provider.load_current_resource
- @current_resource.enabled.should be_true
+ expect(@current_resource.enabled).to be_truthy
end
it "sets the current enabled status to false if the regex does not match" do
status = double("Status", :exitstatus => 0, :stdout => "" , :stderr => "")
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
+ expect(@provider).to receive(:shell_out).with("/sbin/service chef status").and_return(status)
chkconfig = double("Chkconfig", :exitstatus => 0, :stdout => "chef 0:off 1:off 2:off 3:off 4:off 5:off 6:off", :stderr => "")
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
- @provider.instance_variable_get("@service_missing").should be_false
- @provider.load_current_resource.should eql(@current_resource)
- @current_resource.enabled.should be_false
+ expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
+ expect(@provider.instance_variable_get("@service_missing")).to be_falsey
+ expect(@provider.load_current_resource).to eql(@current_resource)
+ expect(@current_resource.enabled).to be_falsey
end
end
@@ -91,9 +91,9 @@ describe "Chef::Provider::Service::Redhat" do
context "when the service does not exist" do
before do
status = double("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service")
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
+ expect(@provider).to receive(:shell_out).with("/sbin/service chef status").and_return(status)
chkconfig = double("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory")
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
+ expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
@provider.load_current_resource
@provider.define_resource_requirements
end
@@ -101,14 +101,14 @@ describe "Chef::Provider::Service::Redhat" do
[ "start", "reload", "restart", "enable" ].each do |action|
it "should raise an error when the action is #{action}" do
@provider.action = action
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
[ "stop", "disable" ].each do |action|
it "should not raise an error when the action is #{action}" do
@provider.action = action
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
end
end
@@ -129,26 +129,26 @@ describe "Chef::Provider::Service::Redhat" do
it "should not raise an error if the service does not exist" do
status = double("Status", :exitstatus => 1, :stdout => "", :stderr => "chef: unrecognized service")
- @provider.should_receive(:shell_out).with("/sbin/service chef status").and_return(status)
+ expect(@provider).to receive(:shell_out).with("/sbin/service chef status").and_return(status)
chkconfig = double("Chkconfig", :existatus=> 1, :stdout => "", :stderr => "error reading information on service chef: No such file or directory")
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
+ expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig --list chef", :returns => [0,1]).and_return(chkconfig)
@provider.load_current_resource
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should_not raise_error
+ expect { @provider.process_resource_requirements }.not_to raise_error
end
end
end
describe "enable_service" do
it "should call chkconfig to add 'service_name'" do
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig #{@new_resource.service_name} on")
+ expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig #{@new_resource.service_name} on")
@provider.enable_service
end
end
describe "disable_service" do
it "should call chkconfig to del 'service_name'" do
- @provider.should_receive(:shell_out!).with("/sbin/chkconfig #{@new_resource.service_name} off")
+ expect(@provider).to receive(:shell_out!).with("/sbin/chkconfig #{@new_resource.service_name} off")
@provider.disable_service
end
end
diff --git a/spec/unit/provider/service/simple_service_spec.rb b/spec/unit/provider/service/simple_service_spec.rb
index 11ebf74725..895c559dff 100644
--- a/spec/unit/provider/service/simple_service_spec.rb
+++ b/spec/unit/provider/service/simple_service_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do
@current_resource = Chef::Resource::Service.new("chef")
@provider = Chef::Provider::Service::Simple.new(@new_resource, @run_context)
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@stdout = StringIO.new(<<-NOMOCKINGSTRINGSPLZ)
aj 7842 5057 0 21:26 pts/2 00:00:06 vi init.rb
@@ -37,40 +37,40 @@ aj 7903 5016 0 21:26 pts/5 00:00:00 /bin/bash
aj 8119 6041 0 21:34 pts/3 00:00:03 vi simple_service_spec.rb
NOMOCKINGSTRINGSPLZ
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
end
it "should create a current resource with the name of the new resource" do
- Chef::Resource::Service.should_receive(:new).and_return(@current_resource)
+ expect(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resources service name to the new resources service name" do
- @current_resource.should_receive(:service_name).with(@new_resource.service_name)
+ expect(@current_resource).to receive(:service_name).with(@new_resource.service_name)
@provider.load_current_resource
end
it "should raise error if the node has a nil ps attribute and no other means to get status" do
@node.automatic_attrs[:command] = {:ps => nil}
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should raise error if the node has an empty ps attribute and no other means to get status" do
@node.automatic_attrs[:command] = {:ps => ""}
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
describe "when we have a 'ps' attribute" do
it "should shell_out! the node's ps command" do
- @provider.should_receive(:shell_out!).with(@node[:command][:ps]).and_return(@status)
+ expect(@provider).to receive(:shell_out!).with(@node[:command][:ps]).and_return(@status)
@provider.load_current_resource
end
it "should read stdout of the ps command" do
- @provider.stub(:shell_out!).and_return(@status)
- @stdout.should_receive(:each_line).and_return(true)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+ expect(@stdout).to receive(:each_line).and_return(true)
@provider.load_current_resource
end
@@ -80,75 +80,75 @@ aj 7842 5057 0 21:26 pts/2 00:00:06 chef
aj 7842 5057 0 21:26 pts/2 00:00:06 poos
NOMOCKINGSTRINGSPLZ
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_true
+ expect(@current_resource.running).to be_truthy
end
it "should set running to false if the regex doesn't match" do
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
it "should raise an exception if ps fails" do
- @provider.stub(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ allow(@provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
@provider.action = :start
@provider.load_current_resource
@provider.define_resource_requirements
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
it "should return the current resource" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
describe "when starting the service" do
it "should call the start command if one is specified" do
- @new_resource.stub(:start_command).and_return("#{@new_resource.start_command}")
- @provider.should_receive(:shell_out_with_systems_locale!).with("#{@new_resource.start_command}")
+ allow(@new_resource).to receive(:start_command).and_return("#{@new_resource.start_command}")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("#{@new_resource.start_command}")
@provider.start_service()
end
it "should raise an exception if no start command is specified" do
@provider.define_resource_requirements
@provider.action = :start
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
describe "when stopping a service" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/etc/init.d/themadness stop")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/themadness stop")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/themadness stop")
@provider.stop_service()
end
it "should raise an exception if no stop command is specified" do
@provider.define_resource_requirements
@provider.action = :stop
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
describe Chef::Provider::Service::Simple, "restart_service" do
it "should call the restart command if one has been specified" do
@new_resource.restart_command("/etc/init.d/foo restart")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/etc/init.d/foo restart")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/etc/init.d/foo restart")
@provider.restart_service()
end
it "should raise an exception if the resource doesn't support restart, no restart command is provided, and no stop command is provided" do
@provider.define_resource_requirements
@provider.action = :restart
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
- @provider.should_receive(:stop_service)
- @provider.should_receive(:sleep).with(1)
- @provider.should_receive(:start_service)
+ expect(@provider).to receive(:stop_service)
+ expect(@provider).to receive(:sleep).with(1)
+ expect(@provider).to receive(:start_service)
@provider.restart_service()
end
end
@@ -157,12 +157,12 @@ NOMOCKINGSTRINGSPLZ
it "should raise an exception if reload is requested but no command is specified" do
@provider.define_resource_requirements
@provider.action = :reload
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should should run the user specified reload command if one is specified" do
@new_resource.reload_command("kill -9 1")
- @provider.should_receive(:shell_out_with_systems_locale!).with("kill -9 1")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("kill -9 1")
@provider.reload_service()
end
end
diff --git a/spec/unit/provider/service/solaris_smf_service_spec.rb b/spec/unit/provider/service/solaris_smf_service_spec.rb
index 8df22efa7e..2039408914 100644
--- a/spec/unit/provider/service/solaris_smf_service_spec.rb
+++ b/spec/unit/provider/service/solaris_smf_service_spec.rb
@@ -29,70 +29,70 @@ describe Chef::Provider::Service::Solaris do
@current_resource = Chef::Resource::Service.new('chef')
@provider = Chef::Provider::Service::Solaris.new(@new_resource, @run_context)
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@stdin = StringIO.new
@stdout = StringIO.new
@stderr = StringIO.new
@pid = 2342
@stdout_string = "state disabled"
- @stdout.stub(:gets).and_return(@stdout_string)
+ allow(@stdout).to receive(:gets).and_return(@stdout_string)
@status = double("Status", :exitstatus => 0, :stdout => @stdout)
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
end
it "should raise an error if /bin/svcs does not exist" do
- File.should_receive(:exists?).with("/bin/svcs").and_return(false)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Service)
+ expect(File).to receive(:exists?).with("/bin/svcs").and_return(false)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::Service)
end
describe "on a host with /bin/svcs" do
before do
- File.stub(:exists?).with('/bin/svcs').and_return(true)
+ allow(File).to receive(:exists?).with('/bin/svcs').and_return(true)
end
describe "when discovering the current service state" do
it "should create a current resource with the name of the new resource" do
- @provider.stub(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
- Chef::Resource::Service.should_receive(:new).and_return(@current_resource)
+ allow(@provider).to receive(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
+ expect(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should return the current resource" do
- @provider.stub(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
- @provider.load_current_resource.should eql(@current_resource)
+ allow(@provider).to receive(:shell_out!).with("/bin/svcs -l chef").and_return(@status)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
it "should call '/bin/svcs -l service_name'" do
- @provider.should_receive(:shell_out!).with("/bin/svcs -l chef", {:returns=>[0, 1]}).and_return(@status)
+ expect(@provider).to receive(:shell_out!).with("/bin/svcs -l chef", {:returns=>[0, 1]}).and_return(@status)
@provider.load_current_resource
end
it "should mark service as not running" do
- @provider.stub(:shell_out!).and_return(@status)
- @current_resource.should_receive(:running).with(false)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+ expect(@current_resource).to receive(:running).with(false)
@provider.load_current_resource
end
it "should mark service as running" do
@status = double("Status", :exitstatus => 0, :stdout => 'state online')
- @provider.stub(:shell_out!).and_return(@status)
- @current_resource.should_receive(:running).with(true)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
+ expect(@current_resource).to receive(:running).with(true)
@provider.load_current_resource
end
it "should not mark service as maintenance" do
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @provider.maintenance.should be_false
+ expect(@provider.maintenance).to be_falsey
end
it "should mark service as maintenance" do
@status = double("Status", :exitstatus => 0, :stdout => 'state maintenance')
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @provider.maintenance.should be_true
+ expect(@provider.maintenance).to be_truthy
end
end
@@ -103,30 +103,27 @@ describe Chef::Provider::Service::Solaris do
end
it "should call svcadm enable -s chef" do
- @new_resource.stub(:enable_command).and_return("#{@new_resource.enable_command}")
- @provider.should_not_receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}")
- @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
- @provider.enable_service.should be_true
- @current_resource.enabled.should be_true
+ expect(@provider).not_to receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}")
+ expect(@provider).to receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
+ expect(@provider.enable_service).to be_truthy
+ expect(@current_resource.enabled).to be_truthy
end
it "should call svcadm enable -s chef for start_service" do
- @new_resource.stub(:start_command).and_return("#{@new_resource.start_command}")
- @provider.should_not_receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}")
- @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
- @provider.start_service.should be_true
- @current_resource.enabled.should be_true
+ expect(@provider).not_to receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}")
+ expect(@provider).to receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
+ expect(@provider.start_service).to be_truthy
+ expect(@current_resource.enabled).to be_truthy
end
it "should call svcadm clear chef for start_service when state maintenance" do
@status = double("Status", :exitstatus => 0, :stdout => 'state maintenance')
- @provider.stub(:shell_out!).and_return(@status)
+ allow(@provider).to receive(:shell_out!).and_return(@status)
@provider.load_current_resource
- @new_resource.stub(:enable_command).and_return("#{@new_resource.enable_command}")
- @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}").and_return(@status)
- @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
- @provider.enable_service.should be_true
- @current_resource.enabled.should be_true
+ expect(@provider).to receive(:shell_out!).with("/usr/sbin/svcadm clear #{@current_resource.service_name}").and_return(@status)
+ expect(@provider).to receive(:shell_out!).with("/usr/sbin/svcadm enable -s #{@current_resource.service_name}").and_return(@status)
+ expect(@provider.enable_service).to be_truthy
+ expect(@current_resource.enabled).to be_truthy
end
end
@@ -137,15 +134,15 @@ describe Chef::Provider::Service::Solaris do
end
it "should call svcadm disable -s chef" do
- @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm disable -s chef").and_return(@status)
- @provider.disable_service.should be_true
- @current_resource.enabled.should be_false
+ expect(@provider).to receive(:shell_out!).with("/usr/sbin/svcadm disable -s chef").and_return(@status)
+ expect(@provider.disable_service).to be_truthy
+ expect(@current_resource.enabled).to be_falsey
end
it "should call svcadm disable -s chef for stop_service" do
- @provider.should_receive(:shell_out!).with("/usr/sbin/svcadm disable -s chef").and_return(@status)
- @provider.stop_service.should be_true
- @current_resource.enabled.should be_false
+ expect(@provider).to receive(:shell_out!).with("/usr/sbin/svcadm disable -s chef").and_return(@status)
+ expect(@provider.stop_service).to be_truthy
+ expect(@current_resource.enabled).to be_falsey
end
end
@@ -157,7 +154,7 @@ describe Chef::Provider::Service::Solaris do
end
it "should call svcadm refresh chef" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/usr/sbin/svcadm refresh chef").and_return(@status)
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/usr/sbin/svcadm refresh chef").and_return(@status)
@provider.reload_service
end
@@ -171,15 +168,15 @@ describe Chef::Provider::Service::Solaris do
end
it "should be marked not running" do
- @provider.should_receive(:shell_out!).with("/bin/svcs -l chef", {:returns=>[0, 1]}).and_return(@status)
+ expect(@provider).to receive(:shell_out!).with("/bin/svcs -l chef", {:returns=>[0, 1]}).and_return(@status)
@provider.service_status
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
it "should be marked not enabled" do
- @provider.should_receive(:shell_out!).with("/bin/svcs -l chef", {:returns=>[0, 1]}).and_return(@status)
+ expect(@provider).to receive(:shell_out!).with("/bin/svcs -l chef", {:returns=>[0, 1]}).and_return(@status)
@provider.service_status
- @current_resource.enabled.should be_false
+ expect(@current_resource.enabled).to be_falsey
end
end
diff --git a/spec/unit/provider/service/systemd_service_spec.rb b/spec/unit/provider/service/systemd_service_spec.rb
index 7358f63b5e..90b669a459 100644
--- a/spec/unit/provider/service/systemd_service_spec.rb
+++ b/spec/unit/provider/service/systemd_service_spec.rb
@@ -19,238 +19,261 @@
require 'spec_helper'
describe Chef::Provider::Service::Systemd do
+
+ let(:node) { Chef::Node.new }
+
+ let(:events) { Chef::EventDispatch::Dispatcher.new }
+
+ let(:run_context) { Chef::RunContext.new(node, {}, events) }
+
+ let(:service_name) { "rsyslog.service" }
+
+ let(:new_resource) { Chef::Resource::Service.new(service_name) }
+
+ let(:provider) { Chef::Provider::Service::Systemd.new(new_resource, run_context) }
+
+ let(:shell_out_success) do
+ double('shell_out_with_systems_locale', :exitstatus => 0, :error? => false)
+ end
+
+ let(:shell_out_failure) do
+ double('shell_out_with_systems_locale', :exitstatus => 1, :error? => true)
+ end
+
+ let(:current_resource) { Chef::Resource::Service.new(service_name) }
+
before(:each) do
- @node = Chef::Node.new
- @events = Chef::EventDispatch::Dispatcher.new
- @run_context = Chef::RunContext.new(@node, {}, @events)
- @new_resource = Chef::Resource::Service.new('rsyslog.service')
- @provider = Chef::Provider::Service::Systemd.new(@new_resource, @run_context)
-
- @shell_out_success = double('shell_out_with_systems_locale',
- :exitstatus => 0, :error? => false)
- @shell_out_failure = double('shell_out_with_systems_locale',
- :exitstatus => 1, :error? => true)
+ allow(Chef::Resource::Service).to receive(:new).with(service_name).and_return(current_resource)
end
describe "load_current_resource" do
- before(:each) do
- @current_resource = Chef::Resource::Service.new('rsyslog.service')
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- @provider.stub(:is_active?).and_return(false)
- @provider.stub(:is_enabled?).and_return(false)
+ before(:each) do
+ allow(provider).to receive(:is_active?).and_return(false)
+ allow(provider).to receive(:is_enabled?).and_return(false)
end
it "should create a current resource with the name of the new resource" do
- Chef::Resource::Service.should_receive(:new).and_return(@current_resource)
- @provider.load_current_resource
+ expect(Chef::Resource::Service).to receive(:new).with(new_resource.name).and_return(current_resource)
+ provider.load_current_resource
end
it "should set the current resources service name to the new resources service name" do
- @current_resource.should_receive(:service_name).with(@new_resource.service_name)
- @provider.load_current_resource
+ provider.load_current_resource
+ expect(current_resource.service_name).to eql(service_name)
end
it "should check if the service is running" do
- @provider.should_receive(:is_active?)
- @provider.load_current_resource
+ expect(provider).to receive(:is_active?)
+ provider.load_current_resource
end
it "should set running to true if the service is running" do
- @provider.stub(:is_active?).and_return(true)
- @current_resource.should_receive(:running).with(true)
- @provider.load_current_resource
+ allow(provider).to receive(:is_active?).and_return(true)
+ provider.load_current_resource
+ expect(current_resource.running).to be true
end
it "should set running to false if the service is not running" do
- @provider.stub(:is_active?).and_return(false)
- @current_resource.should_receive(:running).with(false)
- @provider.load_current_resource
+ allow(provider).to receive(:is_active?).and_return(false)
+ provider.load_current_resource
+ expect(current_resource.running).to be false
end
describe "when a status command has been specified" do
before do
- @new_resource.stub(:status_command).and_return("/bin/chefhasmonkeypants status")
+ allow(new_resource).to receive(:status_command).and_return("/bin/chefhasmonkeypants status")
end
it "should run the services status command if one has been specified" do
- @provider.stub(:shell_out).and_return(@shell_out_success)
- @current_resource.should_receive(:running).with(true)
- @provider.load_current_resource
+ allow(provider).to receive(:shell_out).and_return(shell_out_success)
+ provider.load_current_resource
+ expect(current_resource.running).to be true
end
it "should run the services status command if one has been specified and properly set status check state" do
- @provider.stub(:shell_out).with("/bin/chefhasmonkeypants status").and_return(@shell_out_success)
- @provider.load_current_resource
- @provider.instance_variable_get("@status_check_success").should be_true
+ allow(provider).to receive(:shell_out).with("/bin/chefhasmonkeypants status").and_return(shell_out_success)
+ provider.load_current_resource
+ expect(provider.status_check_success).to be true
end
it "should set running to false if a status command fails" do
- @provider.stub(:shell_out).and_return(@shell_out_failure)
- @current_resource.should_receive(:running).with(false)
- @provider.load_current_resource
+ allow(provider).to receive(:shell_out).and_return(shell_out_failure)
+ provider.load_current_resource
+ expect(current_resource.running).to be false
end
it "should update state to indicate status check failed when a status command fails" do
- @provider.stub(:shell_out).and_return(@shell_out_failure)
- @provider.load_current_resource
- @provider.instance_variable_get("@status_check_success").should be_false
+ allow(provider).to receive(:shell_out).and_return(shell_out_failure)
+ provider.load_current_resource
+ expect(provider.status_check_success).to be false
end
end
it "should check if the service is enabled" do
- @provider.should_receive(:is_enabled?)
- @provider.load_current_resource
+ expect(provider).to receive(:is_enabled?)
+ provider.load_current_resource
end
it "should set enabled to true if the service is enabled" do
- @provider.stub(:is_enabled?).and_return(true)
- @current_resource.should_receive(:enabled).with(true)
- @provider.load_current_resource
+ allow(provider).to receive(:is_enabled?).and_return(true)
+ provider.load_current_resource
+ expect(current_resource.enabled).to be true
end
it "should set enabled to false if the service is not enabled" do
- @provider.stub(:is_enabled?).and_return(false)
- @current_resource.should_receive(:enabled).with(false)
- @provider.load_current_resource
+ allow(provider).to receive(:is_enabled?).and_return(false)
+ provider.load_current_resource
+ expect(current_resource.enabled).to be false
end
it "should return the current resource" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(provider.load_current_resource).to eql(current_resource)
end
end
- describe "start and stop service" do
- before(:each) do
- @current_resource = Chef::Resource::Service.new('rsyslog.service')
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- @provider.current_resource = @current_resource
- end
+ def setup_current_resource
+ provider.current_resource = current_resource
+ current_resource.service_name(service_name)
+ end
- it "should call the start command if one is specified" do
- @new_resource.stub(:start_command).and_return("/sbin/rsyslog startyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog startyousillysally")
- @provider.start_service
- end
+ %w{/usr/bin/systemctl /bin/systemctl}.each do |systemctl_path|
+ describe "when systemctl path is #{systemctl_path}" do
+ before(:each) do
+ setup_current_resource
+ allow(provider).to receive(:which).with("systemctl").and_return(systemctl_path)
+ end
- it "should call '/bin/systemctl start service_name' if no start command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/bin/systemctl start #{@new_resource.service_name}").and_return(@shell_out_success)
- @provider.start_service
- end
+ describe "start and stop service" do
- it "should not call '/bin/systemctl start service_name' if it is already running" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_not_receive(:shell_out_with_systems_locale!).with("/bin/systemctl start #{@new_resource.service_name}")
- @provider.start_service
- end
+ it "should call the start command if one is specified" do
+ allow(new_resource).to receive(:start_command).and_return("/sbin/rsyslog startyousillysally")
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog startyousillysally")
+ provider.start_service
+ end
- it "should call the restart command if one is specified" do
- @current_resource.stub(:running).and_return(true)
- @new_resource.stub(:restart_command).and_return("/sbin/rsyslog restartyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog restartyousillysally")
- @provider.restart_service
- end
+ it "should call '#{systemctl_path} start service_name' if no start command is specified" do
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("#{systemctl_path} start #{service_name}").and_return(shell_out_success)
+ provider.start_service
+ end
- it "should call '/bin/systemctl restart service_name' if no restart command is specified" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:shell_out_with_systems_locale!).with("/bin/systemctl restart #{@new_resource.service_name}").and_return(@shell_out_success)
- @provider.restart_service
- end
+ it "should not call '#{systemctl_path} start service_name' if it is already running" do
+ current_resource.running(true)
+ expect(provider).not_to receive(:shell_out_with_systems_locale!).with("#{systemctl_path} start #{service_name}")
+ provider.start_service
+ end
- describe "reload service" do
- context "when a reload command is specified" do
- it "should call the reload command" do
- @current_resource.stub(:running).and_return(true)
- @new_resource.stub(:reload_command).and_return("/sbin/rsyslog reloadyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog reloadyousillysally")
- @provider.reload_service
+ it "should call the restart command if one is specified" do
+ current_resource.running(true)
+ allow(new_resource).to receive(:restart_command).and_return("/sbin/rsyslog restartyousillysally")
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog restartyousillysally")
+ provider.restart_service
end
- end
- context "when a reload command is not specified" do
- it "should call '/bin/systemctl reload service_name' if the service is running" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:shell_out_with_systems_locale!).with("/bin/systemctl reload #{@new_resource.service_name}").and_return(@shell_out_success)
- @provider.reload_service
+ it "should call '#{systemctl_path} restart service_name' if no restart command is specified" do
+ current_resource.running(true)
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("#{systemctl_path} restart #{service_name}").and_return(shell_out_success)
+ provider.restart_service
end
- it "should start the service if the service is not running" do
- @current_resource.stub(:running).and_return(false)
- @provider.should_receive(:start_service).and_return(true)
- @provider.reload_service
+ describe "reload service" do
+ context "when a reload command is specified" do
+ it "should call the reload command" do
+ current_resource.running(true)
+ allow(new_resource).to receive(:reload_command).and_return("/sbin/rsyslog reloadyousillysally")
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog reloadyousillysally")
+ provider.reload_service
+ end
+ end
+
+ context "when a reload command is not specified" do
+ it "should call '#{systemctl_path} reload service_name' if the service is running" do
+ current_resource.running(true)
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("#{systemctl_path} reload #{service_name}").and_return(shell_out_success)
+ provider.reload_service
+ end
+
+ it "should start the service if the service is not running" do
+ current_resource.running(false)
+ expect(provider).to receive(:start_service).and_return(true)
+ provider.reload_service
+ end
+ end
end
- end
- end
- it "should call the stop command if one is specified" do
- @current_resource.stub(:running).and_return(true)
- @new_resource.stub(:stop_command).and_return("/sbin/rsyslog stopyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog stopyousillysally")
- @provider.stop_service
- end
+ it "should call the stop command if one is specified" do
+ current_resource.running(true)
+ allow(new_resource).to receive(:stop_command).and_return("/sbin/rsyslog stopyousillysally")
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog stopyousillysally")
+ provider.stop_service
+ end
- it "should call '/bin/systemctl stop service_name' if no stop command is specified" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:shell_out_with_systems_locale!).with("/bin/systemctl stop #{@new_resource.service_name}").and_return(@shell_out_success)
- @provider.stop_service
- end
+ it "should call '#{systemctl_path} stop service_name' if no stop command is specified" do
+ current_resource.running(true)
+ expect(provider).to receive(:shell_out_with_systems_locale!).with("#{systemctl_path} stop #{service_name}").and_return(shell_out_success)
+ provider.stop_service
+ end
- it "should not call '/bin/systemctl stop service_name' if it is already stopped" do
- @current_resource.stub(:running).and_return(false)
- @provider.should_not_receive(:shell_out_with_systems_locale!).with("/bin/systemctl stop #{@new_resource.service_name}")
- @provider.stop_service
- end
- end
+ it "should not call '#{systemctl_path} stop service_name' if it is already stopped" do
+ current_resource.running(false)
+ expect(provider).not_to receive(:shell_out_with_systems_locale!).with("#{systemctl_path} stop #{service_name}")
+ provider.stop_service
+ end
+ end
- describe "enable and disable service" do
- before(:each) do
- @current_resource = Chef::Resource::Service.new('rsyslog.service')
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- @provider.current_resource = @current_resource
- end
+ describe "enable and disable service" do
+ before(:each) do
+ provider.current_resource = current_resource
+ current_resource.service_name(service_name)
+ allow(provider).to receive(:which).with("systemctl").and_return("#{systemctl_path}")
+ end
- it "should call '/bin/systemctl enable service_name' to enable the service" do
- @provider.should_receive(:shell_out!).with("/bin/systemctl enable #{@new_resource.service_name}").and_return(@shell_out_success)
- @provider.enable_service
- end
+ it "should call '#{systemctl_path} enable service_name' to enable the service" do
+ expect(provider).to receive(:shell_out!).with("#{systemctl_path} enable #{service_name}").and_return(shell_out_success)
+ provider.enable_service
+ end
- it "should call '/bin/systemctl disable service_name' to disable the service" do
- @provider.should_receive(:shell_out!).with("/bin/systemctl disable #{@new_resource.service_name}").and_return(@shell_out_success)
- @provider.disable_service
- end
- end
+ it "should call '#{systemctl_path} disable service_name' to disable the service" do
+ expect(provider).to receive(:shell_out!).with("#{systemctl_path} disable #{service_name}").and_return(shell_out_success)
+ provider.disable_service
+ end
+ end
- describe "is_active?" do
- before(:each) do
- @current_resource = Chef::Resource::Service.new('rsyslog.service')
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- end
+ describe "is_active?" do
+ before(:each) do
+ provider.current_resource = current_resource
+ current_resource.service_name(service_name)
+ allow(provider).to receive(:which).with("systemctl").and_return("#{systemctl_path}")
+ end
- it "should return true if '/bin/systemctl is-active service_name' returns 0" do
- @provider.should_receive(:shell_out).with('/bin/systemctl is-active rsyslog.service --quiet').and_return(@shell_out_success)
- @provider.is_active?.should be_true
- end
+ it "should return true if '#{systemctl_path} is-active service_name' returns 0" do
+ expect(provider).to receive(:shell_out).with("#{systemctl_path} is-active #{service_name} --quiet").and_return(shell_out_success)
+ expect(provider.is_active?).to be true
+ end
- it "should return false if '/bin/systemctl is-active service_name' returns anything except 0" do
- @provider.should_receive(:shell_out).with('/bin/systemctl is-active rsyslog.service --quiet').and_return(@shell_out_failure)
- @provider.is_active?.should be_false
- end
- end
+ it "should return false if '#{systemctl_path} is-active service_name' returns anything except 0" do
+ expect(provider).to receive(:shell_out).with("#{systemctl_path} is-active #{service_name} --quiet").and_return(shell_out_failure)
+ expect(provider.is_active?).to be false
+ end
+ end
- describe "is_enabled?" do
- before(:each) do
- @current_resource = Chef::Resource::Service.new('rsyslog.service')
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
- end
+ describe "is_enabled?" do
+ before(:each) do
+ provider.current_resource = current_resource
+ current_resource.service_name(service_name)
+ allow(provider).to receive(:which).with("systemctl").and_return("#{systemctl_path}")
+ end
- it "should return true if '/bin/systemctl is-enabled service_name' returns 0" do
- @provider.should_receive(:shell_out).with('/bin/systemctl is-enabled rsyslog.service --quiet').and_return(@shell_out_success)
- @provider.is_enabled?.should be_true
- end
+ it "should return true if '#{systemctl_path} is-enabled service_name' returns 0" do
+ expect(provider).to receive(:shell_out).with("#{systemctl_path} is-enabled #{service_name} --quiet").and_return(shell_out_success)
+ expect(provider.is_enabled?).to be true
+ end
- it "should return false if '/bin/systemctl is-enabled service_name' returns anything except 0" do
- @provider.should_receive(:shell_out).with('/bin/systemctl is-enabled rsyslog.service --quiet').and_return(@shell_out_failure)
- @provider.is_enabled?.should be_false
+ it "should return false if '#{systemctl_path} is-enabled service_name' returns anything except 0" do
+ expect(provider).to receive(:shell_out).with("#{systemctl_path} is-enabled #{service_name} --quiet").and_return(shell_out_failure)
+ expect(provider.is_enabled?).to be false
+ end
+ end
end
end
end
diff --git a/spec/unit/provider/service/upstart_service_spec.rb b/spec/unit/provider/service/upstart_service_spec.rb
index 499a794ff4..ca7ce8f930 100644
--- a/spec/unit/provider/service/upstart_service_spec.rb
+++ b/spec/unit/provider/service/upstart_service_spec.rb
@@ -41,22 +41,22 @@ describe Chef::Provider::Service::Upstart do
@node.automatic_attrs[:platform_version] = '9.04'
#Chef::Platform.stub(:find_platform_and_version).and_return([ "ubuntu", "9.04" ])
@provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
- @provider.instance_variable_get(:@upstart_job_dir).should == "/etc/event.d"
- @provider.instance_variable_get(:@upstart_conf_suffix).should == ""
+ expect(@provider.instance_variable_get(:@upstart_job_dir)).to eq("/etc/event.d")
+ expect(@provider.instance_variable_get(:@upstart_conf_suffix)).to eq("")
end
it "should return /etc/init as the upstart job directory when running on Ubuntu 9.10" do
@node.automatic_attrs[:platform_version] = '9.10'
@provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
- @provider.instance_variable_get(:@upstart_job_dir).should == "/etc/init"
- @provider.instance_variable_get(:@upstart_conf_suffix).should == ".conf"
+ expect(@provider.instance_variable_get(:@upstart_job_dir)).to eq("/etc/init")
+ expect(@provider.instance_variable_get(:@upstart_conf_suffix)).to eq(".conf")
end
it "should return /etc/init as the upstart job directory by default" do
@node.automatic_attrs[:platform_version] = '9000'
@provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
- @provider.instance_variable_get(:@upstart_job_dir).should == "/etc/init"
- @provider.instance_variable_get(:@upstart_conf_suffix).should == ".conf"
+ expect(@provider.instance_variable_get(:@upstart_job_dir)).to eq("/etc/init")
+ expect(@provider.instance_variable_get(:@upstart_conf_suffix)).to eq(".conf")
end
end
@@ -65,26 +65,26 @@ describe Chef::Provider::Service::Upstart do
@node.automatic_attrs[:command] = {:ps => "ps -ax"}
@current_resource = Chef::Resource::Service.new("rsyslog")
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@status = double("Status", :exitstatus => 0)
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@stdin = StringIO.new
@stdout = StringIO.new
@stderr = StringIO.new
@pid = double("PID")
- ::File.stub(:exists?).and_return(true)
- ::File.stub(:open).and_return(true)
+ allow(::File).to receive(:exists?).and_return(true)
+ allow(::File).to receive(:open).and_return(true)
end
it "should create a current resource with the name of the new resource" do
- Chef::Resource::Service.should_receive(:new).and_return(@current_resource)
+ expect(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@provider.load_current_resource
end
it "should set the current resources service name to the new resources service name" do
- @current_resource.should_receive(:service_name).with(@new_resource.service_name)
+ expect(@current_resource).to receive(:service_name).with(@new_resource.service_name)
@provider.load_current_resource
end
@@ -92,11 +92,11 @@ describe Chef::Provider::Service::Upstart do
@new_resource.parameters({ "OSD_ID" => "2" })
@provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @new_resource.service_name.should == @current_resource.service_name
+ expect(@new_resource.service_name).to eq(@current_resource.service_name)
end
it "should run '/sbin/status rsyslog'" do
- @provider.should_receive(:popen4).with("/sbin/status rsyslog").and_return(@status)
+ expect(@provider).to receive(:popen4).with("/sbin/status rsyslog").and_return(@status)
@provider.load_current_resource
end
@@ -106,99 +106,99 @@ describe Chef::Provider::Service::Upstart do
it "should set running to true if the status command returns 0" do
@stdout = StringIO.new("rsyslog start/running")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_true
+ expect(@current_resource.running).to be_truthy
end
it "should set running to false if the status command returns anything except 0" do
@stdout = StringIO.new("rsyslog stop/waiting")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
end
describe "when the status command uses the old format" do
it "should set running to true if the status command returns 0" do
@stdout = StringIO.new("rsyslog (start) running, process 32225")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_true
+ expect(@current_resource.running).to be_truthy
end
it "should set running to false if the status command returns anything except 0" do
@stdout = StringIO.new("rsyslog (stop) waiting")
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
- @current_resource.running.should be_false
+ expect(@current_resource.running).to be_falsey
end
end
it "should set running to false if it catches a Chef::Exceptions::Exec" do
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec)
- @current_resource.should_receive(:running).with(false)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_raise(Chef::Exceptions::Exec)
+ expect(@current_resource).to receive(:running).with(false)
@provider.load_current_resource
end
it "should set enabled to true when it finds 'starts on'" do
@lines = double("start on filesystem", :gets => "start on filesystem")
- ::File.stub(:open).and_yield(@lines)
- @current_resource.should_receive(:running).with(false)
+ allow(::File).to receive(:open).and_yield(@lines)
+ expect(@current_resource).to receive(:running).with(false)
@provider.load_current_resource
end
it "should set enabled to false when it finds '#starts on'" do
@lines = double("start on filesystem", :gets => "#start on filesystem")
- ::File.stub(:open).and_yield(@lines)
- @current_resource.should_receive(:running).with(false)
+ allow(::File).to receive(:open).and_yield(@lines)
+ expect(@current_resource).to receive(:running).with(false)
@provider.load_current_resource
end
it "should assume disable when no job configuration file is found" do
- ::File.stub(:exists?).and_return(false)
- @current_resource.should_receive(:running).with(false)
+ allow(::File).to receive(:exists?).and_return(false)
+ expect(@current_resource).to receive(:running).with(false)
@provider.load_current_resource
end
it "should track state when the upstart configuration file fails to load" do
- File.should_receive(:exists?).and_return false
+ expect(File).to receive(:exists?).and_return false
@provider.load_current_resource
- @provider.instance_variable_get("@config_file_found").should == false
+ expect(@provider.instance_variable_get("@config_file_found")).to eq(false)
end
describe "when a status command has been specified" do
before do
- @new_resource.stub(:status_command).and_return("/bin/chefhasmonkeypants status")
+ allow(@new_resource).to receive(:status_command).and_return("/bin/chefhasmonkeypants status")
end
it "should run the services status command if one has been specified" do
- @provider.stub(:shell_out!).with("/bin/chefhasmonkeypants status").and_return(0)
- @current_resource.should_receive(:running).with(true)
+ allow(@provider).to receive(:shell_out!).with("/bin/chefhasmonkeypants status").and_return(0)
+ expect(@current_resource).to receive(:running).with(true)
@provider.load_current_resource
end
it "should track state when the user-provided status command fails" do
- @provider.stub(:shell_out!).and_raise(Errno::ENOENT)
+ allow(@provider).to receive(:shell_out!).and_raise(Errno::ENOENT)
@provider.load_current_resource
- @provider.instance_variable_get("@command_success").should == false
+ expect(@provider.instance_variable_get("@command_success")).to eq(false)
end
it "should set running to false if it catches a Chef::Exceptions::Exec when using a status command" do
- @provider.stub(:shell_out!).and_raise(Errno::ENOENT)
- @current_resource.should_receive(:running).with(false)
+ allow(@provider).to receive(:shell_out!).and_raise(Errno::ENOENT)
+ expect(@current_resource).to receive(:running).with(false)
@provider.load_current_resource
end
end
it "should track state when we fail to obtain service status via upstart_state" do
- @provider.should_receive(:upstart_state).and_raise Chef::Exceptions::Exec
+ expect(@provider).to receive(:upstart_state).and_raise Chef::Exceptions::Exec
@provider.load_current_resource
- @provider.instance_variable_get("@command_success").should == false
+ expect(@provider.instance_variable_get("@command_success")).to eq(false)
end
it "should return the current resource" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
end
@@ -206,26 +206,26 @@ describe Chef::Provider::Service::Upstart do
describe "enable and disable service" do
before(:each) do
@current_resource = Chef::Resource::Service.new('rsyslog')
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@provider.current_resource = @current_resource
- Chef::Util::FileEdit.stub(:new)
+ allow(Chef::Util::FileEdit).to receive(:new)
end
it "should enable the service if it is not enabled" do
@file = Object.new
- Chef::Util::FileEdit.stub(:new).and_return(@file)
- @current_resource.stub(:enabled).and_return(false)
- @file.should_receive(:search_file_replace)
- @file.should_receive(:write_file)
+ allow(Chef::Util::FileEdit).to receive(:new).and_return(@file)
+ allow(@current_resource).to receive(:enabled).and_return(false)
+ expect(@file).to receive(:search_file_replace)
+ expect(@file).to receive(:write_file)
@provider.enable_service()
end
it "should disable the service if it is enabled" do
@file = Object.new
- Chef::Util::FileEdit.stub(:new).and_return(@file)
- @current_resource.stub(:enabled).and_return(true)
- @file.should_receive(:search_file_replace)
- @file.should_receive(:write_file)
+ allow(Chef::Util::FileEdit).to receive(:new).and_return(@file)
+ allow(@current_resource).to receive(:enabled).and_return(true)
+ expect(@file).to receive(:search_file_replace)
+ expect(@file).to receive(:write_file)
@provider.disable_service()
end
@@ -235,24 +235,24 @@ describe Chef::Provider::Service::Upstart do
before(:each) do
@current_resource = Chef::Resource::Service.new('rsyslog')
- Chef::Resource::Service.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::Service).to receive(:new).and_return(@current_resource)
@provider.current_resource = @current_resource
end
it "should call the start command if one is specified" do
- @new_resource.stub(:start_command).and_return("/sbin/rsyslog startyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog startyousillysally")
+ allow(@new_resource).to receive(:start_command).and_return("/sbin/rsyslog startyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog startyousillysally")
@provider.start_service()
end
it "should call '/sbin/start service_name' if no start command is specified" do
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/start #{@new_resource.service_name}").and_return(0)
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/start #{@new_resource.service_name}").and_return(0)
@provider.start_service()
end
it "should not call '/sbin/start service_name' if it is already running" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_not_receive(:shell_out_with_systems_locale!)
+ allow(@current_resource).to receive(:running).and_return(true)
+ expect(@provider).not_to receive(:shell_out_with_systems_locale!)
@provider.start_service()
end
@@ -261,58 +261,58 @@ describe Chef::Provider::Service::Upstart do
@new_resource.parameters({ "OSD_ID" => "2" })
@provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/start rsyslog OSD_ID=2").and_return(0)
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/start rsyslog OSD_ID=2").and_return(0)
@provider.start_service()
end
it "should call the restart command if one is specified" do
- @current_resource.stub(:running).and_return(true)
- @new_resource.stub(:restart_command).and_return("/sbin/rsyslog restartyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog restartyousillysally")
+ allow(@current_resource).to receive(:running).and_return(true)
+ allow(@new_resource).to receive(:restart_command).and_return("/sbin/rsyslog restartyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog restartyousillysally")
@provider.restart_service()
end
it "should call '/sbin/restart service_name' if no restart command is specified" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/restart #{@new_resource.service_name}").and_return(0)
+ allow(@current_resource).to receive(:running).and_return(true)
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/restart #{@new_resource.service_name}").and_return(0)
@provider.restart_service()
end
it "should call '/sbin/start service_name' if restart_service is called for a stopped service" do
- @current_resource.stub(:running).and_return(false)
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/start #{@new_resource.service_name}").and_return(0)
+ allow(@current_resource).to receive(:running).and_return(false)
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/start #{@new_resource.service_name}").and_return(0)
@provider.restart_service()
end
it "should call the reload command if one is specified" do
- @current_resource.stub(:running).and_return(true)
- @new_resource.stub(:reload_command).and_return("/sbin/rsyslog reloadyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog reloadyousillysally")
+ allow(@current_resource).to receive(:running).and_return(true)
+ allow(@new_resource).to receive(:reload_command).and_return("/sbin/rsyslog reloadyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog reloadyousillysally")
@provider.reload_service()
end
it "should call '/sbin/reload service_name' if no reload command is specified" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/reload #{@new_resource.service_name}").and_return(0)
+ allow(@current_resource).to receive(:running).and_return(true)
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/reload #{@new_resource.service_name}").and_return(0)
@provider.reload_service()
end
it "should call the stop command if one is specified" do
- @current_resource.stub(:running).and_return(true)
- @new_resource.stub(:stop_command).and_return("/sbin/rsyslog stopyousillysally")
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog stopyousillysally")
+ allow(@current_resource).to receive(:running).and_return(true)
+ allow(@new_resource).to receive(:stop_command).and_return("/sbin/rsyslog stopyousillysally")
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/rsyslog stopyousillysally")
@provider.stop_service()
end
it "should call '/sbin/stop service_name' if no stop command is specified" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:shell_out_with_systems_locale!).with("/sbin/stop #{@new_resource.service_name}").and_return(0)
+ allow(@current_resource).to receive(:running).and_return(true)
+ expect(@provider).to receive(:shell_out_with_systems_locale!).with("/sbin/stop #{@new_resource.service_name}").and_return(0)
@provider.stop_service()
end
it "should not call '/sbin/stop service_name' if it is already stopped" do
- @current_resource.stub(:running).and_return(false)
- @provider.should_not_receive(:shell_out_with_systems_locale!).with("/sbin/stop #{@new_resource.service_name}")
+ allow(@current_resource).to receive(:running).and_return(false)
+ expect(@provider).not_to receive(:shell_out_with_systems_locale!).with("/sbin/stop #{@new_resource.service_name}")
@provider.stop_service()
end
end
diff --git a/spec/unit/provider/service/windows_spec.rb b/spec/unit/provider/service/windows_spec.rb
index 14bdb782cd..e4b0714d22 100644
--- a/spec/unit/provider/service/windows_spec.rb
+++ b/spec/unit/provider/service/windows_spec.rb
@@ -33,102 +33,102 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
Win32::Service::AUTO_START = 0x00000002
Win32::Service::DEMAND_START = 0x00000003
Win32::Service::DISABLED = 0x00000004
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "running"))
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "auto start"))
- Win32::Service.stub(:exists?).and_return(true)
+ allow(Win32::Service).to receive(:exists?).and_return(true)
end
it "should set the current resources service name to the new resources service name" do
@provider.load_current_resource
- @provider.current_resource.service_name.should == 'chef'
+ expect(@provider.current_resource.service_name).to eq('chef')
end
it "should return the current resource" do
- @provider.load_current_resource.should equal(@provider.current_resource)
+ expect(@provider.load_current_resource).to equal(@provider.current_resource)
end
it "should set the current resources status" do
@provider.load_current_resource
- @provider.current_resource.running.should be_true
+ expect(@provider.current_resource.running).to be_truthy
end
it "should set the current resources start type" do
@provider.load_current_resource
- @provider.current_resource.enabled.should be_true
+ expect(@provider.current_resource.enabled).to be_truthy
end
it "does not set the current resources start type if it is neither AUTO START or DISABLED" do
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "manual"))
@provider.load_current_resource
- @provider.current_resource.enabled.should be_nil
+ expect(@provider.current_resource.enabled).to be_nil
end
describe Chef::Provider::Service::Windows, "start_service" do
before(:each) do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "stopped"),
double("StatusStruct", :current_state => "running"))
end
it "should call the start command if one is specified" do
@new_resource.start_command "sc start chef"
- @provider.should_receive(:shell_out!).with("#{@new_resource.start_command}").and_return("Starting custom service")
+ expect(@provider).to receive(:shell_out!).with("#{@new_resource.start_command}").and_return("Starting custom service")
@provider.start_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should use the built-in command if no start command is specified" do
- Win32::Service.should_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).to receive(:start).with(@new_resource.service_name)
@provider.start_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should do nothing if the service does not exist" do
- Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false)
- Win32::Service.should_not_receive(:start).with(@new_resource.service_name)
+ allow(Win32::Service).to receive(:exists?).with(@new_resource.service_name).and_return(false)
+ expect(Win32::Service).not_to receive(:start).with(@new_resource.service_name)
@provider.start_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should do nothing if the service is running" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "running"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:start).with(@new_resource.service_name)
@provider.start_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should raise an error if the service is paused" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "paused"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:start).with(@new_resource.service_name)
expect { @provider.start_service }.to raise_error( Chef::Exceptions::Service )
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should wait and continue if the service is in start_pending" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "start pending"),
double("StatusStruct", :current_state => "start pending"),
double("StatusStruct", :current_state => "running"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:start).with(@new_resource.service_name)
@provider.start_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should fail if the service is in stop_pending" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "stop pending"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:start).with(@new_resource.service_name)
expect { @provider.start_service }.to raise_error( Chef::Exceptions::Service )
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
end
@@ -137,78 +137,78 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
describe Chef::Provider::Service::Windows, "stop_service" do
before(:each) do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "running"),
double("StatusStruct", :current_state => "stopped"))
end
it "should call the stop command if one is specified" do
@new_resource.stop_command "sc stop chef"
- @provider.should_receive(:shell_out!).with("#{@new_resource.stop_command}").and_return("Stopping custom service")
+ expect(@provider).to receive(:shell_out!).with("#{@new_resource.stop_command}").and_return("Stopping custom service")
@provider.stop_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should use the built-in command if no stop command is specified" do
- Win32::Service.should_receive(:stop).with(@new_resource.service_name)
+ expect(Win32::Service).to receive(:stop).with(@new_resource.service_name)
@provider.stop_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should do nothing if the service does not exist" do
- Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false)
- Win32::Service.should_not_receive(:stop).with(@new_resource.service_name)
+ allow(Win32::Service).to receive(:exists?).with(@new_resource.service_name).and_return(false)
+ expect(Win32::Service).not_to receive(:stop).with(@new_resource.service_name)
@provider.stop_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should do nothing if the service is stopped" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "stopped"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:stop).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:stop).with(@new_resource.service_name)
@provider.stop_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should raise an error if the service is paused" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "paused"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:start).with(@new_resource.service_name)
expect { @provider.stop_service }.to raise_error( Chef::Exceptions::Service )
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should wait and continue if the service is in stop_pending" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "stop pending"),
double("StatusStruct", :current_state => "stop pending"),
double("StatusStruct", :current_state => "stopped"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:stop).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:stop).with(@new_resource.service_name)
@provider.stop_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should fail if the service is in start_pending" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "start pending"))
@provider.load_current_resource
- Win32::Service.should_not_receive(:stop).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:stop).with(@new_resource.service_name)
expect { @provider.stop_service }.to raise_error( Chef::Exceptions::Service )
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
it "should pass custom timeout to the stop command if provided" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "running"))
@new_resource.timeout 1
- Win32::Service.should_receive(:stop).with(@new_resource.service_name)
+ expect(Win32::Service).to receive(:stop).with(@new_resource.service_name)
Timeout.timeout(2) do
expect { @provider.stop_service }.to raise_error(Timeout::Error)
end
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
end
@@ -217,112 +217,112 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
it "should call the restart command if one is specified" do
@new_resource.restart_command "sc restart"
- @provider.should_receive(:shell_out!).with("#{@new_resource.restart_command}")
+ expect(@provider).to receive(:shell_out!).with("#{@new_resource.restart_command}")
@provider.restart_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should stop then start the service if it is running" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "running"),
double("StatusStruct", :current_state => "stopped"),
double("StatusStruct", :current_state => "stopped"),
double("StatusStruct", :current_state => "running"))
- Win32::Service.should_receive(:stop).with(@new_resource.service_name)
- Win32::Service.should_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).to receive(:stop).with(@new_resource.service_name)
+ expect(Win32::Service).to receive(:start).with(@new_resource.service_name)
@provider.restart_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should just start the service if it is stopped" do
- Win32::Service.stub(:status).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:status).with(@new_resource.service_name).and_return(
double("StatusStruct", :current_state => "stopped"),
double("StatusStruct", :current_state => "stopped"),
double("StatusStruct", :current_state => "running"))
- Win32::Service.should_receive(:start).with(@new_resource.service_name)
+ expect(Win32::Service).to receive(:start).with(@new_resource.service_name)
@provider.restart_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should do nothing if the service does not exist" do
- Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false)
- Win32::Service.should_not_receive(:stop).with(@new_resource.service_name)
- Win32::Service.should_not_receive(:start).with(@new_resource.service_name)
+ allow(Win32::Service).to receive(:exists?).with(@new_resource.service_name).and_return(false)
+ expect(Win32::Service).not_to receive(:stop).with(@new_resource.service_name)
+ expect(Win32::Service).not_to receive(:start).with(@new_resource.service_name)
@provider.restart_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
end
describe Chef::Provider::Service::Windows, "enable_service" do
before(:each) do
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "disabled"))
end
it "should enable service" do
- Win32::Service.should_receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::AUTO_START)
+ expect(Win32::Service).to receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::AUTO_START)
@provider.enable_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should do nothing if the service does not exist" do
- Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false)
- Win32::Service.should_not_receive(:configure)
+ allow(Win32::Service).to receive(:exists?).with(@new_resource.service_name).and_return(false)
+ expect(Win32::Service).not_to receive(:configure)
@provider.enable_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
end
describe Chef::Provider::Service::Windows, "action_enable" do
it "does nothing if the service is enabled" do
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "auto start"))
- @provider.should_not_receive(:enable_service)
+ expect(@provider).not_to receive(:enable_service)
@provider.action_enable
end
it "enables the service if it is not set to automatic start" do
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "disabled"))
- @provider.should_receive(:enable_service)
+ expect(@provider).to receive(:enable_service)
@provider.action_enable
end
end
describe Chef::Provider::Service::Windows, "action_disable" do
it "does nothing if the service is disabled" do
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "disabled"))
- @provider.should_not_receive(:disable_service)
+ expect(@provider).not_to receive(:disable_service)
@provider.action_disable
end
it "disables the service if it is not set to disabled" do
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "auto start"))
- @provider.should_receive(:disable_service)
+ expect(@provider).to receive(:disable_service)
@provider.action_disable
end
end
describe Chef::Provider::Service::Windows, "disable_service" do
before(:each) do
- Win32::Service.stub(:config_info).with(@new_resource.service_name).and_return(
+ allow(Win32::Service).to receive(:config_info).with(@new_resource.service_name).and_return(
double("ConfigStruct", :start_type => "auto start"))
end
it "should disable service" do
- Win32::Service.should_receive(:configure)
+ expect(Win32::Service).to receive(:configure)
@provider.disable_service
- @new_resource.updated_by_last_action?.should be_true
+ expect(@new_resource.updated_by_last_action?).to be_truthy
end
it "should do nothing if the service does not exist" do
- Win32::Service.stub(:exists?).with(@new_resource.service_name).and_return(false)
- Win32::Service.should_not_receive(:configure)
+ allow(Win32::Service).to receive(:exists?).with(@new_resource.service_name).and_return(false)
+ expect(Win32::Service).not_to receive(:configure)
@provider.disable_service
- @new_resource.updated_by_last_action?.should be_false
+ expect(@new_resource.updated_by_last_action?).to be_falsey
end
end
@@ -330,15 +330,15 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
{ :automatic => "auto start", :manual => "demand start", :disabled => "disabled" }.each do |type,win32|
it "sets the startup type to #{type} if it is something else" do
@new_resource.startup_type(type)
- @provider.stub(:current_start_type).and_return("fire")
- @provider.should_receive(:set_startup_type).with(type)
+ allow(@provider).to receive(:current_start_type).and_return("fire")
+ expect(@provider).to receive(:set_startup_type).with(type)
@provider.action_configure_startup
end
it "leaves the startup type as #{type} if it is already set" do
@new_resource.startup_type(type)
- @provider.stub(:current_start_type).and_return(win32)
- @provider.should_not_receive(:set_startup_type).with(type)
+ allow(@provider).to receive(:current_start_type).and_return(win32)
+ expect(@provider).not_to receive(:set_startup_type).with(type)
@provider.action_configure_startup
end
end
@@ -346,17 +346,17 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
describe Chef::Provider::Service::Windows, "set_start_type" do
it "when called with :automatic it calls Win32::Service#configure with Win32::Service::AUTO_START" do
- Win32::Service.should_receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::AUTO_START)
+ expect(Win32::Service).to receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::AUTO_START)
@provider.send(:set_startup_type, :automatic)
end
it "when called with :manual it calls Win32::Service#configure with Win32::Service::DEMAND_START" do
- Win32::Service.should_receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::DEMAND_START)
+ expect(Win32::Service).to receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::DEMAND_START)
@provider.send(:set_startup_type, :manual)
end
it "when called with :disabled it calls Win32::Service#configure with Win32::Service::DISABLED" do
- Win32::Service.should_receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::DISABLED)
+ expect(Win32::Service).to receive(:configure).with(:service_name => @new_resource.service_name, :start_type => Win32::Service::DISABLED)
@provider.send(:set_startup_type, :disabled)
end
diff --git a/spec/unit/provider/service_spec.rb b/spec/unit/provider/service_spec.rb
index 7ddc01ff0b..17bade55b6 100644
--- a/spec/unit/provider/service_spec.rb
+++ b/spec/unit/provider/service_spec.rb
@@ -28,73 +28,73 @@ describe Chef::Provider::Service do
@provider = Chef::Provider::Service.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
end
describe "when enabling the service" do
it "should enable the service if disabled and set the resource as updated" do
@current_resource.enabled(false)
- @provider.should_receive(:enable_service).and_return(true)
+ expect(@provider).to receive(:enable_service).and_return(true)
@provider.action_enable
@provider.set_updated_status
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
it "should not enable the service if already enabled" do
@current_resource.enabled(true)
- @provider.should_not_receive(:enable_service)
+ expect(@provider).not_to receive(:enable_service)
@provider.action_enable
@provider.set_updated_status
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
end
describe "when disabling the service" do
it "should disable the service if enabled and set the resource as updated" do
- @current_resource.stub(:enabled).and_return(true)
- @provider.should_receive(:disable_service).and_return(true)
+ allow(@current_resource).to receive(:enabled).and_return(true)
+ expect(@provider).to receive(:disable_service).and_return(true)
@provider.run_action(:disable)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
it "should not disable the service if already disabled" do
- @current_resource.stub(:enabled).and_return(false)
- @provider.should_not_receive(:disable_service)
+ allow(@current_resource).to receive(:enabled).and_return(false)
+ expect(@provider).not_to receive(:disable_service)
@provider.run_action(:disable)
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
end
describe "action_start" do
it "should start the service if it isn't running and set the resource as updated" do
@current_resource.running(false)
- @provider.should_receive(:start_service).with.and_return(true)
+ expect(@provider).to receive(:start_service).with(no_args).and_return(true)
@provider.run_action(:start)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
it "should not start the service if already running" do
@current_resource.running(true)
- @provider.should_not_receive(:start_service)
+ expect(@provider).not_to receive(:start_service)
@provider.run_action(:start)
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
end
describe "action_stop" do
it "should stop the service if it is running and set the resource as updated" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:stop_service).and_return(true)
+ allow(@current_resource).to receive(:running).and_return(true)
+ expect(@provider).to receive(:stop_service).and_return(true)
@provider.run_action(:stop)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
it "should not stop the service if it's already stopped" do
- @current_resource.stub(:running).and_return(false)
- @provider.should_not_receive(:stop_service)
+ allow(@current_resource).to receive(:running).and_return(false)
+ expect(@provider).not_to receive(:stop_service)
@provider.run_action(:stop)
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
end
@@ -104,16 +104,16 @@ describe Chef::Provider::Service do
end
it "should restart the service if it's supported and set the resource as updated" do
- @provider.should_receive(:restart_service).and_return(true)
+ expect(@provider).to receive(:restart_service).and_return(true)
@provider.run_action(:restart)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
it "should restart the service even if it isn't running and set the resource as updated" do
- @current_resource.stub(:running).and_return(false)
- @provider.should_receive(:restart_service).and_return(true)
+ allow(@current_resource).to receive(:running).and_return(false)
+ expect(@provider).to receive(:restart_service).and_return(true)
@provider.run_action(:restart)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
end
@@ -124,46 +124,46 @@ describe Chef::Provider::Service do
it "should raise an exception if reload isn't supported" do
@new_resource.supports(:reload => false)
- @new_resource.stub(:reload_command).and_return(false)
- lambda { @provider.run_action(:reload) }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ allow(@new_resource).to receive(:reload_command).and_return(false)
+ expect { @provider.run_action(:reload) }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "should reload the service if it is running and set the resource as updated" do
- @current_resource.stub(:running).and_return(true)
- @provider.should_receive(:reload_service).and_return(true)
+ allow(@current_resource).to receive(:running).and_return(true)
+ expect(@provider).to receive(:reload_service).and_return(true)
@provider.run_action(:reload)
- @provider.new_resource.should be_updated
+ expect(@provider.new_resource).to be_updated
end
it "should not reload the service if it's stopped" do
- @current_resource.stub(:running).and_return(false)
- @provider.should_not_receive(:reload_service)
+ allow(@current_resource).to receive(:running).and_return(false)
+ expect(@provider).not_to receive(:reload_service)
@provider.run_action(:stop)
- @provider.new_resource.should_not be_updated
+ expect(@provider.new_resource).not_to be_updated
end
end
it "delegates enable_service to subclasses" do
- lambda { @provider.enable_service }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.enable_service }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "delegates disable_service to subclasses" do
- lambda { @provider.disable_service }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.disable_service }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "delegates start_service to subclasses" do
- lambda { @provider.start_service }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.start_service }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "delegates stop_service to subclasses" do
- lambda { @provider.stop_service }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.stop_service }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "delegates restart_service to subclasses" do
- lambda { @provider.restart_service }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.restart_service }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
it "delegates reload_service to subclasses" do
- lambda { @provider.reload_service }.should raise_error(Chef::Exceptions::UnsupportedAction)
+ expect { @provider.reload_service }.to raise_error(Chef::Exceptions::UnsupportedAction)
end
end
diff --git a/spec/unit/provider/subversion_spec.rb b/spec/unit/provider/subversion_spec.rb
index 5d9d1cec1e..b372f0df7a 100644
--- a/spec/unit/provider/subversion_spec.rb
+++ b/spec/unit/provider/subversion_spec.rb
@@ -34,9 +34,9 @@ describe Chef::Provider::Subversion do
end
it "converts resource attributes to options for run_command and popen4" do
- @provider.run_options.should == {}
+ expect(@provider.run_options).to eq({})
@resource.user 'deployninja'
- @provider.run_options.should == {:user => "deployninja"}
+ expect(@provider.run_options).to eq({:user => "deployninja"})
end
context "determining the revision of the currently deployed code" do
@@ -48,8 +48,8 @@ describe Chef::Provider::Subversion do
end
it "sets the revision to nil if there isn't any deployed code yet" do
- ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").and_return(false)
- @provider.find_current_revision.should be_nil
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(false)
+ expect(@provider.find_current_revision).to be_nil
end
it "determines the current revision if there's a checkout with svn data available" do
@@ -62,47 +62,47 @@ describe Chef::Provider::Subversion do
"Last Changed Author: codeninja\n" +
"Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision
"Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n"
- ::File.should_receive(:exist?).at_least(1).times.with("/my/deploy/dir/.svn").and_return(true)
- ::File.should_receive(:directory?).with("/my/deploy/dir").and_return(true)
- ::Dir.should_receive(:chdir).with("/my/deploy/dir").and_yield
- @stdout.stub(:string).and_return(example_svn_info)
- @stderr.stub(:string).and_return("")
- @exitstatus.stub(:exitstatus).and_return(0)
+ expect(::File).to receive(:exist?).at_least(1).times.with("/my/deploy/dir/.svn").and_return(true)
+ expect(::File).to receive(:directory?).with("/my/deploy/dir").and_return(true)
+ expect(::Dir).to receive(:chdir).with("/my/deploy/dir").and_yield
+ allow(@stdout).to receive(:string).and_return(example_svn_info)
+ allow(@stderr).to receive(:string).and_return("")
+ allow(@exitstatus).to receive(:exitstatus).and_return(0)
expected_command = ["svn info", {:cwd=>"/my/deploy/dir"}]
- @provider.should_receive(:popen4).with(*expected_command).
+ expect(@provider).to receive(:popen4).with(*expected_command).
and_yield("no-pid", "no-stdin", @stdout,@stderr).
and_return(@exitstatus)
- @provider.find_current_revision.should eql("11410")
+ expect(@provider.find_current_revision).to eql("11410")
end
it "gives nil as the current revision if the deploy dir isn't a SVN working copy" do
example_svn_info = "svn: '/tmp/deploydir' is not a working copy\n"
- ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
- ::File.should_receive(:directory?).with("/my/deploy/dir").and_return(true)
- ::Dir.should_receive(:chdir).with("/my/deploy/dir").and_yield
- @stdout.stub(:string).and_return(example_svn_info)
- @stderr.stub(:string).and_return("")
- @exitstatus.stub(:exitstatus).and_return(1)
- @provider.should_receive(:popen4).and_yield("no-pid", "no-stdin", @stdout,@stderr).
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
+ expect(::File).to receive(:directory?).with("/my/deploy/dir").and_return(true)
+ expect(::Dir).to receive(:chdir).with("/my/deploy/dir").and_yield
+ allow(@stdout).to receive(:string).and_return(example_svn_info)
+ allow(@stderr).to receive(:string).and_return("")
+ allow(@exitstatus).to receive(:exitstatus).and_return(1)
+ expect(@provider).to receive(:popen4).and_yield("no-pid", "no-stdin", @stdout,@stderr).
and_return(@exitstatus)
- @provider.find_current_revision.should be_nil
+ expect(@provider.find_current_revision).to be_nil
end
it "finds the current revision when loading the current resource state" do
# note: the test is kinda janky, but it provides regression coverage for CHEF-2092
@resource.instance_variable_set(:@action, :sync)
- @provider.should_receive(:find_current_revision).and_return("12345")
+ expect(@provider).to receive(:find_current_revision).and_return("12345")
@provider.load_current_resource
- @provider.current_resource.revision.should == "12345"
+ expect(@provider.current_resource.revision).to eq("12345")
end
end
it "creates the current_resource object and sets its revision to the current deployment's revision as long as we're not exporting" do
- @provider.stub(:find_current_revision).and_return("11410")
+ allow(@provider).to receive(:find_current_revision).and_return("11410")
@provider.new_resource.instance_variable_set :@action, [:checkout]
@provider.load_current_resource
- @provider.current_resource.name.should eql(@resource.name)
- @provider.current_resource.revision.should eql("11410")
+ expect(@provider.current_resource.name).to eql(@resource.name)
+ expect(@provider.current_resource.revision).to eql("11410")
end
context "resolving revisions to an integer" do
@@ -114,7 +114,7 @@ describe Chef::Provider::Subversion do
end
it "returns the revision number as is if it's already an integer" do
- @provider.revision_int.should eql("12345")
+ expect(@provider.revision_int).to eql("12345")
end
it "queries the server and resolves the revision if it's not an integer (i.e. 'HEAD')" do
@@ -128,153 +128,153 @@ describe Chef::Provider::Subversion do
"Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision
"Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n"
exitstatus = double("exitstatus")
- exitstatus.stub(:exitstatus).and_return(0)
+ allow(exitstatus).to receive(:exitstatus).and_return(0)
@resource.revision "HEAD"
- @stdout.stub(:string).and_return(example_svn_info)
- @stderr.stub(:string).and_return("")
+ allow(@stdout).to receive(:string).and_return(example_svn_info)
+ allow(@stderr).to receive(:string).and_return("")
expected_command = ["svn info http://svn.example.org/trunk/ --no-auth-cache -rHEAD", {:cwd=>Dir.tmpdir}]
- @provider.should_receive(:popen4).with(*expected_command).
+ expect(@provider).to receive(:popen4).with(*expected_command).
and_yield("no-pid","no-stdin",@stdout,@stderr).
and_return(exitstatus)
- @provider.revision_int.should eql("11410")
+ expect(@provider.revision_int).to eql("11410")
end
it "returns a helpful message if data from `svn info` can't be parsed" do
example_svn_info = "some random text from an error message\n"
exitstatus = double("exitstatus")
- exitstatus.stub(:exitstatus).and_return(0)
+ allow(exitstatus).to receive(:exitstatus).and_return(0)
@resource.revision "HEAD"
- @stdout.stub(:string).and_return(example_svn_info)
- @stderr.stub(:string).and_return("")
- @provider.should_receive(:popen4).and_yield("no-pid","no-stdin",@stdout,@stderr).
+ allow(@stdout).to receive(:string).and_return(example_svn_info)
+ allow(@stderr).to receive(:string).and_return("")
+ expect(@provider).to receive(:popen4).and_yield("no-pid","no-stdin",@stdout,@stderr).
and_return(exitstatus)
- lambda {@provider.revision_int}.should raise_error(RuntimeError, "Could not parse `svn info` data: some random text from an error message")
+ expect {@provider.revision_int}.to raise_error(RuntimeError, "Could not parse `svn info` data: some random text from an error message")
end
it "responds to :revision_slug as an alias for revision_sha" do
- @provider.should respond_to(:revision_slug)
+ expect(@provider).to respond_to(:revision_slug)
end
end
it "generates a checkout command with default options" do
- @provider.checkout_command.should eql("svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
+ expect(@provider.checkout_command).to eql("svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
end
it "generates a checkout command with authentication" do
@resource.svn_username "deployNinja"
@resource.svn_password "vanish!"
- @provider.checkout_command.should eql("svn checkout -q --username deployNinja --password vanish! " +
+ expect(@provider.checkout_command).to eql("svn checkout -q --username deployNinja --password vanish! " +
"-r12345 http://svn.example.org/trunk/ /my/deploy/dir")
end
it "generates a checkout command with arbitrary options" do
@resource.svn_arguments "--no-auth-cache"
- @provider.checkout_command.should eql("svn checkout --no-auth-cache -q -r12345 "+
+ expect(@provider.checkout_command).to eql("svn checkout --no-auth-cache -q -r12345 "+
"http://svn.example.org/trunk/ /my/deploy/dir")
end
it "generates a sync command with default options" do
- @provider.sync_command.should eql("svn update -q -r12345 /my/deploy/dir")
+ expect(@provider.sync_command).to eql("svn update -q -r12345 /my/deploy/dir")
end
it "generates an export command with default options" do
- @provider.export_command.should eql("svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
+ expect(@provider.export_command).to eql("svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
end
it "doesn't try to find the current revision when loading the resource if running an export" do
@provider.new_resource.instance_variable_set :@action, [:export]
- @provider.should_not_receive(:find_current_revision)
+ expect(@provider).not_to receive(:find_current_revision)
@provider.load_current_resource
end
it "doesn't try to find the current revision when loading the resource if running a force export" do
@provider.new_resource.instance_variable_set :@action, [:force_export]
- @provider.should_not_receive(:find_current_revision)
+ expect(@provider).not_to receive(:find_current_revision)
@provider.load_current_resource
end
it "runs an export with the --force option" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:shell_out!).with(command: expected_cmd)
+ expect(@provider).to receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:force_export)
- @resource.should be_updated
+ expect(@resource).to be_updated
end
it "runs the checkout command for action_checkout" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:shell_out!).with(command: expected_cmd)
+ expect(@provider).to receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:checkout)
- @resource.should be_updated
+ expect(@resource).to be_updated
end
it "raises an error if the svn checkout command would fail because the enclosing directory doesn't exist" do
- lambda {@provider.run_action(:sync)}.should raise_error(Chef::Exceptions::MissingParentDirectory)
+ expect {@provider.run_action(:sync)}.to raise_error(Chef::Exceptions::MissingParentDirectory)
end
it "should not checkout if the destination exists or is a non empty directory" do
- ::File.stub(:exist?).with("/my/deploy/dir/.svn").and_return(false)
- ::File.stub(:exist?).with("/my/deploy/dir").and_return(true)
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::Dir.stub(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar'])
- @provider.should_not_receive(:checkout_command)
+ allow(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(false)
+ allow(::File).to receive(:exist?).with("/my/deploy/dir").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ allow(::Dir).to receive(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar'])
+ expect(@provider).not_to receive(:checkout_command)
@provider.run_action(:checkout)
- @resource.should_not be_updated
+ expect(@resource).not_to be_updated
end
it "runs commands with the user and group specified in the resource" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
@resource.user "whois"
@resource.group "thisis"
expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:shell_out!).with(command: expected_cmd, user: "whois", group: "thisis")
+ expect(@provider).to receive(:shell_out!).with(command: expected_cmd, user: "whois", group: "thisis")
@provider.run_action(:checkout)
- @resource.should be_updated
+ expect(@resource).to be_updated
end
it "does a checkout for action_sync if there's no deploy dir" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").twice.and_return(false)
- @provider.should_receive(:action_checkout)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").twice.and_return(false)
+ expect(@provider).to receive(:action_checkout)
@provider.run_action(:sync)
end
it "does a checkout for action_sync if the deploy dir exists but is empty" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").twice.and_return(false)
- @provider.should_receive(:action_checkout)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").twice.and_return(false)
+ expect(@provider).to receive(:action_checkout)
@provider.run_action(:sync)
end
it "runs the sync_command on action_sync if the deploy dir exists and isn't empty" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
- @provider.stub(:find_current_revision).and_return("11410")
- @provider.stub(:current_revision_matches_target_revision?).and_return(false)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
+ allow(@provider).to receive(:find_current_revision).and_return("11410")
+ allow(@provider).to receive(:current_revision_matches_target_revision?).and_return(false)
expected_cmd = "svn update -q -r12345 /my/deploy/dir"
- @provider.should_receive(:shell_out!).with(command: expected_cmd)
+ expect(@provider).to receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:sync)
- @resource.should be_updated
+ expect(@resource).to be_updated
end
it "does not fetch any updates if the remote revision matches the current revision" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
- ::File.should_receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
- @provider.stub(:find_current_revision).and_return('12345')
- @provider.stub(:current_revision_matches_target_revision?).and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
+ expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
+ allow(@provider).to receive(:find_current_revision).and_return('12345')
+ allow(@provider).to receive(:current_revision_matches_target_revision?).and_return(true)
@provider.run_action(:sync)
- @resource.should_not be_updated
+ expect(@resource).not_to be_updated
end
it "runs the export_command on action_export" do
- ::File.stub(:directory?).with("/my/deploy").and_return(true)
+ allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:shell_out!).with(command: expected_cmd)
+ expect(@provider).to receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:export)
- @resource.should be_updated
+ expect(@resource).to be_updated
end
end
diff --git a/spec/unit/provider/template/content_spec.rb b/spec/unit/provider/template/content_spec.rb
index b419e70519..4b88a3aea5 100644
--- a/spec/unit/provider/template/content_spec.rb
+++ b/spec/unit/provider/template/content_spec.rb
@@ -54,25 +54,25 @@ describe Chef::Provider::Template::Content do
end
it "finds the template file in the cookbook cache if it isn't local" do
- content.template_location.should == CHEF_SPEC_DATA + '/cookbooks/openldap/templates/default/openldap_stuff.conf.erb'
+ expect(content.template_location).to eq(CHEF_SPEC_DATA + '/cookbooks/openldap/templates/default/openldap_stuff.conf.erb')
end
it "finds the template file locally if it is local" do
- new_resource.stub(:local).and_return(true)
- new_resource.stub(:source).and_return('/tmp/its_on_disk.erb')
- content.template_location.should == '/tmp/its_on_disk.erb'
+ allow(new_resource).to receive(:local).and_return(true)
+ allow(new_resource).to receive(:source).and_return('/tmp/its_on_disk.erb')
+ expect(content.template_location).to eq('/tmp/its_on_disk.erb')
end
it "should use the cookbook name if defined in the template resource" do
- new_resource.stub(:cookbook_name).and_return('apache2')
- new_resource.stub(:cookbook).and_return('openldap')
- new_resource.stub(:source).and_return("test.erb")
- content.template_location.should == CHEF_SPEC_DATA + '/cookbooks/openldap/templates/default/test.erb'
+ allow(new_resource).to receive(:cookbook_name).and_return('apache2')
+ allow(new_resource).to receive(:cookbook).and_return('openldap')
+ allow(new_resource).to receive(:source).and_return("test.erb")
+ expect(content.template_location).to eq(CHEF_SPEC_DATA + '/cookbooks/openldap/templates/default/test.erb')
end
it "creates the template with the rendered content" do
run_context.node.normal[:slappiness] = "a warm gun"
- IO.read(content.tempfile.path).should == "slappiness is a warm gun"
+ expect(IO.read(content.tempfile.path)).to eq("slappiness is a warm gun")
end
end
diff --git a/spec/unit/provider/template_spec.rb b/spec/unit/provider/template_spec.rb
index 514bdc12ff..713303d818 100644
--- a/spec/unit/provider/template_spec.rb
+++ b/spec/unit/provider/template_spec.rb
@@ -39,7 +39,7 @@ describe Chef::Provider::Template do
let(:provider) do
provider = described_class.new(resource, run_context)
- provider.stub(:content).and_return(content)
+ allow(provider).to receive(:content).and_return(content)
provider
end
@@ -51,7 +51,7 @@ describe Chef::Provider::Template do
let(:content) do
content = double('Chef::Provider::File::Content::Template', :template_location => "/foo/bar/baz")
- File.stub(:exists?).with("/foo/bar/baz").and_return(true)
+ allow(File).to receive(:exists?).with("/foo/bar/baz").and_return(true)
content
end
@@ -73,15 +73,15 @@ describe Chef::Provider::Template do
let(:provider) do
provider = described_class.new(resource, run_context)
- provider.stub(:content).and_return(content)
+ allow(provider).to receive(:content).and_return(content)
provider
end
it "stops executing when the local template source can't be found" do
setup_normal_file
- content.stub(:template_location).and_return("/baz/bar/foo")
- File.stub(:exists?).with("/baz/bar/foo").and_return(false)
- lambda { provider.run_action(:create) }.should raise_error Chef::Mixin::WhyRun::ResourceRequirements::Assertion::AssertionFailure
+ allow(content).to receive(:template_location).and_return("/baz/bar/foo")
+ allow(File).to receive(:exists?).with("/baz/bar/foo").and_return(false)
+ expect { provider.run_action(:create) }.to raise_error Chef::Mixin::WhyRun::ResourceRequirements::Assertion::AssertionFailure
end
end
diff --git a/spec/unit/provider/user/dscl_spec.rb b/spec/unit/provider/user/dscl_spec.rb
index c17aefb00d..24691cce33 100644
--- a/spec/unit/provider/user/dscl_spec.rb
+++ b/spec/unit/provider/user/dscl_spec.rb
@@ -24,12 +24,12 @@ require 'mixlib/shellout'
describe Chef::Provider::User::Dscl do
before do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
end
let(:node) {
node = Chef::Node.new
- node.stub(:[]).with(:platform_version).and_return(mac_version)
- node.stub(:[]).with(:platform).and_return("mac_os_x")
+ allow(node).to receive(:[]).with(:platform_version).and_return(mac_version)
+ allow(node).to receive(:[]).with(:platform).and_return("mac_os_x")
node
}
@@ -115,38 +115,38 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
describe "when shelling out to dscl" do
it "should run dscl with the supplied cmd /Path args" do
shell_return = ShellCmdResult.new('stdout', 'err', 0)
- provider.should_receive(:shell_out).with("dscl . -cmd /Path args").and_return(shell_return)
- provider.run_dscl("cmd /Path args").should == 'stdout'
+ expect(provider).to receive(:shell_out).with("dscl . -cmd /Path args").and_return(shell_return)
+ expect(provider.run_dscl("cmd /Path args")).to eq('stdout')
end
it "returns an empty string from delete commands" do
shell_return = ShellCmdResult.new('out', 'err', 23)
- provider.should_receive(:shell_out).with("dscl . -delete /Path args").and_return(shell_return)
- provider.run_dscl("delete /Path args").should == ""
+ expect(provider).to receive(:shell_out).with("dscl . -delete /Path args").and_return(shell_return)
+ expect(provider.run_dscl("delete /Path args")).to eq("")
end
it "should raise an exception for any other command" do
shell_return = ShellCmdResult.new('out', 'err', 23)
- provider.should_receive(:shell_out).with('dscl . -cmd /Path arguments').and_return(shell_return)
- lambda { provider.run_dscl("cmd /Path arguments") }.should raise_error(Chef::Exceptions::DsclCommandFailed)
+ expect(provider).to receive(:shell_out).with('dscl . -cmd /Path arguments').and_return(shell_return)
+ expect { provider.run_dscl("cmd /Path arguments") }.to raise_error(Chef::Exceptions::DsclCommandFailed)
end
it "raises an exception when dscl reports 'no such key'" do
shell_return = ShellCmdResult.new("No such key: ", 'err', 23)
- provider.should_receive(:shell_out).with('dscl . -cmd /Path args').and_return(shell_return)
- lambda { provider.run_dscl("cmd /Path args") }.should raise_error(Chef::Exceptions::DsclCommandFailed)
+ expect(provider).to receive(:shell_out).with('dscl . -cmd /Path args').and_return(shell_return)
+ expect { provider.run_dscl("cmd /Path args") }.to raise_error(Chef::Exceptions::DsclCommandFailed)
end
it "raises an exception when dscl reports 'eDSRecordNotFound'" do
shell_return = ShellCmdResult.new("<dscl_cmd> DS Error: -14136 (eDSRecordNotFound)", 'err', -14136)
- provider.should_receive(:shell_out).with('dscl . -cmd /Path args').and_return(shell_return)
- lambda { provider.run_dscl("cmd /Path args") }.should raise_error(Chef::Exceptions::DsclCommandFailed)
+ expect(provider).to receive(:shell_out).with('dscl . -cmd /Path args').and_return(shell_return)
+ expect { provider.run_dscl("cmd /Path args") }.to raise_error(Chef::Exceptions::DsclCommandFailed)
end
end
describe "get_free_uid" do
before do
- provider.should_receive(:run_dscl).with("list /Users uid").and_return("\nwheel 200\nstaff 201\nbrahms 500\nchopin 501\n")
+ expect(provider).to receive(:run_dscl).with("list /Users uid").and_return("\nwheel 200\nstaff 201\nbrahms 500\nchopin 501\n")
end
describe "when resource is configured as system" do
@@ -155,59 +155,59 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
end
it "should return the first unused uid number on or above 500" do
- provider.get_free_uid.should eq(202)
+ expect(provider.get_free_uid).to eq(202)
end
end
it "should return the first unused uid number on or above 200" do
- provider.get_free_uid.should eq(502)
+ expect(provider.get_free_uid).to eq(502)
end
it "should raise an exception when the search limit is exhausted" do
search_limit = 1
- lambda { provider.get_free_uid(search_limit) }.should raise_error(RuntimeError)
+ expect { provider.get_free_uid(search_limit) }.to raise_error(RuntimeError)
end
end
describe "uid_used?" do
it "should return false if not given any valid uid number" do
- provider.uid_used?(nil).should be_false
+ expect(provider.uid_used?(nil)).to be_falsey
end
describe "when called with a user id" do
before do
- provider.should_receive(:run_dscl).with("list /Users uid").and_return("\naj 500\n")
+ expect(provider).to receive(:run_dscl).with("list /Users uid").and_return("\naj 500\n")
end
it "should return true for a used uid number" do
- provider.uid_used?(500).should be_true
+ expect(provider.uid_used?(500)).to be_truthy
end
it "should return false for an unused uid number" do
- provider.uid_used?(501).should be_false
+ expect(provider.uid_used?(501)).to be_falsey
end
end
end
describe "when determining the uid to set" do
it "raises RequestedUIDUnavailable if the requested uid is already in use" do
- provider.stub(:uid_used?).and_return(true)
- provider.should_receive(:get_free_uid).and_return(501)
- lambda { provider.dscl_set_uid }.should raise_error(Chef::Exceptions::RequestedUIDUnavailable)
+ allow(provider).to receive(:uid_used?).and_return(true)
+ expect(provider).to receive(:get_free_uid).and_return(501)
+ expect { provider.dscl_set_uid }.to raise_error(Chef::Exceptions::RequestedUIDUnavailable)
end
it "finds a valid, unused uid when none is specified" do
- provider.should_receive(:run_dscl).with("list /Users uid").and_return('')
- provider.should_receive(:run_dscl).with("create /Users/toor UniqueID 501")
- provider.should_receive(:get_free_uid).and_return(501)
+ expect(provider).to receive(:run_dscl).with("list /Users uid").and_return('')
+ expect(provider).to receive(:run_dscl).with("create /Users/toor UniqueID 501")
+ expect(provider).to receive(:get_free_uid).and_return(501)
provider.dscl_set_uid
- new_resource.uid.should eq(501)
+ expect(new_resource.uid).to eq(501)
end
it "sets the uid specified in the resource" do
new_resource.uid(1000)
- provider.should_receive(:run_dscl).with("create /Users/toor UniqueID 1000").and_return(true)
- provider.should_receive(:run_dscl).with("list /Users uid").and_return('')
+ expect(provider).to receive(:run_dscl).with("create /Users/toor UniqueID 1000").and_return(true)
+ expect(provider).to receive(:run_dscl).with("list /Users uid").and_return('')
provider.dscl_set_uid
end
end
@@ -226,14 +226,14 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "deletes the home directory when resource#home is nil" do
new_resource.instance_variable_set(:@home, nil)
- provider.should_receive(:run_dscl).with("delete /Users/toor NFSHomeDirectory").and_return(true)
+ expect(provider).to receive(:run_dscl).with("delete /Users/toor NFSHomeDirectory").and_return(true)
provider.dscl_set_home
end
it "raises InvalidHomeDirectory when the resource's home directory doesn't look right" do
new_resource.home('epic-fail')
- lambda { provider.dscl_set_home }.should raise_error(Chef::Exceptions::InvalidHomeDirectory)
+ expect { provider.dscl_set_home }.to raise_error(Chef::Exceptions::InvalidHomeDirectory)
end
it "moves the users home to the new location if it exists and the target location is different" do
@@ -243,34 +243,34 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
current_home_files = [current_home + '/my-dot-emacs', current_home + '/my-dot-vim']
current_resource.home(current_home)
new_resource.gid(23)
- ::File.stub(:exists?).with('/old/home/toor').and_return(true)
- ::File.stub(:exists?).with('/Users/toor').and_return(true)
+ allow(::File).to receive(:exists?).with('/old/home/toor').and_return(true)
+ allow(::File).to receive(:exists?).with('/Users/toor').and_return(true)
- FileUtils.should_receive(:mkdir_p).with('/Users/toor').and_return(true)
- FileUtils.should_receive(:rmdir).with(current_home)
- ::Dir.should_receive(:glob).with("#{CHEF_SPEC_DATA}/old_home_dir/*",::File::FNM_DOTMATCH).and_return(current_home_files)
- FileUtils.should_receive(:mv).with(current_home_files, "/Users/toor", :force => true)
- FileUtils.should_receive(:chown_R).with('toor','23','/Users/toor')
+ expect(FileUtils).to receive(:mkdir_p).with('/Users/toor').and_return(true)
+ expect(FileUtils).to receive(:rmdir).with(current_home)
+ expect(::Dir).to receive(:glob).with("#{CHEF_SPEC_DATA}/old_home_dir/*",::File::FNM_DOTMATCH).and_return(current_home_files)
+ expect(FileUtils).to receive(:mv).with(current_home_files, "/Users/toor", :force => true)
+ expect(FileUtils).to receive(:chown_R).with('toor','23','/Users/toor')
- provider.should_receive(:run_dscl).with("create /Users/toor NFSHomeDirectory '/Users/toor'")
+ expect(provider).to receive(:run_dscl).with("create /Users/toor NFSHomeDirectory '/Users/toor'")
provider.dscl_set_home
end
it "should raise an exception when the systems user template dir (skel) cannot be found" do
- ::File.stub(:exists?).and_return(false,false,false)
- lambda { provider.dscl_set_home }.should raise_error(Chef::Exceptions::User)
+ allow(::File).to receive(:exists?).and_return(false,false,false)
+ expect { provider.dscl_set_home }.to raise_error(Chef::Exceptions::User)
end
it "should run ditto to copy any missing files from skel to the new home dir" do
- ::File.should_receive(:exists?).with("/System/Library/User\ Template/English.lproj").and_return(true)
- FileUtils.should_receive(:chown_R).with('toor', '', '/Users/toor')
- provider.should_receive(:shell_out!).with("ditto '/System/Library/User Template/English.lproj' '/Users/toor'")
+ expect(::File).to receive(:exists?).with("/System/Library/User\ Template/English.lproj").and_return(true)
+ expect(FileUtils).to receive(:chown_R).with('toor', '', '/Users/toor')
+ expect(provider).to receive(:shell_out!).with("ditto '/System/Library/User Template/English.lproj' '/Users/toor'")
provider.ditto_home
end
it "creates the user's NFSHomeDirectory and home directory" do
- provider.should_receive(:run_dscl).with("create /Users/toor NFSHomeDirectory '/Users/toor'").and_return(true)
- provider.should_receive(:ditto_home)
+ expect(provider).to receive(:run_dscl).with("create /Users/toor NFSHomeDirectory '/Users/toor'").and_return(true)
+ expect(provider).to receive(:ditto_home)
provider.dscl_set_home
end
end
@@ -280,8 +280,8 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:plutil_exists) { true }
before do
- ::File.stub(:exists?).with("/usr/bin/dscl").and_return(dscl_exists)
- ::File.stub(:exists?).with("/usr/bin/plutil").and_return(plutil_exists)
+ allow(::File).to receive(:exists?).with("/usr/bin/dscl").and_return(dscl_exists)
+ allow(::File).to receive(:exists?).with("/usr/bin/plutil").and_return(plutil_exists)
end
def run_requirements
@@ -294,7 +294,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:dscl_exists) { false }
it "should raise an error" do
- lambda { run_requirements }.should raise_error
+ expect { run_requirements }.to raise_error
end
end
@@ -302,7 +302,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:plutil_exists) { false }
it "should raise an error" do
- lambda { run_requirements }.should raise_error
+ expect { run_requirements }.to raise_error
end
end
@@ -312,7 +312,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
}
it "should raise an error" do
- lambda { run_requirements }.should raise_error
+ expect { run_requirements }.to raise_error
end
end
@@ -325,7 +325,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:password) { salted_sha512_password }
it "should not raise an error" do
- lambda { run_requirements }.should_not raise_error
+ expect { run_requirements }.not_to raise_error
end
end
@@ -333,7 +333,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:password) { salted_sha512_pbkdf2_password }
it "should raise an error" do
- lambda { run_requirements }.should raise_error
+ expect { run_requirements }.to raise_error
end
end
end
@@ -348,7 +348,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:password) { salted_sha512_password }
it "should raise an error" do
- lambda { run_requirements }.should raise_error
+ expect { run_requirements }.to raise_error
end
end
@@ -357,7 +357,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
describe "when salt and iteration is not set" do
it "should raise an error" do
- lambda { run_requirements }.should raise_error
+ expect { run_requirements }.to raise_error
end
end
@@ -366,7 +366,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:iterations) { salted_sha512_pbkdf2_iterations }
it "should not raise an error" do
- lambda { run_requirements }.should_not raise_error
+ expect { run_requirements }.not_to raise_error
end
end
end
@@ -379,8 +379,8 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
let(:user_plist_file) { nil }
before do
- provider.should_receive(:shell_out).with("dscacheutil '-flushcache'")
- provider.should_receive(:shell_out).with("plutil -convert xml1 -o - /var/db/dslocal/nodes/Default/users/toor.plist") do
+ expect(provider).to receive(:shell_out).with("dscacheutil '-flushcache'")
+ expect(provider).to receive(:shell_out).with("plutil -convert xml1 -o - /var/db/dslocal/nodes/Default/users/toor.plist") do
if user_plist_file.nil?
ShellCmdResult.new('Can not find the file', 'Sorry!!', 1)
else
@@ -389,23 +389,23 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
end
if !user_plist_file.nil?
- provider.should_receive(:convert_binary_plist_to_xml).and_return(File.read(File.join(CHEF_SPEC_DATA, "mac_users/#{user_plist_file}.shadow.xml")))
+ expect(provider).to receive(:convert_binary_plist_to_xml).and_return(File.read(File.join(CHEF_SPEC_DATA, "mac_users/#{user_plist_file}.shadow.xml")))
end
end
describe "when user is not there" do
it "shouldn't raise an error" do
- lambda { provider.load_current_resource }.should_not raise_error
+ expect { provider.load_current_resource }.not_to raise_error
end
it "should set @user_exists" do
provider.load_current_resource
- provider.instance_variable_get(:@user_exists).should be_false
+ expect(provider.instance_variable_get(:@user_exists)).to be_falsey
end
it "should set username" do
provider.load_current_resource
- provider.current_resource.username.should eq("toor")
+ expect(provider.current_resource.username).to eq("toor")
end
end
@@ -421,12 +421,12 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "collects the user data correctly" do
provider.load_current_resource
- provider.current_resource.comment.should eq("vagrant")
- provider.current_resource.uid.should eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
- provider.current_resource.gid.should eq("80")
- provider.current_resource.home.should eq("/Users/vagrant")
- provider.current_resource.shell.should eq("/bin/bash")
- provider.current_resource.password.should eq(vagrant_sha_512)
+ expect(provider.current_resource.comment).to eq("vagrant")
+ expect(provider.current_resource.uid).to eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
+ expect(provider.current_resource.gid).to eq("80")
+ expect(provider.current_resource.home).to eq("/Users/vagrant")
+ expect(provider.current_resource.shell).to eq("/bin/bash")
+ expect(provider.current_resource.password).to eq(vagrant_sha_512)
end
describe "when a plain password is set that is same" do
@@ -434,7 +434,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "diverged_password? should report false" do
provider.load_current_resource
- provider.diverged_password?.should be_false
+ expect(provider.diverged_password?).to be_falsey
end
end
@@ -443,7 +443,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "diverged_password? should report true" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
@@ -453,7 +453,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "diverged_password? should report false" do
provider.load_current_resource
- provider.diverged_password?.should be_false
+ expect(provider.diverged_password?).to be_falsey
end
end
@@ -462,7 +462,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "diverged_password? should report true" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
@@ -472,7 +472,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "diverged_password? should report false" do
provider.load_current_resource
- provider.diverged_password?.should be_false
+ expect(provider.diverged_password?).to be_falsey
end
end
end
@@ -486,19 +486,19 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30"
it "collects the user data correctly" do
provider.load_current_resource
- provider.current_resource.comment.should eq("vagrant")
- provider.current_resource.uid.should eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
- provider.current_resource.gid.should eq("80")
- provider.current_resource.home.should eq("/Users/vagrant")
- provider.current_resource.shell.should eq("/bin/bash")
- provider.current_resource.password.should eq("ea4c2d265d801ba0ec0dfccd\
+ expect(provider.current_resource.comment).to eq("vagrant")
+ expect(provider.current_resource.uid).to eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
+ expect(provider.current_resource.gid).to eq("80")
+ expect(provider.current_resource.home).to eq("/Users/vagrant")
+ expect(provider.current_resource.shell).to eq("/bin/bash")
+ expect(provider.current_resource.password).to eq("ea4c2d265d801ba0ec0dfccd\
253dfc1de91cbe0806b4acc1ed7fe22aebcf6beb5344d0f442e590\
ffa04d679075da3afb119e41b72b5eaf08ee4aa54693722646d5\
19ee04843deb8a3e977428d33f625e83887913e5c13b70035961\
5e00ad7bc3e7a0c98afc3e19d1360272454f8d33a9214d2fbe8b\
e68d1f9821b26689312366")
- provider.current_resource.salt.should eq("f994ef2f73b7c5594ebd1553300976b20733ce0e24d659783d87f3d81cbbb6a9")
- provider.current_resource.iterations.should eq(39840)
+ expect(provider.current_resource.salt).to eq("f994ef2f73b7c5594ebd1553300976b20733ce0e24d659783d87f3d81cbbb6a9")
+ expect(provider.current_resource.iterations).to eq(39840)
end
end
@@ -512,12 +512,12 @@ e68d1f9821b26689312366")
it "collects the user data correctly" do
provider.load_current_resource
- provider.current_resource.comment.should eq("vagrant")
- provider.current_resource.uid.should eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
- provider.current_resource.gid.should eq("80")
- provider.current_resource.home.should eq("/Users/vagrant")
- provider.current_resource.shell.should eq("/bin/bash")
- provider.current_resource.password.should eq("6f75d7190441facc34291ebbea1fc756b242d4f\
+ expect(provider.current_resource.comment).to eq("vagrant")
+ expect(provider.current_resource.uid).to eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
+ expect(provider.current_resource.gid).to eq("80")
+ expect(provider.current_resource.home).to eq("/Users/vagrant")
+ expect(provider.current_resource.shell).to eq("/bin/bash")
+ expect(provider.current_resource.password).to eq("6f75d7190441facc34291ebbea1fc756b242d4f\
e9bcff141bccb84f1979e27e539539aa31f9f7dcc92c0cea959\
ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
end
@@ -525,7 +525,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
describe "when a plain text password is set" do
it "reports password needs to be updated" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
@@ -536,7 +536,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "reports password needs to be updated" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
end
@@ -550,14 +550,14 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "collects the user data correctly" do
provider.load_current_resource
- provider.current_resource.comment.should eq("vagrant")
- provider.current_resource.uid.should eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
- provider.current_resource.gid.should eq("80")
- provider.current_resource.home.should eq("/Users/vagrant")
- provider.current_resource.shell.should eq("/bin/bash")
- provider.current_resource.password.should eq(vagrant_sha_512_pbkdf2)
- provider.current_resource.salt.should eq(vagrant_sha_512_pbkdf2_salt)
- provider.current_resource.iterations.should eq(vagrant_sha_512_pbkdf2_iterations)
+ expect(provider.current_resource.comment).to eq("vagrant")
+ expect(provider.current_resource.uid).to eq("11112222-3333-4444-AAAA-BBBBCCCCDDDD")
+ expect(provider.current_resource.gid).to eq("80")
+ expect(provider.current_resource.home).to eq("/Users/vagrant")
+ expect(provider.current_resource.shell).to eq("/bin/bash")
+ expect(provider.current_resource.password).to eq(vagrant_sha_512_pbkdf2)
+ expect(provider.current_resource.salt).to eq(vagrant_sha_512_pbkdf2_salt)
+ expect(provider.current_resource.iterations).to eq(vagrant_sha_512_pbkdf2_iterations)
end
describe "when a plain password is set that is same" do
@@ -565,7 +565,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "diverged_password? should report false" do
provider.load_current_resource
- provider.diverged_password?.should be_false
+ expect(provider.diverged_password?).to be_falsey
end
end
@@ -574,7 +574,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "diverged_password? should report true" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
@@ -585,7 +585,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "diverged_password? should report true" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
@@ -596,7 +596,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "diverged_password? should report true" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
@@ -607,7 +607,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "diverged_password? should report true" do
provider.load_current_resource
- provider.diverged_password?.should be_true
+ expect(provider.diverged_password?).to be_truthy
end
end
end
@@ -616,23 +616,23 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
describe "salted_sha512_pbkdf2?" do
it "should return true when the string is a salted_sha512_pbkdf2 hash" do
- provider.salted_sha512_pbkdf2?(salted_sha512_pbkdf2_password).should be_true
+ expect(provider.salted_sha512_pbkdf2?(salted_sha512_pbkdf2_password)).to be_truthy
end
it "should return false otherwise" do
- provider.salted_sha512_pbkdf2?(salted_sha512_password).should be_false
- provider.salted_sha512_pbkdf2?("any other string").should be_false
+ expect(provider.salted_sha512_pbkdf2?(salted_sha512_password)).to be_falsey
+ expect(provider.salted_sha512_pbkdf2?("any other string")).to be_falsey
end
end
describe "salted_sha512?" do
it "should return true when the string is a salted_sha512_pbkdf2 hash" do
- provider.salted_sha512_pbkdf2?(salted_sha512_pbkdf2_password).should be_true
+ expect(provider.salted_sha512_pbkdf2?(salted_sha512_pbkdf2_password)).to be_truthy
end
it "should return false otherwise" do
- provider.salted_sha512?(salted_sha512_pbkdf2_password).should be_false
- provider.salted_sha512?("any other string").should be_false
+ expect(provider.salted_sha512?(salted_sha512_pbkdf2_password)).to be_falsey
+ expect(provider.salted_sha512?("any other string")).to be_falsey
end
end
@@ -647,9 +647,9 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "password_shadow_info should have salted-sha-512 format" do
shadow_info = provider.prepare_password_shadow_info
- shadow_info.should have_key("SALTED-SHA512")
+ expect(shadow_info).to have_key("SALTED-SHA512")
info = shadow_info["SALTED-SHA512"].string.unpack('H*').first
- provider.salted_sha512?(info).should be_true
+ expect(provider.salted_sha512?(info)).to be_truthy
end
end
@@ -658,10 +658,10 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "password_shadow_info should have salted-sha-512 format" do
shadow_info = provider.prepare_password_shadow_info
- shadow_info.should have_key("SALTED-SHA512")
+ expect(shadow_info).to have_key("SALTED-SHA512")
info = shadow_info["SALTED-SHA512"].string.unpack('H*').first
- provider.salted_sha512?(info).should be_true
- info.should eq(vagrant_sha_512)
+ expect(provider.salted_sha512?(info)).to be_truthy
+ expect(info).to eq(vagrant_sha_512)
end
end
end
@@ -677,12 +677,12 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "password_shadow_info should have salted-sha-512 format" do
shadow_info = provider.prepare_password_shadow_info
- shadow_info.should have_key("SALTED-SHA512-PBKDF2")
- shadow_info["SALTED-SHA512-PBKDF2"].should have_key("entropy")
- shadow_info["SALTED-SHA512-PBKDF2"].should have_key("salt")
- shadow_info["SALTED-SHA512-PBKDF2"].should have_key("iterations")
+ expect(shadow_info).to have_key("SALTED-SHA512-PBKDF2")
+ expect(shadow_info["SALTED-SHA512-PBKDF2"]).to have_key("entropy")
+ expect(shadow_info["SALTED-SHA512-PBKDF2"]).to have_key("salt")
+ expect(shadow_info["SALTED-SHA512-PBKDF2"]).to have_key("iterations")
info = shadow_info["SALTED-SHA512-PBKDF2"]["entropy"].string.unpack('H*').first
- provider.salted_sha512_pbkdf2?(info).should be_true
+ expect(provider.salted_sha512_pbkdf2?(info)).to be_truthy
end
end
@@ -693,13 +693,13 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
it "password_shadow_info should have salted-sha-512 format" do
shadow_info = provider.prepare_password_shadow_info
- shadow_info.should have_key("SALTED-SHA512-PBKDF2")
- shadow_info["SALTED-SHA512-PBKDF2"].should have_key("entropy")
- shadow_info["SALTED-SHA512-PBKDF2"].should have_key("salt")
- shadow_info["SALTED-SHA512-PBKDF2"].should have_key("iterations")
+ expect(shadow_info).to have_key("SALTED-SHA512-PBKDF2")
+ expect(shadow_info["SALTED-SHA512-PBKDF2"]).to have_key("entropy")
+ expect(shadow_info["SALTED-SHA512-PBKDF2"]).to have_key("salt")
+ expect(shadow_info["SALTED-SHA512-PBKDF2"]).to have_key("iterations")
info = shadow_info["SALTED-SHA512-PBKDF2"]["entropy"].string.unpack('H*').first
- provider.salted_sha512_pbkdf2?(info).should be_true
- info.should eq(vagrant_sha_512_pbkdf2)
+ expect(provider.salted_sha512_pbkdf2?(info)).to be_truthy
+ expect(info).to eq(vagrant_sha_512_pbkdf2)
end
end
end
@@ -712,14 +712,14 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
end
it "should sleep and flush the dscl cache before saving the password" do
- provider.should_receive(:prepare_password_shadow_info).and_return({ })
+ expect(provider).to receive(:prepare_password_shadow_info).and_return({ })
mock_shellout = double("Mock::Shellout")
- mock_shellout.stub(:run_command)
- Mixlib::ShellOut.should_receive(:new).and_return(mock_shellout)
- provider.should_receive(:read_user_info)
- provider.should_receive(:dscl_set)
- provider.should_receive(:sleep).with(3)
- provider.should_receive(:save_user_info)
+ allow(mock_shellout).to receive(:run_command)
+ expect(Mixlib::ShellOut).to receive(:new).and_return(mock_shellout)
+ expect(provider).to receive(:read_user_info)
+ expect(provider).to receive(:dscl_set)
+ expect(provider).to receive(:sleep).with(3)
+ expect(provider).to receive(:save_user_info)
provider.set_password
end
end
@@ -732,33 +732,33 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
end
it "creates the user, comment field, sets uid, gid, configures the home directory, sets the shell, and sets the password" do
- provider.should_receive :dscl_create_user
- provider.should_receive :dscl_create_comment
- provider.should_receive :dscl_set_uid
- provider.should_receive :dscl_set_gid
- provider.should_receive :dscl_set_home
- provider.should_receive :dscl_set_shell
- provider.should_receive :set_password
+ expect(provider).to receive :dscl_create_user
+ expect(provider).to receive :dscl_create_comment
+ expect(provider).to receive :dscl_set_uid
+ expect(provider).to receive :dscl_set_gid
+ expect(provider).to receive :dscl_set_home
+ expect(provider).to receive :dscl_set_shell
+ expect(provider).to receive :set_password
provider.create_user
end
it "creates the user and sets the comment field" do
- provider.should_receive(:run_dscl).with("create /Users/toor").and_return(true)
+ expect(provider).to receive(:run_dscl).with("create /Users/toor").and_return(true)
provider.dscl_create_user
end
it "sets the comment field" do
- provider.should_receive(:run_dscl).with("create /Users/toor RealName '#mockssuck'").and_return(true)
+ expect(provider).to receive(:run_dscl).with("create /Users/toor RealName '#mockssuck'").and_return(true)
provider.dscl_create_comment
end
it "should run run_dscl with create /Users/user PrimaryGroupID to set the users primary group" do
- provider.should_receive(:run_dscl).with("create /Users/toor PrimaryGroupID '1001'").and_return(true)
+ expect(provider).to receive(:run_dscl).with("create /Users/toor PrimaryGroupID '1001'").and_return(true)
provider.dscl_set_gid
end
it "should run run_dscl with create /Users/user UserShell to set the users login shell" do
- provider.should_receive(:run_dscl).with("create /Users/toor UserShell '/usr/bin/false'").and_return(true)
+ expect(provider).to receive(:run_dscl).with("create /Users/toor UserShell '/usr/bin/false'").and_return(true)
provider.dscl_set_shell
end
end
@@ -770,15 +770,15 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
end
it "should map the group name to a numeric ID when the group exists" do
- provider.should_receive(:run_dscl).with("read /Groups/newgroup PrimaryGroupID").ordered.and_return("PrimaryGroupID: 1001\n")
- provider.should_receive(:run_dscl).with("create /Users/toor PrimaryGroupID '1001'").ordered.and_return(true)
+ expect(provider).to receive(:run_dscl).with("read /Groups/newgroup PrimaryGroupID").ordered.and_return("PrimaryGroupID: 1001\n")
+ expect(provider).to receive(:run_dscl).with("create /Users/toor PrimaryGroupID '1001'").ordered.and_return(true)
provider.dscl_set_gid
end
it "should raise an exception when the group does not exist" do
shell_return = ShellCmdResult.new("<dscl_cmd> DS Error: -14136 (eDSRecordNotFound)", 'err', -14136)
- provider.should_receive(:shell_out).with('dscl . -read /Groups/newgroup PrimaryGroupID').and_return(shell_return)
- lambda { provider.dscl_set_gid }.should raise_error(Chef::Exceptions::GroupIDNotFound)
+ expect(provider).to receive(:shell_out).with('dscl . -read /Groups/newgroup PrimaryGroupID').and_return(shell_return)
+ expect { provider.dscl_set_gid }.to raise_error(Chef::Exceptions::GroupIDNotFound)
end
end
end
@@ -797,13 +797,13 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
end
it "sets the user, comment field, uid, gid, moves the home directory, sets the shell, and sets the password" do
- provider.should_receive :dscl_create_user
- provider.should_receive :dscl_create_comment
- provider.should_receive :dscl_set_uid
- provider.should_receive :dscl_set_gid
- provider.should_receive :dscl_set_home
- provider.should_receive :dscl_set_shell
- provider.should_receive :set_password
+ expect(provider).to receive :dscl_create_user
+ expect(provider).to receive :dscl_create_comment
+ expect(provider).to receive :dscl_set_uid
+ expect(provider).to receive :dscl_set_gid
+ expect(provider).to receive :dscl_set_home
+ expect(provider).to receive :dscl_set_shell
+ expect(provider).to receive :set_password
provider.create_user
end
end
@@ -818,15 +818,15 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
end
it "sets the gid" do
- provider.should_receive :dscl_set_gid
+ expect(provider).to receive :dscl_set_gid
provider.manage_user
end
end
describe "when the user exists" do
before do
- provider.should_receive(:shell_out).with("dscacheutil '-flushcache'")
- provider.should_receive(:shell_out).with("plutil -convert xml1 -o - /var/db/dslocal/nodes/Default/users/toor.plist") do
+ expect(provider).to receive(:shell_out).with("dscacheutil '-flushcache'")
+ expect(provider).to receive(:shell_out).with("plutil -convert xml1 -o - /var/db/dslocal/nodes/Default/users/toor.plist") do
ShellCmdResult.new(File.read(File.join(CHEF_SPEC_DATA, "mac_users/10.9.plist.xml")), "", 0)
end
provider.load_current_resource
@@ -835,20 +835,20 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
describe "when Chef is removing the user" do
it "removes the user from the groups and deletes home directory when the resource is configured to manage home" do
new_resource.supports({ :manage_home => true })
- provider.should_receive(:run_dscl).with("list /Groups").and_return("my_group\nyour_group\nreal_group\n")
- provider.should_receive(:run_dscl).with("read /Groups/my_group").and_raise(Chef::Exceptions::DsclCommandFailed) # Empty group
- provider.should_receive(:run_dscl).with("read /Groups/your_group").and_return("GroupMembership: not_you")
- provider.should_receive(:run_dscl).with("read /Groups/real_group").and_return("GroupMembership: toor")
- provider.should_receive(:run_dscl).with("delete /Groups/real_group GroupMembership 'toor'")
- provider.should_receive(:run_dscl).with("delete /Users/toor")
- FileUtils.should_receive(:rm_rf).with("/Users/vagrant")
+ expect(provider).to receive(:run_dscl).with("list /Groups").and_return("my_group\nyour_group\nreal_group\n")
+ expect(provider).to receive(:run_dscl).with("read /Groups/my_group").and_raise(Chef::Exceptions::DsclCommandFailed) # Empty group
+ expect(provider).to receive(:run_dscl).with("read /Groups/your_group").and_return("GroupMembership: not_you")
+ expect(provider).to receive(:run_dscl).with("read /Groups/real_group").and_return("GroupMembership: toor")
+ expect(provider).to receive(:run_dscl).with("delete /Groups/real_group GroupMembership 'toor'")
+ expect(provider).to receive(:run_dscl).with("delete /Users/toor")
+ expect(FileUtils).to receive(:rm_rf).with("/Users/vagrant")
provider.remove_user
end
end
describe "when user is not locked" do
it "determines the user as not locked" do
- provider.should_not be_locked
+ expect(provider).not_to be_locked
end
end
@@ -859,11 +859,11 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
end
it "determines the user as not locked" do
- provider.should be_locked
+ expect(provider).to be_locked
end
it "can unlock the user" do
- provider.should_receive(:run_dscl).with("create /Users/toor AuthenticationAuthority ';ShadowHash;HASHLIST:<SALTED-SHA512-PBKDF2>'")
+ expect(provider).to receive(:run_dscl).with("create /Users/toor AuthenticationAuthority ';ShadowHash;HASHLIST:<SALTED-SHA512-PBKDF2>'")
provider.unlock_user
end
end
@@ -871,7 +871,7 @@ ea18e18b720e358e7fbe3cfbeaa561456f6ba008937a30")
describe "when locking the user" do
it "should run run_dscl with append /Users/user AuthenticationAuthority ;DisabledUser; to lock the user account" do
- provider.should_receive(:run_dscl).with("append /Users/toor AuthenticationAuthority ';DisabledUser;'")
+ expect(provider).to receive(:run_dscl).with("append /Users/toor AuthenticationAuthority ';DisabledUser;'")
provider.lock_user
end
end
diff --git a/spec/unit/provider/user/pw_spec.rb b/spec/unit/provider/user/pw_spec.rb
index a577a57de9..b225972e87 100644
--- a/spec/unit/provider/user/pw_spec.rb
+++ b/spec/unit/provider/user/pw_spec.rb
@@ -56,64 +56,64 @@ describe Chef::Provider::User::Pw do
}
field_list.each do |attribute, option|
it "should check for differences in #{attribute} between the new and current resources" do
- @current_resource.should_receive(attribute)
- @new_resource.should_receive(attribute)
+ expect(@current_resource).to receive(attribute)
+ expect(@new_resource).to receive(attribute)
@provider.set_options
end
it "should set the option for #{attribute} if the new resources #{attribute} is not null" do
- @new_resource.stub(attribute).and_return("hola")
- @provider.set_options.should eql(" #{@new_resource.username} #{option} '#{@new_resource.send(attribute)}' -m")
+ allow(@new_resource).to receive(attribute).and_return("hola")
+ expect(@provider.set_options).to eql(" #{@new_resource.username} #{option} '#{@new_resource.send(attribute)}' -m")
end
it "should set the option for #{attribute} if the new resources #{attribute} is not null, without homedir management" do
- @new_resource.stub(:supports).and_return({:manage_home => false})
- @new_resource.stub(attribute).and_return("hola")
- @provider.set_options.should eql(" #{@new_resource.username} #{option} '#{@new_resource.send(attribute)}'")
+ allow(@new_resource).to receive(:supports).and_return({:manage_home => false})
+ allow(@new_resource).to receive(attribute).and_return("hola")
+ expect(@provider.set_options).to eql(" #{@new_resource.username} #{option} '#{@new_resource.send(attribute)}'")
end
end
it "should combine all the possible options" do
match_string = " adam"
field_list.sort{ |a,b| a[0] <=> b[0] }.each do |attribute, option|
- @new_resource.stub(attribute).and_return("hola")
+ allow(@new_resource).to receive(attribute).and_return("hola")
match_string << " #{option} 'hola'"
end
match_string << " -m"
- @provider.set_options.should eql(match_string)
+ expect(@provider.set_options).to eql(match_string)
end
end
describe "create_user" do
before(:each) do
- @provider.stub(:run_command).and_return(true)
- @provider.stub(:modify_password).and_return(true)
+ allow(@provider).to receive(:run_command).and_return(true)
+ allow(@provider).to receive(:modify_password).and_return(true)
end
it "should run pw useradd with the return of set_options" do
- @provider.should_receive(:run_command).with({ :command => "pw useradd adam -m" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw useradd adam -m" }).and_return(true)
@provider.create_user
end
it "should modify the password" do
- @provider.should_receive(:modify_password).and_return(true)
+ expect(@provider).to receive(:modify_password).and_return(true)
@provider.create_user
end
end
describe "manage_user" do
before(:each) do
- @provider.stub(:run_command).and_return(true)
- @provider.stub(:modify_password).and_return(true)
+ allow(@provider).to receive(:run_command).and_return(true)
+ allow(@provider).to receive(:modify_password).and_return(true)
end
it "should run pw usermod with the return of set_options" do
- @provider.should_receive(:run_command).with({ :command => "pw usermod adam -m" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw usermod adam -m" }).and_return(true)
@provider.manage_user
end
it "should modify the password" do
- @provider.should_receive(:modify_password).and_return(true)
+ expect(@provider).to receive(:modify_password).and_return(true)
@provider.create_user
end
end
@@ -121,38 +121,38 @@ describe Chef::Provider::User::Pw do
describe "remove_user" do
it "should run pw userdel with the new resources user name" do
@new_resource.supports :manage_home => false
- @provider.should_receive(:run_command).with({ :command => "pw userdel #{@new_resource.username}" }).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw userdel #{@new_resource.username}" }).and_return(true)
@provider.remove_user
end
it "should run pw userdel with the new resources user name and -r if manage_home is true" do
- @provider.should_receive(:run_command).with({ :command => "pw userdel #{@new_resource.username} -r"}).and_return(true)
+ expect(@provider).to receive(:run_command).with({ :command => "pw userdel #{@new_resource.username} -r"}).and_return(true)
@provider.remove_user
end
end
describe "determining if the user is locked" do
it "should return true if user is locked" do
- @current_resource.stub(:password).and_return("*LOCKED*abracadabra")
- @provider.check_lock.should eql(true)
+ allow(@current_resource).to receive(:password).and_return("*LOCKED*abracadabra")
+ expect(@provider.check_lock).to eql(true)
end
it "should return false if user is not locked" do
- @current_resource.stub(:password).and_return("abracadabra")
- @provider.check_lock.should eql(false)
+ allow(@current_resource).to receive(:password).and_return("abracadabra")
+ expect(@provider.check_lock).to eql(false)
end
end
describe "when locking the user" do
it "should run pw lock with the new resources username" do
- @provider.should_receive(:run_command).with({ :command => "pw lock #{@new_resource.username}"})
+ expect(@provider).to receive(:run_command).with({ :command => "pw lock #{@new_resource.username}"})
@provider.lock_user
end
end
describe "when unlocking the user" do
it "should run pw unlock with the new resources username" do
- @provider.should_receive(:run_command).with({ :command => "pw unlock #{@new_resource.username}"})
+ expect(@provider).to receive(:run_command).with({ :command => "pw unlock #{@new_resource.username}"})
@provider.unlock_user
end
end
@@ -160,76 +160,76 @@ describe Chef::Provider::User::Pw do
describe "when modifying the password" do
before(:each) do
@status = double("Status", :exitstatus => 0)
- @provider.stub(:popen4).and_return(@status)
+ allow(@provider).to receive(:popen4).and_return(@status)
@pid, @stdin, @stdout, @stderr = nil, nil, nil, nil
end
describe "and the new password has not been specified" do
before(:each) do
- @new_resource.stub(:password).and_return(nil)
+ allow(@new_resource).to receive(:password).and_return(nil)
end
it "logs an appropriate message" do
- Chef::Log.should_receive(:debug).with("user[adam] no change needed to password")
+ expect(Chef::Log).to receive(:debug).with("user[adam] no change needed to password")
@provider.modify_password
end
end
describe "and the new password has been specified" do
before(:each) do
- @new_resource.stub(:password).and_return("abracadabra")
+ allow(@new_resource).to receive(:password).and_return("abracadabra")
end
it "should check for differences in password between the new and current resources" do
- @current_resource.should_receive(:password)
- @new_resource.should_receive(:password)
+ expect(@current_resource).to receive(:password)
+ expect(@new_resource).to receive(:password)
@provider.modify_password
end
end
describe "and the passwords are identical" do
before(:each) do
- @new_resource.stub(:password).and_return("abracadabra")
- @current_resource.stub(:password).and_return("abracadabra")
+ allow(@new_resource).to receive(:password).and_return("abracadabra")
+ allow(@current_resource).to receive(:password).and_return("abracadabra")
end
it "logs an appropriate message" do
- Chef::Log.should_receive(:debug).with("user[adam] no change needed to password")
+ expect(Chef::Log).to receive(:debug).with("user[adam] no change needed to password")
@provider.modify_password
end
end
describe "and the passwords are different" do
before(:each) do
- @new_resource.stub(:password).and_return("abracadabra")
- @current_resource.stub(:password).and_return("sesame")
+ allow(@new_resource).to receive(:password).and_return("abracadabra")
+ allow(@current_resource).to receive(:password).and_return("sesame")
end
it "should log an appropriate message" do
- Chef::Log.should_receive(:debug).with("user[adam] updating password")
+ expect(Chef::Log).to receive(:debug).with("user[adam] updating password")
@provider.modify_password
end
it "should run pw usermod with the username and the option -H 0" do
- @provider.should_receive(:popen4).with("pw usermod adam -H 0", :waitlast => true).and_return(@status)
+ expect(@provider).to receive(:popen4).with("pw usermod adam -H 0", :waitlast => true).and_return(@status)
@provider.modify_password
end
it "should send the new password to the stdin of pw usermod" do
@stdin = StringIO.new
- @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ allow(@provider).to receive(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.modify_password
- @stdin.string.should == "abracadabra\n"
+ expect(@stdin.string).to eq("abracadabra\n")
end
it "should raise an exception if pw usermod fails" do
- @status.should_receive(:exitstatus).and_return(1)
- lambda { @provider.modify_password }.should raise_error(Chef::Exceptions::User)
+ expect(@status).to receive(:exitstatus).and_return(1)
+ expect { @provider.modify_password }.to raise_error(Chef::Exceptions::User)
end
it "should not raise an exception if pw usermod succeeds" do
- @status.should_receive(:exitstatus).and_return(0)
- lambda { @provider.modify_password }.should_not raise_error
+ expect(@status).to receive(:exitstatus).and_return(0)
+ expect { @provider.modify_password }.not_to raise_error
end
end
end
@@ -240,13 +240,13 @@ describe Chef::Provider::User::Pw do
end
it "should raise an error if the required binary /usr/sbin/pw doesn't exist" do
- File.should_receive(:exists?).with("/usr/sbin/pw").and_return(false)
- lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::User)
+ expect(File).to receive(:exists?).with("/usr/sbin/pw").and_return(false)
+ expect { @provider.load_current_resource }.to raise_error(Chef::Exceptions::User)
end
it "shouldn't raise an error if /usr/sbin/pw exists" do
- File.stub(:exists?).and_return(true)
- lambda { @provider.load_current_resource }.should_not raise_error
+ allow(File).to receive(:exists?).and_return(true)
+ expect { @provider.load_current_resource }.not_to raise_error
end
end
end
diff --git a/spec/unit/provider/user/solaris_spec.rb b/spec/unit/provider/user/solaris_spec.rb
index d8bd0f9e75..ef62fd1d5a 100644
--- a/spec/unit/provider/user/solaris_spec.rb
+++ b/spec/unit/provider/user/solaris_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Provider::User::Solaris do
p.current_resource = @current_resource
# Prevent the useradd-based provider tests from trying to write /etc/shadow
- p.stub(:write_shadow_file)
+ allow(p).to receive(:write_shadow_file)
p
end
@@ -51,28 +51,28 @@ describe Chef::Provider::User::Solaris do
@new_resource.password "hocus-pocus"
- # Let these tests run #write_shadow_file
- provider.unstub(:write_shadow_file)
end
it "should use its own shadow file writer to set the password" do
- provider.should_receive(:write_shadow_file)
- provider.stub(:shell_out!).and_return(true)
+ expect(provider).to receive(:write_shadow_file)
+ allow(provider).to receive(:shell_out!).and_return(true)
provider.manage_user
end
it "should write out a modified version of the password file" do
+ # Let this test run #write_shadow_file
+ allow(provider).to receive(:write_shadow_file).and_call_original
password_file = Tempfile.new("shadow")
password_file.puts "adam:existingpassword:15441::::::"
password_file.close
provider.password_file = password_file.path
- provider.stub(:shell_out!).and_return(true)
+ allow(provider).to receive(:shell_out!).and_return(true)
# may not be able to write to /etc for tests...
temp_file = Tempfile.new("shadow")
- Tempfile.stub(:new).with("shadow", "/etc").and_return(temp_file)
+ allow(Tempfile).to receive(:new).with("shadow", "/etc").and_return(temp_file)
@new_resource.password "verysecurepassword"
provider.manage_user
- ::File.open(password_file.path, "r").read.should =~ /adam:verysecurepassword:/
+ expect(::File.open(password_file.path, "r").read).to match(/adam:verysecurepassword:/)
password_file.unlink
end
end
diff --git a/spec/unit/provider/user/useradd_spec.rb b/spec/unit/provider/user/useradd_spec.rb
index a65da3f9e1..b9f6ee0d86 100644
--- a/spec/unit/provider/user/useradd_spec.rb
+++ b/spec/unit/provider/user/useradd_spec.rb
@@ -43,7 +43,7 @@ describe Chef::Provider::User::Useradd do
# CHEF-5247: Chef::Provider::User::Solaris subclasses Chef::Provider::User::Useradd, but does not use usermod to change passwords.
# Thus, a call to Solaris#manage_user calls Solaris#manage_password and Useradd#manage_user, but the latter should be a no-op.
it "should not run the command if universal_options is an empty array" do
- provider.stub(:universal_options).and_return([])
+ allow(provider).to receive(:universal_options).and_return([])
expect(provider).not_to receive(:shell_out!)
provider.manage_user
end
diff --git a/spec/unit/provider/user/windows_spec.rb b/spec/unit/provider/user/windows_spec.rb
index 45a1c61c41..e51e20a68f 100644
--- a/spec/unit/provider/user/windows_spec.rb
+++ b/spec/unit/provider/user/windows_spec.rb
@@ -36,7 +36,7 @@ describe Chef::Provider::User::Windows do
@current_resource = Chef::Resource::User.new("monkey")
@net_user = double("Chef::Util::Windows::NetUser")
- Chef::Util::Windows::NetUser.stub(:new).and_return(@net_user)
+ allow(Chef::Util::Windows::NetUser).to receive(:new).and_return(@net_user)
@provider = Chef::Provider::User::Windows.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
@@ -62,27 +62,27 @@ describe Chef::Provider::User::Windows do
describe "and the attributes match" do
it "doesn't set the comment field to be updated" do
- @provider.set_options.should_not have_key(:full_name)
+ expect(@provider.set_options).not_to have_key(:full_name)
end
it "doesn't set the home directory to be updated" do
- @provider.set_options.should_not have_key(:home_dir)
+ expect(@provider.set_options).not_to have_key(:home_dir)
end
it "doesn't set the group id to be updated" do
- @provider.set_options.should_not have_key(:primary_group_id)
+ expect(@provider.set_options).not_to have_key(:primary_group_id)
end
it "doesn't set the user id to be updated" do
- @provider.set_options.should_not have_key(:user_id)
+ expect(@provider.set_options).not_to have_key(:user_id)
end
it "doesn't set the shell to be updated" do
- @provider.set_options.should_not have_key(:script_path)
+ expect(@provider.set_options).not_to have_key(:script_path)
end
it "doesn't set the password to be updated" do
- @provider.set_options.should_not have_key(:password)
+ expect(@provider.set_options).not_to have_key(:password)
end
end
@@ -100,53 +100,53 @@ describe Chef::Provider::User::Windows do
end
it "marks the full_name field to be updated" do
- @provider.set_options[:full_name].should == "Adam Jacob"
+ expect(@provider.set_options[:full_name]).to eq("Adam Jacob")
end
it "marks the home_dir attribute to be updated" do
- @provider.set_options[:home_dir].should == '/home/adam'
+ expect(@provider.set_options[:home_dir]).to eq('/home/adam')
end
it "marks the primary_group_id attribute to be updated" do
- @provider.set_options[:primary_group_id].should == 1000
+ expect(@provider.set_options[:primary_group_id]).to eq(1000)
end
it "marks the user_id attribute to be updated" do
- @provider.set_options[:user_id].should == 1000
+ expect(@provider.set_options[:user_id]).to eq(1000)
end
it "marks the script_path attribute to be updated" do
- @provider.set_options[:script_path].should == '/usr/bin/zsh'
+ expect(@provider.set_options[:script_path]).to eq('/usr/bin/zsh')
end
it "marks the password attribute to be updated" do
- @provider.set_options[:password].should == 'abracadabra'
+ expect(@provider.set_options[:password]).to eq('abracadabra')
end
end
end
describe "when creating the user" do
it "should call @net_user.add with the return of set_options" do
- @provider.stub(:set_options).and_return(:name=> "monkey")
- @net_user.should_receive(:add).with(:name=> "monkey")
+ allow(@provider).to receive(:set_options).and_return(:name=> "monkey")
+ expect(@net_user).to receive(:add).with(:name=> "monkey")
@provider.create_user
end
end
describe "manage_user" do
before(:each) do
- @provider.stub(:set_options).and_return(:name=> "monkey")
+ allow(@provider).to receive(:set_options).and_return(:name=> "monkey")
end
it "should call @net_user.update with the return of set_options" do
- @net_user.should_receive(:update).with(:name=> "monkey")
+ expect(@net_user).to receive(:update).with(:name=> "monkey")
@provider.manage_user
end
end
describe "when removing the user" do
it "should call @net_user.delete" do
- @net_user.should_receive(:delete)
+ expect(@net_user).to receive(:delete)
@provider.remove_user
end
end
@@ -157,28 +157,28 @@ describe Chef::Provider::User::Windows do
end
it "should return true if user is locked" do
- @net_user.stub(:check_enabled).and_return(true)
- @provider.check_lock.should eql(true)
+ allow(@net_user).to receive(:check_enabled).and_return(true)
+ expect(@provider.check_lock).to eql(true)
end
it "should return false if user is not locked" do
- @net_user.stub(:check_enabled).and_return(false)
- @provider.check_lock.should eql(false)
+ allow(@net_user).to receive(:check_enabled).and_return(false)
+ expect(@provider.check_lock).to eql(false)
end
end
describe "locking the user" do
it "should call @net_user.disable_account" do
- @net_user.stub(:check_enabled).and_return(true)
- @net_user.should_receive(:disable_account)
+ allow(@net_user).to receive(:check_enabled).and_return(true)
+ expect(@net_user).to receive(:disable_account)
@provider.lock_user
end
end
describe "unlocking the user" do
it "should call @net_user.enable_account" do
- @net_user.stub(:check_enabled).and_return(false)
- @net_user.should_receive(:enable_account)
+ allow(@net_user).to receive(:check_enabled).and_return(false)
+ expect(@net_user).to receive(:enable_account)
@provider.unlock_user
end
end
diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb
index 153db6f283..44434794e7 100644
--- a/spec/unit/provider/user_spec.rb
+++ b/spec/unit/provider/user_spec.rb
@@ -47,11 +47,11 @@ describe Chef::Provider::User do
describe "when first created" do
it "assume the user exists by default" do
- @provider.user_exists.should eql(true)
+ expect(@provider.user_exists).to eql(true)
end
it "does not know the locked state" do
- @provider.locked.should eql(nil)
+ expect(@provider.locked).to eql(nil)
end
end
@@ -69,7 +69,7 @@ describe Chef::Provider::User do
# :password => nil,
# :updated => nil
#)
- Chef::Resource::User.stub(:new).and_return(@current_resource)
+ allow(Chef::Resource::User).to receive(:new).and_return(@current_resource)
@pw_user = EtcPwnamIsh.new
@pw_user.name = "adam"
@pw_user.gid = 1000
@@ -78,34 +78,34 @@ describe Chef::Provider::User do
@pw_user.dir = "/home/adam"
@pw_user.shell = "/usr/bin/zsh"
@pw_user.passwd = "*"
- Etc.stub(:getpwnam).and_return(@pw_user)
+ allow(Etc).to receive(:getpwnam).and_return(@pw_user)
end
it "should create a current resource with the same name as the new resource" do
@provider.load_current_resource
- @provider.current_resource.name.should == 'adam'
+ expect(@provider.current_resource.name).to eq('adam')
end
it "should set the username of the current resource to the username of the new resource" do
@provider.load_current_resource
- @current_resource.username.should == @new_resource.username
+ expect(@current_resource.username).to eq(@new_resource.username)
end
it "should change the encoding of gecos to the encoding of the new resource", :ruby_gte_19_only do
@pw_user.gecos.force_encoding('ASCII-8BIT')
@provider.load_current_resource
- @provider.current_resource.comment.encoding.should == @new_resource.comment.encoding
+ expect(@provider.current_resource.comment.encoding).to eq(@new_resource.comment.encoding)
end
it "should look up the user in /etc/passwd with getpwnam" do
- Etc.should_receive(:getpwnam).with(@new_resource.username).and_return(@pw_user)
+ expect(Etc).to receive(:getpwnam).with(@new_resource.username).and_return(@pw_user)
@provider.load_current_resource
end
it "should set user_exists to false if the user is not found with getpwnam" do
- Etc.should_receive(:getpwnam).and_raise(ArgumentError)
+ expect(Etc).to receive(:getpwnam).and_raise(ArgumentError)
@provider.load_current_resource
- @provider.user_exists.should eql(false)
+ expect(@provider.user_exists).to eql(false)
end
# The mapping between the Chef::Resource::User and Getpwnam struct
@@ -118,24 +118,24 @@ describe Chef::Provider::User do
}
user_attrib_map.each do |user_attrib, getpwnam_attrib|
it "should set the current resources #{user_attrib} based on getpwnam #{getpwnam_attrib}" do
- @current_resource.should_receive(user_attrib).with(@pw_user.send(getpwnam_attrib))
+ expect(@current_resource).to receive(user_attrib).with(@pw_user.send(getpwnam_attrib))
@provider.load_current_resource
end
end
it "should attempt to convert the group gid if one has been supplied" do
- @provider.should_receive(:convert_group_name)
+ expect(@provider).to receive(:convert_group_name)
@provider.load_current_resource
end
it "shouldn't try and convert the group gid if none has been supplied" do
- @new_resource.stub(:gid).and_return(nil)
- @provider.should_not_receive(:convert_group_name)
+ allow(@new_resource).to receive(:gid).and_return(nil)
+ expect(@provider).not_to receive(:convert_group_name)
@provider.load_current_resource
end
it "should return the current resource" do
- @provider.load_current_resource.should eql(@current_resource)
+ expect(@provider.load_current_resource).to eql(@current_resource)
end
describe "and running assertions" do
@@ -156,7 +156,7 @@ describe Chef::Provider::User do
user.name = "root"
user.passwd = "x"
@new_resource.password "some new password"
- Etc.stub(:getpwnam).and_return(user)
+ allow(Etc).to receive(:getpwnam).and_return(user)
end
unless shadow_lib_unavail?
@@ -167,10 +167,10 @@ describe Chef::Provider::User do
it "should pass assertions when ruby-shadow can be loaded" do
@provider.action = 'create'
original_method = @provider.method(:require)
- @provider.should_receive(:require) { |*args| original_method.call(*args) }
+ expect(@provider).to receive(:require) { |*args| original_method.call(*args) }
passwd_info = Struct::PasswdEntry.new(:sp_namp => "adm ", :sp_pwdp => "$1$T0N0Q.lc$nyG6pFI3Dpqa5cxUz/57j0", :sp_lstchg => 14861, :sp_min => 0, :sp_max => 99999,
:sp_warn => 7, :sp_inact => -1, :sp_expire => -1, :sp_flag => -1)
- Shadow::Passwd.should_receive(:getspnam).with("adam").and_return(passwd_info)
+ expect(Shadow::Passwd).to receive(:getspnam).with("adam").and_return(passwd_info)
@provider.load_current_resource
@provider.define_resource_requirements
@provider.process_resource_requirements
@@ -180,10 +180,10 @@ describe Chef::Provider::User do
end
it "should fail assertions when ruby-shadow cannot be loaded" do
- @provider.should_receive(:require).with("shadow") { raise LoadError }
+ expect(@provider).to receive(:require).with("shadow") { raise LoadError }
@provider.load_current_resource
@provider.define_resource_requirements
- lambda {@provider.process_resource_requirements}.should raise_error Chef::Exceptions::MissingLibrary
+ expect {@provider.process_resource_requirements}.to raise_error Chef::Exceptions::MissingLibrary
end
end
@@ -206,7 +206,7 @@ describe Chef::Provider::User do
it "should return true if #{attribute} doesn't match" do
@new_resource.send(attribute, mapping[attribute][0])
@current_resource.send(attribute, mapping[attribute][1])
- @provider.compare_user.should eql(true)
+ expect(@provider.compare_user).to eql(true)
end
end
@@ -214,18 +214,18 @@ describe Chef::Provider::User do
it "should return false if string #{attribute} matches fixnum" do
@new_resource.send(attribute, "100")
@current_resource.send(attribute, 100)
- @provider.compare_user.should eql(false)
+ expect(@provider.compare_user).to eql(false)
end
end
it "should return false if the objects are identical" do
- @provider.compare_user.should eql(false)
+ expect(@provider.compare_user).to eql(false)
end
end
describe "action_create" do
before(:each) do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
# @current_resource = double("Chef::Resource::User",
# :null_object => true,
# :username => "adam",
@@ -246,58 +246,58 @@ describe Chef::Provider::User do
it "should call create_user if the user does not exist" do
@provider.user_exists = false
- @provider.should_receive(:create_user).and_return(true)
+ expect(@provider).to receive(:create_user).and_return(true)
@provider.action_create
@provider.set_updated_status
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should call manage_user if the user exists and has mismatched attributes" do
@provider.user_exists = true
- @provider.stub(:compare_user).and_return(true)
- @provider.should_receive(:manage_user).and_return(true)
+ allow(@provider).to receive(:compare_user).and_return(true)
+ expect(@provider).to receive(:manage_user).and_return(true)
@provider.action_create
end
it "should set the new_resources updated flag when it creates the user if we call manage_user" do
@provider.user_exists = true
- @provider.stub(:compare_user).and_return(true)
- @provider.stub(:manage_user).and_return(true)
+ allow(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:manage_user).and_return(true)
@provider.action_create
@provider.set_updated_status
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "action_remove" do
before(:each) do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
end
it "should not call remove_user if the user does not exist" do
@provider.user_exists = false
- @provider.should_not_receive(:remove_user)
+ expect(@provider).not_to receive(:remove_user)
@provider.action_remove
end
it "should call remove_user if the user exists" do
@provider.user_exists = true
- @provider.should_receive(:remove_user)
+ expect(@provider).to receive(:remove_user)
@provider.action_remove
end
it "should set the new_resources updated flag to true if the user is removed" do
@provider.user_exists = true
- @provider.should_receive(:remove_user)
+ expect(@provider).to receive(:remove_user)
@provider.action_remove
@provider.set_updated_status
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
end
describe "action_manage" do
before(:each) do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
# @node = Chef::Node.new
# @new_resource = double("Chef::Resource::User",
# :null_object => true
@@ -312,35 +312,35 @@ describe Chef::Provider::User do
end
it "should run manage_user if the user exists and has mismatched attributes" do
- @provider.should_receive(:compare_user).and_return(true)
- @provider.should_receive(:manage_user).and_return(true)
+ expect(@provider).to receive(:compare_user).and_return(true)
+ expect(@provider).to receive(:manage_user).and_return(true)
@provider.action_manage
end
it "should set the new resources updated flag to true if manage_user is called" do
- @provider.stub(:compare_user).and_return(true)
- @provider.stub(:manage_user).and_return(true)
+ allow(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:manage_user).and_return(true)
@provider.action_manage
@provider.set_updated_status
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not run manage_user if the user does not exist" do
@provider.user_exists = false
- @provider.should_not_receive(:manage_user)
+ expect(@provider).not_to receive(:manage_user)
@provider.action_manage
end
it "should not run manage_user if the user exists but has no differing attributes" do
- @provider.should_receive(:compare_user).and_return(false)
- @provider.should_not_receive(:manage_user)
+ expect(@provider).to receive(:compare_user).and_return(false)
+ expect(@provider).not_to receive(:manage_user)
@provider.action_manage
end
end
describe "action_modify" do
before(:each) do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
# @node = Chef::Node.new
# @new_resource = double("Chef::Resource::User",
# :null_object => true
@@ -355,61 +355,61 @@ describe Chef::Provider::User do
end
it "should run manage_user if the user exists and has mismatched attributes" do
- @provider.should_receive(:compare_user).and_return(true)
- @provider.should_receive(:manage_user).and_return(true)
+ expect(@provider).to receive(:compare_user).and_return(true)
+ expect(@provider).to receive(:manage_user).and_return(true)
@provider.action_modify
end
it "should set the new resources updated flag to true if manage_user is called" do
- @provider.stub(:compare_user).and_return(true)
- @provider.stub(:manage_user).and_return(true)
+ allow(@provider).to receive(:compare_user).and_return(true)
+ allow(@provider).to receive(:manage_user).and_return(true)
@provider.action_modify
@provider.set_updated_status
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should not run manage_user if the user exists but has no differing attributes" do
- @provider.should_receive(:compare_user).and_return(false)
- @provider.should_not_receive(:manage_user)
+ expect(@provider).to receive(:compare_user).and_return(false)
+ expect(@provider).not_to receive(:manage_user)
@provider.action_modify
end
it "should raise a Chef::Exceptions::User if the user doesn't exist" do
@provider.user_exists = false
- lambda { @provider.action = :modify; @provider.run_action }.should raise_error(Chef::Exceptions::User)
+ expect { @provider.action = :modify; @provider.run_action }.to raise_error(Chef::Exceptions::User)
end
end
describe "action_lock" do
before(:each) do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
end
it "should lock the user if it exists and is unlocked" do
- @provider.stub(:check_lock).and_return(false)
- @provider.should_receive(:lock_user).and_return(true)
+ allow(@provider).to receive(:check_lock).and_return(false)
+ expect(@provider).to receive(:lock_user).and_return(true)
@provider.action_lock
end
it "should set the new resources updated flag to true if lock_user is called" do
- @provider.stub(:check_lock).and_return(false)
- @provider.should_receive(:lock_user)
+ allow(@provider).to receive(:check_lock).and_return(false)
+ expect(@provider).to receive(:lock_user)
@provider.action_lock
@provider.set_updated_status
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should raise a Chef::Exceptions::User if we try and lock a user that does not exist" do
@provider.user_exists = false
@provider.action = :lock
- lambda { @provider.run_action }.should raise_error(Chef::Exceptions::User)
+ expect { @provider.run_action }.to raise_error(Chef::Exceptions::User)
end
end
describe "action_unlock" do
before(:each) do
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:load_current_resource)
# @node = Chef::Node.new
# @new_resource = double("Chef::Resource::User",
# :null_object => true
@@ -425,17 +425,17 @@ describe Chef::Provider::User do
end
it "should unlock the user if it exists and is locked" do
- @provider.stub(:check_lock).and_return(true)
- @provider.should_receive(:unlock_user).and_return(true)
+ allow(@provider).to receive(:check_lock).and_return(true)
+ expect(@provider).to receive(:unlock_user).and_return(true)
@provider.action_unlock
@provider.set_updated_status
- @new_resource.should be_updated
+ expect(@new_resource).to be_updated
end
it "should raise a Chef::Exceptions::User if we try and unlock a user that does not exist" do
@provider.user_exists = false
@provider.action = :unlock
- lambda { @provider.run_action }.should raise_error(Chef::Exceptions::User)
+ expect { @provider.run_action }.to raise_error(Chef::Exceptions::User)
end
end
@@ -446,21 +446,21 @@ describe Chef::Provider::User do
end
it "should lookup the group name locally" do
- Etc.should_receive(:getgrnam).with("999").and_return(@group)
- @provider.convert_group_name.should == 999
+ expect(Etc).to receive(:getgrnam).with("999").and_return(@group)
+ expect(@provider.convert_group_name).to eq(999)
end
it "should raise an error if we can't translate the group name during resource assertions" do
- Etc.should_receive(:getgrnam).and_raise(ArgumentError)
+ expect(Etc).to receive(:getgrnam).and_raise(ArgumentError)
@provider.define_resource_requirements
@provider.convert_group_name
- lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::User)
+ expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::User)
end
it "should set the new resources gid to the integerized version if available" do
- Etc.should_receive(:getgrnam).with("999").and_return(@group)
+ expect(Etc).to receive(:getgrnam).with("999").and_return(@group)
@provider.convert_group_name
- @new_resource.gid.should == 999
+ expect(@new_resource.gid).to eq(999)
end
end
end
diff --git a/spec/unit/provider/whyrun_safe_ruby_block_spec.rb b/spec/unit/provider/whyrun_safe_ruby_block_spec.rb
index d5209248b3..2a4dccdad7 100644
--- a/spec/unit/provider/whyrun_safe_ruby_block_spec.rb
+++ b/spec/unit/provider/whyrun_safe_ruby_block_spec.rb
@@ -31,15 +31,15 @@ describe Chef::Provider::WhyrunSafeRubyBlock, "initialize" do
it "should call the block and flag the resource as updated" do
@provider.run_action(:run)
- $evil_global_evil_laugh.should == :mwahahaha
- @new_resource.should be_updated
+ expect($evil_global_evil_laugh).to eq(:mwahahaha)
+ expect(@new_resource).to be_updated
end
it "should call the block and flat the resource as updated - even in whyrun" do
Chef::Config[:why_run] = true
@provider.run_action(:run)
- $evil_global_evil_laugh.should == :mwahahaha
- @new_resource.should be_updated
+ expect($evil_global_evil_laugh).to eq(:mwahahaha)
+ expect(@new_resource).to be_updated
Chef::Config[:why_run] = false
end
diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb
new file mode 100644
index 0000000000..c56207c554
--- /dev/null
+++ b/spec/unit/provider_resolver_spec.rb
@@ -0,0 +1,552 @@
+#
+# Author:: Lamont Granquist (<lamont@getchef.com>)
+# Copyright:: Copyright (c) 2014 Opscode, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'chef/mixin/convert_to_class_name'
+
+include Chef::Mixin::ConvertToClassName
+
+describe Chef::ProviderResolver do
+
+ let(:node) do
+ node = Chef::Node.new
+ allow(node).to receive(:[]).with(:os).and_return(os)
+ allow(node).to receive(:[]).with(:platform_family).and_return(platform_family)
+ allow(node).to receive(:[]).with(:platform).and_return(platform)
+ allow(node).to receive(:[]).with(:platform_version).and_return(platform_version)
+ allow(node).to receive(:is_a?).and_return(Chef::Node)
+ node
+ end
+
+ let(:provider_resolver) { Chef::ProviderResolver.new(node, resource, action) }
+
+ let(:action) { :start }
+
+ let(:resolved_provider) { provider_resolver.resolve }
+
+ let(:provider) { nil }
+
+ let(:resource_name) { :service }
+
+ let(:resource) { double(Chef::Resource, provider: provider, resource_name: resource_name) }
+
+ describe "resolving service resource" do
+ def stub_service_providers(*services)
+ services ||= []
+ allow(Chef::Platform::ServiceHelpers).to receive(:service_resource_providers)
+ .and_return(services)
+ end
+
+ def stub_service_configs(*configs)
+ configs ||= []
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return(configs)
+ end
+
+ before do
+ expect(provider_resolver).not_to receive(:maybe_chef_platform_lookup)
+ allow(resource).to receive(:service_name).and_return("ntp")
+ end
+
+ shared_examples_for "an ubuntu platform with upstart, update-rc.d and systemd" do
+ before do
+ stub_service_providers(:debian, :invokercd, :upstart, :systemd)
+ end
+
+ it "when only the SysV init script exists, it returns a Service::Debian provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd, :systemd ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
+ end
+
+ it "when both SysV and Upstart scripts exist, it returns a Service::Upstart provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd, :upstart, :systemd ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
+ end
+
+ it "when only the Upstart script exists, it returns a Service::Upstart provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :upstart, :systemd ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
+ end
+
+ it "when both do not exist, it calls the old style provider resolver and returns a Debian Provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :systemd ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
+ end
+ it "when only the SysV init script exists, it returns a Service::Debian provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Debian)
+ end
+
+ it "when both SysV and Upstart scripts exist, it returns a Service::Upstart provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd, :upstart ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+
+ it "when only the Upstart script exists, it returns a Service::Upstart provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :upstart ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+
+ it "when both do not exist, it calls the old style provider resolver and returns a Debian Provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Systemd)
+ end
+ end
+
+ shared_examples_for "an ubuntu platform with upstart and update-rc.d" do
+ before do
+ stub_service_providers(:debian, :invokercd, :upstart)
+ end
+
+ # needs to be handled by the highest priority init.d handler
+ context "when only the SysV init script exists" do
+ before do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd ] )
+ end
+
+ it "enables init, invokercd, debian and upstart providers" do
+ expect(provider_resolver.enabled_handlers).to include(
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ Chef::Provider::Service::Upstart,
+ )
+ end
+
+ it "supports all the enabled handlers except for upstart" do
+ expect(provider_resolver.supported_handlers).to include(
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ )
+ expect(provider_resolver.supported_handlers).to_not include(
+ Chef::Provider::Service::Upstart,
+ )
+ end
+
+ it "returns a Service::Debian provider" do
+ expect(resolved_provider).to eql(Chef::Provider::Service::Debian)
+ end
+ end
+
+ # on ubuntu this must be handled by upstart, the init script will exit 1 and fail
+ context "when both SysV and Upstart scripts exist" do
+ before do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd, :upstart ] )
+ end
+
+ it "enables init, invokercd, debian and upstart providers" do
+ expect(provider_resolver.enabled_handlers).to include(
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ Chef::Provider::Service::Upstart,
+ )
+ end
+
+ it "supports all the enabled handlers" do
+ expect(provider_resolver.supported_handlers).to include(
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ Chef::Provider::Service::Upstart,
+ )
+ end
+
+ it "returns a Service::Upstart provider" do
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+ end
+
+ # this case is a pure-upstart script which is easy
+ context "when only the Upstart script exists" do
+ before do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :upstart ] )
+ end
+
+ it "enables init, invokercd, debian and upstart providers" do
+ expect(provider_resolver.enabled_handlers).to include(
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ Chef::Provider::Service::Upstart,
+ )
+ end
+
+ it "supports only the upstart handler" do
+ expect(provider_resolver.supported_handlers).to include(
+ Chef::Provider::Service::Upstart,
+ )
+ expect(provider_resolver.supported_handlers).to_not include(
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ )
+ end
+
+ it "returns a Service::Upstart provider" do
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+ end
+
+ # this case is important to get correct for why-run when no config is setup
+ context "when both do not exist" do
+ before do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ ] )
+ end
+
+ it "enables init, invokercd, debian and upstart providers" do
+ expect(provider_resolver.enabled_handlers).to include(
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ Chef::Provider::Service::Upstart,
+ )
+ end
+
+ it "no providers claim to support the resource" do
+ expect(provider_resolver.supported_handlers).to_not include(
+ Chef::Provider::Service::Upstart,
+ Chef::Provider::Service::Debian,
+ Chef::Provider::Service::Init,
+ Chef::Provider::Service::Invokercd,
+ )
+ end
+
+ it "returns a Debian Provider" do
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+ end
+ end
+
+ shared_examples_for "a debian platform using the insserv provider" do
+ context "with a default install" do
+ before do
+ stub_service_providers(:debian, :invokercd, :insserv)
+ end
+
+ it "uses the Service::Insserv Provider to manage sysv init scripts" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Insserv)
+ end
+
+ it "uses the Service::Insserv Provider when there is no config" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Insserv)
+ end
+ end
+
+ context "when the user has installed upstart" do
+ before do
+ stub_service_providers(:debian, :invokercd, :insserv, :upstart)
+ end
+
+ it "when only the SysV init script exists, it returns an Insserv provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Insserv)
+ end
+
+ it "when both SysV and Upstart scripts exist, it returns a Service::Upstart provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :initd, :upstart ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+
+ it "when only the Upstart script exists, it returns a Service::Upstart provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ :upstart ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+
+ it "when both do not exist, it calls the old style provider resolver and returns a Debian Provider" do
+ allow(Chef::Platform::ServiceHelpers).to receive(:config_for_service).with("ntp")
+ .and_return( [ ] )
+ expect(resolved_provider).to eql(Chef::Provider::Service::Upstart)
+ end
+ end
+ end
+
+ describe "on Ubuntu 14.10" do
+ let(:os) { "linux" }
+ let(:platform) { "ubuntu" }
+ let(:platform_family) { "debian" }
+ let(:platform_version) { "14.04" }
+
+ it_behaves_like "an ubuntu platform with upstart, update-rc.d and systemd"
+ end
+
+ describe "on Ubuntu 14.04" do
+ let(:os) { "linux" }
+ let(:platform) { "ubuntu" }
+ let(:platform_family) { "debian" }
+ let(:platform_version) { "14.04" }
+
+ it_behaves_like "an ubuntu platform with upstart and update-rc.d"
+ end
+
+ describe "on Ubuntu 10.04" do
+ let(:os) { "linux" }
+ let(:platform) { "ubuntu" }
+ let(:platform_family) { "debian" }
+ let(:platform_version) { "10.04" }
+
+ it_behaves_like "an ubuntu platform with upstart and update-rc.d"
+ end
+
+ # old debian uses the Debian provider (does not have insserv or upstart, or update-rc.d???)
+ describe "on Debian 4.0" do
+ let(:os) { "linux" }
+ let(:platform) { "debian" }
+ let(:platform_family) { "debian" }
+ let(:platform_version) { "4.0" }
+
+ #it_behaves_like "a debian platform using the debian provider"
+ end
+
+ # Debian replaced the debian provider with insserv in the FIXME:VERSION distro
+ describe "on Debian 7.0" do
+ let(:os) { "linux" }
+ let(:platform) { "debian" }
+ let(:platform_family) { "debian" }
+ let(:platform_version) { "7.0" }
+
+ it_behaves_like "a debian platform using the insserv provider"
+ end
+
+ %w{solaris2 openindiana opensolaris nexentacore omnios smartos}.each do |platform|
+ describe "on #{platform}" do
+ let(:os) { "solaris2" }
+ let(:platform) { platform }
+ let(:platform_family) { platform }
+ let(:platform_version) { "5.11" }
+
+ it "returns a Solaris provider" do
+ stub_service_providers
+ stub_service_configs
+ expect(resolved_provider).to eql(Chef::Provider::Service::Solaris)
+ end
+
+ it "always returns a Solaris provider" do
+ # no matter what we stub on the next two lines we should get a Solaris provider
+ stub_service_providers(:debian, :invokercd, :insserv, :upstart, :redhat, :systemd)
+ stub_service_configs(:initd, :upstart, :xinetd, :user_local_etc_rcd, :systemd)
+ expect(resolved_provider).to eql(Chef::Provider::Service::Solaris)
+ end
+ end
+ end
+
+ %w{mswin mingw32 windows}.each do |platform|
+ describe "on #{platform}" do
+ let(:os) { "windows" }
+ let(:platform) { platform }
+ let(:platform_family) { "windows" }
+ let(:platform_version) { "5.11" }
+
+ it "returns a Windows provider" do
+ stub_service_providers
+ stub_service_configs
+ expect(resolved_provider).to eql(Chef::Provider::Service::Windows)
+ end
+
+ it "always returns a Windows provider" do
+ # no matter what we stub on the next two lines we should get a Windows provider
+ stub_service_providers(:debian, :invokercd, :insserv, :upstart, :redhat, :systemd)
+ stub_service_configs(:initd, :upstart, :xinetd, :user_local_etc_rcd, :systemd)
+ expect(resolved_provider).to eql(Chef::Provider::Service::Windows)
+ end
+ end
+ end
+
+ %w{mac_os_x mac_os_x_server}.each do |platform|
+ describe "on #{platform}" do
+ let(:os) { "darwin" }
+ let(:platform) { platform }
+ let(:platform_family) { "mac_os_x" }
+ let(:platform_version) { "10.9.2" }
+
+ it "returns a Macosx provider" do
+ stub_service_providers
+ stub_service_configs
+ expect(resolved_provider).to eql(Chef::Provider::Service::Macosx)
+ end
+
+ it "always returns a Macosx provider" do
+ # no matter what we stub on the next two lines we should get a Macosx provider
+ stub_service_providers(:debian, :invokercd, :insserv, :upstart, :redhat, :systemd)
+ stub_service_configs(:initd, :upstart, :xinetd, :user_local_etc_rcd, :systemd)
+ expect(resolved_provider).to eql(Chef::Provider::Service::Macosx)
+ end
+ end
+ end
+
+ %w{freebsd netbsd}.each do |platform|
+ describe "on #{platform}" do
+ let(:os) { platform }
+ let(:platform) { platform }
+ let(:platform_family) { platform }
+ let(:platform_version) { "10.0-RELEASE" }
+
+ it "returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
+ stub_service_providers
+ stub_service_configs(:usr_local_etc_rcd)
+ expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
+ end
+
+ it "returns a Freebsd provider if it finds the /etc/rc.d initscript" do
+ stub_service_providers
+ stub_service_configs(:etc_rcd)
+ expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
+ end
+
+ it "always returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
+ # should only care about :usr_local_etc_rcd stub in the service configs
+ stub_service_providers(:debian, :invokercd, :insserv, :upstart, :redhat, :systemd)
+ stub_service_configs(:usr_local_etc_rcd, :initd, :upstart, :xinetd, :systemd)
+ expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
+ end
+
+ it "always returns a Freebsd provider if it finds the /usr/local/etc/rc.d initscript" do
+ # should only care about :etc_rcd stub in the service configs
+ stub_service_providers(:debian, :invokercd, :insserv, :upstart, :redhat, :systemd)
+ stub_service_configs(:etc_rcd, :initd, :upstart, :xinetd, :systemd)
+ expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
+ end
+
+ it "foo" do
+ stub_service_providers
+ stub_service_configs
+ expect(resolved_provider).to eql(Chef::Provider::Service::Freebsd)
+ end
+ end
+ end
+
+ end
+
+ describe "resolving static providers" do
+ def resource_class(resource)
+ Chef::Resource.const_get(convert_to_class_name(resource.to_s))
+ end
+ static_mapping = {
+ apt_package: Chef::Provider::Package::Apt,
+ bash: Chef::Provider::Script,
+ bff_package: Chef::Provider::Package::Aix,
+ breakpoint: Chef::Provider::Breakpoint,
+ chef_gem: Chef::Provider::Package::Rubygems,
+ cookbook_file: Chef::Provider::CookbookFile,
+ csh: Chef::Provider::Script,
+ deploy: Chef::Provider::Deploy::Timestamped,
+ deploy_revision: Chef::Provider::Deploy::Revision,
+ directory: Chef::Provider::Directory,
+ dpkg_package: Chef::Provider::Package::Dpkg,
+ dsc_script: Chef::Provider::DscScript,
+ easy_install_package: Chef::Provider::Package::EasyInstall,
+ erl_call: Chef::Provider::ErlCall,
+ execute: Chef::Provider::Execute,
+ file: Chef::Provider::File,
+ gem_package: Chef::Provider::Package::Rubygems,
+ git: Chef::Provider::Git,
+ homebrew_package: Chef::Provider::Package::Homebrew,
+ http_request: Chef::Provider::HttpRequest,
+ ips_package: Chef::Provider::Package::Ips,
+ link: Chef::Provider::Link,
+ log: Chef::Provider::Log::ChefLog,
+ macports_package: Chef::Provider::Package::Macports,
+ pacman_package: Chef::Provider::Package::Pacman,
+ paludis_package: Chef::Provider::Package::Paludis,
+ perl: Chef::Provider::Script,
+ portage_package: Chef::Provider::Package::Portage,
+ python: Chef::Provider::Script,
+ remote_directory: Chef::Provider::RemoteDirectory,
+ route: Chef::Provider::Route,
+ rpm_package: Chef::Provider::Package::Rpm,
+ ruby: Chef::Provider::Script,
+ ruby_block: Chef::Provider::RubyBlock,
+ script: Chef::Provider::Script,
+ smartos_package: Chef::Provider::Package::SmartOS,
+ solaris_package: Chef::Provider::Package::Solaris,
+ subversion: Chef::Provider::Subversion,
+ template: Chef::Provider::Template,
+ timestamped_deploy: Chef::Provider::Deploy::Timestamped,
+ whyrun_safe_ruby_block: Chef::Provider::WhyrunSafeRubyBlock,
+ windows_package: Chef::Provider::Package::Windows,
+ windows_service: Chef::Provider::Service::Windows,
+ yum_package: Chef::Provider::Package::Yum,
+ }
+
+ describe "on Ubuntu 14.04" do
+ let(:os) { "linux" }
+ let(:platform) { "ubuntu" }
+ let(:platform_family) { "debian" }
+ let(:platform_version) { "14.04" }
+
+ supported_providers = [
+ :apt_package, :bash, :breakpoint, :chef_gem, :cookbook_file, :csh, :deploy,
+ :deploy_revision, :directory, :dpkg_package, :easy_install_package,
+ :erl_call, :execute, :file, :gem_package, :git, :http_request, :link, :log, :pacman_package, :paludis_package,
+ :perl, :python, :remote_directory, :route, :rpm_package, :ruby, :ruby_block, :script,
+ :subversion, :template, :timestamped_deploy, :whyrun_safe_ruby_block, :yum_package,
+ ]
+
+ supported_providers.each do |static_resource|
+ static_provider = static_mapping[static_resource]
+ context "when the resource is a #{static_resource}" do
+ let(:resource) { double(Chef::Resource, provider: nil, resource_name: static_resource) }
+ let(:action) { :start } # in reality this doesn't matter much
+ it "should resolve to a #{static_provider} provider" do
+ expect(provider_resolver).not_to receive(:maybe_chef_platform_lookup)
+ expect(resolved_provider).to eql(static_provider)
+ end
+ end
+ end
+
+ unsupported_providers = [
+ :bff_package, :dsc_script, :homebrew_package, :ips_package, :macports_package,
+ :smartos_package, :solaris_package, :windows_package,
+ :windows_service,
+ ]
+
+ unsupported_providers.each do |static_resource|
+ static_provider = static_mapping[static_resource]
+ context "when the resource is a #{static_resource}" do
+ let(:resource) { double(Chef::Resource, provider: nil, resource_name: static_resource) }
+ let(:action) { :start } # in reality this doesn't matter much
+ it "should fall back into the old provider mapper code and hooks" do
+ retval = Object.new
+ expect(provider_resolver).to receive(:maybe_chef_platform_lookup).and_return(retval)
+ expect(resolved_provider).to equal(retval)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/spec/unit/provider_spec.rb b/spec/unit/provider_spec.rb
index 9b89fc1888..5a21b094d0 100644
--- a/spec/unit/provider_spec.rb
+++ b/spec/unit/provider_spec.rb
@@ -74,23 +74,23 @@ describe Chef::Provider do
end
it "should store the resource passed to new as new_resource" do
- @provider.new_resource.should eql(@resource)
+ expect(@provider.new_resource).to eql(@resource)
end
it "should store the node passed to new as node" do
- @provider.node.should eql(@node)
+ expect(@provider.node).to eql(@node)
end
it "should have nil for current_resource by default" do
- @provider.current_resource.should eql(nil)
+ expect(@provider.current_resource).to eql(nil)
end
it "should not support whyrun by default" do
- @provider.send(:whyrun_supported?).should eql(false)
+ expect(@provider.send(:whyrun_supported?)).to eql(false)
end
it "should return true for action_nothing" do
- @provider.action_nothing.should eql(true)
+ expect(@provider.action_nothing).to eql(true)
end
it "evals embedded recipes with a pristine resource collection" do
@@ -98,27 +98,27 @@ describe Chef::Provider do
temporary_collection = nil
snitch = Proc.new {temporary_collection = @run_context.resource_collection}
@provider.send(:recipe_eval, &snitch)
- temporary_collection.should be_an_instance_of(Chef::ResourceCollection)
- @provider.run_context.instance_variable_get(:@resource_collection).should == "doesn't matter what this is"
+ expect(temporary_collection).to be_an_instance_of(Chef::ResourceCollection)
+ expect(@provider.run_context.instance_variable_get(:@resource_collection)).to eq("doesn't matter what this is")
end
it "does not re-load recipes when creating the temporary run context" do
# we actually want to test that RunContext#load is never called, but we
# can't stub all instances of an object with rspec's mocks. :/
- Chef::RunContext.stub(:new).and_raise("not supposed to happen")
+ allow(Chef::RunContext).to receive(:new).and_raise("not supposed to happen")
snitch = Proc.new {temporary_collection = @run_context.resource_collection}
@provider.send(:recipe_eval, &snitch)
end
context "when no converge actions are queued" do
before do
- @provider.stub(:whyrun_supported?).and_return(true)
- @provider.stub(:load_current_resource)
+ allow(@provider).to receive(:whyrun_supported?).and_return(true)
+ allow(@provider).to receive(:load_current_resource)
end
it "does not mark the new resource as updated" do
- @resource.should_not be_updated
- @resource.should_not be_updated_by_last_action
+ expect(@resource).not_to be_updated
+ expect(@resource).not_to be_updated_by_last_action
end
end
@@ -129,23 +129,23 @@ describe Chef::Provider do
end
it "should tell us that it does support whyrun" do
- @provider.should be_whyrun_supported
+ expect(@provider).to be_whyrun_supported
end
it "queues up converge actions" do
@provider.action_foo
- @provider.send(:converge_actions).should have(1).actions
+ expect(@provider.send(:converge_actions).actions.size).to eq(1)
end
it "executes pending converge actions to converge the system" do
@provider.run_action(:foo)
- @provider.instance_variable_get(:@system_state_altered).should be_true
+ expect(@provider.instance_variable_get(:@system_state_altered)).to be_truthy
end
it "marks the resource as updated" do
@provider.run_action(:foo)
- @resource.should be_updated
- @resource.should be_updated_by_last_action
+ expect(@resource).to be_updated
+ expect(@resource).to be_updated_by_last_action
end
end
@@ -160,20 +160,20 @@ describe Chef::Provider do
end
it "should tell us that it doesn't support whyrun" do
- @provider.should_not be_whyrun_supported
+ expect(@provider).not_to be_whyrun_supported
end
it "should automatically generate a converge_by block on the provider's behalf" do
@provider.run_action(:foo)
- @provider.send(:converge_actions).should have(0).actions
- @provider.system_state_altered.should be_false
+ expect(@provider.send(:converge_actions).actions.size).to eq(0)
+ expect(@provider.system_state_altered).to be_falsey
end
it "should automatically execute the generated converge_by block" do
@provider.run_action(:foo)
- @provider.system_state_altered.should be_false
- @resource.should_not be_updated
- @resource.should_not be_updated_by_last_action
+ expect(@provider.system_state_altered).to be_falsey
+ expect(@resource).not_to be_updated
+ expect(@resource).not_to be_updated_by_last_action
end
end
end
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 5b6f3ea55b..1b7506d965 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -52,50 +52,50 @@ describe Chef::Recipe do
describe "method_missing" do
describe "resources" do
it "should load a two word (zen_master) resource" do
- lambda do
+ expect do
recipe.zen_master "monkey" do
peace true
end
- end.should_not raise_error
+ end.not_to raise_error
end
it "should load a one word (cat) resource" do
- lambda do
+ expect do
recipe.cat "loulou" do
pretty_kitty true
end
- end.should_not raise_error
+ end.not_to raise_error
end
it "should load a four word (one_two_three_four) resource" do
- lambda do
+ expect do
recipe.one_two_three_four "numbers" do
i_can_count true
end
- end.should_not raise_error
+ end.not_to raise_error
end
it "should throw an error if you access a resource that we can't find" do
- lambda { recipe.not_home("not_home_resource") }.should raise_error(NameError)
+ expect { recipe.not_home("not_home_resource") }.to raise_error(NameError)
end
it "should require a name argument" do
- lambda {
+ expect {
recipe.cat
- }.should raise_error(ArgumentError, "You must supply a name when declaring a cat resource")
+ }.to raise_error(ArgumentError, "You must supply a name when declaring a cat resource")
end
it "should allow regular errors (not NameErrors) to pass unchanged" do
- lambda {
+ expect {
recipe.cat("felix") { raise ArgumentError, "You Suck" }
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should add our zen_master to the collection" do
recipe.zen_master "monkey" do
peace true
end
- run_context.resource_collection.lookup("zen_master[monkey]").name.should eql("monkey")
+ expect(run_context.resource_collection.lookup("zen_master[monkey]").name).to eql("monkey")
end
it "should add our zen masters to the collection in the order they appear" do
@@ -105,32 +105,34 @@ describe Chef::Recipe do
end
end
- run_context.resource_collection.map{|r| r.name}.should eql(["monkey", "dog", "cat"])
+ expect(run_context.resource_collection.map{|r| r.name}).to eql(["monkey", "dog", "cat"])
end
it "should return the new resource after creating it" do
res = recipe.zen_master "makoto" do
peace true
end
- res.resource_name.should eql(:zen_master)
- res.name.should eql("makoto")
+ expect(res.resource_name).to eql(:zen_master)
+ expect(res.name).to eql("makoto")
end
describe "should locate platform mapped resources" do
it "locate resource for particular platform" do
- Object.const_set('ShaunTheSheep', Class.new(Chef::Resource){ provides :laughter, :on_platforms => ["television"] })
+ ShaunTheSheep = Class.new(Chef::Resource)
+ ShaunTheSheep.provides :laughter, :on_platforms => ["television"]
node.automatic[:platform] = "television"
node.automatic[:platform_version] = "123"
res = recipe.laughter "timmy"
- res.name.should eql("timmy")
+ expect(res.name).to eql("timmy")
res.kind_of?(ShaunTheSheep)
end
it "locate a resource for all platforms" do
- Object.const_set("YourMom", Class.new(Chef::Resource){ provides :love_and_caring })
+ YourMom = Class.new(Chef::Resource)
+ YourMom.provides :love_and_caring
res = recipe.love_and_caring "mommy"
- res.name.should eql("mommy")
+ expect(res.name).to eql("mommy")
res.kind_of?(YourMom)
end
@@ -145,13 +147,13 @@ describe Chef::Recipe do
end
it "applies attributes from the block to the resource" do
- zm_resource.something.should == "bvb"
+ expect(zm_resource.something).to eq("bvb")
end
it "sets contextual attributes on the resource" do
- zm_resource.recipe_name.should == "test"
- zm_resource.cookbook_name.should == "hjk"
- zm_resource.source_line.should include(__FILE__)
+ expect(zm_resource.recipe_name).to eq("test")
+ expect(zm_resource.cookbook_name).to eq("hjk")
+ expect(zm_resource.source_line).to include(__FILE__)
end
it "does not add the resource to the resource collection" do
@@ -169,18 +171,18 @@ describe Chef::Recipe do
end
it "applies attributes from the block to the resource" do
- zm_resource.something.should == "bvb"
+ expect(zm_resource.something).to eq("bvb")
end
it "sets contextual attributes on the resource" do
- zm_resource.recipe_name.should == "test"
- zm_resource.cookbook_name.should == "hjk"
- zm_resource.source_line.should include(__FILE__)
+ expect(zm_resource.recipe_name).to eq("test")
+ expect(zm_resource.cookbook_name).to eq("hjk")
+ expect(zm_resource.source_line).to include(__FILE__)
end
it "adds the resource to the resource collection" do
zm_resource # force let binding evaluation
- run_context.resource_collection.resources(:zen_master => "klopp").should == zm_resource
+ expect(run_context.resource_collection.resources(:zen_master => "klopp")).to eq(zm_resource)
end
end
@@ -188,16 +190,7 @@ describe Chef::Recipe do
# zen_follower resource has this:
# provides :follower, :on_platforms => ["zen"]
before do
- node.stub(:[]) do |key|
- case key
- when :platform
- :zen
- when :platform_version
- "1.0.0"
- else
- nil
- end
- end
+ node.automatic_attrs[:platform] = "zen"
end
let(:resource_follower) do
@@ -208,7 +201,7 @@ describe Chef::Recipe do
it "defines the resource using the declaration name with short name" do
resource_follower
- run_context.resource_collection.lookup("follower[srst]").should_not be_nil
+ expect(run_context.resource_collection.lookup("follower[srst]")).not_to be_nil
end
end
@@ -222,25 +215,25 @@ describe Chef::Recipe do
it "defines the resource using the declaration name with long name" do
resource_zn_follower
- run_context.resource_collection.lookup("zen_follower[srst]").should_not be_nil
+ expect(run_context.resource_collection.lookup("zen_follower[srst]")).not_to be_nil
end
end
describe "when attempting to create a resource of an invalid type" do
it "gives a sane error message when using method_missing" do
- lambda do
+ expect do
recipe.no_such_resource("foo")
- end.should raise_error(NoMethodError, %q[No resource or method named `no_such_resource' for `Chef::Recipe "test"'])
+ end.to raise_error(NoMethodError, %q[No resource or method named `no_such_resource' for `Chef::Recipe "test"'])
end
it "gives a sane error message when using method_missing 'bare'" do
- lambda do
+ expect do
recipe.instance_eval do
# Giving an argument will change this from NameError to NoMethodError
no_such_resource
end
- end.should raise_error(NameError, %q[No resource, method, or local variable named `no_such_resource' for `Chef::Recipe "test"'])
+ end.to raise_error(NameError, %q[No resource, method, or local variable named `no_such_resource' for `Chef::Recipe "test"'])
end
it "gives a sane error message when using build_resource" do
@@ -256,11 +249,11 @@ describe Chef::Recipe do
describe "when creating a resource that contains an error in the attributes block" do
it "does not obfuscate the error source" do
- lambda do
+ expect do
recipe.zen_master("klopp") do
this_method_doesnt_exist
end
- end.should raise_error(NoMethodError, "undefined method `this_method_doesnt_exist' for Chef::Resource::ZenMaster")
+ end.to raise_error(NoMethodError, "undefined method `this_method_doesnt_exist' for Chef::Resource::ZenMaster")
end
@@ -287,28 +280,28 @@ describe Chef::Recipe do
end
it "copies attributes from the first resource" do
- duplicated_resource.something.should == "bvb09"
+ expect(duplicated_resource.something).to eq("bvb09")
end
it "does not copy the action from the first resource" do
- original_resource.action.should == [:score]
- duplicated_resource.action.should == :nothing
+ expect(original_resource.action).to eq([:score])
+ expect(duplicated_resource.action).to eq(:nothing)
end
it "does not copy the source location of the first resource" do
# sanity check source location:
- original_resource.source_line.should include(__FILE__)
- duplicated_resource.source_line.should include(__FILE__)
+ expect(original_resource.source_line).to include(__FILE__)
+ expect(duplicated_resource.source_line).to include(__FILE__)
# actual test:
- original_resource.source_line.should_not == duplicated_resource.source_line
+ expect(original_resource.source_line).not_to eq(duplicated_resource.source_line)
end
it "sets the cookbook name on the cloned resource to that resource's cookbook" do
- duplicated_resource.cookbook_name.should == "second_cb"
+ expect(duplicated_resource.cookbook_name).to eq("second_cb")
end
it "sets the recipe name on the cloned resource to that resoure's recipe" do
- duplicated_resource.recipe_name.should == "second_recipe"
+ expect(duplicated_resource.recipe_name).to eq("second_recipe")
end
end
@@ -326,8 +319,8 @@ describe Chef::Recipe do
recipe.crow "mine" do
peace true
end
- run_context.resource_collection.resources(:zen_master => "lao tzu").name.should eql("lao tzu")
- run_context.resource_collection.resources(:zen_master => "lao tzu").something.should eql(true)
+ expect(run_context.resource_collection.resources(:zen_master => "lao tzu").name).to eql("lao tzu")
+ expect(run_context.resource_collection.resources(:zen_master => "lao tzu").something).to eql(true)
end
it "should set the node on defined resources" do
@@ -343,7 +336,19 @@ describe Chef::Recipe do
recipe.crow "mine" do
something node[:foo]
end
- recipe.resources(:zen_master => "lao tzu").something.should eql(false)
+ expect(recipe.resources(:zen_master => "lao tzu").something).to eql(false)
+ end
+
+ it "should return the last statement in the definition as the retval" do
+ crow_define = Chef::ResourceDefinition.new
+ crow_define.define :crow, :peace => false, :something => true do
+ "the return val"
+ end
+ run_context.definitions[:crow] = crow_define
+ crow_block = recipe.crow "mine" do
+ peace true
+ end
+ expect(crow_block).to eql("the return val")
end
end
@@ -356,8 +361,8 @@ describe Chef::Recipe do
peace = true
end
CODE
- lambda { recipe.instance_eval(code) }.should_not raise_error
- recipe.resources(:zen_master => "gnome").name.should eql("gnome")
+ expect { recipe.instance_eval(code) }.not_to raise_error
+ expect(recipe.resources(:zen_master => "gnome").name).to eql("gnome")
end
end
@@ -366,7 +371,7 @@ describe Chef::Recipe do
code = <<-CODE
exec 'do_not_try_to_exec'
CODE
- lambda { recipe.instance_eval(code) }.should raise_error(Chef::Exceptions::ResourceNotFound)
+ expect { recipe.instance_eval(code) }.to raise_error(Chef::Exceptions::ResourceNotFound)
end
end
@@ -374,100 +379,108 @@ describe Chef::Recipe do
it "should load a resource from a ruby file" do
recipe.from_file(File.join(CHEF_SPEC_DATA, "recipes", "test.rb"))
res = recipe.resources(:file => "/etc/nsswitch.conf")
- res.name.should eql("/etc/nsswitch.conf")
- res.action.should eql([:create])
- res.owner.should eql("root")
- res.group.should eql("root")
- res.mode.should eql(0644)
+ expect(res.name).to eql("/etc/nsswitch.conf")
+ expect(res.action).to eql([:create])
+ expect(res.owner).to eql("root")
+ expect(res.group).to eql("root")
+ expect(res.mode).to eql(0644)
end
it "should raise an exception if the file cannot be found or read" do
- lambda { recipe.from_file("/tmp/monkeydiving") }.should raise_error(IOError)
+ expect { recipe.from_file("/tmp/monkeydiving") }.to raise_error(IOError)
end
end
describe "include_recipe" do
it "should evaluate another recipe with include_recipe" do
- node.should_receive(:loaded_recipe).with(:openldap, "gigantor")
- run_context.stub(:unreachable_cookbook?).with(:openldap).and_return(false)
+ expect(node).to receive(:loaded_recipe).with(:openldap, "gigantor")
+ allow(run_context).to receive(:unreachable_cookbook?).with(:openldap).and_return(false)
run_context.include_recipe "openldap::gigantor"
res = run_context.resource_collection.resources(:cat => "blanket")
- res.name.should eql("blanket")
- res.pretty_kitty.should eql(false)
+ expect(res.name).to eql("blanket")
+ expect(res.pretty_kitty).to eql(false)
end
it "should load the default recipe for a cookbook if include_recipe is called without a ::" do
- node.should_receive(:loaded_recipe).with(:openldap, "default")
- run_context.stub(:unreachable_cookbook?).with(:openldap).and_return(false)
+ expect(node).to receive(:loaded_recipe).with(:openldap, "default")
+ allow(run_context).to receive(:unreachable_cookbook?).with(:openldap).and_return(false)
run_context.include_recipe "openldap"
res = run_context.resource_collection.resources(:cat => "blanket")
- res.name.should eql("blanket")
- res.pretty_kitty.should eql(true)
+ expect(res.name).to eql("blanket")
+ expect(res.pretty_kitty).to eql(true)
end
it "should store that it has seen a recipe in the run_context" do
- node.should_receive(:loaded_recipe).with(:openldap, "default")
- run_context.stub(:unreachable_cookbook?).with(:openldap).and_return(false)
+ expect(node).to receive(:loaded_recipe).with(:openldap, "default")
+ allow(run_context).to receive(:unreachable_cookbook?).with(:openldap).and_return(false)
run_context.include_recipe "openldap"
- run_context.loaded_recipe?("openldap").should be_true
+ expect(run_context.loaded_recipe?("openldap")).to be_truthy
end
it "should not include the same recipe twice" do
- node.should_receive(:loaded_recipe).with(:openldap, "default").exactly(:once)
- run_context.stub(:unreachable_cookbook?).with(:openldap).and_return(false)
- cookbook_collection[:openldap].should_receive(:load_recipe).with("default", run_context)
+ expect(node).to receive(:loaded_recipe).with(:openldap, "default").exactly(:once)
+ allow(run_context).to receive(:unreachable_cookbook?).with(:openldap).and_return(false)
+ expect(cookbook_collection[:openldap]).to receive(:load_recipe).with("default", run_context)
recipe.include_recipe "openldap"
- cookbook_collection[:openldap].should_not_receive(:load_recipe).with("default", run_context)
+ expect(cookbook_collection[:openldap]).not_to receive(:load_recipe).with("default", run_context)
recipe.include_recipe "openldap"
end
end
describe "tags" do
+ describe "with the default node object" do
+ let(:node) { Chef::Node.new }
+
+ it "should return false for any tags" do
+ expect(recipe.tagged?("foo")).to be(false)
+ end
+ end
+
it "should set tags via tag" do
recipe.tag "foo"
- node[:tags].should include("foo")
+ expect(node[:tags]).to include("foo")
end
it "should set multiple tags via tag" do
recipe.tag "foo", "bar"
- node[:tags].should include("foo")
- node[:tags].should include("bar")
+ expect(node[:tags]).to include("foo")
+ expect(node[:tags]).to include("bar")
end
it "should not set the same tag twice via tag" do
recipe.tag "foo"
recipe.tag "foo"
- node[:tags].should eql([ "foo" ])
+ expect(node[:tags]).to eql([ "foo" ])
end
it "should return the current list of tags from tag with no arguments" do
recipe.tag "foo"
- recipe.tag.should eql([ "foo" ])
+ expect(recipe.tag).to eql([ "foo" ])
end
it "should return true from tagged? if node is tagged" do
recipe.tag "foo"
- recipe.tagged?("foo").should be(true)
+ expect(recipe.tagged?("foo")).to be(true)
end
it "should return false from tagged? if node is not tagged" do
- recipe.tagged?("foo").should be(false)
+ expect(recipe.tagged?("foo")).to be(false)
end
it "should return false from tagged? if node is not tagged" do
- recipe.tagged?("foo").should be(false)
+ expect(recipe.tagged?("foo")).to be(false)
end
it "should remove a tag from the tag list via untag" do
recipe.tag "foo"
recipe.untag "foo"
- node[:tags].should eql([])
+ expect(node[:tags]).to eql([])
end
it "should remove multiple tags from the tag list via untag" do
recipe.tag "foo", "bar"
recipe.untag "bar", "foo"
- node[:tags].should eql([])
+ expect(node[:tags]).to eql([])
end
end
end
diff --git a/spec/unit/registry_helper_spec.rb b/spec/unit/registry_helper_spec.rb
index 444a82dc7c..036a0834db 100644
--- a/spec/unit/registry_helper_spec.rb
+++ b/spec/unit/registry_helper_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Provider::RegistryKey do
let(:missing_key_path) {'HKCU\Software'}
before(:each) do
- Chef::Win32::Registry.any_instance.stub(:machine_architecture).and_return(:x86_64)
+ allow_any_instance_of(Chef::Win32::Registry).to receive(:machine_architecture).and_return(:x86_64)
@registry = Chef::Win32::Registry.new()
#Making the values for registry constants available on unix
@@ -49,328 +49,328 @@ describe Chef::Provider::RegistryKey do
describe "get_values" do
it "gets all values for a key if the key exists" do
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:map)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:map)
@registry.get_values(key_path)
end
it "throws an exception if key does not exist" do
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
- lambda{@registry.get_values(key_path)}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
+ expect{@registry.get_values(key_path)}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
end
describe "set_value" do
it "does nothing if key and hive and value exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(true)
- @registry.should_receive(:data_exists?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:data_exists?).with(key_path, value1).and_return(true)
@registry.set_value(key_path, value1)
end
it "updates value if key and hive and value exist, but data is different" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(true)
- @registry.should_receive(:data_exists?).with(key_path, value1).and_return(false)
- @hive_mock.should_receive(:open).with(key, Win32::Registry::KEY_SET_VALUE | ::Win32::Registry::KEY_QUERY_VALUE | @registry.registry_system_architecture).and_yield(@reg_mock)
- @registry.should_receive(:get_type_from_name).with(:string).and_return(1)
- @reg_mock.should_receive(:write).with("one", 1, "1")
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:data_exists?).with(key_path, value1).and_return(false)
+ expect(@hive_mock).to receive(:open).with(key, Win32::Registry::KEY_SET_VALUE | ::Win32::Registry::KEY_QUERY_VALUE | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@registry).to receive(:get_type_from_name).with(:string).and_return(1)
+ expect(@reg_mock).to receive(:write).with("one", 1, "1")
@registry.set_value(key_path, value1)
end
it "creates value if the key exists and the value does not exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(false)
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_SET_VALUE | ::Win32::Registry::KEY_QUERY_VALUE | @registry.registry_system_architecture).and_yield(@reg_mock)
- @registry.should_receive(:get_type_from_name).with(:string).and_return(1)
- @reg_mock.should_receive(:write).with("one", 1, "1")
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(false)
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_SET_VALUE | ::Win32::Registry::KEY_QUERY_VALUE | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@registry).to receive(:get_type_from_name).with(:string).and_return(1)
+ expect(@reg_mock).to receive(:write).with("one", 1, "1")
@registry.set_value(key_path, value1)
end
it "should raise an exception if the key does not exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
- lambda {@registry.set_value(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect(@registry).to receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.set_value(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
end
describe "delete_value" do
it "deletes value if value exists" do
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_SET_VALUE | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:delete_value).with("one").and_return(true)
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_SET_VALUE | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:delete_value).with("one").and_return(true)
@registry.delete_value(key_path, value1)
end
it "raises an exception if the key does not exist" do
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
@registry.delete_value(key_path, value1)
end
it "does nothing if the value does not exist" do
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(false)
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(false)
@registry.delete_value(key_path, value1)
end
end
describe "create_key" do
it "creates key if intermediate keys are missing and recursive is set to true" do
- @registry.should_receive(:keys_missing?).with(key_path).and_return(true)
- @registry.should_receive(:create_missing).with(key_path)
- @registry.should_receive(:key_exists?).with(key_path).and_return(false)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:create).with(key, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture)
+ expect(@registry).to receive(:keys_missing?).with(key_path).and_return(true)
+ expect(@registry).to receive(:create_missing).with(key_path)
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(false)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:create).with(key, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture)
@registry.create_key(key_path, true)
end
it "raises an exception if intermediate keys are missing and recursive is set to false" do
- @registry.should_receive(:keys_missing?).with(key_path).and_return(true)
- lambda{@registry.create_key(key_path, false)}.should raise_error(Chef::Exceptions::Win32RegNoRecursive)
+ expect(@registry).to receive(:keys_missing?).with(key_path).and_return(true)
+ expect{@registry.create_key(key_path, false)}.to raise_error(Chef::Exceptions::Win32RegNoRecursive)
end
it "does nothing if the key exists" do
- @registry.should_receive(:keys_missing?).with(key_path).and_return(true)
- @registry.should_receive(:create_missing).with(key_path)
- @registry.should_receive(:key_exists?).with(key_path).and_return(true)
+ expect(@registry).to receive(:keys_missing?).with(key_path).and_return(true)
+ expect(@registry).to receive(:create_missing).with(key_path)
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(true)
@registry.create_key(key_path, true)
end
it "create key if intermediate keys not missing and recursive is set to false" do
- @registry.should_receive(:keys_missing?).with(key_path).and_return(false)
- @registry.should_receive(:key_exists?).with(key_path).and_return(false)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:create).with(key, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture)
+ expect(@registry).to receive(:keys_missing?).with(key_path).and_return(false)
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(false)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:create).with(key, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture)
@registry.create_key(key_path, false)
end
it "create key if intermediate keys not missing and recursive is set to true" do
- @registry.should_receive(:keys_missing?).with(key_path).and_return(false)
- @registry.should_receive(:key_exists?).with(key_path).and_return(false)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:create).with(key, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture)
+ expect(@registry).to receive(:keys_missing?).with(key_path).and_return(false)
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(false)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:create).with(key, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture)
@registry.create_key(key_path, true)
end
end
describe "delete_key", :windows_only do
it "deletes key if it has subkeys and recursive is set to true" do
- @registry.should_receive(:key_exists?).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:has_subkeys?).with(key_path).and_return(true)
- @registry.should_receive(:get_subkeys).with(key_path).and_return([sub_key])
- @registry.should_receive(:key_exists?).with(key_path+"\\"+sub_key).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path+"\\"+sub_key).and_return([@hive_mock, key+"\\"+sub_key])
- @registry.should_receive(:has_subkeys?).with(key_path+"\\"+sub_key).and_return(false)
- @registry.should_receive(:delete_key_ex).twice
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:has_subkeys?).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_subkeys).with(key_path).and_return([sub_key])
+ expect(@registry).to receive(:key_exists?).with(key_path+"\\"+sub_key).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path+"\\"+sub_key).and_return([@hive_mock, key+"\\"+sub_key])
+ expect(@registry).to receive(:has_subkeys?).with(key_path+"\\"+sub_key).and_return(false)
+ expect(@registry).to receive(:delete_key_ex).twice
@registry.delete_key(key_path, true)
end
it "raises an exception if it has subkeys but recursive is set to false" do
- @registry.should_receive(:key_exists?).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:has_subkeys?).with(key_path).and_return(true)
- lambda{@registry.delete_key(key_path, false)}.should raise_error(Chef::Exceptions::Win32RegNoRecursive)
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:has_subkeys?).with(key_path).and_return(true)
+ expect{@registry.delete_key(key_path, false)}.to raise_error(Chef::Exceptions::Win32RegNoRecursive)
end
it "deletes key if the key exists and has no subkeys" do
- @registry.should_receive(:key_exists?).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:has_subkeys?).with(key_path).and_return(false)
- @registry.should_receive(:delete_key_ex)
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:has_subkeys?).with(key_path).and_return(false)
+ expect(@registry).to receive(:delete_key_ex)
@registry.delete_key(key_path, true)
end
end
describe "key_exists?" do
it "returns true if key_exists" do
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @registry.key_exists?(key_path).should == true
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@registry.key_exists?(key_path)).to eq(true)
end
it "returns false if key does not exist" do
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_raise(::Win32::Registry::Error)
- @registry.key_exists?(key_path).should == false
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_raise(::Win32::Registry::Error)
+ expect(@registry.key_exists?(key_path)).to eq(false)
end
end
describe "key_exists!" do
it "throws an exception if the key_parent does not exist" do
- @registry.should_receive(:key_exists?).with(key_path).and_return(false)
- lambda{@registry.key_exists!(key_path)}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect(@registry).to receive(:key_exists?).with(key_path).and_return(false)
+ expect{@registry.key_exists!(key_path)}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
end
describe "hive_exists?" do
it "returns true if the hive exists" do
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
@registry.hive_exists?(key_path) == true
end
it "returns false if the hive does not exist" do
- @registry.should_receive(:get_hive_and_key).with(key_path).and_raise(Chef::Exceptions::Win32RegHiveMissing)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_raise(Chef::Exceptions::Win32RegHiveMissing)
@registry.hive_exists?(key_path) == false
end
end
describe "has_subkeys?" do
it "returns true if the key has subkeys" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:each_key).and_yield(key)
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:each_key).and_yield(key)
@registry.has_subkeys?(key_path) == true
end
it "returns false if the key does not have subkeys" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:each_key).and_return(no_args())
- @registry.has_subkeys?(key_path).should == false
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:each_key).and_return(no_args())
+ expect(@registry.has_subkeys?(key_path)).to eq(false)
end
it "throws an exception if the key does not exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
- lambda {@registry.set_value(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect(@registry).to receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.set_value(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
end
describe "get_subkeys" do
it "returns the subkeys if they exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:each_key).and_yield(sub_key)
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:each_key).and_yield(sub_key)
@registry.get_subkeys(key_path)
end
end
describe "value_exists?" do
it "throws an exception if the key does not exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
- lambda {@registry.value_exists?(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect(@registry).to receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.value_exists?(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if the value exists" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:any?).and_yield("one")
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:any?).and_yield("one")
@registry.value_exists?(key_path, value1) == true
end
it "returns false if the value does not exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:any?).and_yield(no_args())
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:any?).and_yield(no_args())
@registry.value_exists?(key_path, value1) == false
end
end
describe "data_exists?" do
it "throws an exception if the key does not exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
- lambda {@registry.data_exists?(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect(@registry).to receive(:key_exists!).with(key_path).and_raise(Chef::Exceptions::Win32RegKeyMissing)
+ expect {@registry.data_exists?(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if the data exists" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @registry.should_receive(:get_type_from_name).with(:string).and_return(1)
- @reg_mock.should_receive(:each).with(no_args()).and_yield("one", 1, "1")
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @registry.data_exists?(key_path, value1).should == true
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@registry).to receive(:get_type_from_name).with(:string).and_return(1)
+ expect(@reg_mock).to receive(:each).with(no_args()).and_yield("one", 1, "1")
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@registry.data_exists?(key_path, value1)).to eq(true)
end
it "returns false if the data does not exist" do
- @registry.should_receive(:key_exists!).with(key_path).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @registry.should_receive(:get_type_from_name).with(:string).and_return(1)
- @reg_mock.should_receive(:each).with(no_args()).and_yield("one", 1, "2")
- @registry.data_exists?(key_path, value1).should == false
+ expect(@registry).to receive(:key_exists!).with(key_path).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@registry).to receive(:get_type_from_name).with(:string).and_return(1)
+ expect(@reg_mock).to receive(:each).with(no_args()).and_yield("one", 1, "2")
+ expect(@registry.data_exists?(key_path, value1)).to eq(false)
end
end
describe "value_exists!" do
it "does nothing if the value exists" do
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(true)
@registry.value_exists!(key_path, value1)
end
it "throws an exception if the value does not exist" do
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(false)
- lambda{@registry.value_exists!(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegValueMissing)
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(false)
+ expect{@registry.value_exists!(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegValueMissing)
end
end
describe "data_exists!" do
it "does nothing if the data exists" do
- @registry.should_receive(:data_exists?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:data_exists?).with(key_path, value1).and_return(true)
@registry.data_exists!(key_path, value1)
end
it "throws an exception if the data does not exist" do
- @registry.should_receive(:data_exists?).with(key_path, value1).and_return(false)
- lambda{@registry.data_exists!(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegDataMissing)
+ expect(@registry).to receive(:data_exists?).with(key_path, value1).and_return(false)
+ expect{@registry.data_exists!(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegDataMissing)
end
end
describe "type_matches?" do
it "returns true if type matches" do
- @registry.should_receive(:value_exists!).with(key_path, value1).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @registry.should_receive(:get_type_from_name).with(:string).and_return(1)
- @reg_mock.should_receive(:each).and_yield("one", 1)
- @registry.type_matches?(key_path, value1).should == true
+ expect(@registry).to receive(:value_exists!).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@registry).to receive(:get_type_from_name).with(:string).and_return(1)
+ expect(@reg_mock).to receive(:each).and_yield("one", 1)
+ expect(@registry.type_matches?(key_path, value1)).to eq(true)
end
it "returns false if type does not match" do
- @registry.should_receive(:value_exists!).with(key_path, value1).and_return(true)
- @registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
- @hive_mock.should_receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:each).and_yield("two", 2)
- @registry.type_matches?(key_path, value1).should == false
+ expect(@registry).to receive(:value_exists!).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
+ expect(@hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | @registry.registry_system_architecture).and_yield(@reg_mock)
+ expect(@reg_mock).to receive(:each).and_yield("two", 2)
+ expect(@registry.type_matches?(key_path, value1)).to eq(false)
end
it "throws an exception if value does not exist" do
- @registry.should_receive(:value_exists?).with(key_path, value1).and_return(false)
- lambda{@registry.type_matches?(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegValueMissing)
+ expect(@registry).to receive(:value_exists?).with(key_path, value1).and_return(false)
+ expect{@registry.type_matches?(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegValueMissing)
end
end
describe "type_matches!" do
it "does nothing if the type_matches" do
- @registry.should_receive(:type_matches?).with(key_path, value1).and_return(true)
+ expect(@registry).to receive(:type_matches?).with(key_path, value1).and_return(true)
@registry.type_matches!(key_path, value1)
end
it "throws an exception if the type does not match" do
- @registry.should_receive(:type_matches?).with(key_path, value1).and_return(false)
- lambda{@registry.type_matches!(key_path, value1)}.should raise_error(Chef::Exceptions::Win32RegTypesMismatch)
+ expect(@registry).to receive(:type_matches?).with(key_path, value1).and_return(false)
+ expect{@registry.type_matches!(key_path, value1)}.to raise_error(Chef::Exceptions::Win32RegTypesMismatch)
end
end
describe "keys_missing?" do
it "returns true if the keys are missing" do
- @registry.should_receive(:key_exists?).with(missing_key_path).and_return(false)
- @registry.keys_missing?(key_path).should == true
+ expect(@registry).to receive(:key_exists?).with(missing_key_path).and_return(false)
+ expect(@registry.keys_missing?(key_path)).to eq(true)
end
it "returns false if no keys in the path are missing" do
- @registry.should_receive(:key_exists?).with(missing_key_path).and_return(true)
- @registry.keys_missing?(key_path).should == false
+ expect(@registry).to receive(:key_exists?).with(missing_key_path).and_return(true)
+ expect(@registry.keys_missing?(key_path)).to eq(false)
end
end
end
diff --git a/spec/unit/resource/apt_package_spec.rb b/spec/unit/resource/apt_package_spec.rb
index 58b007c327..be8eb9c324 100644
--- a/spec/unit/resource/apt_package_spec.rb
+++ b/spec/unit/resource/apt_package_spec.rb
@@ -17,27 +17,24 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::AptPackage, "initialize" do
+ static_provider_resolution(
+ resource: Chef::Resource::AptPackage,
+ provider: Chef::Provider::Package::Apt,
+ name: :apt_package,
+ action: :install,
+ os: "linux",
+ )
+
before(:each) do
@resource = Chef::Resource::AptPackage.new("foo")
end
- it "should return a Chef::Resource::AptPackage" do
- @resource.should be_a_kind_of(Chef::Resource::AptPackage)
- end
-
- it "should set the resource_name to :apt_package" do
- @resource.resource_name.should eql(:apt_package)
- end
-
- it "should set the provider to Chef::Provider::Package::Apt" do
- @resource.provider.should eql(Chef::Provider::Package::Apt)
- end
-
it "should support default_release" do
@resource.default_release("lenny-backports")
- @resource.default_release.should eql("lenny-backports")
+ expect(@resource.default_release).to eql("lenny-backports")
end
end
diff --git a/spec/unit/resource/bash_spec.rb b/spec/unit/resource/bash_spec.rb
index d729db6977..f313900433 100644
--- a/spec/unit/resource/bash_spec.rb
+++ b/spec/unit/resource/bash_spec.rb
@@ -25,16 +25,16 @@ describe Chef::Resource::Bash do
end
it "should create a new Chef::Resource::Bash" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Bash)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Bash)
end
it "should have a resource name of :bash" do
- @resource.resource_name.should eql(:bash)
+ expect(@resource.resource_name).to eql(:bash)
end
it "should have an interpreter of bash" do
- @resource.interpreter.should eql("bash")
+ expect(@resource.interpreter).to eql("bash")
end
end
diff --git a/spec/unit/resource/batch_spec.rb b/spec/unit/resource/batch_spec.rb
index b74c7d24a7..4a056b8735 100644
--- a/spec/unit/resource/batch_spec.rb
+++ b/spec/unit/resource/batch_spec.rb
@@ -33,7 +33,7 @@ describe Chef::Resource::Batch do
end
it "should create a new Chef::Resource::Batch" do
- @resource.should be_a_kind_of(Chef::Resource::Batch)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Batch)
end
context "windows script" do
diff --git a/spec/unit/resource/breakpoint_spec.rb b/spec/unit/resource/breakpoint_spec.rb
index 412211a038..ed1f3ebcd5 100644
--- a/spec/unit/resource/breakpoint_spec.rb
+++ b/spec/unit/resource/breakpoint_spec.rb
@@ -17,27 +17,31 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::Breakpoint do
+ static_provider_resolution(
+ resource: Chef::Resource::Breakpoint,
+ provider: Chef::Provider::Breakpoint,
+ name: :breakpoint,
+ action: :break,
+ )
+
before do
@breakpoint = Chef::Resource::Breakpoint.new
end
it "allows the action :break" do
- @breakpoint.allowed_actions.should include(:break)
+ expect(@breakpoint.allowed_actions).to include(:break)
end
it "defaults to the break action" do
- @breakpoint.action.should == "break"
+ expect(@breakpoint.action).to eq("break")
end
it "names itself after the line number of the file where it's created" do
- @breakpoint.name.should match(/breakpoint_spec\.rb\:[\d]{2}\:in \`new\'$/)
- end
-
- it "uses the breakpoint provider" do
- @breakpoint.provider.should == Chef::Provider::Breakpoint
+ expect(@breakpoint.name).to match(/breakpoint_spec\.rb\:[\d]{2}\:in \`new\'$/)
end
end
diff --git a/spec/unit/resource/chef_gem_spec.rb b/spec/unit/resource/chef_gem_spec.rb
index dda65f8741..480856d19f 100644
--- a/spec/unit/resource/chef_gem_spec.rb
+++ b/spec/unit/resource/chef_gem_spec.rb
@@ -18,24 +18,17 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::ChefGem, "initialize" do
- before(:each) do
- @resource = Chef::Resource::ChefGem.new("foo")
- end
-
- it "should return a Chef::Resource::ChefGem" do
- @resource.should be_a_kind_of(Chef::Resource::ChefGem)
- end
-
- it "should set the resource_name to :chef_gem" do
- @resource.resource_name.should eql(:chef_gem)
- end
+ static_provider_resolution(
+ resource: Chef::Resource::ChefGem,
+ provider: Chef::Provider::Package::Rubygems,
+ name: :chef_gem,
+ action: :install,
+ )
- it "should set the provider to Chef::Provider::Package::Rubygems" do
- @resource.provider.should eql(Chef::Provider::Package::Rubygems)
- end
end
describe Chef::Resource::ChefGem, "gem_binary" do
@@ -45,7 +38,7 @@ describe Chef::Resource::ChefGem, "gem_binary" do
end
it "should raise an exception when gem_binary is set" do
- lambda { @resource.gem_binary("/lol/cats/gem") }.should raise_error(ArgumentError)
+ expect { @resource.gem_binary("/lol/cats/gem") }.to raise_error(ArgumentError)
end
it "should set the gem_binary based on computing it from RbConfig" do
diff --git a/spec/unit/resource/conditional_action_not_nothing_spec.rb b/spec/unit/resource/conditional_action_not_nothing_spec.rb
index 49bc0ad57d..d140615cfc 100644
--- a/spec/unit/resource/conditional_action_not_nothing_spec.rb
+++ b/spec/unit/resource/conditional_action_not_nothing_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Resource::ConditionalActionNotNothing do
end
it "indicates that resource convergence should not continue" do
- @conditional.continue?.should be_false
+ expect(@conditional.continue?).to be_falsey
end
end
@@ -38,7 +38,7 @@ describe Chef::Resource::ConditionalActionNotNothing do
end
it "indicates that resource convergence should continue" do
- @conditional.continue?.should be_true
+ expect(@conditional.continue?).to be_truthy
end
end
diff --git a/spec/unit/resource/conditional_spec.rb b/spec/unit/resource/conditional_spec.rb
index 1fc2518013..779c69425a 100644
--- a/spec/unit/resource/conditional_spec.rb
+++ b/spec/unit/resource/conditional_spec.rb
@@ -21,9 +21,9 @@ require 'ostruct'
describe Chef::Resource::Conditional do
before do
- Mixlib::ShellOut.any_instance.stub(:run_command).and_return(nil)
+ allow_any_instance_of(Mixlib::ShellOut).to receive(:run_command).and_return(nil)
@status = OpenStruct.new(:success? => true)
- Mixlib::ShellOut.any_instance.stub(:status).and_return(@status)
+ allow_any_instance_of(Mixlib::ShellOut).to receive(:status).and_return(@status)
@parent_resource = Chef::Resource.new(nil, Chef::Node.new)
end
@@ -53,7 +53,7 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should continue" do
- @conditional.continue?.should be_true
+ expect(@conditional.continue?).to be_truthy
end
end
@@ -64,22 +64,22 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should not continue" do
- @conditional.continue?.should be_false
+ expect(@conditional.continue?).to be_falsey
end
end
describe 'after running a command which timed out' do
before do
@conditional = Chef::Resource::Conditional.only_if(@parent_resource, "false")
- Chef::GuardInterpreter::DefaultGuardInterpreter.any_instance.stub(:shell_out).and_raise(Chef::Exceptions::CommandTimeout)
+ allow_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).to receive(:shell_out).and_raise(Chef::Exceptions::CommandTimeout)
end
it 'indicates that resource convergence should not continue' do
- @conditional.continue?.should be_false
+ expect(@conditional.continue?).to be_falsey
end
it 'should log a warning' do
- Chef::Log.should_receive(:warn).with("Command 'false' timed out")
+ expect(Chef::Log).to receive(:warn).with("Command 'false' timed out")
@conditional.continue?
end
end
@@ -90,7 +90,7 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should continue" do
- @conditional.continue?.should be_true
+ expect(@conditional.continue?).to be_truthy
end
end
@@ -100,7 +100,7 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should not continue" do
- @conditional.continue?.should be_false
+ expect(@conditional.continue?).to be_falsey
end
end
end
@@ -112,7 +112,7 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should not continue" do
- @conditional.continue?.should be_false
+ expect(@conditional.continue?).to be_falsey
end
end
@@ -123,22 +123,22 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should continue" do
- @conditional.continue?.should be_true
+ expect(@conditional.continue?).to be_truthy
end
end
describe 'after running a command which timed out' do
before do
@conditional = Chef::Resource::Conditional.not_if(@parent_resource, "false")
- Chef::GuardInterpreter::DefaultGuardInterpreter.any_instance.stub(:shell_out).and_raise(Chef::Exceptions::CommandTimeout)
+ allow_any_instance_of(Chef::GuardInterpreter::DefaultGuardInterpreter).to receive(:shell_out).and_raise(Chef::Exceptions::CommandTimeout)
end
it 'indicates that resource convergence should continue' do
- @conditional.continue?.should be_true
+ expect(@conditional.continue?).to be_truthy
end
it 'should log a warning' do
- Chef::Log.should_receive(:warn).with("Command 'false' timed out")
+ expect(Chef::Log).to receive(:warn).with("Command 'false' timed out")
@conditional.continue?
end
end
@@ -149,7 +149,7 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should not continue" do
- @conditional.continue?.should be_false
+ expect(@conditional.continue?).to be_falsey
end
end
@@ -159,7 +159,7 @@ describe Chef::Resource::Conditional do
end
it "indicates that resource convergence should continue" do
- @conditional.continue?.should be_true
+ expect(@conditional.continue?).to be_truthy
end
end
end
diff --git a/spec/unit/resource/cookbook_file_spec.rb b/spec/unit/resource/cookbook_file_spec.rb
index 6c55c8035a..834e08bba4 100644
--- a/spec/unit/resource/cookbook_file_spec.rb
+++ b/spec/unit/resource/cookbook_file_spec.rb
@@ -25,25 +25,25 @@ describe Chef::Resource::CookbookFile do
end
it "uses the name parameter for the source parameter" do
- @cookbook_file.name.should == 'sourcecode_tarball.tgz'
+ expect(@cookbook_file.name).to eq('sourcecode_tarball.tgz')
end
it "has a source parameter" do
@cookbook_file.name('config_file.conf')
- @cookbook_file.name.should == 'config_file.conf'
+ expect(@cookbook_file.name).to eq('config_file.conf')
end
it "defaults to a nil cookbook parameter (current cookbook will be used)" do
- @cookbook_file.cookbook.should be_nil
+ expect(@cookbook_file.cookbook).to be_nil
end
it "has a cookbook parameter" do
@cookbook_file.cookbook("munin")
- @cookbook_file.cookbook.should == 'munin'
+ expect(@cookbook_file.cookbook).to eq('munin')
end
it "sets the provider to Chef::Provider::CookbookFile" do
- @cookbook_file.provider.should == Chef::Provider::CookbookFile
+ expect(@cookbook_file.provider).to eq(Chef::Provider::CookbookFile)
end
describe "when it has a backup number, group, mode, owner, source, checksum, and cookbook on nix or path, rights, deny_rights, checksum on windows" do
@@ -68,21 +68,21 @@ describe Chef::Resource::CookbookFile do
state = @cookbook_file.state
if Chef::Platform.windows?
puts state
- state[:rights].should == [{:permissions => :read, :principals => "Everyone"}]
- state[:deny_rights].should == [{:permissions => :full_control, :principals => "Clumsy_Sam"}]
+ expect(state[:rights]).to eq([{:permissions => :read, :principals => "Everyone"}])
+ expect(state[:deny_rights]).to eq([{:permissions => :full_control, :principals => "Clumsy_Sam"}])
else
- state[:group].should == "wheel"
- state[:mode].should == "0664"
- state[:owner].should == "root"
+ expect(state[:group]).to eq("wheel")
+ expect(state[:mode]).to eq("0664")
+ expect(state[:owner]).to eq("root")
end
- state[:checksum].should == "1" * 64
+ expect(state[:checksum]).to eq("1" * 64)
end
it "returns the path as its identity" do
if Chef::Platform.windows?
- @cookbook_file.identity.should == "C:/temp/origin/file.txt"
+ expect(@cookbook_file.identity).to eq("C:/temp/origin/file.txt")
else
- @cookbook_file.identity.should == "/tmp/origin/file.txt"
+ expect(@cookbook_file.identity).to eq("/tmp/origin/file.txt")
end
end
end
diff --git a/spec/unit/resource/cron_spec.rb b/spec/unit/resource/cron_spec.rb
index cf821e3d32..743552c1de 100644
--- a/spec/unit/resource/cron_spec.rb
+++ b/spec/unit/resource/cron_spec.rb
@@ -26,135 +26,135 @@ describe Chef::Resource::Cron do
end
it "should create a new Chef::Resource::Cron" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Cron)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Cron)
end
it "should have a name" do
- @resource.name.should eql("cronify")
+ expect(@resource.name).to eql("cronify")
end
it "should have a default action of 'create'" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
it "should accept create or delete for action" do
- lambda { @resource.action :create }.should_not raise_error
- lambda { @resource.action :delete }.should_not raise_error
- lambda { @resource.action :lolcat }.should raise_error(ArgumentError)
+ expect { @resource.action :create }.not_to raise_error
+ expect { @resource.action :delete }.not_to raise_error
+ expect { @resource.action :lolcat }.to raise_error(ArgumentError)
end
it "should allow you to set a command" do
@resource.command "/bin/true"
- @resource.command.should eql("/bin/true")
+ expect(@resource.command).to eql("/bin/true")
end
it "should allow you to set a user" do
@resource.user "daemon"
- @resource.user.should eql("daemon")
+ expect(@resource.user).to eql("daemon")
end
it "should allow you to specify the minute" do
@resource.minute "30"
- @resource.minute.should eql("30")
+ expect(@resource.minute).to eql("30")
end
it "should allow you to specify the hour" do
@resource.hour "6"
- @resource.hour.should eql("6")
+ expect(@resource.hour).to eql("6")
end
it "should allow you to specify the day" do
@resource.day "10"
- @resource.day.should eql("10")
+ expect(@resource.day).to eql("10")
end
it "should allow you to specify the month" do
@resource.month "10"
- @resource.month.should eql("10")
+ expect(@resource.month).to eql("10")
end
it "should allow you to specify the weekday" do
@resource.weekday "2"
- @resource.weekday.should eql("2")
+ expect(@resource.weekday).to eql("2")
end
it "should allow you to specify the mailto variable" do
@resource.mailto "test@example.com"
- @resource.mailto.should eql("test@example.com")
+ expect(@resource.mailto).to eql("test@example.com")
end
it "should allow you to specify the path" do
@resource.path "/usr/bin:/usr/sbin"
- @resource.path.should eql("/usr/bin:/usr/sbin")
+ expect(@resource.path).to eql("/usr/bin:/usr/sbin")
end
it "should allow you to specify the home directory" do
@resource.home "/root"
- @resource.home.should eql("/root")
+ expect(@resource.home).to eql("/root")
end
it "should allow you to specify the shell to run the command with" do
@resource.shell "/bin/zsh"
- @resource.shell.should eql("/bin/zsh")
+ expect(@resource.shell).to eql("/bin/zsh")
end
it "should allow you to specify environment variables hash" do
env = {"TEST" => "LOL"}
@resource.environment env
- @resource.environment.should eql(env)
+ expect(@resource.environment).to eql(env)
end
it "should allow * for all time and date values" do
[ "minute", "hour", "day", "month", "weekday" ].each do |x|
- @resource.send(x, "*").should eql("*")
+ expect(@resource.send(x, "*")).to eql("*")
end
end
it "should allow ranges for all time and date values" do
[ "minute", "hour", "day", "month", "weekday" ].each do |x|
- @resource.send(x, "1-2,5").should eql("1-2,5")
+ expect(@resource.send(x, "1-2,5")).to eql("1-2,5")
end
end
it "should have a default value of * for all time and date values" do
[ "minute", "hour", "day", "month", "weekday" ].each do |x|
- @resource.send(x).should eql("*")
+ expect(@resource.send(x)).to eql("*")
end
end
it "should have a default value of root for the user" do
- @resource.user.should eql("root")
+ expect(@resource.user).to eql("root")
end
it "should reject any minute over 59" do
- lambda { @resource.minute "60" }.should raise_error(RangeError)
+ expect { @resource.minute "60" }.to raise_error(RangeError)
end
it "should reject any hour over 23" do
- lambda { @resource.hour "24" }.should raise_error(RangeError)
+ expect { @resource.hour "24" }.to raise_error(RangeError)
end
it "should reject any day over 31" do
- lambda { @resource.day "32" }.should raise_error(RangeError)
+ expect { @resource.day "32" }.to raise_error(RangeError)
end
it "should reject any month over 12" do
- lambda { @resource.month "13" }.should raise_error(RangeError)
+ expect { @resource.month "13" }.to raise_error(RangeError)
end
describe "weekday" do
it "should reject any weekday over 7" do
- lambda { @resource.weekday "8" }.should raise_error(RangeError)
+ expect { @resource.weekday "8" }.to raise_error(RangeError)
end
it "should reject any symbols which don't represent day of week" do
- lambda { @resource.weekday :foo }.should raise_error(RangeError)
+ expect { @resource.weekday :foo }.to raise_error(RangeError)
end
end
it "should convert integer schedule values to a string" do
[ "minute", "hour", "day", "month", "weekday" ].each do |x|
- @resource.send(x, 5).should eql("5")
+ expect(@resource.send(x, 5)).to eql("5")
end
end
@@ -171,16 +171,16 @@ describe Chef::Resource::Cron do
it "describes the state" do
state = @resource.state
- state[:minute].should == "1"
- state[:hour].should == "2"
- state[:day].should == "3"
- state[:month].should == "4"
- state[:weekday].should == "5"
- state[:user].should == "root"
+ expect(state[:minute]).to eq("1")
+ expect(state[:hour]).to eq("2")
+ expect(state[:day]).to eq("3")
+ expect(state[:month]).to eq("4")
+ expect(state[:weekday]).to eq("5")
+ expect(state[:user]).to eq("root")
end
it "returns the command as its identity" do
- @resource.identity.should == "tackle"
+ expect(@resource.identity).to eq("tackle")
end
end
end
diff --git a/spec/unit/resource/csh_spec.rb b/spec/unit/resource/csh_spec.rb
index e1534a8f5f..5fb3b00507 100644
--- a/spec/unit/resource/csh_spec.rb
+++ b/spec/unit/resource/csh_spec.rb
@@ -25,16 +25,16 @@ describe Chef::Resource::Csh do
end
it "should create a new Chef::Resource::Csh" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Csh)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Csh)
end
it "should have a resource name of :csh" do
- @resource.resource_name.should eql(:csh)
+ expect(@resource.resource_name).to eql(:csh)
end
it "should have an interpreter of csh" do
- @resource.interpreter.should eql("csh")
+ expect(@resource.interpreter).to eql("csh")
end
end
diff --git a/spec/unit/resource/deploy_revision_spec.rb b/spec/unit/resource/deploy_revision_spec.rb
index 1f509992aa..d136aa251e 100644
--- a/spec/unit/resource/deploy_revision_spec.rb
+++ b/spec/unit/resource/deploy_revision_spec.rb
@@ -17,31 +17,26 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::DeployRevision do
- it "defaults to the revision deploy provider" do
- @resource = Chef::Resource::DeployRevision.new("deploy _this_!")
- @resource.provider.should == Chef::Provider::Deploy::Revision
- end
-
- it "has a name of deploy_revision" do
- @resource = Chef::Resource::DeployRevision.new("deploy _this_!")
- @resource.resource_name.should == :deploy_revision
- end
+ static_provider_resolution(
+ resource: Chef::Resource::DeployRevision,
+ provider: Chef::Provider::Deploy::Revision,
+ name: :deploy_revision,
+ action: :deploy,
+ )
end
describe Chef::Resource::DeployBranch do
- it "defaults to the revision deploy provider" do
- @resource = Chef::Resource::DeployBranch.new("deploy _this_!")
- @resource.provider.should == Chef::Provider::Deploy::Revision
- end
-
- it "has a name of deploy_branch" do
- @resource = Chef::Resource::DeployBranch.new("deploy _this_!")
- @resource.resource_name.should == :deploy_branch
- end
+ static_provider_resolution(
+ resource: Chef::Resource::DeployBranch,
+ provider: Chef::Provider::Deploy::Revision,
+ name: :deploy_branch,
+ action: :deploy,
+ )
end
diff --git a/spec/unit/resource/deploy_spec.rb b/spec/unit/resource/deploy_spec.rb
index 7cc25ed41c..0403a7ba6b 100644
--- a/spec/unit/resource/deploy_spec.rb
+++ b/spec/unit/resource/deploy_spec.rb
@@ -17,35 +17,44 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::Deploy do
+ static_provider_resolution(
+ resource: Chef::Resource::Deploy,
+ provider: Chef::Provider::Deploy::Timestamped,
+ name: :deploy,
+ action: :deploy,
+ )
+
+
class << self
def resource_has_a_string_attribute(attr_name)
it "has a String attribute for #{attr_name.to_s}" do
@resource.send(attr_name, "this is a string")
- @resource.send(attr_name).should eql("this is a string")
- lambda {@resource.send(attr_name, 8675309)}.should raise_error(ArgumentError)
+ expect(@resource.send(attr_name)).to eql("this is a string")
+ expect {@resource.send(attr_name, 8675309)}.to raise_error(ArgumentError)
end
end
def resource_has_a_boolean_attribute(attr_name, opts={:defaults_to=>false})
it "has a Boolean attribute for #{attr_name.to_s}" do
- @resource.send(attr_name).should eql(opts[:defaults_to])
+ expect(@resource.send(attr_name)).to eql(opts[:defaults_to])
@resource.send(attr_name, !opts[:defaults_to])
- @resource.send(attr_name).should eql( !opts[:defaults_to] )
+ expect(@resource.send(attr_name)).to eql( !opts[:defaults_to] )
end
end
def resource_has_a_callback_attribute(attr_name)
it "has a Callback attribute #{attr_name}" do
callback_block = lambda { :noop }
- lambda {@resource.send(attr_name, &callback_block)}.should_not raise_error
- @resource.send(attr_name).should == callback_block
+ expect {@resource.send(attr_name, &callback_block)}.not_to raise_error
+ expect(@resource.send(attr_name)).to eq(callback_block)
callback_file = "path/to/callback.rb"
- lambda {@resource.send(attr_name, callback_file)}.should_not raise_error
- @resource.send(attr_name).should == callback_file
- lambda {@resource.send(attr_name, :this_is_fail)}.should raise_error(ArgumentError)
+ expect {@resource.send(attr_name, callback_file)}.not_to raise_error
+ expect(@resource.send(attr_name)).to eq(callback_file)
+ expect {@resource.send(attr_name, :this_is_fail)}.to raise_error(ArgumentError)
end
end
end
@@ -76,7 +85,7 @@ describe Chef::Resource::Deploy do
resource_has_a_boolean_attribute(:shallow_clone, :defaults_to=>false)
it "uses the first argument as the deploy directory" do
- @resource.deploy_to.should eql("/my/deploy/dir")
+ expect(@resource.deploy_to).to eql("/my/deploy/dir")
end
# For git, any revision, branch, tag, whatever is resolved to a SHA1 ref.
@@ -84,100 +93,100 @@ describe Chef::Resource::Deploy do
# Therefore, revision and branch ARE NOT SEPARATE THINGS
it "aliases #revision as #branch" do
@resource.branch "stable"
- @resource.revision.should eql("stable")
+ expect(@resource.revision).to eql("stable")
end
it "takes the SCM resource to use as a constant, and defaults to git" do
- @resource.scm_provider.should eql(Chef::Provider::Git)
+ expect(@resource.scm_provider).to eql(Chef::Provider::Git)
@resource.scm_provider Chef::Provider::Subversion
- @resource.scm_provider.should eql(Chef::Provider::Subversion)
+ expect(@resource.scm_provider).to eql(Chef::Provider::Subversion)
end
it "allows scm providers to be set via symbol" do
- @resource.scm_provider.should == Chef::Provider::Git
+ expect(@resource.scm_provider).to eq(Chef::Provider::Git)
@resource.scm_provider :subversion
- @resource.scm_provider.should == Chef::Provider::Subversion
+ expect(@resource.scm_provider).to eq(Chef::Provider::Subversion)
end
it "allows scm providers to be set via string" do
- @resource.scm_provider.should == Chef::Provider::Git
+ expect(@resource.scm_provider).to eq(Chef::Provider::Git)
@resource.scm_provider "subversion"
- @resource.scm_provider.should == Chef::Provider::Subversion
+ expect(@resource.scm_provider).to eq(Chef::Provider::Subversion)
end
it "has a boolean attribute for svn_force_export defaulting to false" do
- @resource.svn_force_export.should be_false
+ expect(@resource.svn_force_export).to be_falsey
@resource.svn_force_export true
- @resource.svn_force_export.should be_true
- lambda {@resource.svn_force_export(10053)}.should raise_error(ArgumentError)
+ expect(@resource.svn_force_export).to be_truthy
+ expect {@resource.svn_force_export(10053)}.to raise_error(ArgumentError)
end
it "takes arbitrary environment variables in a hash" do
@resource.environment "RAILS_ENV" => "production"
- @resource.environment.should == {"RAILS_ENV" => "production"}
+ expect(@resource.environment).to eq({"RAILS_ENV" => "production"})
end
it "takes string arguments to environment for backwards compat, setting RAILS_ENV, RACK_ENV, and MERB_ENV" do
@resource.environment "production"
- @resource.environment.should == {"RAILS_ENV"=>"production", "RACK_ENV"=>"production","MERB_ENV"=>"production"}
+ expect(@resource.environment).to eq({"RAILS_ENV"=>"production", "RACK_ENV"=>"production","MERB_ENV"=>"production"})
end
it "sets destination to $deploy_to/shared/$repository_cache" do
- @resource.destination.should eql("/my/deploy/dir/shared/cached-copy")
+ expect(@resource.destination).to eql("/my/deploy/dir/shared/cached-copy")
end
it "sets shared_path to $deploy_to/shared" do
- @resource.shared_path.should eql("/my/deploy/dir/shared")
+ expect(@resource.shared_path).to eql("/my/deploy/dir/shared")
end
it "sets current_path to $deploy_to/current" do
- @resource.current_path.should eql("/my/deploy/dir/current")
+ expect(@resource.current_path).to eql("/my/deploy/dir/current")
end
it "gets the current_path correct even if the shared_path is set (regression test)" do
@resource.shared_path
- @resource.current_path.should eql("/my/deploy/dir/current")
+ expect(@resource.current_path).to eql("/my/deploy/dir/current")
end
it "gives #depth as 5 if shallow clone is true, nil otherwise" do
- @resource.depth.should be_nil
+ expect(@resource.depth).to be_nil
@resource.shallow_clone true
- @resource.depth.should eql("5")
+ expect(@resource.depth).to eql("5")
end
it "aliases repo as repository" do
@resource.repository "git@github.com/opcode/cookbooks.git"
- @resource.repo.should eql("git@github.com/opcode/cookbooks.git")
+ expect(@resource.repo).to eql("git@github.com/opcode/cookbooks.git")
end
it "aliases git_ssh_wrapper as ssh_wrapper" do
@resource.ssh_wrapper "git_my_repo.sh"
- @resource.git_ssh_wrapper.should eql("git_my_repo.sh")
+ expect(@resource.git_ssh_wrapper).to eql("git_my_repo.sh")
end
it "has an Array attribute purge_before_symlink, default: log, tmp/pids, public/system" do
- @resource.purge_before_symlink.should == %w{ log tmp/pids public/system }
+ expect(@resource.purge_before_symlink).to eq(%w{ log tmp/pids public/system })
@resource.purge_before_symlink %w{foo bar baz}
- @resource.purge_before_symlink.should == %w{foo bar baz}
+ expect(@resource.purge_before_symlink).to eq(%w{foo bar baz})
end
it "has an Array attribute create_dirs_before_symlink, default: tmp, public, config" do
- @resource.create_dirs_before_symlink.should == %w{tmp public config}
+ expect(@resource.create_dirs_before_symlink).to eq(%w{tmp public config})
@resource.create_dirs_before_symlink %w{foo bar baz}
- @resource.create_dirs_before_symlink.should == %w{foo bar baz}
+ expect(@resource.create_dirs_before_symlink).to eq(%w{foo bar baz})
end
it 'has a Hash attribute symlinks, default: {"system" => "public/system", "pids" => "tmp/pids", "log" => "log"}' do
default = { "system" => "public/system", "pids" => "tmp/pids", "log" => "log"}
- @resource.symlinks.should == default
+ expect(@resource.symlinks).to eq(default)
@resource.symlinks "foo" => "bar/baz"
- @resource.symlinks.should == {"foo" => "bar/baz"}
+ expect(@resource.symlinks).to eq({"foo" => "bar/baz"})
end
it 'has a Hash attribute symlink_before_migrate, default "config/database.yml" => "config/database.yml"' do
- @resource.symlink_before_migrate.should == {"config/database.yml" => "config/database.yml"}
+ expect(@resource.symlink_before_migrate).to eq({"config/database.yml" => "config/database.yml"})
@resource.symlink_before_migrate "wtf?" => "wtf is going on"
- @resource.symlink_before_migrate.should == {"wtf?" => "wtf is going on"}
+ expect(@resource.symlink_before_migrate).to eq({"wtf?" => "wtf is going on"})
end
resource_has_a_callback_attribute :before_migrate
@@ -187,59 +196,55 @@ describe Chef::Resource::Deploy do
it "aliases restart_command as restart" do
@resource.restart "foobaz"
- @resource.restart_command.should == "foobaz"
+ expect(@resource.restart_command).to eq("foobaz")
end
it "takes a block for the restart parameter" do
restart_like_this = lambda {p :noop}
@resource.restart(&restart_like_this)
- @resource.restart.should == restart_like_this
- end
-
- it "defaults to using the Deploy::Timestamped provider" do
- @resource.provider.should == Chef::Provider::Deploy::Timestamped
+ expect(@resource.restart).to eq(restart_like_this)
end
it "allows providers to be set with a full class name" do
@resource.provider Chef::Provider::Deploy::Timestamped
- @resource.provider.should == Chef::Provider::Deploy::Timestamped
+ expect(@resource.provider).to eq(Chef::Provider::Deploy::Timestamped)
end
it "allows deploy providers to be set via symbol" do
@resource.provider :revision
- @resource.provider.should == Chef::Provider::Deploy::Revision
+ expect(@resource.provider).to eq(Chef::Provider::Deploy::Revision)
end
it "allows deploy providers to be set via string" do
@resource.provider "revision"
- @resource.provider.should == Chef::Provider::Deploy::Revision
+ expect(@resource.provider).to eq(Chef::Provider::Deploy::Revision)
end
it "defaults keep_releases to 5" do
- @resource.keep_releases.should == 5
+ expect(@resource.keep_releases).to eq(5)
end
it "allows keep_releases to be set via integer" do
@resource.keep_releases 10
- @resource.keep_releases.should == 10
+ expect(@resource.keep_releases).to eq(10)
end
it "enforces a minimum keep_releases of 1" do
@resource.keep_releases 0
- @resource.keep_releases.should == 1
+ expect(@resource.keep_releases).to eq(1)
end
describe "when it has a timeout attribute" do
let(:ten_seconds) { 10 }
before { @resource.timeout(ten_seconds) }
it "stores this timeout" do
- @resource.timeout.should == ten_seconds
+ expect(@resource.timeout).to eq(ten_seconds)
end
end
describe "when it has no timeout attribute" do
it "should have no default timeout" do
- @resource.timeout.should be_nil
+ expect(@resource.timeout).to be_nil
end
end
@@ -261,12 +266,12 @@ describe Chef::Resource::Deploy do
it "describes its state" do
state = @resource.state
- state[:deploy_to].should == "/"
- state[:revision].should == "1.2.3"
+ expect(state[:deploy_to]).to eq("/")
+ expect(state[:revision]).to eq("1.2.3")
end
it "returns the repository URI as its identity" do
- @resource.identity.should == "http://uri.org"
+ expect(@resource.identity).to eq("http://uri.org")
end
end
diff --git a/spec/unit/resource/directory_spec.rb b/spec/unit/resource/directory_spec.rb
index a42383c49e..c452b2a914 100644
--- a/spec/unit/resource/directory_spec.rb
+++ b/spec/unit/resource/directory_spec.rb
@@ -26,38 +26,38 @@ describe Chef::Resource::Directory do
end
it "should create a new Chef::Resource::Directory" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Directory)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Directory)
end
it "should have a name" do
- @resource.name.should eql("fakey_fakerton")
+ expect(@resource.name).to eql("fakey_fakerton")
end
it "should have a default action of 'create'" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
it "should accept create or delete for action" do
- lambda { @resource.action :create }.should_not raise_error
- lambda { @resource.action :delete }.should_not raise_error
- lambda { @resource.action :blues }.should raise_error(ArgumentError)
+ expect { @resource.action :create }.not_to raise_error
+ expect { @resource.action :delete }.not_to raise_error
+ expect { @resource.action :blues }.to raise_error(ArgumentError)
end
it "should use the object name as the path by default" do
- @resource.path.should eql("fakey_fakerton")
+ expect(@resource.path).to eql("fakey_fakerton")
end
it "should accept a string as the path" do
- lambda { @resource.path "/tmp" }.should_not raise_error
- @resource.path.should eql("/tmp")
- lambda { @resource.path Hash.new }.should raise_error(ArgumentError)
+ expect { @resource.path "/tmp" }.not_to raise_error
+ expect(@resource.path).to eql("/tmp")
+ expect { @resource.path Hash.new }.to raise_error(ArgumentError)
end
it "should allow you to have specify whether the action is recursive with true/false" do
- lambda { @resource.recursive true }.should_not raise_error
- lambda { @resource.recursive false }.should_not raise_error
- lambda { @resource.recursive "monkey" }.should raise_error(ArgumentError)
+ expect { @resource.recursive true }.not_to raise_error
+ expect { @resource.recursive false }.not_to raise_error
+ expect { @resource.recursive "monkey" }.to raise_error(ArgumentError)
end
describe "when it has group, mode, and owner" do
@@ -70,13 +70,13 @@ describe Chef::Resource::Directory do
it "describes its state" do
state = @resource.state
- state[:group].should == "wheel"
- state[:mode].should == "0664"
- state[:owner].should == "root"
+ expect(state[:group]).to eq("wheel")
+ expect(state[:mode]).to eq("0664")
+ expect(state[:owner]).to eq("root")
end
it "returns the directory path as its identity" do
- @resource.identity.should == "/tmp/foo/bar/"
+ expect(@resource.identity).to eq("/tmp/foo/bar/")
end
end
end
diff --git a/spec/unit/resource/dpkg_package_spec.rb b/spec/unit/resource/dpkg_package_spec.rb
index 9ef498a577..931e6763bd 100644
--- a/spec/unit/resource/dpkg_package_spec.rb
+++ b/spec/unit/resource/dpkg_package_spec.rb
@@ -17,22 +17,16 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::DpkgPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::DpkgPackage.new("foo")
- end
+ static_provider_resolution(
+ resource: Chef::Resource::DpkgPackage,
+ provider: Chef::Provider::Package::Dpkg,
+ name: :dpkg_package,
+ action: :install,
+ os: 'linux',
+ )
- it "should return a Chef::Resource::DpkgPackage" do
- @resource.should be_a_kind_of(Chef::Resource::DpkgPackage)
- end
-
- it "should set the resource_name to :dpkg_package" do
- @resource.resource_name.should eql(:dpkg_package)
- end
-
- it "should set the provider to Chef::Provider::Package::Dpkg" do
- @resource.provider.should eql(Chef::Provider::Package::Dpkg)
- end
end
diff --git a/spec/unit/resource/easy_install_package_spec.rb b/spec/unit/resource/easy_install_package_spec.rb
index 9682c8177b..c68b026b39 100644
--- a/spec/unit/resource/easy_install_package_spec.rb
+++ b/spec/unit/resource/easy_install_package_spec.rb
@@ -17,32 +17,23 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::EasyInstallPackage, "initialize" do
+ static_provider_resolution(
+ resource: Chef::Resource::EasyInstallPackage,
+ provider: Chef::Provider::Package::EasyInstall,
+ name: :easy_install_package,
+ action: :install,
+ )
+
before(:each) do
@resource = Chef::Resource::EasyInstallPackage.new("foo")
end
- it "should create a new Chef::Resource::EasyInstallPackage" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::EasyInstallPackage)
- end
-
- it "should return a Chef::Resource::EasyInstallPackage" do
- @resource.should be_a_kind_of(Chef::Resource::EasyInstallPackage)
- end
-
- it "should set the resource_name to :easy_install_package" do
- @resource.resource_name.should eql(:easy_install_package)
- end
-
- it "should set the provider to Chef::Provider::Package::EasyInstall" do
- @resource.provider.should eql(Chef::Provider::Package::EasyInstall)
- end
-
it "should allow you to set the easy_install_binary attribute" do
@resource.easy_install_binary "/opt/local/bin/easy_install"
- @resource.easy_install_binary.should eql("/opt/local/bin/easy_install")
+ expect(@resource.easy_install_binary).to eql("/opt/local/bin/easy_install")
end
end
diff --git a/spec/unit/resource/env_spec.rb b/spec/unit/resource/env_spec.rb
index a1f599400b..566827a27e 100644
--- a/spec/unit/resource/env_spec.rb
+++ b/spec/unit/resource/env_spec.rb
@@ -26,43 +26,43 @@ describe Chef::Resource::Env do
end
it "should create a new Chef::Resource::Env" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Env)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Env)
end
it "should have a name" do
- @resource.name.should eql("FOO")
+ expect(@resource.name).to eql("FOO")
end
it "should have a default action of 'create'" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
{ :create => false, :delete => false, :modify => false, :flibber => true }.each do |action,bad_value|
it "should #{bad_value ? 'not' : ''} accept #{action.to_s}" do
if bad_value
- lambda { @resource.action action }.should raise_error(ArgumentError)
+ expect { @resource.action action }.to raise_error(ArgumentError)
else
- lambda { @resource.action action }.should_not raise_error
+ expect { @resource.action action }.not_to raise_error
end
end
end
it "should use the object name as the key_name by default" do
- @resource.key_name.should eql("FOO")
+ expect(@resource.key_name).to eql("FOO")
end
it "should accept a string as the env value via 'value'" do
- lambda { @resource.value "bar" }.should_not raise_error
+ expect { @resource.value "bar" }.not_to raise_error
end
it "should not accept a Hash for the env value via 'to'" do
- lambda { @resource.value Hash.new }.should raise_error(ArgumentError)
+ expect { @resource.value Hash.new }.to raise_error(ArgumentError)
end
it "should allow you to set an env value via 'to'" do
@resource.value "bar"
- @resource.value.should eql("bar")
+ expect(@resource.value).to eql("bar")
end
describe "when it has key name and value" do
@@ -74,11 +74,11 @@ describe Chef::Resource::Env do
it "describes its state" do
state = @resource.state
- state[:value].should == "level7"
+ expect(state[:value]).to eq("level7")
end
it "returns the key name as its identity" do
- @resource.identity.should == "charmander"
+ expect(@resource.identity).to eq("charmander")
end
end
diff --git a/spec/unit/resource/erl_call_spec.rb b/spec/unit/resource/erl_call_spec.rb
index 3efbdca9a0..8ec182665f 100644
--- a/spec/unit/resource/erl_call_spec.rb
+++ b/spec/unit/resource/erl_call_spec.rb
@@ -26,45 +26,45 @@ describe Chef::Resource::ErlCall do
end
it "should create a new Chef::Resource::ErlCall" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::ErlCall)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::ErlCall)
end
it "should have a resource name of :erl_call" do
- @resource.resource_name.should eql(:erl_call)
+ expect(@resource.resource_name).to eql(:erl_call)
end
it "should have a default action of run" do
- @resource.action.should eql("run")
+ expect(@resource.action).to eql("run")
end
it "should accept run as an action" do
- lambda { @resource.action :run }.should_not raise_error
+ expect { @resource.action :run }.not_to raise_error
end
it "should allow you to set the code attribute" do
@resource.code "q()."
- @resource.code.should eql("q().")
+ expect(@resource.code).to eql("q().")
end
it "should allow you to set the cookie attribute" do
@resource.cookie "nomnomnom"
- @resource.cookie.should eql("nomnomnom")
+ expect(@resource.cookie).to eql("nomnomnom")
end
it "should allow you to set the distributed attribute" do
@resource.distributed true
- @resource.distributed.should eql(true)
+ expect(@resource.distributed).to eql(true)
end
it "should allow you to set the name_type attribute" do
@resource.name_type "sname"
- @resource.name_type.should eql("sname")
+ expect(@resource.name_type).to eql("sname")
end
it "should allow you to set the node_name attribute" do
@resource.node_name "chef@erlang"
- @resource.node_name.should eql("chef@erlang")
+ expect(@resource.node_name).to eql("chef@erlang")
end
describe "when it has cookie and node_name" do
@@ -75,7 +75,7 @@ describe Chef::Resource::ErlCall do
end
it "returns the code as its identity" do
- @resource.identity.should == "erl-call:function()"
+ expect(@resource.identity).to eq("erl-call:function()")
end
end
end
diff --git a/spec/unit/resource/execute_spec.rb b/spec/unit/resource/execute_spec.rb
index 8c8dcfb6ca..70b9d87d4c 100644
--- a/spec/unit/resource/execute_spec.rb
+++ b/spec/unit/resource/execute_spec.rb
@@ -23,4 +23,9 @@ describe Chef::Resource::Execute do
let(:resource_instance_name) { "some command" }
let(:execute_resource) { Chef::Resource::Execute.new(resource_instance_name) }
it_behaves_like "an execute resource"
+
+ it "default guard interpreter should be :execute interpreter" do
+ expect(execute_resource.guard_interpreter).to be(:execute)
+ end
+
end
diff --git a/spec/unit/resource/file_spec.rb b/spec/unit/resource/file_spec.rb
index 9c6365f6d3..cfa7511673 100644
--- a/spec/unit/resource/file_spec.rb
+++ b/spec/unit/resource/file_spec.rb
@@ -25,55 +25,55 @@ describe Chef::Resource::File do
end
it "should have a name" do
- @resource.name.should eql("fakey_fakerton")
+ expect(@resource.name).to eql("fakey_fakerton")
end
it "should have a default action of 'create'" do
- @resource.action.should eql("create")
+ expect(@resource.action).to eql("create")
end
it "should have a default content of nil" do
- @resource.content.should be_nil
+ expect(@resource.content).to be_nil
end
it "should be set to back up 5 files by default" do
- @resource.backup.should eql(5)
+ expect(@resource.backup).to eql(5)
end
it "should only accept strings for content" do
- lambda { @resource.content 5 }.should raise_error(ArgumentError)
- lambda { @resource.content :foo }.should raise_error(ArgumentError)
- lambda { @resource.content "hello" => "there" }.should raise_error(ArgumentError)
- lambda { @resource.content "hi" }.should_not raise_error
+ expect { @resource.content 5 }.to raise_error(ArgumentError)
+ expect { @resource.content :foo }.to raise_error(ArgumentError)
+ expect { @resource.content "hello" => "there" }.to raise_error(ArgumentError)
+ expect { @resource.content "hi" }.not_to raise_error
end
it "should only accept false or a number for backup" do
- lambda { @resource.backup true }.should raise_error(ArgumentError)
- lambda { @resource.backup false }.should_not raise_error
- lambda { @resource.backup 10 }.should_not raise_error
- lambda { @resource.backup "blues" }.should raise_error(ArgumentError)
+ expect { @resource.backup true }.to raise_error(ArgumentError)
+ expect { @resource.backup false }.not_to raise_error
+ expect { @resource.backup 10 }.not_to raise_error
+ expect { @resource.backup "blues" }.to raise_error(ArgumentError)
end
it "should accept a sha256 for checksum" do
- lambda { @resource.checksum "0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa" }.should_not raise_error
- lambda { @resource.checksum "monkey!" }.should raise_error(ArgumentError)
+ expect { @resource.checksum "0fd012fdc96e96f8f7cf2046522a54aed0ce470224513e45da6bc1a17a4924aa" }.not_to raise_error
+ expect { @resource.checksum "monkey!" }.to raise_error(ArgumentError)
end
it "should accept create, delete or touch for action" do
- lambda { @resource.action :create }.should_not raise_error
- lambda { @resource.action :delete }.should_not raise_error
- lambda { @resource.action :touch }.should_not raise_error
- lambda { @resource.action :blues }.should raise_error(ArgumentError)
+ expect { @resource.action :create }.not_to raise_error
+ expect { @resource.action :delete }.not_to raise_error
+ expect { @resource.action :touch }.not_to raise_error
+ expect { @resource.action :blues }.to raise_error(ArgumentError)
end
it "should use the object name as the path by default" do
- @resource.path.should eql("fakey_fakerton")
+ expect(@resource.path).to eql("fakey_fakerton")
end
it "should accept a string as the path" do
- lambda { @resource.path "/tmp" }.should_not raise_error
- @resource.path.should eql("/tmp")
- lambda { @resource.path Hash.new }.should raise_error(ArgumentError)
+ expect { @resource.path "/tmp" }.not_to raise_error
+ expect(@resource.path).to eql("/tmp")
+ expect { @resource.path Hash.new }.to raise_error(ArgumentError)
end
describe "when it has a path, owner, group, mode, and checksum" do
@@ -88,15 +88,15 @@ describe Chef::Resource::File do
context "on unix", :unix_only do
it "describes its state" do
state = @resource.state
- state[:owner].should == "root"
- state[:group].should == "wheel"
- state[:mode].should == "0644"
- state[:checksum].should == "1" * 64
+ expect(state[:owner]).to eq("root")
+ expect(state[:group]).to eq("wheel")
+ expect(state[:mode]).to eq("0644")
+ expect(state[:checksum]).to eq("1" * 64)
end
end
it "returns the file path as its identity" do
- @resource.identity.should == "/tmp/foo.txt"
+ expect(@resource.identity).to eq("/tmp/foo.txt")
end
end
@@ -108,8 +108,8 @@ describe Chef::Resource::File do
end
it "describes its state including windows ACL attributes" do
state = @resource.state
- state[:rights].should == [ {:permissions => :read, :principals => "Everyone"},
- {:permissions => :full_control, :principals => "DOMAIN\User"} ]
+ expect(state[:rights]).to eq([ {:permissions => :read, :principals => "Everyone"},
+ {:permissions => :full_control, :principals => "DOMAIN\User"} ])
end
end
diff --git a/spec/unit/resource/freebsd_package_spec.rb b/spec/unit/resource/freebsd_package_spec.rb
index 04a6962270..7263d3a7ba 100644
--- a/spec/unit/resource/freebsd_package_spec.rb
+++ b/spec/unit/resource/freebsd_package_spec.rb
@@ -32,15 +32,15 @@ describe Chef::Resource::FreebsdPackage do
describe "Initialization" do
it "should return a Chef::Resource::FreebsdPackage" do
- @resource.should be_a_kind_of(Chef::Resource::FreebsdPackage)
+ expect(@resource).to be_a_kind_of(Chef::Resource::FreebsdPackage)
end
it "should set the resource_name to :freebsd_package" do
- @resource.resource_name.should eql(:freebsd_package)
+ expect(@resource.resource_name).to eql(:freebsd_package)
end
it "should not set the provider" do
- @resource.provider.should be_nil
+ expect(@resource.provider).to be_nil
end
end
@@ -50,7 +50,7 @@ describe Chef::Resource::FreebsdPackage do
it "should be Freebsd::Port" do
@resource.source('ports')
@resource.after_created
- @resource.provider.should == Chef::Provider::Package::Freebsd::Port
+ expect(@resource.provider).to eq(Chef::Provider::Package::Freebsd::Port)
end
end
@@ -59,7 +59,7 @@ describe Chef::Resource::FreebsdPackage do
[1000017, 1000018, 1000500, 1001001, 1100000].each do |__freebsd_version|
@node.automatic_attrs[:os_version] = __freebsd_version
@resource.after_created
- @resource.provider.should == Chef::Provider::Package::Freebsd::Pkgng
+ expect(@resource.provider).to eq(Chef::Provider::Package::Freebsd::Pkgng)
end
end
end
@@ -67,21 +67,21 @@ describe Chef::Resource::FreebsdPackage do
describe "if pkgng enabled" do
it "should be Freebsd::Pkgng" do
pkg_enabled = OpenStruct.new(:stdout => "yes\n")
- @resource.stub(:shell_out!).with("make -V WITH_PKGNG", :env => nil).and_return(pkg_enabled)
+ allow(@resource).to receive(:shell_out!).with("make -V WITH_PKGNG", :env => nil).and_return(pkg_enabled)
@resource.after_created
- @resource.provider.should == Chef::Provider::Package::Freebsd::Pkgng
+ expect(@resource.provider).to eq(Chef::Provider::Package::Freebsd::Pkgng)
end
end
describe "if __Freebsd_version is less than 1000017 and pkgng not enabled" do
it "should be Freebsd::Pkg" do
pkg_enabled = OpenStruct.new(:stdout => "\n")
- @resource.stub(:shell_out!).with("make -V WITH_PKGNG", :env => nil).and_return(pkg_enabled)
+ allow(@resource).to receive(:shell_out!).with("make -V WITH_PKGNG", :env => nil).and_return(pkg_enabled)
[1000016, 1000000, 901503, 902506, 802511].each do |__freebsd_version|
@node.automatic_attrs[:os_version] = __freebsd_version
@resource.after_created
- @resource.provider.should == Chef::Provider::Package::Freebsd::Pkg
+ expect(@resource.provider).to eq(Chef::Provider::Package::Freebsd::Pkg)
end
end
end
diff --git a/spec/unit/resource/gem_package_spec.rb b/spec/unit/resource/gem_package_spec.rb
index 98703455de..0f3eae70bb 100644
--- a/spec/unit/resource/gem_package_spec.rb
+++ b/spec/unit/resource/gem_package_spec.rb
@@ -17,24 +17,17 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::GemPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::GemPackage.new("foo")
- end
-
- it "should return a Chef::Resource::GemPackage" do
- @resource.should be_a_kind_of(Chef::Resource::GemPackage)
- end
-
- it "should set the resource_name to :gem_package" do
- @resource.resource_name.should eql(:gem_package)
- end
+ static_provider_resolution(
+ resource: Chef::Resource::GemPackage,
+ provider: Chef::Provider::Package::Rubygems,
+ name: :gem_package,
+ action: :install,
+ )
- it "should set the provider to Chef::Provider::Package::Rubygems" do
- @resource.provider.should eql(Chef::Provider::Package::Rubygems)
- end
end
describe Chef::Resource::GemPackage, "gem_binary" do
@@ -44,6 +37,6 @@ describe Chef::Resource::GemPackage, "gem_binary" do
it "should set the gem_binary variable to whatever is passed in" do
@resource.gem_binary("/opt/local/bin/gem")
- @resource.gem_binary.should eql("/opt/local/bin/gem")
+ expect(@resource.gem_binary).to eql("/opt/local/bin/gem")
end
end
diff --git a/spec/unit/resource/git_spec.rb b/spec/unit/resource/git_spec.rb
index 95a30c28a4..6a39b3d172 100644
--- a/spec/unit/resource/git_spec.rb
+++ b/spec/unit/resource/git_spec.rb
@@ -17,30 +17,34 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::Git do
+ static_provider_resolution(
+ resource: Chef::Resource::Git,
+ provider: Chef::Provider::Git,
+ name: :git,
+ action: :sync,
+ )
+
before(:each) do
@git = Chef::Resource::Git.new("my awesome webapp")
end
it "is a kind of Scm Resource" do
- @git.should be_a_kind_of(Chef::Resource::Scm)
- @git.should be_an_instance_of(Chef::Resource::Git)
- end
-
- it "uses the git provider" do
- @git.provider.should eql(Chef::Provider::Git)
+ expect(@git).to be_a_kind_of(Chef::Resource::Scm)
+ expect(@git).to be_an_instance_of(Chef::Resource::Git)
end
it "uses aliases revision as branch" do
@git.branch "HEAD"
- @git.revision.should eql("HEAD")
+ expect(@git.revision).to eql("HEAD")
end
it "aliases revision as reference" do
@git.reference "v1.0 tag"
- @git.revision.should eql("v1.0 tag")
+ expect(@git.revision).to eql("v1.0 tag")
end
end
diff --git a/spec/unit/resource/group_spec.rb b/spec/unit/resource/group_spec.rb
index 0c3cf4f67f..bcf9205f7e 100644
--- a/spec/unit/resource/group_spec.rb
+++ b/spec/unit/resource/group_spec.rb
@@ -25,47 +25,47 @@ describe Chef::Resource::Group, "initialize" do
end
it "should create a new Chef::Resource::Group" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Group)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Group)
end
it "should set the resource_name to :group" do
- @resource.resource_name.should eql(:group)
+ expect(@resource.resource_name).to eql(:group)
end
it "should set the group_name equal to the argument to initialize" do
- @resource.group_name.should eql("admin")
+ expect(@resource.group_name).to eql("admin")
end
it "should default gid to nil" do
- @resource.gid.should eql(nil)
+ expect(@resource.gid).to eql(nil)
end
it "should default members to an empty array" do
- @resource.members.should eql([])
+ expect(@resource.members).to eql([])
end
it "should alias users to members, also an empty array" do
- @resource.users.should eql([])
+ expect(@resource.users).to eql([])
end
it "should set action to :create" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
%w{create remove modify manage}.each do |action|
it "should allow action #{action}" do
- @resource.allowed_actions.detect { |a| a == action.to_sym }.should eql(action.to_sym)
+ expect(@resource.allowed_actions.detect { |a| a == action.to_sym }).to eql(action.to_sym)
end
end
it "should accept domain groups (@ or \ separator) on non-windows" do
- lambda { @resource.group_name "domain\@group" }.should_not raise_error
- @resource.group_name.should == "domain\@group"
- lambda { @resource.group_name "domain\\group" }.should_not raise_error
- @resource.group_name.should == "domain\\group"
- lambda { @resource.group_name "domain\\group^name" }.should_not raise_error
- @resource.group_name.should == "domain\\group^name"
+ expect { @resource.group_name "domain\@group" }.not_to raise_error
+ expect(@resource.group_name).to eq("domain\@group")
+ expect { @resource.group_name "domain\\group" }.not_to raise_error
+ expect(@resource.group_name).to eq("domain\\group")
+ expect { @resource.group_name "domain\\group^name" }.not_to raise_error
+ expect(@resource.group_name).to eq("domain\\group^name")
end
end
@@ -76,11 +76,11 @@ describe Chef::Resource::Group, "group_name" do
it "should allow a string" do
@resource.group_name "pirates"
- @resource.group_name.should eql("pirates")
+ expect(@resource.group_name).to eql("pirates")
end
it "should not allow a hash" do
- lambda { @resource.send(:group_name, { :aj => "is freakin awesome" }) }.should raise_error(ArgumentError)
+ expect { @resource.send(:group_name, { :aj => "is freakin awesome" }) }.to raise_error(ArgumentError)
end
end
@@ -91,11 +91,11 @@ describe Chef::Resource::Group, "gid" do
it "should allow an integer" do
@resource.gid 100
- @resource.gid.should eql(100)
+ expect(@resource.gid).to eql(100)
end
it "should not allow a hash" do
- lambda { @resource.send(:gid, { :aj => "is freakin awesome" }) }.should raise_error(ArgumentError)
+ expect { @resource.send(:gid, { :aj => "is freakin awesome" }) }.to raise_error(ArgumentError)
end
end
@@ -107,16 +107,16 @@ describe Chef::Resource::Group, "members" do
[ :users, :members].each do |method|
it "(#{method}) should allow and convert a string" do
@resource.send(method, "aj")
- @resource.send(method).should eql(["aj"])
+ expect(@resource.send(method)).to eql(["aj"])
end
it "(#{method}) should allow an array" do
@resource.send(method, [ "aj", "adam" ])
- @resource.send(method).should eql( ["aj", "adam"] )
+ expect(@resource.send(method)).to eql( ["aj", "adam"] )
end
it "(#{method}) should not allow a hash" do
- lambda { @resource.send(method, { :aj => "is freakin awesome" }) }.should raise_error(ArgumentError)
+ expect { @resource.send(method, { :aj => "is freakin awesome" }) }.to raise_error(ArgumentError)
end
end
end
@@ -127,16 +127,16 @@ describe Chef::Resource::Group, "append" do
end
it "should default to false" do
- @resource.append.should eql(false)
+ expect(@resource.append).to eql(false)
end
it "should allow a boolean" do
@resource.append true
- @resource.append.should eql(true)
+ expect(@resource.append).to eql(true)
end
it "should not allow a hash" do
- lambda { @resource.send(:gid, { :aj => "is freakin awesome" }) }.should raise_error(ArgumentError)
+ expect { @resource.send(:gid, { :aj => "is freakin awesome" }) }.to raise_error(ArgumentError)
end
describe "when it has members" do
@@ -147,11 +147,11 @@ describe Chef::Resource::Group, "append" do
it "describes its state" do
state = @resource.state
- state[:members].should eql(["blastoise", "pikachu"])
+ expect(state[:members]).to eql(["blastoise", "pikachu"])
end
it "returns the group name as its identity" do
- @resource.identity.should == "pokemon"
+ expect(@resource.identity).to eq("pokemon")
end
end
end
diff --git a/spec/unit/resource/homebrew_package_spec.rb b/spec/unit/resource/homebrew_package_spec.rb
index bb657607b7..bb248d1189 100644
--- a/spec/unit/resource/homebrew_package_spec.rb
+++ b/spec/unit/resource/homebrew_package_spec.rb
@@ -16,26 +16,19 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::HomebrewPackage, 'initialize' do
- let(:resource) { Chef::Resource::HomebrewPackage.new('emacs') }
-
- it 'returns a Chef::Resource::HomebrewPackage' do
- expect(resource).to be_a_kind_of(Chef::Resource::HomebrewPackage)
- end
-
- it 'sets the resource_name to :homebrew_package' do
- expect(resource.resource_name).to eql(:homebrew_package)
- end
+ static_provider_resolution(
+ resource: Chef::Resource::HomebrewPackage,
+ provider: Chef::Provider::Package::Homebrew,
+ name: :homebrew_package,
+ action: :install,
+ os: "mac_os_x",
+ )
- it 'sets the provider to Chef::Provider::Package::Homebrew' do
- expect(resource.provider).to eql(Chef::Provider::Package::Homebrew)
- end
-
- it 'sets the homebrew_user to nil' do
- expect(resource.homebrew_user).to eql(nil)
- end
+ let(:resource) { Chef::Resource::HomebrewPackage.new('emacs') }
shared_examples 'home_brew user set and returned' do
it 'returns the configured homebrew_user' do
diff --git a/spec/unit/resource/http_request_spec.rb b/spec/unit/resource/http_request_spec.rb
index b636ca9994..aa4ce4dfbc 100644
--- a/spec/unit/resource/http_request_spec.rb
+++ b/spec/unit/resource/http_request_spec.rb
@@ -26,22 +26,22 @@ describe Chef::Resource::HttpRequest do
end
it "should create a new Chef::Resource::HttpRequest" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::HttpRequest)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::HttpRequest)
end
it "should set url to a string" do
@resource.url "http://slashdot.org"
- @resource.url.should eql("http://slashdot.org")
+ expect(@resource.url).to eql("http://slashdot.org")
end
it "should set the message to the name by default" do
- @resource.message.should eql("fakey_fakerton")
+ expect(@resource.message).to eql("fakey_fakerton")
end
it "should set message to a string" do
@resource.message "monkeybars"
- @resource.message.should eql("monkeybars")
+ expect(@resource.message).to eql("monkeybars")
end
describe "when it has a message and headers" do
@@ -52,7 +52,7 @@ describe Chef::Resource::HttpRequest do
end
it "returns the url as its identity" do
- @resource.identity.should == "http://www.trololol.net"
+ expect(@resource.identity).to eq("http://www.trololol.net")
end
end
diff --git a/spec/unit/resource/ifconfig_spec.rb b/spec/unit/resource/ifconfig_spec.rb
index 10a4d09982..ea5282acd5 100644
--- a/spec/unit/resource/ifconfig_spec.rb
+++ b/spec/unit/resource/ifconfig_spec.rb
@@ -38,12 +38,12 @@ describe Chef::Resource::Ifconfig do
it "describes its state" do
state = @resource.state
- state[:inet_addr].should == "434.2343.23"
- state[:mask].should == "255.255.545"
+ expect(state[:inet_addr]).to eq("434.2343.23")
+ expect(state[:mask]).to eq("255.255.545")
end
it "returns the device as its identity" do
- @resource.identity.should == "charmander"
+ expect(@resource.identity).to eq("charmander")
end
end
@@ -54,9 +54,9 @@ describe Chef::Resource::Ifconfig do
end
it "should use an ordinary Provider::Ifconfig as a provider for #{platform} #{version}" do
- @resource.provider_for_action(:add).should be_a_kind_of(Chef::Provider::Ifconfig)
- @resource.provider_for_action(:add).should_not be_a_kind_of(Chef::Provider::Ifconfig::Debian)
- @resource.provider_for_action(:add).should_not be_a_kind_of(Chef::Provider::Ifconfig::Redhat)
+ expect(@resource.provider_for_action(:add)).to be_a_kind_of(Chef::Provider::Ifconfig)
+ expect(@resource.provider_for_action(:add)).not_to be_a_kind_of(Chef::Provider::Ifconfig::Debian)
+ expect(@resource.provider_for_action(:add)).not_to be_a_kind_of(Chef::Provider::Ifconfig::Redhat)
end
end
@@ -67,7 +67,7 @@ describe Chef::Resource::Ifconfig do
end
it "should use an Provider::Ifconfig::Redhat as a provider for #{platform} #{version}" do
- @resource.provider_for_action(:add).should be_a_kind_of(Chef::Provider::Ifconfig::Redhat)
+ expect(@resource.provider_for_action(:add)).to be_a_kind_of(Chef::Provider::Ifconfig::Redhat)
end
end
@@ -78,7 +78,7 @@ describe Chef::Resource::Ifconfig do
end
it "should use an Ifconfig::Debian as a provider for #{platform} #{version}" do
- @resource.provider_for_action(:add).should be_a_kind_of(Chef::Provider::Ifconfig::Debian)
+ expect(@resource.provider_for_action(:add)).to be_a_kind_of(Chef::Provider::Ifconfig::Debian)
end
end
diff --git a/spec/unit/resource/ips_package_spec.rb b/spec/unit/resource/ips_package_spec.rb
index 61661922fa..126ae00224 100644
--- a/spec/unit/resource/ips_package_spec.rb
+++ b/spec/unit/resource/ips_package_spec.rb
@@ -17,27 +17,24 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::IpsPackage, "initialize" do
+ static_provider_resolution(
+ resource: Chef::Resource::IpsPackage,
+ provider: Chef::Provider::Package::Ips,
+ name: :ips_package,
+ action: :install,
+ os: "solaris2",
+ )
+
before(:each) do
@resource = Chef::Resource::IpsPackage.new("crypto/gnupg")
end
- it "should return a Chef::Resource::IpsPackage" do
- @resource.should be_a_kind_of(Chef::Resource::IpsPackage)
- end
-
- it "should set the resource_name to :ips_package" do
- @resource.resource_name.should eql(:ips_package)
- end
-
- it "should set the provider to Chef::Provider::Package::Ips" do
- @resource.provider.should eql(Chef::Provider::Package::Ips)
- end
-
it "should support accept_license" do
@resource.accept_license(true)
- @resource.accept_license.should eql(true)
+ expect(@resource.accept_license).to eql(true)
end
end
diff --git a/spec/unit/resource/link_spec.rb b/spec/unit/resource/link_spec.rb
index 221617f9b3..3573a15f31 100644
--- a/spec/unit/resource/link_spec.rb
+++ b/spec/unit/resource/link_spec.rb
@@ -22,78 +22,78 @@ require 'spec_helper'
describe Chef::Resource::Link do
before(:each) do
- Chef::Resource::Link.any_instance.should_receive(:verify_links_supported!).and_return(true)
+ expect_any_instance_of(Chef::Resource::Link).to receive(:verify_links_supported!).and_return(true)
@resource = Chef::Resource::Link.new("fakey_fakerton")
end
it "should create a new Chef::Resource::Link" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Link)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Link)
end
it "should have a name" do
- @resource.name.should eql("fakey_fakerton")
+ expect(@resource.name).to eql("fakey_fakerton")
end
it "should have a default action of 'create'" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
{ :create => false, :delete => false, :blues => true }.each do |action,bad_value|
it "should #{bad_value ? 'not' : ''} accept #{action.to_s}" do
if bad_value
- lambda { @resource.action action }.should raise_error(ArgumentError)
+ expect { @resource.action action }.to raise_error(ArgumentError)
else
- lambda { @resource.action action }.should_not raise_error
+ expect { @resource.action action }.not_to raise_error
end
end
end
it "should use the object name as the target_file by default" do
- @resource.target_file.should eql("fakey_fakerton")
+ expect(@resource.target_file).to eql("fakey_fakerton")
end
it "should accept a string as the link source via 'to'" do
- lambda { @resource.to "/tmp" }.should_not raise_error
+ expect { @resource.to "/tmp" }.not_to raise_error
end
it "should not accept a Hash for the link source via 'to'" do
- lambda { @resource.to Hash.new }.should raise_error(ArgumentError)
+ expect { @resource.to Hash.new }.to raise_error(ArgumentError)
end
it "should allow you to set a link source via 'to'" do
@resource.to "/tmp/foo"
- @resource.to.should eql("/tmp/foo")
+ expect(@resource.to).to eql("/tmp/foo")
end
it "should allow you to specify the link type" do
@resource.link_type "symbolic"
- @resource.link_type.should eql(:symbolic)
+ expect(@resource.link_type).to eql(:symbolic)
end
it "should default to a symbolic link" do
- @resource.link_type.should eql(:symbolic)
+ expect(@resource.link_type).to eql(:symbolic)
end
it "should accept a hard link_type" do
@resource.link_type :hard
- @resource.link_type.should eql(:hard)
+ expect(@resource.link_type).to eql(:hard)
end
it "should reject any other link_type but :hard and :symbolic" do
- lambda { @resource.link_type "x-men" }.should raise_error(ArgumentError)
+ expect { @resource.link_type "x-men" }.to raise_error(ArgumentError)
end
it "should accept a group name or id for group" do
- lambda { @resource.group "root" }.should_not raise_error
- lambda { @resource.group 123 }.should_not raise_error
- lambda { @resource.group "root:goo" }.should raise_error(ArgumentError)
+ expect { @resource.group "root" }.not_to raise_error
+ expect { @resource.group 123 }.not_to raise_error
+ expect { @resource.group "root:goo" }.to raise_error(ArgumentError)
end
it "should accept a user name or id for owner" do
- lambda { @resource.owner "root" }.should_not raise_error
- lambda { @resource.owner 123 }.should_not raise_error
- lambda { @resource.owner "root:goo" }.should raise_error(ArgumentError)
+ expect { @resource.owner "root" }.not_to raise_error
+ expect { @resource.owner 123 }.not_to raise_error
+ expect { @resource.owner "root:goo" }.to raise_error(ArgumentError)
end
describe "when it has to, link_type, owner, and group" do
@@ -107,13 +107,13 @@ describe Chef::Resource::Link do
it "describes its state" do
state = @resource.state
- state[:to].should == "/to/dir/file.tar"
- state[:owner].should == "root"
- state[:group].should == "0664"
+ expect(state[:to]).to eq("/to/dir/file.tar")
+ expect(state[:owner]).to eq("root")
+ expect(state[:group]).to eq("0664")
end
it "returns the target file as its identity" do
- @resource.identity.should == "/var/target.tar"
+ expect(@resource.identity).to eq("/var/target.tar")
end
end
end
diff --git a/spec/unit/resource/log_spec.rb b/spec/unit/resource/log_spec.rb
index c0201e57f3..b2af194238 100644
--- a/spec/unit/resource/log_spec.rb
+++ b/spec/unit/resource/log_spec.rb
@@ -27,29 +27,29 @@ describe Chef::Resource::Log do
end
it "should create a new Chef::Resource::Log" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Log)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Log)
end
it "supports the :write actions" do
- @resource.allowed_actions.should include(:write)
+ expect(@resource.allowed_actions).to include(:write)
end
it "should have a name of log" do
- @resource.resource_name.should == :log
+ expect(@resource.resource_name).to eq(:log)
end
it "should allow you to set a log string" do
- @resource.name.should == @log_str
+ expect(@resource.name).to eq(@log_str)
end
it "should set the message to the first argument to new" do
- @resource.message.should == @log_str
+ expect(@resource.message).to eq(@log_str)
end
it "should accept a string for the log message" do
@resource.message "this is different"
- @resource.message.should == "this is different"
+ expect(@resource.message).to eq("this is different")
end
it "should accept a vaild level option" do
@@ -58,7 +58,7 @@ describe Chef::Resource::Log do
@resource.level :warn
@resource.level :error
@resource.level :fatal
- lambda { @resource.level :unsupported }.should raise_error(ArgumentError)
+ expect { @resource.level :unsupported }.to raise_error(ArgumentError)
end
describe "when the identity is defined" do
@@ -67,7 +67,7 @@ describe Chef::Resource::Log do
end
it "returns the log string as its identity" do
- @resource.identity.should == "ery day I'm loggin-in"
+ expect(@resource.identity).to eq("ery day I'm loggin-in")
end
end
end
diff --git a/spec/unit/resource/macports_package_spec.rb b/spec/unit/resource/macports_package_spec.rb
index 7e2e200487..0a203b2e97 100644
--- a/spec/unit/resource/macports_package_spec.rb
+++ b/spec/unit/resource/macports_package_spec.rb
@@ -17,21 +17,16 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::MacportsPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::MacportsPackage.new("foo")
- end
- it "should return a Chef::Resource::MacportsPackage" do
- @resource.should be_a_kind_of(Chef::Resource::MacportsPackage)
- end
+ static_provider_resolution(
+ resource: Chef::Resource::MacportsPackage,
+ provider: Chef::Provider::Package::Macports,
+ name: :macports_package,
+ action: :install,
+ os: "mac_os_x",
+ )
- it "should set the resource_name to :macports_package" do
- @resource.resource_name.should eql(:macports_package)
- end
-
- it "should set the provider to Chef::Provider::Package::Macports" do
- @resource.provider.should eql(Chef::Provider::Package::Macports)
- end
end
diff --git a/spec/unit/resource/mdadm_spec.rb b/spec/unit/resource/mdadm_spec.rb
index daf10bcfea..866309ec5b 100644
--- a/spec/unit/resource/mdadm_spec.rb
+++ b/spec/unit/resource/mdadm_spec.rb
@@ -26,57 +26,57 @@ describe Chef::Resource::Mdadm do
end
it "should create a new Chef::Resource::Mdadm" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Mdadm)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Mdadm)
end
it "should have a resource name of :mdadm" do
- @resource.resource_name.should eql(:mdadm)
+ expect(@resource.resource_name).to eql(:mdadm)
end
it "should have a default action of create" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
it "should accept create, assemble, stop as actions" do
- lambda { @resource.action :create }.should_not raise_error
- lambda { @resource.action :assemble }.should_not raise_error
- lambda { @resource.action :stop }.should_not raise_error
+ expect { @resource.action :create }.not_to raise_error
+ expect { @resource.action :assemble }.not_to raise_error
+ expect { @resource.action :stop }.not_to raise_error
end
it "should allow you to set the raid_device attribute" do
@resource.raid_device "/dev/md3"
- @resource.raid_device.should eql("/dev/md3")
+ expect(@resource.raid_device).to eql("/dev/md3")
end
it "should allow you to set the chunk attribute" do
@resource.chunk 256
- @resource.chunk.should eql(256)
+ expect(@resource.chunk).to eql(256)
end
it "should allow you to set the level attribute" do
@resource.level 1
- @resource.level.should eql(1)
+ expect(@resource.level).to eql(1)
end
it "should allow you to set the metadata attribute" do
@resource.metadata "1.2"
- @resource.metadata.should eql("1.2")
+ expect(@resource.metadata).to eql("1.2")
end
it "should allow you to set the bitmap attribute" do
@resource.metadata "internal"
- @resource.metadata.should eql("internal")
+ expect(@resource.metadata).to eql("internal")
end
it "should allow you to set the devices attribute" do
@resource.devices ["/dev/sda", "/dev/sdb"]
- @resource.devices.should eql(["/dev/sda", "/dev/sdb"])
+ expect(@resource.devices).to eql(["/dev/sda", "/dev/sdb"])
end
it "should allow you to set the exists attribute" do
@resource.exists true
- @resource.exists.should eql(true)
+ expect(@resource.exists).to eql(true)
end
describe "when it has devices, level, and chunk" do
@@ -89,13 +89,13 @@ describe Chef::Resource::Mdadm do
it "describes its state" do
state = @resource.state
- state[:devices].should eql(["device1", "device2"])
- state[:level].should == 1
- state[:chunk].should == 42
+ expect(state[:devices]).to eql(["device1", "device2"])
+ expect(state[:level]).to eq(1)
+ expect(state[:chunk]).to eq(42)
end
it "returns the raid device as its identity" do
- @resource.identity.should == "raider"
+ expect(@resource.identity).to eq("raider")
end
end
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index 0a154342c7..ad95c06e04 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -25,150 +25,150 @@ describe Chef::Resource::Mount do
end
it "should create a new Chef::Resource::Mount" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Mount)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Mount)
end
it "should have a name" do
- @resource.name.should eql("filesystem")
+ expect(@resource.name).to eql("filesystem")
end
it "should set mount_point to the name" do
- @resource.mount_point.should eql("filesystem")
+ expect(@resource.mount_point).to eql("filesystem")
end
it "should have a default action of mount" do
- @resource.action.should eql(:mount)
+ expect(@resource.action).to eql(:mount)
end
it "should accept mount, umount and remount as actions" do
- lambda { @resource.action :mount }.should_not raise_error
- lambda { @resource.action :umount }.should_not raise_error
- lambda { @resource.action :remount }.should_not raise_error
- lambda { @resource.action :brooklyn }.should raise_error(ArgumentError)
+ expect { @resource.action :mount }.not_to raise_error
+ expect { @resource.action :umount }.not_to raise_error
+ expect { @resource.action :remount }.not_to raise_error
+ expect { @resource.action :brooklyn }.to raise_error(ArgumentError)
end
it "should allow you to set the device attribute" do
@resource.device "/dev/sdb3"
- @resource.device.should eql("/dev/sdb3")
+ expect(@resource.device).to eql("/dev/sdb3")
end
it "should set fsck_device to '-' by default" do
- @resource.fsck_device.should eql('-')
+ expect(@resource.fsck_device).to eql('-')
end
it "should allow you to set the fsck_device attribute" do
@resource.fsck_device "/dev/rdsk/sdb3"
- @resource.fsck_device.should eql("/dev/rdsk/sdb3")
+ expect(@resource.fsck_device).to eql("/dev/rdsk/sdb3")
end
it "should allow you to set the fstype attribute" do
@resource.fstype "nfs"
- @resource.fstype.should eql("nfs")
+ expect(@resource.fstype).to eql("nfs")
end
it "should allow you to set the dump attribute" do
@resource.dump 1
- @resource.dump.should eql(1)
+ expect(@resource.dump).to eql(1)
end
it "should allow you to set the pass attribute" do
@resource.pass 1
- @resource.pass.should eql(1)
+ expect(@resource.pass).to eql(1)
end
it "should set the options attribute to defaults" do
- @resource.options.should eql(["defaults"])
+ expect(@resource.options).to eql(["defaults"])
end
it "should allow options to be sent as a string, and convert to array" do
@resource.options "rw,noexec"
- @resource.options.should be_a_kind_of(Array)
+ expect(@resource.options).to be_a_kind_of(Array)
end
it "should allow options attribute as an array" do
@resource.options ["ro", "nosuid"]
- @resource.options.should be_a_kind_of(Array)
+ expect(@resource.options).to be_a_kind_of(Array)
end
it "should allow options to be sent as a delayed evaluator" do
@resource.options Chef::DelayedEvaluator.new {["rw", "noexec"]}
- @resource.options.should eql(["rw", "noexec"])
+ expect(@resource.options).to eql(["rw", "noexec"])
end
it "should allow options to be sent as a delayed evaluator, and convert to array" do
@resource.options Chef::DelayedEvaluator.new {"rw,noexec"}
- @resource.options.should be_a_kind_of(Array)
- @resource.options.should eql(["rw", "noexec"])
+ expect(@resource.options).to be_a_kind_of(Array)
+ expect(@resource.options).to eql(["rw", "noexec"])
end
it "should accept true for mounted" do
@resource.mounted(true)
- @resource.mounted.should eql(true)
+ expect(@resource.mounted).to eql(true)
end
it "should accept false for mounted" do
@resource.mounted(false)
- @resource.mounted.should eql(false)
+ expect(@resource.mounted).to eql(false)
end
it "should set mounted to false by default" do
- @resource.mounted.should eql(false)
+ expect(@resource.mounted).to eql(false)
end
it "should not accept a string for mounted" do
- lambda { @resource.mounted("poop") }.should raise_error(ArgumentError)
+ expect { @resource.mounted("poop") }.to raise_error(ArgumentError)
end
it "should accept true for enabled" do
@resource.enabled(true)
- @resource.enabled.should eql(true)
+ expect(@resource.enabled).to eql(true)
end
it "should accept false for enabled" do
@resource.enabled(false)
- @resource.enabled.should eql(false)
+ expect(@resource.enabled).to eql(false)
end
it "should set enabled to false by default" do
- @resource.enabled.should eql(false)
+ expect(@resource.enabled).to eql(false)
end
it "should not accept a string for enabled" do
- lambda { @resource.enabled("poop") }.should raise_error(ArgumentError)
+ expect { @resource.enabled("poop") }.to raise_error(ArgumentError)
end
it "should default all feature support to false" do
support_hash = { :remount => false }
- @resource.supports.should == support_hash
+ expect(@resource.supports).to eq(support_hash)
end
it "should allow you to set feature support as an array" do
support_array = [ :remount ]
support_hash = { :remount => true }
@resource.supports(support_array)
- @resource.supports.should == support_hash
+ expect(@resource.supports).to eq(support_hash)
end
it "should allow you to set feature support as a hash" do
support_hash = { :remount => true }
@resource.supports(support_hash)
- @resource.supports.should == support_hash
+ expect(@resource.supports).to eq(support_hash)
end
it "should allow you to set username" do
@resource.username("Administrator")
- @resource.username.should == "Administrator"
+ expect(@resource.username).to eq("Administrator")
end
it "should allow you to set password" do
@resource.password("Jetstream123!")
- @resource.password.should == "Jetstream123!"
+ expect(@resource.password).to eq("Jetstream123!")
end
it "should allow you to set domain" do
@resource.domain("TEST_DOMAIN")
- @resource.domain.should == "TEST_DOMAIN"
+ expect(@resource.domain).to eq("TEST_DOMAIN")
end
describe "when it has mount point, device type, and fstype" do
@@ -181,13 +181,13 @@ describe Chef::Resource::Mount do
it "describes its state" do
state = @resource.state
- state[:mount_point].should == "123.456"
- state[:device_type].should eql(:device)
- state[:fstype].should == "ranked"
+ expect(state[:mount_point]).to eq("123.456")
+ expect(state[:device_type]).to eql(:device)
+ expect(state[:fstype]).to eq("ranked")
end
it "returns the device as its identity" do
- @resource.identity.should == "charmander"
+ expect(@resource.identity).to eq("charmander")
end
end
@@ -202,12 +202,12 @@ describe Chef::Resource::Mount do
it "describes its state" do
state = @resource.state
- state[:mount_point].should == "T:"
- state[:username].should == "Administrator"
- state[:password].should == "Jetstream123!"
- state[:domain].should == "TEST_DOMAIN"
- state[:device_type].should eql(:device)
- state[:fstype].should == "auto"
+ expect(state[:mount_point]).to eq("T:")
+ expect(state[:username]).to eq("Administrator")
+ expect(state[:password]).to eq("Jetstream123!")
+ expect(state[:domain]).to eq("TEST_DOMAIN")
+ expect(state[:device_type]).to eql(:device)
+ expect(state[:fstype]).to eq("auto")
end
end
diff --git a/spec/unit/resource/ohai_spec.rb b/spec/unit/resource/ohai_spec.rb
index b8d062b4c9..fe29755abf 100644
--- a/spec/unit/resource/ohai_spec.rb
+++ b/spec/unit/resource/ohai_spec.rb
@@ -25,21 +25,21 @@ describe Chef::Resource::Ohai do
end
it "should create a new Chef::Resource::Ohai" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Ohai)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Ohai)
end
it "should have a resource name of :ohai" do
- @resource.resource_name.should eql(:ohai)
+ expect(@resource.resource_name).to eql(:ohai)
end
it "should have a default action of create" do
- @resource.action.should eql(:reload)
+ expect(@resource.action).to eql(:reload)
end
it "should allow you to set the plugin attribute" do
@resource.plugin "passwd"
- @resource.plugin.should eql("passwd")
+ expect(@resource.plugin).to eql("passwd")
end
describe "when it has a plugin value" do
@@ -50,11 +50,11 @@ describe Chef::Resource::Ohai do
it "describes its state" do
state = @resource.state
- state[:plugin].should == "passwd"
+ expect(state[:plugin]).to eq("passwd")
end
it "returns the name as its identity" do
- @resource.identity.should == "test"
+ expect(@resource.identity).to eq("test")
end
end
diff --git a/spec/unit/resource/openbsd_package_spec.rb b/spec/unit/resource/openbsd_package_spec.rb
new file mode 100644
index 0000000000..95921c2f02
--- /dev/null
+++ b/spec/unit/resource/openbsd_package_spec.rb
@@ -0,0 +1,49 @@
+#
+# Authors:: AJ Christensen (<aj@opscode.com>)
+# Richard Manyanza (<liseki@nyikacraftsmen.com>)
+# Scott Bonds (<scott@ggr.com>)
+# Copyright:: Copyright (c) 2008 Opscode, Inc.
+# Copyright:: Copyright (c) 2014 Richard Manyanza, Scott Bonds
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+require 'ostruct'
+
+describe Chef::Resource::OpenbsdPackage do
+
+ before(:each) do
+ @node = Chef::Node.new
+ @events = Chef::EventDispatch::Dispatcher.new
+ @run_context = Chef::RunContext.new(@node, {}, @events)
+ @resource = Chef::Resource::OpenbsdPackage.new("foo", @run_context)
+ end
+
+ describe "Initialization" do
+ it "should return a Chef::Resource::OpenbsdPackage" do
+ expect(@resource).to be_a_kind_of(Chef::Resource::OpenbsdPackage)
+ end
+
+ it "should set the resource_name to :openbsd_package" do
+ expect(@resource.resource_name).to eql(:openbsd_package)
+ end
+
+ it "should not set the provider" do
+ expect(@resource.provider).to be_nil
+ end
+ end
+
+end
+
diff --git a/spec/unit/resource/package_spec.rb b/spec/unit/resource/package_spec.rb
index 8a1a13394e..449732a3c4 100644
--- a/spec/unit/resource/package_spec.rb
+++ b/spec/unit/resource/package_spec.rb
@@ -26,42 +26,42 @@ describe Chef::Resource::Package do
end
it "should create a new Chef::Resource::Package" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Package)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Package)
end
it "should set the package_name to the first argument to new" do
- @resource.package_name.should eql("emacs")
+ expect(@resource.package_name).to eql("emacs")
end
it "should accept a string for the package name" do
@resource.package_name "something"
- @resource.package_name.should eql("something")
+ expect(@resource.package_name).to eql("something")
end
it "should accept a string for the version" do
@resource.version "something"
- @resource.version.should eql("something")
+ expect(@resource.version).to eql("something")
end
it "should accept a string for the response file" do
@resource.response_file "something"
- @resource.response_file.should eql("something")
+ expect(@resource.response_file).to eql("something")
end
it "should accept a hash for response file template variables" do
@resource.response_file_variables({:variables => true})
- @resource.response_file_variables.should eql({:variables => true})
+ expect(@resource.response_file_variables).to eql({:variables => true})
end
it "should accept a string for the source" do
@resource.source "something"
- @resource.source.should eql("something")
+ expect(@resource.source).to eql("something")
end
it "should accept a string for the options" do
@resource.options "something"
- @resource.options.should eql("something")
+ expect(@resource.options).to eql("something")
end
describe "when it has a package_name and version" do
@@ -73,12 +73,12 @@ describe Chef::Resource::Package do
it "describes its state" do
state = @resource.state
- state[:version].should == "10.9.8"
- state[:options].should == "-al"
+ expect(state[:version]).to eq("10.9.8")
+ expect(state[:options]).to eq("-al")
end
it "returns the file path as its identity" do
- @resource.identity.should == "tomcat"
+ expect(@resource.identity).to eq("tomcat")
end
end
diff --git a/spec/unit/resource/pacman_package_spec.rb b/spec/unit/resource/pacman_package_spec.rb
index ec5feeb82c..975863d04f 100644
--- a/spec/unit/resource/pacman_package_spec.rb
+++ b/spec/unit/resource/pacman_package_spec.rb
@@ -17,22 +17,16 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::PacmanPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::PacmanPackage.new("foo")
- end
+ static_provider_resolution(
+ resource: Chef::Resource::PacmanPackage,
+ provider: Chef::Provider::Package::Pacman,
+ name: :pacman_package,
+ action: :install,
+ os: "linux",
+ )
- it "should return a Chef::Resource::PacmanPackage" do
- @resource.should be_a_kind_of(Chef::Resource::PacmanPackage)
- end
-
- it "should set the resource_name to :pacman_package" do
- @resource.resource_name.should eql(:pacman_package)
- end
-
- it "should set the provider to Chef::Provider::Package::Pacman" do
- @resource.provider.should eql(Chef::Provider::Package::Pacman)
- end
end
diff --git a/spec/unit/resource/perl_spec.rb b/spec/unit/resource/perl_spec.rb
index d25dc98563..7247cce6e3 100644
--- a/spec/unit/resource/perl_spec.rb
+++ b/spec/unit/resource/perl_spec.rb
@@ -25,16 +25,16 @@ describe Chef::Resource::Perl do
end
it "should create a new Chef::Resource::Perl" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Perl)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Perl)
end
it "should have a resource name of :perl" do
- @resource.resource_name.should eql(:perl)
+ expect(@resource.resource_name).to eql(:perl)
end
it "should have an interpreter of perl" do
- @resource.interpreter.should eql("perl")
+ expect(@resource.interpreter).to eql("perl")
end
end
diff --git a/spec/unit/resource/portage_package_spec.rb b/spec/unit/resource/portage_package_spec.rb
index 510f3b5864..d2ac7ac4be 100644
--- a/spec/unit/resource/portage_package_spec.rb
+++ b/spec/unit/resource/portage_package_spec.rb
@@ -25,14 +25,14 @@ describe Chef::Resource::PortagePackage, "initialize" do
end
it "should return a Chef::Resource::PortagePackage" do
- @resource.should be_a_kind_of(Chef::Resource::PortagePackage)
+ expect(@resource).to be_a_kind_of(Chef::Resource::PortagePackage)
end
it "should set the resource_name to :portage_package" do
- @resource.resource_name.should eql(:portage_package)
+ expect(@resource.resource_name).to eql(:portage_package)
end
it "should set the provider to Chef::Provider::Package::Portage" do
- @resource.provider.should eql(Chef::Provider::Package::Portage)
+ expect(@resource.provider).to eql(Chef::Provider::Package::Portage)
end
end
diff --git a/spec/unit/resource/powershell_spec.rb b/spec/unit/resource/powershell_spec.rb
index da20c4f0bf..c263172ae6 100644
--- a/spec/unit/resource/powershell_spec.rb
+++ b/spec/unit/resource/powershell_spec.rb
@@ -33,32 +33,32 @@ describe Chef::Resource::PowershellScript do
end
it "should create a new Chef::Resource::PowershellScript" do
- @resource.should be_a_kind_of(Chef::Resource::PowershellScript)
+ expect(@resource).to be_a_kind_of(Chef::Resource::PowershellScript)
end
it "should set convert_boolean_return to false by default" do
- @resource.convert_boolean_return.should == false
+ expect(@resource.convert_boolean_return).to eq(false)
end
it "should return the value for convert_boolean_return that was set" do
@resource.convert_boolean_return true
- @resource.convert_boolean_return.should == true
+ expect(@resource.convert_boolean_return).to eq(true)
@resource.convert_boolean_return false
- @resource.convert_boolean_return.should == false
+ expect(@resource.convert_boolean_return).to eq(false)
end
context "when using guards" do
let(:resource) { @resource }
before(:each) do
- resource.stub(:run_action)
- resource.stub(:updated).and_return(true)
+ allow(resource).to receive(:run_action)
+ allow(resource).to receive(:updated).and_return(true)
end
it "inherits exactly the :cwd, :environment, :group, :path, :user, :umask, and :architecture attributes from a parent resource class" do
inherited_difference = Chef::Resource::PowershellScript.guard_inherited_attributes -
[:cwd, :environment, :group, :path, :user, :umask, :architecture ]
- inherited_difference.should == []
+ expect(inherited_difference).to eq([])
end
it "should allow guard interpreter to be set to Chef::Resource::Script" do
diff --git a/spec/unit/resource/python_spec.rb b/spec/unit/resource/python_spec.rb
index 3362b68c62..8a3f7e48ca 100644
--- a/spec/unit/resource/python_spec.rb
+++ b/spec/unit/resource/python_spec.rb
@@ -25,16 +25,16 @@ describe Chef::Resource::Python do
end
it "should create a new Chef::Resource::Python" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Python)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Python)
end
it "should have a resource name of :python" do
- @resource.resource_name.should eql(:python)
+ expect(@resource.resource_name).to eql(:python)
end
it "should have an interpreter of python" do
- @resource.interpreter.should eql("python")
+ expect(@resource.interpreter).to eql("python")
end
end
diff --git a/spec/unit/resource/registry_key_spec.rb b/spec/unit/resource/registry_key_spec.rb
index 00c301d61d..e2a864d73a 100644
--- a/spec/unit/resource/registry_key_spec.rb
+++ b/spec/unit/resource/registry_key_spec.rb
@@ -24,33 +24,33 @@ describe Chef::Resource::RegistryKey, "initialize" do
end
it "should create a new Chef::Resource::RegistryKey" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::RegistryKey)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::RegistryKey)
end
it "should set the resource_name to :registry_key" do
- @resource.resource_name.should eql(:registry_key)
+ expect(@resource.resource_name).to eql(:registry_key)
end
it "should set the key equal to the argument to initialize" do
- @resource.key.should eql('HKCU\Software\Raxicoricofallapatorius')
+ expect(@resource.key).to eql('HKCU\Software\Raxicoricofallapatorius')
end
it "should default recursive to false" do
- @resource.recursive.should eql(false)
+ expect(@resource.recursive).to eql(false)
end
it "should default architecture to :machine" do
- @resource.architecture.should eql(:machine)
+ expect(@resource.architecture).to eql(:machine)
end
it "should set action to :create" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
%w{create create_if_missing delete delete_key}.each do |action|
it "should allow action #{action}" do
- @resource.allowed_actions.detect { |a| a == action.to_sym }.should eql(action.to_sym)
+ expect(@resource.allowed_actions.detect { |a| a == action.to_sym }).to eql(action.to_sym)
end
end
end
@@ -62,15 +62,15 @@ describe Chef::Resource::RegistryKey, "key" do
it "should allow a string" do
@resource.key 'HKCU\Software\Poosh'
- @resource.key.should eql('HKCU\Software\Poosh')
+ expect(@resource.key).to eql('HKCU\Software\Poosh')
end
it "should not allow an integer" do
- lambda { @resource.send(:key, 100) }.should raise_error(ArgumentError)
+ expect { @resource.send(:key, 100) }.to raise_error(ArgumentError)
end
it "should not allow a hash" do
- lambda { @resource.send(:key, { :sonic => "screwdriver" }) }.should raise_error(ArgumentError)
+ expect { @resource.send(:key, { :sonic => "screwdriver" }) }.to raise_error(ArgumentError)
end
end
@@ -81,41 +81,41 @@ describe Chef::Resource::RegistryKey, "values" do
it "should allow a single proper hash of registry values" do
@resource.values( { :name => 'poosh', :type => :string, :data => 'carmen' } )
- @resource.values.should eql([ { :name => 'poosh', :type => :string, :data => 'carmen' } ])
+ expect(@resource.values).to eql([ { :name => 'poosh', :type => :string, :data => 'carmen' } ])
end
it "should allow an array of proper hashes of registry values" do
@resource.values [ { :name => 'poosh', :type => :string, :data => 'carmen' } ]
- @resource.values.should eql([ { :name => 'poosh', :type => :string, :data => 'carmen' } ])
+ expect(@resource.values).to eql([ { :name => 'poosh', :type => :string, :data => 'carmen' } ])
end
it "should return checksummed data if the type is unsafe" do
@resource.values( { :name => 'poosh', :type => :binary, :data => 255.chr * 1 })
- @resource.values.should eql([ { :name => 'poosh', :type => :binary, :data => "00594fd4f42ba43fc1ca0427a0576295" } ])
+ expect(@resource.values).to eql([ { :name => 'poosh', :type => :binary, :data => "00594fd4f42ba43fc1ca0427a0576295" } ])
end
it "should throw an exception if the name field is missing" do
- lambda { @resource.values [ { :type => :string, :data => 'carmen' } ] }.should raise_error(ArgumentError)
+ expect { @resource.values [ { :type => :string, :data => 'carmen' } ] }.to raise_error(ArgumentError)
end
it "should throw an exception if the type field is missing" do
- lambda { @resource.values [ { :name => 'poosh', :data => 'carmen' } ] }.should raise_error(ArgumentError)
+ expect { @resource.values [ { :name => 'poosh', :data => 'carmen' } ] }.to raise_error(ArgumentError)
end
it "should throw an exception if the data field is missing" do
- lambda { @resource.values [ { :name => 'poosh', :type => :string } ] }.should raise_error(ArgumentError)
+ expect { @resource.values [ { :name => 'poosh', :type => :string } ] }.to raise_error(ArgumentError)
end
it "should throw an exception if extra fields are present" do
- lambda { @resource.values [ { :name => 'poosh', :type => :string, :data => 'carmen', :screwdriver => 'sonic' } ] }.should raise_error(ArgumentError)
+ expect { @resource.values [ { :name => 'poosh', :type => :string, :data => 'carmen', :screwdriver => 'sonic' } ] }.to raise_error(ArgumentError)
end
it "should not allow a string" do
- lambda { @resource.send(:values, 'souffle') }.should raise_error(ArgumentError)
+ expect { @resource.send(:values, 'souffle') }.to raise_error(ArgumentError)
end
it "should not allow an integer" do
- lambda { @resource.send(:values, 100) }.should raise_error(ArgumentError)
+ expect { @resource.send(:values, 100) }.to raise_error(ArgumentError)
end
end
@@ -126,23 +126,23 @@ describe Chef::Resource::RegistryKey, "recursive" do
it "should allow a boolean" do
@resource.recursive(true)
- @resource.recursive.should eql(true)
+ expect(@resource.recursive).to eql(true)
end
it "should not allow a hash" do
- lambda { @resource.recursive({:sonic => :screwdriver}) }.should raise_error(ArgumentError)
+ expect { @resource.recursive({:sonic => :screwdriver}) }.to raise_error(ArgumentError)
end
it "should not allow an array" do
- lambda { @resource.recursive([:nose, :chin]) }.should raise_error(ArgumentError)
+ expect { @resource.recursive([:nose, :chin]) }.to raise_error(ArgumentError)
end
it "should not allow a string" do
- lambda { @resource.recursive('souffle') }.should raise_error(ArgumentError)
+ expect { @resource.recursive('souffle') }.to raise_error(ArgumentError)
end
it "should not allow an integer" do
- lambda { @resource.recursive(100) }.should raise_error(ArgumentError)
+ expect { @resource.recursive(100) }.to raise_error(ArgumentError)
end
end
@@ -154,24 +154,24 @@ describe Chef::Resource::RegistryKey, "architecture" do
[ :i386, :x86_64, :machine ].each do |arch|
it "should allow #{arch} as a symbol" do
@resource.architecture(arch)
- @resource.architecture.should eql(arch)
+ expect(@resource.architecture).to eql(arch)
end
end
it "should not allow a hash" do
- lambda { @resource.architecture({:sonic => :screwdriver}) }.should raise_error(ArgumentError)
+ expect { @resource.architecture({:sonic => :screwdriver}) }.to raise_error(ArgumentError)
end
it "should not allow an array" do
- lambda { @resource.architecture([:nose, :chin]) }.should raise_error(ArgumentError)
+ expect { @resource.architecture([:nose, :chin]) }.to raise_error(ArgumentError)
end
it "should not allow a string" do
- lambda { @resource.architecture('souffle') }.should raise_error(ArgumentError)
+ expect { @resource.architecture('souffle') }.to raise_error(ArgumentError)
end
it "should not allow an integer" do
- lambda { @resource.architecture(100) }.should raise_error(ArgumentError)
+ expect { @resource.architecture(100) }.to raise_error(ArgumentError)
end
end
@@ -183,7 +183,7 @@ describe Chef::Resource::RegistryKey, ":unscrubbed_values" do
it "should return unsafe data as-is" do
key_values = [ { :name => 'poosh', :type => :binary, :data => 255.chr * 1 } ]
@resource.values(key_values)
- @resource.unscrubbed_values.should eql(key_values)
+ expect(@resource.unscrubbed_values).to eql(key_values)
end
end
@@ -194,6 +194,6 @@ describe Chef::Resource::RegistryKey, "state" do
it "should return scrubbed values" do
@resource.values([ { :name => 'poosh', :type => :binary, :data => 255.chr * 1 } ])
- @resource.state.should eql( { :values => [{ :name => 'poosh', :type => :binary, :data => "00594fd4f42ba43fc1ca0427a0576295" }] } )
+ expect(@resource.state).to eql( { :values => [{ :name => 'poosh', :type => :binary, :data => "00594fd4f42ba43fc1ca0427a0576295" }] } )
end
end
diff --git a/spec/unit/resource/remote_directory_spec.rb b/spec/unit/resource/remote_directory_spec.rb
index d3800062ae..1ab75586b6 100644
--- a/spec/unit/resource/remote_directory_spec.rb
+++ b/spec/unit/resource/remote_directory_spec.rb
@@ -25,52 +25,52 @@ describe Chef::Resource::RemoteDirectory do
end
it "should create a new Chef::Resource::RemoteDirectory" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::RemoteDirectory)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::RemoteDirectory)
end
it "should set the path to the first argument to new" do
- @resource.path.should eql("/etc/dunk")
+ expect(@resource.path).to eql("/etc/dunk")
end
it "should accept a string for the remote directory source" do
@resource.source "foo"
- @resource.source.should eql("foo")
+ expect(@resource.source).to eql("foo")
end
it "should have the basename of the remote directory resource as the default source" do
- @resource.source.should eql("dunk")
+ expect(@resource.source).to eql("dunk")
end
it "should accept a number for the remote files backup" do
@resource.files_backup 1
- @resource.files_backup.should eql(1)
+ expect(@resource.files_backup).to eql(1)
end
it "should accept false for the remote files backup" do
@resource.files_backup false
- @resource.files_backup.should eql(false)
+ expect(@resource.files_backup).to eql(false)
end
it "should accept 3 or 4 digets for the files_mode" do
@resource.files_mode 100
- @resource.files_mode.should eql(100)
+ expect(@resource.files_mode).to eql(100)
@resource.files_mode 1000
- @resource.files_mode.should eql(1000)
+ expect(@resource.files_mode).to eql(1000)
end
it "should accept a string or number for the files group" do
@resource.files_group "heart"
- @resource.files_group.should eql("heart")
+ expect(@resource.files_group).to eql("heart")
@resource.files_group 1000
- @resource.files_group.should eql(1000)
+ expect(@resource.files_group).to eql(1000)
end
it "should accept a string or number for the files owner" do
@resource.files_owner "heart"
- @resource.files_owner.should eql("heart")
+ expect(@resource.files_owner).to eql("heart")
@resource.files_owner 1000
- @resource.files_owner.should eql(1000)
+ expect(@resource.files_owner).to eql(1000)
end
describe "when it has cookbook, files owner, files mode, and source" do
@@ -85,13 +85,13 @@ describe Chef::Resource::RemoteDirectory do
it "describes its state" do
state = @resource.state
- state[:files_owner].should == "root"
- state[:files_group].should == "supergroup"
- state[:files_mode].should == "0664"
+ expect(state[:files_owner]).to eq("root")
+ expect(state[:files_group]).to eq("supergroup")
+ expect(state[:files_mode]).to eq("0664")
end
it "returns the path as its identity" do
- @resource.identity.should == "/var/path/"
+ expect(@resource.identity).to eq("/var/path/")
end
end
end
diff --git a/spec/unit/resource/remote_file_spec.rb b/spec/unit/resource/remote_file_spec.rb
index 8f1633119d..3731d1aee2 100644
--- a/spec/unit/resource/remote_file_spec.rb
+++ b/spec/unit/resource/remote_file_spec.rb
@@ -27,74 +27,74 @@ describe Chef::Resource::RemoteFile do
describe "initialize" do
it "should create a new Chef::Resource::RemoteFile" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::File)
- @resource.should be_a_kind_of(Chef::Resource::RemoteFile)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::File)
+ expect(@resource).to be_a_kind_of(Chef::Resource::RemoteFile)
end
end
it "says its provider is RemoteFile when the source is an absolute URI" do
@resource.source("http://www.google.com/robots.txt")
- @resource.provider.should == Chef::Provider::RemoteFile
- Chef::Platform.find_provider(:noplatform, 'noversion', @resource).should == Chef::Provider::RemoteFile
+ expect(@resource.provider).to eq(Chef::Provider::RemoteFile)
+ expect(Chef::Platform.find_provider(:noplatform, 'noversion', @resource)).to eq(Chef::Provider::RemoteFile)
end
describe "source" do
it "does not have a default value for 'source'" do
- @resource.source.should eql([])
+ expect(@resource.source).to eql([])
end
it "should accept a URI for the remote file source" do
@resource.source "http://opscode.com/"
- @resource.source.should eql([ "http://opscode.com/" ])
+ expect(@resource.source).to eql([ "http://opscode.com/" ])
end
it "should accept a delayed evalutator (string) for the remote file source" do
@resource.source Chef::DelayedEvaluator.new {"http://opscode.com/"}
- @resource.source.should eql([ "http://opscode.com/" ])
+ expect(@resource.source).to eql([ "http://opscode.com/" ])
end
it "should accept an array of URIs for the remote file source" do
@resource.source([ "http://opscode.com/", "http://puppetlabs.com/" ])
- @resource.source.should eql([ "http://opscode.com/", "http://puppetlabs.com/" ])
+ expect(@resource.source).to eql([ "http://opscode.com/", "http://puppetlabs.com/" ])
end
it "should accept a delated evaluator (array) for the remote file source" do
@resource.source Chef::DelayedEvaluator.new { [ "http://opscode.com/", "http://puppetlabs.com/" ] }
- @resource.source.should eql([ "http://opscode.com/", "http://puppetlabs.com/" ])
+ expect(@resource.source).to eql([ "http://opscode.com/", "http://puppetlabs.com/" ])
end
it "should accept an multiple URIs as arguments for the remote file source" do
@resource.source("http://opscode.com/", "http://puppetlabs.com/")
- @resource.source.should eql([ "http://opscode.com/", "http://puppetlabs.com/" ])
+ expect(@resource.source).to eql([ "http://opscode.com/", "http://puppetlabs.com/" ])
end
it "should only accept a single argument if a delayed evalutor is used" do
- lambda {
+ expect {
@resource.source("http://opscode.com/", Chef::DelayedEvaluator.new {"http://opscode.com/"})
- }.should raise_error(Chef::Exceptions::InvalidRemoteFileURI)
+ }.to raise_error(Chef::Exceptions::InvalidRemoteFileURI)
end
it "should only accept a single array item if a delayed evalutor is used" do
- lambda {
+ expect {
@resource.source(["http://opscode.com/", Chef::DelayedEvaluator.new {"http://opscode.com/"}])
- }.should raise_error(Chef::Exceptions::InvalidRemoteFileURI)
+ }.to raise_error(Chef::Exceptions::InvalidRemoteFileURI)
end
it "does not accept a non-URI as the source" do
- lambda { @resource.source("not-a-uri") }.should raise_error(Chef::Exceptions::InvalidRemoteFileURI)
+ expect { @resource.source("not-a-uri") }.to raise_error(Chef::Exceptions::InvalidRemoteFileURI)
end
it "does not accept a non-URI as the source when read from a delayed evaluator" do
- lambda {
+ expect {
@resource.source(Chef::DelayedEvaluator.new {"not-a-uri"})
@resource.source
- }.should raise_error(Chef::Exceptions::InvalidRemoteFileURI)
+ }.to raise_error(Chef::Exceptions::InvalidRemoteFileURI)
end
it "should raise an exception when source is an empty array" do
- lambda { @resource.source([]) }.should raise_error(ArgumentError)
+ expect { @resource.source([]) }.to raise_error(ArgumentError)
end
end
@@ -102,51 +102,51 @@ describe Chef::Resource::RemoteFile do
describe "checksum" do
it "should accept a string for the checksum object" do
@resource.checksum "asdf"
- @resource.checksum.should eql("asdf")
+ expect(@resource.checksum).to eql("asdf")
end
it "should default to nil" do
- @resource.checksum.should == nil
+ expect(@resource.checksum).to eq(nil)
end
end
describe "ftp_active_mode" do
it "should accept a boolean for the ftp_active_mode object" do
@resource.ftp_active_mode true
- @resource.ftp_active_mode.should be_true
+ expect(@resource.ftp_active_mode).to be_truthy
end
it "should default to false" do
- @resource.ftp_active_mode.should be_false
+ expect(@resource.ftp_active_mode).to be_falsey
end
end
describe "conditional get options" do
it "defaults to using etags and last modified" do
- @resource.use_etags.should be_true
- @resource.use_last_modified.should be_true
+ expect(@resource.use_etags).to be_truthy
+ expect(@resource.use_last_modified).to be_truthy
end
it "enable or disables etag and last modified options as a group" do
@resource.use_conditional_get(false)
- @resource.use_etags.should be_false
- @resource.use_last_modified.should be_false
+ expect(@resource.use_etags).to be_falsey
+ expect(@resource.use_last_modified).to be_falsey
@resource.use_conditional_get(true)
- @resource.use_etags.should be_true
- @resource.use_last_modified.should be_true
+ expect(@resource.use_etags).to be_truthy
+ expect(@resource.use_last_modified).to be_truthy
end
it "disables etags indivdually" do
@resource.use_etags(false)
- @resource.use_etags.should be_false
- @resource.use_last_modified.should be_true
+ expect(@resource.use_etags).to be_falsey
+ expect(@resource.use_last_modified).to be_truthy
end
it "disables last modified individually" do
@resource.use_last_modified(false)
- @resource.use_last_modified.should be_false
- @resource.use_etags.should be_true
+ expect(@resource.use_last_modified).to be_falsey
+ expect(@resource.use_etags).to be_truthy
end
end
@@ -171,21 +171,21 @@ describe Chef::Resource::RemoteFile do
state = @resource.state
if Chef::Platform.windows?
puts state
- state[:rights].should == [{:permissions => :read, :principals => "Everyone"}]
- state[:deny_rights].should == [{:permissions => :full_control, :principals => "Clumsy_Sam"}]
+ expect(state[:rights]).to eq([{:permissions => :read, :principals => "Everyone"}])
+ expect(state[:deny_rights]).to eq([{:permissions => :full_control, :principals => "Clumsy_Sam"}])
else
- state[:group].should == "pokemon"
- state[:mode].should == "0664"
- state[:owner].should == "root"
- state[:checksum].should == "1"*26
+ expect(state[:group]).to eq("pokemon")
+ expect(state[:mode]).to eq("0664")
+ expect(state[:owner]).to eq("root")
+ expect(state[:checksum]).to eq("1"*26)
end
end
it "returns the path as its identity" do
if Chef::Platform.windows?
- @resource.identity.should == "C:/temp/origin/file.txt"
+ expect(@resource.identity).to eq("C:/temp/origin/file.txt")
else
- @resource.identity.should == "/this/path/"
+ expect(@resource.identity).to eq("/this/path/")
end
end
end
diff --git a/spec/unit/resource/route_spec.rb b/spec/unit/resource/route_spec.rb
index 4522438402..ec1d369932 100644
--- a/spec/unit/resource/route_spec.rb
+++ b/spec/unit/resource/route_spec.rb
@@ -26,64 +26,64 @@ describe Chef::Resource::Route do
end
it "should create a new Chef::Resource::Route" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Route)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Route)
end
it "should have a name" do
- @resource.name.should eql("10.0.0.10")
+ expect(@resource.name).to eql("10.0.0.10")
end
it "should have a default action of 'add'" do
- @resource.action.should eql([:add])
+ expect(@resource.action).to eql([:add])
end
it "should accept add or delete for action" do
- lambda { @resource.action :add }.should_not raise_error
- lambda { @resource.action :delete }.should_not raise_error
- lambda { @resource.action :lolcat }.should raise_error(ArgumentError)
+ expect { @resource.action :add }.not_to raise_error
+ expect { @resource.action :delete }.not_to raise_error
+ expect { @resource.action :lolcat }.to raise_error(ArgumentError)
end
it "should use the object name as the target by default" do
- @resource.target.should eql("10.0.0.10")
+ expect(@resource.target).to eql("10.0.0.10")
end
it "should allow you to specify the netmask" do
@resource.netmask "255.255.255.0"
- @resource.netmask.should eql("255.255.255.0")
+ expect(@resource.netmask).to eql("255.255.255.0")
end
it "should allow you to specify the gateway" do
@resource.gateway "10.0.0.1"
- @resource.gateway.should eql("10.0.0.1")
+ expect(@resource.gateway).to eql("10.0.0.1")
end
it "should allow you to specify the metric" do
@resource.metric 10
- @resource.metric.should eql(10)
+ expect(@resource.metric).to eql(10)
end
it "should allow you to specify the device" do
@resource.device "eth0"
- @resource.device.should eql("eth0")
+ expect(@resource.device).to eql("eth0")
end
it "should allow you to specify the route type" do
@resource.route_type "host"
- @resource.route_type.should eql(:host)
+ expect(@resource.route_type).to eql(:host)
end
it "should default to a host route type" do
- @resource.route_type.should eql(:host)
+ expect(@resource.route_type).to eql(:host)
end
it "should accept a net route type" do
@resource.route_type :net
- @resource.route_type.should eql(:net)
+ expect(@resource.route_type).to eql(:net)
end
it "should reject any other route_type but :host and :net" do
- lambda { @resource.route_type "lolcat" }.should raise_error(ArgumentError)
+ expect { @resource.route_type "lolcat" }.to raise_error(ArgumentError)
end
describe "when it has netmask, gateway, and device" do
@@ -96,12 +96,12 @@ describe Chef::Resource::Route do
it "describes its state" do
state = @resource.state
- state[:netmask].should == "lemask"
- state[:gateway].should == "111.111.111"
+ expect(state[:netmask]).to eq("lemask")
+ expect(state[:gateway]).to eq("111.111.111")
end
it "returns the target as its identity" do
- @resource.identity.should == "charmander"
+ expect(@resource.identity).to eq("charmander")
end
end
end
diff --git a/spec/unit/resource/rpm_package_spec.rb b/spec/unit/resource/rpm_package_spec.rb
index 25930a5484..d209c6a5a2 100644
--- a/spec/unit/resource/rpm_package_spec.rb
+++ b/spec/unit/resource/rpm_package_spec.rb
@@ -17,22 +17,18 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::RpmPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::RpmPackage.new("foo")
+ %w{linux aix}.each do |os|
+ static_provider_resolution(
+ resource: Chef::Resource::RpmPackage,
+ provider: Chef::Provider::Package::Rpm,
+ name: :rpm_package,
+ action: :install,
+ os: os
+ )
end
- it "should return a Chef::Resource::RpmPackage" do
- @resource.should be_a_kind_of(Chef::Resource::RpmPackage)
- end
-
- it "should set the resource_name to :rpm_package" do
- @resource.resource_name.should eql(:rpm_package)
- end
-
- it "should set the provider to Chef::Provider::Package::Rpm" do
- @resource.provider.should eql(Chef::Provider::Package::Rpm)
- end
end
diff --git a/spec/unit/resource/ruby_block_spec.rb b/spec/unit/resource/ruby_block_spec.rb
index 82bbd1ffc7..9f19fecd4f 100644
--- a/spec/unit/resource/ruby_block_spec.rb
+++ b/spec/unit/resource/ruby_block_spec.rb
@@ -26,27 +26,27 @@ describe Chef::Resource::RubyBlock do
end
it "should create a new Chef::Resource::RubyBlock" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::RubyBlock)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::RubyBlock)
end
it "should have a default action of 'create'" do
- @resource.action.should eql("run")
+ expect(@resource.action).to eql("run")
end
it "should have a resource name of :ruby_block" do
- @resource.resource_name.should eql(:ruby_block)
+ expect(@resource.resource_name).to eql(:ruby_block)
end
it "should accept a ruby block/proc/.. for the 'block' parameter" do
- @resource.block do
+ expect(@resource.block do
"foo"
- end.call.should eql("foo")
+ end.call).to eql("foo")
end
it "allows the action to be 'create'" do
@resource.action :create
- @resource.action.should == [:create]
+ expect(@resource.action).to eq([:create])
end
describe "when it has been initialized with block code" do
@@ -55,7 +55,7 @@ describe Chef::Resource::RubyBlock do
end
it "returns the block as its identity" do
- @resource.identity.should == "puts 'harrrr'"
+ expect(@resource.identity).to eq("puts 'harrrr'")
end
end
end
diff --git a/spec/unit/resource/ruby_spec.rb b/spec/unit/resource/ruby_spec.rb
index 9bf7316e6d..e899810ab9 100644
--- a/spec/unit/resource/ruby_spec.rb
+++ b/spec/unit/resource/ruby_spec.rb
@@ -25,16 +25,16 @@ describe Chef::Resource::Ruby do
end
it "should create a new Chef::Resource::Ruby" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Ruby)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Ruby)
end
it "should have a resource name of :ruby" do
- @resource.resource_name.should eql(:ruby)
+ expect(@resource.resource_name).to eql(:ruby)
end
it "should have an interpreter of ruby" do
- @resource.interpreter.should eql("ruby")
+ expect(@resource.interpreter).to eql("ruby")
end
end
diff --git a/spec/unit/resource/scm_spec.rb b/spec/unit/resource/scm_spec.rb
index eeb2fb1c3c..72319277ab 100644
--- a/spec/unit/resource/scm_spec.rb
+++ b/spec/unit/resource/scm_spec.rb
@@ -26,141 +26,141 @@ describe Chef::Resource::Scm do
end
it "should be a SCM resource" do
- @resource.should be_a_kind_of(Chef::Resource::Scm)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Scm)
end
it "supports :checkout, :export, :sync, :diff, and :log actions" do
- @resource.allowed_actions.should include(:checkout)
- @resource.allowed_actions.should include(:export)
- @resource.allowed_actions.should include(:sync)
- @resource.allowed_actions.should include(:diff)
- @resource.allowed_actions.should include(:log)
+ expect(@resource.allowed_actions).to include(:checkout)
+ expect(@resource.allowed_actions).to include(:export)
+ expect(@resource.allowed_actions).to include(:sync)
+ expect(@resource.allowed_actions).to include(:diff)
+ expect(@resource.allowed_actions).to include(:log)
end
it "takes the destination path as a string" do
@resource.destination "/path/to/deploy/dir"
- @resource.destination.should eql("/path/to/deploy/dir")
+ expect(@resource.destination).to eql("/path/to/deploy/dir")
end
it "takes a string for the repository URL" do
@resource.repository "git://github.com/opscode/chef.git"
- @resource.repository.should eql("git://github.com/opscode/chef.git")
+ expect(@resource.repository).to eql("git://github.com/opscode/chef.git")
end
it "takes a string for the revision" do
@resource.revision "abcdef"
- @resource.revision.should eql("abcdef")
+ expect(@resource.revision).to eql("abcdef")
end
it "defaults to the ``HEAD'' revision" do
- @resource.revision.should eql("HEAD")
+ expect(@resource.revision).to eql("HEAD")
end
it "takes a string for the user to run as" do
@resource.user "dr_deploy"
- @resource.user.should eql("dr_deploy")
+ expect(@resource.user).to eql("dr_deploy")
end
it "also takes an integer for the user to run as" do
@resource.user 0
- @resource.user.should eql(0)
+ expect(@resource.user).to eql(0)
end
it "takes a string for the group to run as, defaulting to nil" do
- @resource.group.should be_nil
+ expect(@resource.group).to be_nil
@resource.group "opsdevs"
- @resource.group.should == "opsdevs"
+ expect(@resource.group).to eq("opsdevs")
end
it "also takes an integer for the group to run as" do
@resource.group 23
- @resource.group.should == 23
+ expect(@resource.group).to eq(23)
end
it "has a svn_username String attribute" do
@resource.svn_username "moartestsplz"
- @resource.svn_username.should eql("moartestsplz")
+ expect(@resource.svn_username).to eql("moartestsplz")
end
it "has a svn_password String attribute" do
@resource.svn_password "taftplz"
- @resource.svn_password.should eql("taftplz")
+ expect(@resource.svn_password).to eql("taftplz")
end
it "has a svn_arguments String attribute" do
@resource.svn_arguments "--more-taft plz"
- @resource.svn_arguments.should eql("--more-taft plz")
+ expect(@resource.svn_arguments).to eql("--more-taft plz")
end
it "has a svn_info_args String attribute" do
- @resource.svn_info_args.should be_nil
+ expect(@resource.svn_info_args).to be_nil
@resource.svn_info_args("--no-moar-plaintext-creds yep")
- @resource.svn_info_args.should == "--no-moar-plaintext-creds yep"
+ expect(@resource.svn_info_args).to eq("--no-moar-plaintext-creds yep")
end
it "takes the depth as an integer for shallow clones" do
@resource.depth 5
- @resource.depth.should == 5
- lambda {@resource.depth "five"}.should raise_error(ArgumentError)
+ expect(@resource.depth).to eq(5)
+ expect {@resource.depth "five"}.to raise_error(ArgumentError)
end
it "defaults to nil depth for a full clone" do
- @resource.depth.should be_nil
+ expect(@resource.depth).to be_nil
end
it "takes a boolean for #enable_submodules" do
@resource.enable_submodules true
- @resource.enable_submodules.should be_true
- lambda {@resource.enable_submodules "lolz"}.should raise_error(ArgumentError)
+ expect(@resource.enable_submodules).to be_truthy
+ expect {@resource.enable_submodules "lolz"}.to raise_error(ArgumentError)
end
it "defaults to not enabling submodules" do
- @resource.enable_submodules.should be_false
+ expect(@resource.enable_submodules).to be_falsey
end
it "takes a boolean for #enable_checkout" do
@resource.enable_checkout true
- @resource.enable_checkout.should be_true
- lambda {@resource.enable_checkout "lolz"}.should raise_error(ArgumentError)
+ expect(@resource.enable_checkout).to be_truthy
+ expect {@resource.enable_checkout "lolz"}.to raise_error(ArgumentError)
end
it "defaults to enabling checkout" do
- @resource.enable_checkout.should be_true
+ expect(@resource.enable_checkout).to be_truthy
end
it "takes a string for the remote" do
@resource.remote "opscode"
- @resource.remote.should eql("opscode")
- lambda {@resource.remote 1337}.should raise_error(ArgumentError)
+ expect(@resource.remote).to eql("opscode")
+ expect {@resource.remote 1337}.to raise_error(ArgumentError)
end
it "defaults to ``origin'' for the remote" do
- @resource.remote.should == "origin"
+ expect(@resource.remote).to eq("origin")
end
it "takes a string for the ssh wrapper" do
@resource.ssh_wrapper "with_ssh_fu"
- @resource.ssh_wrapper.should eql("with_ssh_fu")
+ expect(@resource.ssh_wrapper).to eql("with_ssh_fu")
end
it "defaults to nil for the ssh wrapper" do
- @resource.ssh_wrapper.should be_nil
+ expect(@resource.ssh_wrapper).to be_nil
end
it "defaults to nil for the environment" do
- @resource.environment.should be_nil
+ expect(@resource.environment).to be_nil
end
describe "when it has a timeout attribute" do
let(:ten_seconds) { 10 }
before { @resource.timeout(ten_seconds) }
it "stores this timeout" do
- @resource.timeout.should == ten_seconds
+ expect(@resource.timeout).to eq(ten_seconds)
end
end
describe "when it has no timeout attribute" do
it "should have no default timeout" do
- @resource.timeout.should be_nil
+ expect(@resource.timeout).to be_nil
end
end
@@ -175,11 +175,11 @@ describe Chef::Resource::Scm do
it "describes its state" do
state = @resource.state
- state[:revision].should == "1.2.3"
+ expect(state[:revision]).to eq("1.2.3")
end
it "returns the destination as its identity" do
- @resource.identity.should == "hell"
+ expect(@resource.identity).to eq("hell")
end
end
@@ -187,7 +187,7 @@ describe Chef::Resource::Scm do
let(:test_environment) { {'CHEF_ENV' => '/tmp' } }
before { @resource.environment(test_environment) }
it "stores this environment" do
- @resource.environment.should == test_environment
+ expect(@resource.environment).to eq(test_environment)
end
end
end
diff --git a/spec/unit/resource/script_spec.rb b/spec/unit/resource/script_spec.rb
index f100b0dc85..9d744baaa5 100644
--- a/spec/unit/resource/script_spec.rb
+++ b/spec/unit/resource/script_spec.rb
@@ -26,7 +26,7 @@ describe Chef::Resource::Script do
it "should accept a string for the interpreter" do
script_resource.interpreter "naaaaNaNaNaaNaaNaaNaa"
- script_resource.interpreter.should eql("naaaaNaNaNaaNaaNaaNaa")
+ expect(script_resource.interpreter).to eql("naaaaNaNaNaaNaaNaaNaa")
end
describe "when it has interpreter and flags" do
@@ -37,7 +37,7 @@ describe Chef::Resource::Script do
end
it "returns the command as its identity" do
- script_resource.identity.should == "grep"
+ expect(script_resource.identity).to eq("grep")
end
end
diff --git a/spec/unit/resource/service_spec.rb b/spec/unit/resource/service_spec.rb
index ec62d012bb..eb6f444e93 100644
--- a/spec/unit/resource/service_spec.rb
+++ b/spec/unit/resource/service_spec.rb
@@ -26,145 +26,135 @@ describe Chef::Resource::Service do
end
it "should create a new Chef::Resource::Service" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::Service)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Service)
end
-
+
it "should not set a provider unless node[:init_package] is defined as systemd" do
- @resource.provider.should == nil
- end
-
- it "should set the provider to Chef::Provider::Service::Systemd if node[:init_package] is systemd" do
- node = Chef::Node.new
- node.set[:init_package] = "systemd"
- cookbook_collection = Chef::CookbookCollection.new([])
- events = Chef::EventDispatch::Dispatcher.new
- run_context = Chef::RunContext.new(node, cookbook_collection, events)
- @resource = Chef::Resource::Service.new("chef", run_context)
- @resource.provider.should == Chef::Provider::Service::Systemd
+ expect(@resource.provider).to eq(nil)
end
it "should set the service_name to the first argument to new" do
- @resource.service_name.should eql("chef")
+ expect(@resource.service_name).to eql("chef")
end
it "should set the pattern to be the service name by default" do
- @resource.pattern.should eql("chef")
+ expect(@resource.pattern).to eql("chef")
end
it "should accept a string for the service name" do
@resource.service_name "something"
- @resource.service_name.should eql("something")
+ expect(@resource.service_name).to eql("something")
end
it "should accept a string for the service pattern" do
@resource.pattern ".*"
- @resource.pattern.should eql(".*")
+ expect(@resource.pattern).to eql(".*")
end
it "should not accept a regexp for the service pattern" do
- lambda {
+ expect {
@resource.pattern /.*/
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should accept a string for the service start command" do
@resource.start_command "/etc/init.d/chef start"
- @resource.start_command.should eql("/etc/init.d/chef start")
+ expect(@resource.start_command).to eql("/etc/init.d/chef start")
end
it "should not accept a regexp for the service start command" do
- lambda {
+ expect {
@resource.start_command /.*/
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should accept a string for the service stop command" do
@resource.stop_command "/etc/init.d/chef stop"
- @resource.stop_command.should eql("/etc/init.d/chef stop")
+ expect(@resource.stop_command).to eql("/etc/init.d/chef stop")
end
it "should not accept a regexp for the service stop command" do
- lambda {
+ expect {
@resource.stop_command /.*/
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should accept a string for the service status command" do
@resource.status_command "/etc/init.d/chef status"
- @resource.status_command.should eql("/etc/init.d/chef status")
+ expect(@resource.status_command).to eql("/etc/init.d/chef status")
end
it "should not accept a regexp for the service status command" do
- lambda {
+ expect {
@resource.status_command /.*/
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should accept a string for the service restart command" do
@resource.restart_command "/etc/init.d/chef restart"
- @resource.restart_command.should eql("/etc/init.d/chef restart")
+ expect(@resource.restart_command).to eql("/etc/init.d/chef restart")
end
it "should not accept a regexp for the service restart command" do
- lambda {
+ expect {
@resource.restart_command /.*/
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should accept a string for the service reload command" do
@resource.reload_command "/etc/init.d/chef reload"
- @resource.reload_command.should eql("/etc/init.d/chef reload")
+ expect(@resource.reload_command).to eql("/etc/init.d/chef reload")
end
it "should not accept a regexp for the service reload command" do
- lambda {
+ expect {
@resource.reload_command /.*/
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should accept a string for the service init command" do
@resource.init_command "/etc/init.d/chef"
- @resource.init_command.should eql("/etc/init.d/chef")
+ expect(@resource.init_command).to eql("/etc/init.d/chef")
end
it "should not accept a regexp for the service init command" do
- lambda {
+ expect {
@resource.init_command /.*/
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
%w{enabled running}.each do |attrib|
it "should accept true for #{attrib}" do
@resource.send(attrib, true)
- @resource.send(attrib).should eql(true)
+ expect(@resource.send(attrib)).to eql(true)
end
it "should accept false for #{attrib}" do
@resource.send(attrib, false)
- @resource.send(attrib).should eql(false)
+ expect(@resource.send(attrib)).to eql(false)
end
it "should not accept a string for #{attrib}" do
- lambda { @resource.send(attrib, "poop") }.should raise_error(ArgumentError)
+ expect { @resource.send(attrib, "poop") }.to raise_error(ArgumentError)
end
it "should default all the feature support to false" do
support_hash = { :status => false, :restart => false, :reload=> false }
- @resource.supports.should == support_hash
+ expect(@resource.supports).to eq(support_hash)
end
it "should allow you to set what features this resource supports as a array" do
support_array = [ :status, :restart ]
support_hash = { :status => true, :restart => true, :reload => false }
@resource.supports(support_array)
- @resource.supports.should == support_hash
+ expect(@resource.supports).to eq(support_hash)
end
it "should allow you to set what features this resource supports as a hash" do
support_hash = { :status => true, :restart => true, :reload => false }
@resource.supports(support_hash)
- @resource.supports.should == support_hash
+ expect(@resource.supports).to eq(support_hash)
end
end
@@ -177,12 +167,12 @@ describe Chef::Resource::Service do
it "describes its state" do
state = @resource.state
- state[:enabled].should eql(true)
- state[:running].should eql(false)
+ expect(state[:enabled]).to eql(true)
+ expect(state[:running]).to eql(false)
end
it "returns the service name as its identity" do
- @resource.identity.should == "superfriend"
+ expect(@resource.identity).to eq("superfriend")
end
end
diff --git a/spec/unit/resource/smartos_package_spec.rb b/spec/unit/resource/smartos_package_spec.rb
index 391713c8ff..c2cf546dd5 100644
--- a/spec/unit/resource/smartos_package_spec.rb
+++ b/spec/unit/resource/smartos_package_spec.rb
@@ -16,23 +16,18 @@
# limitations under the License.
#
-require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
+require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::SmartosPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::SmartosPackage.new("foo")
- end
+ static_provider_resolution(
+ resource: Chef::Resource::SmartosPackage,
+ provider: Chef::Provider::Package::SmartOS,
+ name: :smartos_package,
+ action: :install,
+ os: "solaris2",
+ platform_family: "smartos",
+ )
- it "should return a Chef::Resource::SmartosPackage" do
- @resource.should be_a_kind_of(Chef::Resource::SmartosPackage)
- end
-
- it "should set the resource_name to :smartos_package" do
- @resource.resource_name.should eql(:smartos_package)
- end
-
- it "should set the provider to Chef::Provider::Package::SmartOS" do
- @resource.provider.should eql(Chef::Provider::Package::SmartOS)
- end
end
diff --git a/spec/unit/resource/solaris_package_spec.rb b/spec/unit/resource/solaris_package_spec.rb
index 6d0260ab5a..f5d3e669a1 100644
--- a/spec/unit/resource/solaris_package_spec.rb
+++ b/spec/unit/resource/solaris_package_spec.rb
@@ -17,41 +17,26 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::SolarisPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::SolarisPackage.new("foo")
- end
-
- it "should return a Chef::Resource::SolarisPackage object" do
- @resource.should be_a_kind_of(Chef::Resource::SolarisPackage)
+ %w{solaris2 nexentacore}.each do |platform_family|
+ static_provider_resolution(
+ resource: Chef::Resource::SolarisPackage,
+ provider: Chef::Provider::Package::Solaris,
+ name: :solaris_package,
+ action: :install,
+ os: "solaris2",
+ platform_family: platform_family,
+ )
end
- it "should not raise any Error when valid number of arguments are provided" do
- expect { Chef::Resource::SolarisPackage.new("foo") }.to_not raise_error
- end
-
- it "should raise ArgumentError when incorrect number of arguments are provided" do
- expect { Chef::Resource::SolarisPackage.new }.to raise_error(ArgumentError)
+ before(:each) do
+ @resource = Chef::Resource::SolarisPackage.new("foo")
end
it "should set the package_name to the name provided" do
- @resource.package_name.should eql("foo")
- end
-
- it "should set the resource_name to :solaris_package" do
- @resource.resource_name.should eql(:solaris_package)
- end
-
- it "should set the run_context to the run_context provided" do
- @run_context = double()
- @run_context.stub(:node)
- resource = Chef::Resource::SolarisPackage.new("foo", @run_context)
- resource.run_context.should eql(@run_context)
- end
-
- it "should set the provider to Chef::Provider::Package::Solaris" do
- @resource.provider.should eql(Chef::Provider::Package::Solaris)
+ expect(@resource.package_name).to eql("foo")
end
end
diff --git a/spec/unit/resource/subversion_spec.rb b/spec/unit/resource/subversion_spec.rb
index ae06ce665a..5cd5d0de80 100644
--- a/spec/unit/resource/subversion_spec.rb
+++ b/spec/unit/resource/subversion_spec.rb
@@ -17,47 +17,51 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::Subversion do
+ static_provider_resolution(
+ resource: Chef::Resource::Subversion,
+ provider: Chef::Provider::Subversion,
+ name: :subversion,
+ action: :install,
+ )
+
before do
@svn = Chef::Resource::Subversion.new("ohai, svn project!")
end
it "is a subclass of Resource::Scm" do
- @svn.should be_an_instance_of(Chef::Resource::Subversion)
- @svn.should be_a_kind_of(Chef::Resource::Scm)
- end
-
- it "uses the subversion provider" do
- @svn.provider.should eql(Chef::Provider::Subversion)
+ expect(@svn).to be_an_instance_of(Chef::Resource::Subversion)
+ expect(@svn).to be_a_kind_of(Chef::Resource::Scm)
end
it "allows the force_export action" do
- @svn.allowed_actions.should include(:force_export)
+ expect(@svn.allowed_actions).to include(:force_export)
end
it "sets svn info arguments to --no-auth-cache by default" do
- @svn.svn_info_args.should == '--no-auth-cache'
+ expect(@svn.svn_info_args).to eq('--no-auth-cache')
end
it "resets svn info arguments to nil when given false in the setter" do
@svn.svn_info_args(false)
- @svn.svn_info_args.should be_nil
+ expect(@svn.svn_info_args).to be_nil
end
it "sets svn arguments to --no-auth-cache by default" do
- @svn.svn_arguments.should == '--no-auth-cache'
+ expect(@svn.svn_arguments).to eq('--no-auth-cache')
end
it "resets svn arguments to nil when given false in the setter" do
@svn.svn_arguments(false)
- @svn.svn_arguments.should be_nil
+ expect(@svn.svn_arguments).to be_nil
end
it "hides password from custom exception message" do
@svn.svn_password "l33th4x0rpa$$w0rd"
e = @svn.customize_exception(Chef::Exceptions::Exec.new "Exception with password #{@svn.svn_password}")
- e.message.include?(@svn.svn_password).should be_false
+ expect(e.message.include?(@svn.svn_password)).to be_falsey
end
end
diff --git a/spec/unit/resource/template_spec.rb b/spec/unit/resource/template_spec.rb
index c9dfdc7014..df5ca94b8a 100644
--- a/spec/unit/resource/template_spec.rb
+++ b/spec/unit/resource/template_spec.rb
@@ -26,54 +26,54 @@ describe Chef::Resource::Template do
describe "initialize" do
it "should create a new Chef::Resource::Template" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::File)
- @resource.should be_a_kind_of(Chef::Resource::Template)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::File)
+ expect(@resource).to be_a_kind_of(Chef::Resource::Template)
end
end
describe "source" do
it "should accept a string for the template source" do
@resource.source "something"
- @resource.source.should eql("something")
+ expect(@resource.source).to eql("something")
end
it "should have a default based on the param name with .erb appended" do
- @resource.source.should eql("fakey_fakerton.erb")
+ expect(@resource.source).to eql("fakey_fakerton.erb")
end
it "should use only the basename of the file as the default" do
r = Chef::Resource::Template.new("/tmp/obit/fakey_fakerton")
- r.source.should eql("fakey_fakerton.erb")
+ expect(r.source).to eql("fakey_fakerton.erb")
end
end
describe "variables" do
it "should accept a hash for the variable list" do
@resource.variables({ :reluctance => :awkward })
- @resource.variables.should == { :reluctance => :awkward }
+ expect(@resource.variables).to eq({ :reluctance => :awkward })
end
end
describe "cookbook" do
it "should accept a string for the cookbook name" do
@resource.cookbook("foo")
- @resource.cookbook.should == "foo"
+ expect(@resource.cookbook).to eq("foo")
end
it "should default to nil" do
- @resource.cookbook.should == nil
+ expect(@resource.cookbook).to eq(nil)
end
end
describe "local" do
it "should accept a boolean for whether a template is local or remote" do
@resource.local(true)
- @resource.local.should == true
+ expect(@resource.local).to eq(true)
end
it "should default to false" do
- @resource.local.should == false
+ expect(@resource.local).to eq(false)
end
end
@@ -89,10 +89,10 @@ describe Chef::Resource::Template do
context "on unix", :unix_only do
it "describes its state" do
state = @resource.state
- state[:owner].should == "root"
- state[:group].should == "wheel"
- state[:mode].should == "0644"
- state[:checksum].should == "1" * 64
+ expect(state[:owner]).to eq("root")
+ expect(state[:group]).to eq("wheel")
+ expect(state[:mode]).to eq("0644")
+ expect(state[:checksum]).to eq("1" * 64)
end
end
@@ -102,7 +102,7 @@ describe Chef::Resource::Template do
end
it "returns the file path as its identity" do
- @resource.identity.should == "/tmp/foo.txt"
+ expect(@resource.identity).to eq("/tmp/foo.txt")
end
end
@@ -117,19 +117,19 @@ describe Chef::Resource::Template do
it "collects helper method bodies as blocks" do
@resource.helper(:example_1) { "example_1" }
@resource.helper(:example_2) { "example_2" }
- @resource.inline_helper_blocks[:example_1].call.should == "example_1"
- @resource.inline_helper_blocks[:example_2].call.should == "example_2"
+ expect(@resource.inline_helper_blocks[:example_1].call).to eq("example_1")
+ expect(@resource.inline_helper_blocks[:example_2].call).to eq("example_2")
end
it "compiles helper methods into a module" do
@resource.helper(:example_1) { "example_1" }
@resource.helper(:example_2) { "example_2" }
modules = @resource.helper_modules
- modules.should have(1).module
+ expect(modules.size).to eq(1)
o = Object.new
modules.each {|m| o.extend(m)}
- o.example_1.should == "example_1"
- o.example_2.should == "example_2"
+ expect(o.example_1).to eq("example_1")
+ expect(o.example_2).to eq("example_2")
end
it "compiles helper methods with arguments into a module" do
@@ -137,15 +137,15 @@ describe Chef::Resource::Template do
modules = @resource.helper_modules
o = Object.new
modules.each {|m| o.extend(m)}
- o.shout("shout").should == "SHOUT"
+ expect(o.shout("shout")).to eq("SHOUT")
end
it "raises an error when attempting to define a helper method without a method body" do
- lambda { @resource.helper(:example) }.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { @resource.helper(:example) }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "raises an error when attempting to define a helper method with a non-Symbod method name" do
- lambda { @resource.helper("example") { "fail" } }.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { @resource.helper("example") { "fail" } }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "collects helper module bodies as blocks" do
@@ -155,7 +155,7 @@ describe Chef::Resource::Template do
end
end
module_body = @resource.inline_helper_modules.first
- module_body.should be_a(Proc)
+ expect(module_body).to be_a(Proc)
end
it "compiles helper module bodies into modules" do
@@ -165,27 +165,27 @@ describe Chef::Resource::Template do
end
end
modules = @resource.helper_modules
- modules.should have(1).module
+ expect(modules.size).to eq(1)
o = Object.new
modules.each {|m| o.extend(m)}
- o.example_1.should == "example_1"
+ expect(o.example_1).to eq("example_1")
end
it "raises an error when no block or module name is given for helpers definition" do
- lambda { @resource.helpers() }.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { @resource.helpers() }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "raises an error when a non-module is given for helpers definition" do
- lambda { @resource.helpers("NotAModule") }.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { @resource.helpers("NotAModule") }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "raises an error when a module name and block are both given for helpers definition" do
- lambda { @resource.helpers(ExampleHelpers) { module_code } }.should raise_error(Chef::Exceptions::ValidationFailed)
+ expect { @resource.helpers(ExampleHelpers) { module_code } }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "collects helper modules" do
@resource.helpers(ExampleHelpers)
- @resource.helper_modules.should include(ExampleHelpers)
+ expect(@resource.helper_modules).to include(ExampleHelpers)
end
it "combines all helpers into a set of compiled modules" do
@@ -196,13 +196,13 @@ describe Chef::Resource::Template do
end
end
@resource.helper(:inline_method) { "inline_method" }
- @resource.should have(3).helper_modules
+ expect(@resource.helper_modules.size).to eq(3)
o = Object.new
@resource.helper_modules.each {|m| o.extend(m)}
- o.static_example.should == "static_example"
- o.inline_module.should == "inline_module"
- o.inline_method.should == "inline_method"
+ expect(o.static_example).to eq("static_example")
+ expect(o.inline_module).to eq("inline_module")
+ expect(o.inline_method).to eq("inline_method")
end
diff --git a/spec/unit/resource/timestamped_deploy_spec.rb b/spec/unit/resource/timestamped_deploy_spec.rb
index f380ffca87..eca6c570d4 100644
--- a/spec/unit/resource/timestamped_deploy_spec.rb
+++ b/spec/unit/resource/timestamped_deploy_spec.rb
@@ -18,11 +18,16 @@
require 'spec_helper'
-describe Chef::Resource::TimestampedDeploy do
+describe Chef::Resource::TimestampedDeploy, "initialize" do
- it "defaults to the TimestampedDeploy provider" do
- @resource = Chef::Resource::TimestampedDeploy.new("stuff")
- @resource.provider.should == Chef::Provider::Deploy::Timestamped
- end
+ static_provider_resolution(
+ resource: Chef::Resource::TimestampedDeploy,
+ provider: Chef::Provider::Deploy::Timestamped,
+ name: :deploy,
+ action: :deploy,
+ os: 'linux',
+ platform_family: 'rhel',
+ )
end
+
diff --git a/spec/unit/resource/user_spec.rb b/spec/unit/resource/user_spec.rb
index 70b866202b..f05de94fe0 100644
--- a/spec/unit/resource/user_spec.rb
+++ b/spec/unit/resource/user_spec.rb
@@ -24,51 +24,51 @@ describe Chef::Resource::User, "initialize" do
end
it "should create a new Chef::Resource::User" do
- @resource.should be_a_kind_of(Chef::Resource)
- @resource.should be_a_kind_of(Chef::Resource::User)
+ expect(@resource).to be_a_kind_of(Chef::Resource)
+ expect(@resource).to be_a_kind_of(Chef::Resource::User)
end
it "should set the resource_name to :user" do
- @resource.resource_name.should eql(:user)
+ expect(@resource.resource_name).to eql(:user)
end
it "should set the username equal to the argument to initialize" do
- @resource.username.should eql("adam")
+ expect(@resource.username).to eql("adam")
end
%w{comment uid gid home shell password}.each do |attrib|
it "should set #{attrib} to nil" do
- @resource.send(attrib).should eql(nil)
+ expect(@resource.send(attrib)).to eql(nil)
end
end
it "should set action to :create" do
- @resource.action.should eql(:create)
+ expect(@resource.action).to eql(:create)
end
it "should set supports[:manage_home] to false" do
- @resource.supports[:manage_home].should eql(false)
+ expect(@resource.supports[:manage_home]).to eql(false)
end
it "should set supports[:non_unique] to false" do
- @resource.supports[:non_unique].should eql(false)
+ expect(@resource.supports[:non_unique]).to eql(false)
end
it "should set force to false" do
- @resource.force.should eql(false)
+ expect(@resource.force).to eql(false)
end
%w{create remove modify manage lock unlock}.each do |action|
it "should allow action #{action}" do
- @resource.allowed_actions.detect { |a| a == action.to_sym }.should eql(action.to_sym)
+ expect(@resource.allowed_actions.detect { |a| a == action.to_sym }).to eql(action.to_sym)
end
end
it "should accept domain users (@ or \ separator) on non-windows" do
- lambda { @resource.username "domain\@user" }.should_not raise_error
- @resource.username.should == "domain\@user"
- lambda { @resource.username "domain\\user" }.should_not raise_error
- @resource.username.should == "domain\\user"
+ expect { @resource.username "domain\@user" }.not_to raise_error
+ expect(@resource.username).to eq("domain\@user")
+ expect { @resource.username "domain\\user" }.not_to raise_error
+ expect(@resource.username).to eq("domain\\user")
end
end
@@ -80,11 +80,11 @@ end
it "should allow a string" do
@resource.send(attrib, "adam")
- @resource.send(attrib).should eql("adam")
+ expect(@resource.send(attrib)).to eql("adam")
end
it "should not allow a hash" do
- lambda { @resource.send(attrib, { :woot => "i found it" }) }.should raise_error(ArgumentError)
+ expect { @resource.send(attrib, { :woot => "i found it" }) }.to raise_error(ArgumentError)
end
end
end
@@ -97,16 +97,16 @@ end
it "should allow a string" do
@resource.send(attrib, "100")
- @resource.send(attrib).should eql("100")
+ expect(@resource.send(attrib)).to eql("100")
end
it "should allow an integer" do
@resource.send(attrib, 100)
- @resource.send(attrib).should eql(100)
+ expect(@resource.send(attrib)).to eql(100)
end
it "should not allow a hash" do
- lambda { @resource.send(attrib, { :woot => "i found it" }) }.should raise_error(ArgumentError)
+ expect { @resource.send(attrib, { :woot => "i found it" }) }.to raise_error(ArgumentError)
end
end
@@ -120,13 +120,13 @@ end
it "describes its state" do
state = @resource.state
- state[:uid].should == 123
- state[:gid].should == 456
- state[:home].should == "/usr/local/root/"
+ expect(state[:uid]).to eq(123)
+ expect(state[:gid]).to eq(456)
+ expect(state[:home]).to eq("/usr/local/root/")
end
it "returns the username as its identity" do
- @resource.identity.should == "root"
+ expect(@resource.identity).to eq("root")
end
end
diff --git a/spec/unit/resource/windows_package_spec.rb b/spec/unit/resource/windows_package_spec.rb
index c9ef8d910c..1e02f2449b 100644
--- a/spec/unit/resource/windows_package_spec.rb
+++ b/spec/unit/resource/windows_package_spec.rb
@@ -18,7 +18,18 @@
require 'spec_helper'
-describe Chef::Resource::WindowsPackage, "initialize", :windows_only do
+describe Chef::Resource::WindowsPackage, "initialize" do
+ before(:each) do
+ stub_const("File::ALT_SEPARATOR", "\\")
+ end
+
+ static_provider_resolution(
+ resource: Chef::Resource::WindowsPackage,
+ provider: Chef::Provider::Package::Windows,
+ os: "windows",
+ name: :windows_package,
+ action: :start
+ )
let(:resource) { Chef::Resource::WindowsPackage.new("solitaire.msi") }
@@ -30,13 +41,9 @@ describe Chef::Resource::WindowsPackage, "initialize", :windows_only do
expect(resource.resource_name).to eql(:windows_package)
end
- it "sets the provider to Chef::Provider::Package::Windows" do
- expect(resource.provider).to eql(Chef::Provider::Package::Windows)
- end
-
- it "supports setting installer_type" do
- resource.installer_type("msi")
- expect(resource.installer_type).to eql("msi")
+ it "supports setting installer_type as a symbol" do
+ resource.installer_type(:msi)
+ expect(resource.installer_type).to eql(:msi)
end
# String, Integer
@@ -56,13 +63,13 @@ describe Chef::Resource::WindowsPackage, "initialize", :windows_only do
end
it "coverts a source to an absolute path" do
- ::File.stub(:absolute_path).and_return("c:\\Files\\frost.msi")
+ allow(::File).to receive(:absolute_path).and_return("c:\\Files\\frost.msi")
resource.source("frost.msi")
expect(resource.source).to eql "c:\\Files\\frost.msi"
end
it "converts slashes to backslashes in the source path" do
- ::File.stub(:absolute_path).and_return("c:\\frost.msi")
+ allow(::File).to receive(:absolute_path).and_return("c:\\frost.msi")
resource.source("c:/frost.msi")
expect(resource.source).to eql "c:\\frost.msi"
end
diff --git a/spec/unit/resource/windows_service_spec.rb b/spec/unit/resource/windows_service_spec.rb
index c92c3be1b0..45a295c24e 100644
--- a/spec/unit/resource/windows_service_spec.rb
+++ b/spec/unit/resource/windows_service_spec.rb
@@ -18,7 +18,14 @@
require 'spec_helper'
-describe Chef::Resource::WindowsService, "initialize", :windows_only do
+describe Chef::Resource::WindowsService, "initialize" do
+ static_provider_resolution(
+ resource: Chef::Resource::WindowsService,
+ provider: Chef::Provider::Service::Windows,
+ os: "windows",
+ name: :windows_service,
+ action: :start
+ )
let(:resource) { Chef::Resource::WindowsService.new("BITS") }
@@ -30,10 +37,6 @@ describe Chef::Resource::WindowsService, "initialize", :windows_only do
expect(resource.resource_name).to eql(:windows_service)
end
- it "sets the provider to Chef::Provider::Service::Windows" do
- expect(resource.provider).to eql(Chef::Provider::Service::Windows)
- end
-
it "supports setting startup_type" do
resource.startup_type(:manual)
expect(resource.startup_type).to eql(:manual)
@@ -41,6 +44,6 @@ describe Chef::Resource::WindowsService, "initialize", :windows_only do
it "allows the action to be 'configure_startup'" do
resource.action :configure_startup
- resource.action.should == [:configure_startup]
+ expect(resource.action).to eq([:configure_startup])
end
end
diff --git a/spec/unit/resource/yum_package_spec.rb b/spec/unit/resource/yum_package_spec.rb
index 57ab4dfcd9..e01b87c580 100644
--- a/spec/unit/resource/yum_package_spec.rb
+++ b/spec/unit/resource/yum_package_spec.rb
@@ -17,24 +17,19 @@
#
require 'spec_helper'
+require 'support/shared/unit/resource/static_provider_resolution'
describe Chef::Resource::YumPackage, "initialize" do
- before(:each) do
- @resource = Chef::Resource::YumPackage.new("foo")
- end
-
- it "should return a Chef::Resource::YumPackage" do
- @resource.should be_a_kind_of(Chef::Resource::YumPackage)
- end
-
- it "should set the resource_name to :yum_package" do
- @resource.resource_name.should eql(:yum_package)
- end
+ static_provider_resolution(
+ resource: Chef::Resource::YumPackage,
+ provider: Chef::Provider::Package::Yum,
+ name: :yum_package,
+ action: :install,
+ os: 'linux',
+ platform_family: 'rhel',
+ )
- it "should set the provider to Chef::Provider::Package::Yum" do
- @resource.provider.should eql(Chef::Provider::Package::Yum)
- end
end
describe Chef::Resource::YumPackage, "arch" do
@@ -44,7 +39,7 @@ describe Chef::Resource::YumPackage, "arch" do
it "should set the arch variable to whatever is passed in" do
@resource.arch("i386")
- @resource.arch.should eql("i386")
+ expect(@resource.arch).to eql("i386")
end
end
@@ -55,20 +50,20 @@ describe Chef::Resource::YumPackage, "flush_cache" do
it "should default the flush timing to false" do
flush_hash = { :before => false, :after => false }
- @resource.flush_cache.should == flush_hash
+ expect(@resource.flush_cache).to eq(flush_hash)
end
it "should allow you to set the flush timing with an array" do
flush_array = [ :before, :after ]
flush_hash = { :before => true, :after => true }
@resource.flush_cache(flush_array)
- @resource.flush_cache.should == flush_hash
+ expect(@resource.flush_cache).to eq(flush_hash)
end
it "should allow you to set the flush timing with a hash" do
flush_hash = { :before => true, :after => true }
@resource.flush_cache(flush_hash)
- @resource.flush_cache.should == flush_hash
+ expect(@resource.flush_cache).to eq(flush_hash)
end
end
@@ -78,8 +73,8 @@ describe Chef::Resource::YumPackage, "allow_downgrade" do
end
it "should allow you to specify whether allow_downgrade is true or false" do
- lambda { @resource.allow_downgrade true }.should_not raise_error
- lambda { @resource.allow_downgrade false }.should_not raise_error
- lambda { @resource.allow_downgrade "monkey" }.should raise_error(ArgumentError)
+ expect { @resource.allow_downgrade true }.not_to raise_error
+ expect { @resource.allow_downgrade false }.not_to raise_error
+ expect { @resource.allow_downgrade "monkey" }.to raise_error(ArgumentError)
end
end
diff --git a/spec/unit/resource_collection/resource_list_spec.rb b/spec/unit/resource_collection/resource_list_spec.rb
new file mode 100644
index 0000000000..1e6c477854
--- /dev/null
+++ b/spec/unit/resource_collection/resource_list_spec.rb
@@ -0,0 +1,137 @@
+#
+# Author:: Serdar Sutay (<serdar@getchef.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+
+describe Chef::ResourceCollection::ResourceList do
+ let(:resource_list) { Chef::ResourceCollection::ResourceList.new() }
+ let(:resource) { Chef::Resource::ZenMaster.new("makoto") }
+ let(:second_resource) { Chef::Resource::ZenMaster.new("hattori") }
+
+ def insert_resource(res)
+ expect{ resource_list.insert(res) }.not_to raise_error
+ end
+
+ describe "initialize" do
+ it "should return a Chef::ResourceList" do
+ expect(resource_list).to be_instance_of(Chef::ResourceCollection::ResourceList)
+ end
+ end
+
+ describe "insert" do
+ it "should be able to insert a Chef::Resource" do
+ insert_resource(resource)
+ expect(resource_list[0]).to be(resource)
+ end
+
+ it "should insert things in order" do
+ insert_resource(resource)
+ insert_resource(second_resource)
+ expect(resource_list[0]).to be(resource)
+ expect(resource_list[1]).to be(second_resource)
+ end
+
+ it "should raise error when trying to install something other than Chef::Resource" do
+ expect{ resource_list.insert("not a resource") }.to raise_error(ArgumentError)
+ end
+ end
+
+ describe "accessors" do
+ it "should be able to insert with []=" do
+ expect{ resource_list[0] = resource }.not_to raise_error
+ expect{ resource_list[1] = second_resource }.not_to raise_error
+ expect(resource_list[0]).to be(resource)
+ expect(resource_list[1]).to be(second_resource)
+ end
+
+ it "should be empty by default" do
+ expect(resource_list.empty?).to be_truthy
+ end
+
+ describe "when resources are inserted" do
+ before do
+ insert_resource(resource)
+ insert_resource(second_resource)
+ end
+
+ it "should get resources with all_resources method" do
+ resources = resource_list.all_resources
+
+ expect(resources[0]).to be(resource)
+ expect(resources[1]).to be(second_resource)
+ end
+
+ it "should be able to get resources with each" do
+ current = 0
+ expected_resources = [resource, second_resource]
+
+ resource_list.each do |r|
+ expect(r).to be(expected_resources[current])
+ current += 1
+ end
+
+ expect(current).to eq(2)
+ end
+
+ it "should be able to get resources with each_index" do
+ current = 0
+
+ resource_list.each_index do |i|
+ expect(i).to eq(current)
+ current += 1
+ end
+
+ expect(current).to eq(2)
+ end
+
+ it "should be able to check if the list is empty" do
+ expect(resource_list.empty?).to be_falsey
+ end
+ end
+ end
+
+ describe "during execute" do
+ before(:each) do
+ insert_resource(resource)
+ insert_resource(second_resource)
+ end
+
+ it "should execute resources in order" do
+ current = 0
+ expected_resources = [resource, second_resource]
+
+ resource_list.execute_each_resource do |r|
+ expect(r).to be(expected_resources[current])
+ current += 1
+ end
+
+ expect(current).to eq(2)
+ end
+
+ it "should be able to insert resources on the fly" do
+ resource_to_inject = Chef::Resource::ZenMaster.new("there is no spoon")
+ expected_resources = [resource, resource_to_inject, second_resource]
+
+ resource_list.execute_each_resource do |r|
+ resource_list.insert(resource_to_inject) if r == resource
+ end
+
+ expect(resource_list.all_resources).to eq(expected_resources)
+ end
+ end
+end
diff --git a/spec/unit/resource_collection/resource_set_spec.rb b/spec/unit/resource_collection/resource_set_spec.rb
new file mode 100644
index 0000000000..0e25934216
--- /dev/null
+++ b/spec/unit/resource_collection/resource_set_spec.rb
@@ -0,0 +1,199 @@
+#
+# Author:: Tyler Ball (<tball@getchef.com>)
+# Copyright:: Copyright (c) 2014 Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'spec_helper'
+
+describe Chef::ResourceCollection::ResourceSet do
+ let(:collection) { Chef::ResourceCollection::ResourceSet.new }
+
+ let(:zen_master_name) { "Neo" }
+ let(:zen_master2_name) { "Morpheus" }
+ let(:zen_follower_name) { "Squid" }
+ let(:zen_master) { Chef::Resource::ZenMaster.new(zen_master_name) }
+ let(:zen_master2) { Chef::Resource::ZenMaster.new(zen_master2_name) }
+ let(:zen_follower) { Chef::Resource::ZenFollower.new(zen_follower_name) }
+
+ describe "initialize" do
+ it "should return a Chef::ResourceSet" do
+ expect(collection).to be_instance_of(Chef::ResourceCollection::ResourceSet)
+ end
+ end
+
+ describe "keys" do
+ it "should return an empty list for an empty ResourceSet" do
+ expect(collection.keys).to eq([])
+ end
+
+ it "should return the keys for a non-empty ResourceSet" do
+ collection.instance_variable_get(:@resources_by_key)["key"] = nil
+ expect(collection.keys).to eq(["key"])
+ end
+ end
+
+ describe "insert_as, lookup and find" do
+ # To validate insert_as you need lookup, and vice-versa - putting all tests in 1 context to avoid duplication
+ it "should accept only Chef::Resources" do
+ expect { collection.insert_as(zen_master) }.to_not raise_error
+ expect { collection.insert_as("string") }.to raise_error(ArgumentError)
+ end
+
+ it "should allow you to lookup resources by a default .to_s" do
+ collection.insert_as(zen_master)
+ expect(collection.lookup(zen_master.to_s)).to equal(zen_master)
+ end
+
+ it "should use a custom type and name to insert" do
+ collection.insert_as(zen_master, "OtherResource", "other_resource")
+ expect(collection.lookup("OtherResource[other_resource]")).to equal(zen_master)
+ end
+
+ it "should raise an exception if you send something strange to lookup" do
+ expect { collection.lookup(:symbol) }.to raise_error(ArgumentError)
+ end
+
+ it "should raise an exception if it cannot find a resource with lookup" do
+ expect { collection.lookup(zen_master.to_s) }.to raise_error(Chef::Exceptions::ResourceNotFound)
+ end
+
+ it "should find a resource by type symbol and name" do
+ collection.insert_as(zen_master)
+ expect(collection.find(:zen_master => zen_master_name)).to equal(zen_master)
+ end
+
+ it "should find a resource by type symbol and array of names" do
+ collection.insert_as(zen_master)
+ collection.insert_as(zen_master2)
+ check_by_names(collection.find(:zen_master => [zen_master_name,zen_master2_name]), zen_master_name, zen_master2_name)
+ end
+
+ it "should find a resource by type symbol and array of names with custom names" do
+ collection.insert_as(zen_master, :zzz, "name1")
+ collection.insert_as(zen_master2, :zzz, "name2")
+ check_by_names(collection.find( :zzz => ["name1","name2"]), zen_master_name, zen_master2_name)
+ end
+
+ it "should find resources of multiple kinds (:zen_master => a, :zen_follower => b)" do
+ collection.insert_as(zen_master)
+ collection.insert_as(zen_follower)
+ check_by_names(collection.find(:zen_master => [zen_master_name], :zen_follower => [zen_follower_name]),
+ zen_master_name, zen_follower_name)
+ end
+
+ it "should find resources of multiple kinds (:zen_master => a, :zen_follower => b with custom names)" do
+ collection.insert_as(zen_master, :zzz, "name1")
+ collection.insert_as(zen_master2, :zzz, "name2")
+ collection.insert_as(zen_follower, :yyy, "name3")
+ check_by_names(collection.find(:zzz => ["name1","name2"], :yyy => ["name3"]),
+ zen_master_name, zen_follower_name, zen_master2_name)
+ end
+
+ it "should find a resource by string zen_master[a]" do
+ collection.insert_as(zen_master)
+ expect(collection.find("zen_master[#{zen_master_name}]")).to eq(zen_master)
+ end
+
+ it "should find a resource by string zen_master[a] with custom names" do
+ collection.insert_as(zen_master, :zzz, "name1")
+ expect(collection.find("zzz[name1]")).to eq(zen_master)
+ end
+
+ it "should find resources by strings of zen_master[a,b]" do
+ collection.insert_as(zen_master)
+ collection.insert_as(zen_master2)
+ check_by_names(collection.find("zen_master[#{zen_master_name},#{zen_master2_name}]"),
+ zen_master_name, zen_master2_name)
+ end
+
+ it "should find resources by strings of zen_master[a,b] with custom names" do
+ collection.insert_as(zen_master, :zzz, "name1")
+ collection.insert_as(zen_master2, :zzz, "name2")
+ check_by_names(collection.find("zzz[name1,name2]"),
+ zen_master_name, zen_master2_name)
+ end
+
+ it "should find resources of multiple types by strings of zen_master[a]" do
+ collection.insert_as(zen_master)
+ collection.insert_as(zen_follower)
+ check_by_names(collection.find("zen_master[#{zen_master_name}]", "zen_follower[#{zen_follower_name}]"),
+ zen_master_name, zen_follower_name)
+ end
+
+ it "should find resources of multiple types by strings of zen_master[a] with custom names" do
+ collection.insert_as(zen_master, :zzz, "name1")
+ collection.insert_as(zen_master2, :zzz, "name2")
+ collection.insert_as(zen_follower, :yyy, "name3")
+ check_by_names(collection.find("zzz[name1,name2]", "yyy[name3]"),
+ zen_master_name, zen_follower_name,zen_master2_name)
+ end
+
+ it "should only keep the last copy when multiple instances of a Resource are inserted" do
+ collection.insert_as(zen_master)
+ expect(collection.find("zen_master[#{zen_master_name}]")).to eq(zen_master)
+ new_zm =zen_master.dup
+ new_zm.retries = 10
+ expect(new_zm).to_not eq(zen_master)
+ collection.insert_as(new_zm)
+ expect(collection.find("zen_master[#{zen_master_name}]")).to eq(new_zm)
+ end
+
+ it "should raise an exception if you pass a bad name to resources" do
+ expect { collection.find("michael jackson") }.to raise_error(ArgumentError)
+ end
+
+ it "should raise an exception if you pass something other than a string or hash to resource" do
+ expect { collection.find([Array.new]) }.to raise_error(ArgumentError)
+ end
+
+ it "raises an error when attempting to find a resource that does not exist" do
+ expect { collection.find("script[nonesuch]") }.to raise_error(Chef::Exceptions::ResourceNotFound)
+ end
+ end
+
+ describe "validate_lookup_spec!" do
+ it "accepts a string of the form 'resource_type[resource_name]'" do
+ expect(collection.validate_lookup_spec!("resource_type[resource_name]")).to be_truthy
+ end
+
+ it "accepts a single-element :resource_type => 'resource_name' Hash" do
+ expect(collection.validate_lookup_spec!(:service => "apache2")).to be_truthy
+ end
+
+ it "accepts a chef resource object" do
+ expect(collection.validate_lookup_spec!(zen_master)).to be_truthy
+ end
+
+ it "rejects a malformed query string" do
+ expect { collection.validate_lookup_spec!("resource_type[missing-end-bracket") }.to \
+ raise_error(Chef::Exceptions::InvalidResourceSpecification)
+ end
+
+ it "rejects an argument that is not a String, Hash, or Chef::Resource" do
+ expect { collection.validate_lookup_spec!(Object.new) }.to \
+ raise_error(Chef::Exceptions::InvalidResourceSpecification)
+ end
+
+ end
+
+ def check_by_names(results, *names)
+ expect(results.size).to eq(names.size)
+ names.each do |name|
+ expect(results.detect{|r| r.name == name}).to_not eq(nil)
+ end
+ end
+
+end
diff --git a/spec/unit/resource_collection/stepable_iterator_spec.rb b/spec/unit/resource_collection/stepable_iterator_spec.rb
index b649f8be6e..b34b7140fe 100644
--- a/spec/unit/resource_collection/stepable_iterator_spec.rb
+++ b/spec/unit/resource_collection/stepable_iterator_spec.rb
@@ -21,7 +21,7 @@ describe Chef::ResourceCollection::StepableIterator do
CRSI = Chef::ResourceCollection::StepableIterator
it "has an empty array for its collection by default" do
- CRSI.new.collection.should == []
+ expect(CRSI.new.collection).to eq([])
end
describe "doing basic iteration" do
@@ -31,8 +31,8 @@ describe Chef::ResourceCollection::StepableIterator do
end
it "re-initializes the instance with a collection" do
- @iterator.collection.should equal(@simple_collection)
- @iterator.size.should == 4
+ expect(@iterator.collection).to equal(@simple_collection)
+ expect(@iterator.size).to eq(4)
end
it "iterates over the collection" do
@@ -40,7 +40,7 @@ describe Chef::ResourceCollection::StepableIterator do
@iterator.each do |int|
sum += int
end
- sum.should == 10
+ expect(sum).to eq(10)
end
it "iterates over the collection with each_index" do
@@ -48,8 +48,8 @@ describe Chef::ResourceCollection::StepableIterator do
@iterator.each_index do |idx|
collected_by_index << @simple_collection[idx]
end
- collected_by_index.should == @simple_collection
- collected_by_index.should_not equal(@simple_collection)
+ expect(collected_by_index).to eq(@simple_collection)
+ expect(collected_by_index).not_to equal(@simple_collection)
end
it "iterates over the collection with index and element" do
@@ -57,7 +57,7 @@ describe Chef::ResourceCollection::StepableIterator do
@iterator.each_with_index do |element, index|
collected[index] = element
end
- collected.should == {0=>1, 1=>2, 2=>3, 3=>4}
+ expect(collected).to eq({0=>1, 1=>2, 2=>3, 3=>4})
end
end
@@ -76,49 +76,49 @@ describe Chef::ResourceCollection::StepableIterator do
end
it "allows the iteration to be paused" do
- @snitch_var.should == 23
+ expect(@snitch_var).to eq(23)
end
it "allows the iteration to be resumed" do
- @snitch_var.should == 23
+ expect(@snitch_var).to eq(23)
@iterator.resume
- @snitch_var.should == 42
+ expect(@snitch_var).to eq(42)
end
it "allows iteration to be rewound" do
@iterator.skip_back(2)
@iterator.resume
- @snitch_var.should == 23
+ expect(@snitch_var).to eq(23)
@iterator.resume
- @snitch_var.should == 42
+ expect(@snitch_var).to eq(42)
end
it "allows iteration to be fast forwarded" do
@iterator.skip_forward
@iterator.resume
- @snitch_var.should == 23
+ expect(@snitch_var).to eq(23)
end
it "allows iteration to be rewound" do
@snitch_var = nil
@iterator.rewind
- @iterator.position.should == 0
+ expect(@iterator.position).to eq(0)
@iterator.resume
- @snitch_var.should == 23
+ expect(@snitch_var).to eq(23)
end
it "allows iteration to be stepped" do
@snitch_var = nil
@iterator.rewind
@iterator.step
- @iterator.position.should == 1
- @snitch_var.should == 23
+ expect(@iterator.position).to eq(1)
+ expect(@snitch_var).to eq(23)
end
it "doesn't step if there are no more steps" do
- @iterator.step.should == 3
- lambda {@iterator.step}.should_not raise_error
- @iterator.step.should be_nil
+ expect(@iterator.step).to eq(3)
+ expect {@iterator.step}.not_to raise_error
+ expect(@iterator.step).to be_nil
end
it "allows the iteration to start by being stepped" do
@@ -126,17 +126,17 @@ describe Chef::ResourceCollection::StepableIterator do
@iterator = CRSI.for_collection(@collection)
@iterator.iterate_on(:element) { |proc| proc.call }
@iterator.step
- @iterator.position.should == 1
- @snitch_var.should == 23
+ expect(@iterator.position).to eq(1)
+ expect(@snitch_var).to eq(23)
end
it "should work correctly when elements are added to the collection during iteration" do
@collection.insert(2, lambda { @snitch_var = 815})
@collection.insert(3, lambda { @iterator.pause })
@iterator.resume
- @snitch_var.should == 815
+ expect(@snitch_var).to eq(815)
@iterator.resume
- @snitch_var.should == 42
+ expect(@snitch_var).to eq(42)
end
end
diff --git a/spec/unit/resource_collection_spec.rb b/spec/unit/resource_collection_spec.rb
index cf119f1ab0..b43b012dfc 100644
--- a/spec/unit/resource_collection_spec.rb
+++ b/spec/unit/resource_collection_spec.rb
@@ -20,104 +20,77 @@
require 'spec_helper'
describe Chef::ResourceCollection do
+ let(:rc) { Chef::ResourceCollection.new() }
+ let(:resource) { Chef::Resource::ZenMaster.new("makoto") }
- before(:each) do
- @rc = Chef::ResourceCollection.new()
- @resource = Chef::Resource::ZenMaster.new("makoto")
+ it "should throw an error when calling a non-delegated method" do
+ expect { rc.not_a_method }.to raise_error(NoMethodError)
end
describe "initialize" do
it "should return a Chef::ResourceCollection" do
- @rc.should be_kind_of(Chef::ResourceCollection)
+ expect(rc).to be_kind_of(Chef::ResourceCollection)
end
end
describe "[]" do
it "should accept Chef::Resources through [index]" do
- lambda { @rc[0] = @resource }.should_not raise_error
- lambda { @rc[0] = "string" }.should raise_error
+ expect { rc[0] = resource }.not_to raise_error
+ expect { rc[0] = "string" }.to raise_error(ArgumentError)
end
it "should allow you to fetch Chef::Resources by position" do
- @rc[0] = @resource
- @rc[0].should eql(@resource)
+ rc[0] = resource
+ expect(rc[0]).to eql(resource)
end
end
describe "push" do
it "should accept Chef::Resources through pushing" do
- lambda { @rc.push(@resource) }.should_not raise_error
- lambda { @rc.push("string") }.should raise_error
+ expect { rc.push(resource) }.not_to raise_error
+ expect { rc.push("string") }.to raise_error(ArgumentError)
end
end
describe "<<" do
it "should accept the << operator" do
- lambda { @rc << @resource }.should_not raise_error
+ expect { rc << resource }.not_to raise_error
end
end
describe "insert" do
it "should accept only Chef::Resources" do
- lambda { @rc.insert(@resource) }.should_not raise_error
- lambda { @rc.insert("string") }.should raise_error
+ expect { rc.insert(resource) }.not_to raise_error
+ expect { rc.insert("string") }.to raise_error(ArgumentError)
+ end
+
+ it "should accept named arguments in any order" do
+ rc.insert(resource, :instance_name => 'foo', :resource_type =>'bar')
+ expect(rc[0]).to eq(resource)
end
it "should append resources to the end of the collection when not executing a run" do
zmr = Chef::Resource::ZenMaster.new("there is no spoon")
- @rc.insert(@resource)
- @rc.insert(zmr)
- @rc[0].should eql(@resource)
- @rc[1].should eql(zmr)
+ rc.insert(resource)
+ rc.insert(zmr)
+ expect(rc[0]).to eql(resource)
+ expect(rc[1]).to eql(zmr)
end
it "should insert resources to the middle of the collection if called while executing a run" do
resource_to_inject = Chef::Resource::ZenMaster.new("there is no spoon")
zmr = Chef::Resource::ZenMaster.new("morpheus")
dummy = Chef::Resource::ZenMaster.new("keanu reeves")
- @rc.insert(zmr)
- @rc.insert(dummy)
+ rc.insert(zmr)
+ rc.insert(dummy)
- @rc.execute_each_resource do |resource|
- @rc.insert(resource_to_inject) if resource == zmr
+ rc.execute_each_resource do |resource|
+ rc.insert(resource_to_inject) if resource == zmr
end
- @rc[0].should eql(zmr)
- @rc[1].should eql(resource_to_inject)
- @rc[2].should eql(dummy)
- end
- end
-
- describe "insert_at" do
- it "should accept only Chef::Resources" do
- lambda { @rc.insert_at(0, @resource, @resource) }.should_not raise_error
- lambda { @rc.insert_at(0, "string") }.should raise_error
- lambda { @rc.insert_at(0, @resource, "string") }.should raise_error
- end
-
- it "should toss an error if it receives a bad index" do
- @rc.insert_at(10, @resource)
- end
-
- it "should insert resources at the beginning when asked" do
- @rc.insert(Chef::Resource::ZenMaster.new('1'))
- @rc.insert(Chef::Resource::ZenMaster.new('2'))
- @rc.insert_at(0, Chef::Resource::ZenMaster.new('X'))
- @rc.all_resources.map { |r| r.name }.should == [ 'X', '1', '2' ]
- end
-
- it "should insert resources in the middle when asked" do
- @rc.insert(Chef::Resource::ZenMaster.new('1'))
- @rc.insert(Chef::Resource::ZenMaster.new('2'))
- @rc.insert_at(1, Chef::Resource::ZenMaster.new('X'))
- @rc.all_resources.map { |r| r.name }.should == [ '1', 'X', '2' ]
- end
-
- it "should insert resources at the end when asked" do
- @rc.insert(Chef::Resource::ZenMaster.new('1'))
- @rc.insert(Chef::Resource::ZenMaster.new('2'))
- @rc.insert_at(2, Chef::Resource::ZenMaster.new('X'))
- @rc.all_resources.map { |r| r.name }.should == [ '1', '2', 'X' ]
+ expect(rc[0]).to eql(zmr)
+ expect(rc[1]).to eql(resource_to_inject)
+ expect(rc[2]).to eql(dummy)
end
end
@@ -125,19 +98,19 @@ describe Chef::ResourceCollection do
it "should allow you to iterate over every resource in the collection" do
load_up_resources
results = Array.new
- lambda {
- @rc.each do |r|
+ expect {
+ rc.each do |r|
results << r.name
end
- }.should_not raise_error
+ }.not_to raise_error
results.each_index do |i|
case i
when 0
- results[i].should eql("dog")
+ expect(results[i]).to eql("dog")
when 1
- results[i].should eql("cat")
+ expect(results[i]).to eql("cat")
when 2
- results[i].should eql("monkey")
+ expect(results[i]).to eql("monkey")
end
end
end
@@ -147,19 +120,19 @@ describe Chef::ResourceCollection do
it "should allow you to iterate over every resource by index" do
load_up_resources
results = Array.new
- lambda {
- @rc.each_index do |i|
- results << @rc[i].name
+ expect {
+ rc.each_index do |i|
+ results << rc[i].name
end
- }.should_not raise_error
+ }.not_to raise_error
results.each_index do |i|
case i
when 0
- results[i].should eql("dog")
+ expect(results[i]).to eql("dog")
when 1
- results[i].should eql("cat")
+ expect(results[i]).to eql("cat")
when 2
- results[i].should eql("monkey")
+ expect(results[i]).to eql("monkey")
end
end
end
@@ -168,24 +141,24 @@ describe Chef::ResourceCollection do
describe "lookup" do
it "should allow you to find resources by name via lookup" do
zmr = Chef::Resource::ZenMaster.new("dog")
- @rc << zmr
- @rc.lookup(zmr.to_s).should eql(zmr)
+ rc << zmr
+ expect(rc.lookup(zmr.to_s)).to eql(zmr)
zmr = Chef::Resource::ZenMaster.new("cat")
- @rc[0] = zmr
- @rc.lookup(zmr).should eql(zmr)
+ rc[0] = zmr
+ expect(rc.lookup(zmr)).to eql(zmr)
zmr = Chef::Resource::ZenMaster.new("monkey")
- @rc.push(zmr)
- @rc.lookup(zmr).should eql(zmr)
+ rc.push(zmr)
+ expect(rc.lookup(zmr)).to eql(zmr)
end
it "should raise an exception if you send something strange to lookup" do
- lambda { @rc.lookup(:symbol) }.should raise_error(ArgumentError)
+ expect { rc.lookup(:symbol) }.to raise_error(ArgumentError)
end
it "should raise an exception if it cannot find a resource with lookup" do
- lambda { @rc.lookup("zen_master[dog]") }.should raise_error(Chef::Exceptions::ResourceNotFound)
+ expect { rc.lookup("zen_master[dog]") }.to raise_error(Chef::Exceptions::ResourceNotFound)
end
end
@@ -193,135 +166,135 @@ describe Chef::ResourceCollection do
it "should find a resource by symbol and name (:zen_master => monkey)" do
load_up_resources
- @rc.resources(:zen_master => "monkey").name.should eql("monkey")
+ expect(rc.resources(:zen_master => "monkey").name).to eql("monkey")
end
it "should find a resource by symbol and array of names (:zen_master => [a,b])" do
load_up_resources
- results = @rc.resources(:zen_master => [ "monkey", "dog" ])
- results.length.should eql(2)
+ results = rc.resources(:zen_master => [ "monkey", "dog" ])
+ expect(results.length).to eql(2)
check_by_names(results, "monkey", "dog")
end
it "should find resources of multiple kinds (:zen_master => a, :file => b)" do
load_up_resources
- results = @rc.resources(:zen_master => "monkey", :file => "something")
- results.length.should eql(2)
+ results = rc.resources(:zen_master => "monkey", :file => "something")
+ expect(results.length).to eql(2)
check_by_names(results, "monkey", "something")
end
it "should find a resource by string zen_master[a]" do
load_up_resources
- @rc.resources("zen_master[monkey]").name.should eql("monkey")
+ expect(rc.resources("zen_master[monkey]").name).to eql("monkey")
end
it "should find resources by strings of zen_master[a,b]" do
load_up_resources
- results = @rc.resources("zen_master[monkey,dog]")
- results.length.should eql(2)
+ results = rc.resources("zen_master[monkey,dog]")
+ expect(results.length).to eql(2)
check_by_names(results, "monkey", "dog")
end
it "should find resources of multiple types by strings of zen_master[a]" do
load_up_resources
- results = @rc.resources("zen_master[monkey]", "file[something]")
- results.length.should eql(2)
+ results = rc.resources("zen_master[monkey]", "file[something]")
+ expect(results.length).to eql(2)
check_by_names(results, "monkey", "something")
end
it "should raise an exception if you pass a bad name to resources" do
- lambda { @rc.resources("michael jackson") }.should raise_error(ArgumentError)
+ expect { rc.resources("michael jackson") }.to raise_error(ArgumentError)
end
it "should raise an exception if you pass something other than a string or hash to resource" do
- lambda { @rc.resources([Array.new]) }.should raise_error(ArgumentError)
+ expect { rc.resources([Array.new]) }.to raise_error(ArgumentError)
end
it "raises an error when attempting to find a resource that does not exist" do
- lambda {@rc.find("script[nonesuch]")}.should raise_error(Chef::Exceptions::ResourceNotFound)
+ expect {rc.find("script[nonesuch]")}.to raise_error(Chef::Exceptions::ResourceNotFound)
end
end
describe "when validating a resource query object" do
it "accepts a string of the form 'resource_type[resource_name]'" do
- @rc.validate_lookup_spec!("resource_type[resource_name]").should be_true
+ expect(rc.validate_lookup_spec!("resource_type[resource_name]")).to be_truthy
end
it "accepts a single-element :resource_type => 'resource_name' Hash" do
- @rc.validate_lookup_spec!(:service => "apache2").should be_true
+ expect(rc.validate_lookup_spec!(:service => "apache2")).to be_truthy
end
it "accepts a chef resource object" do
res = Chef::Resource.new("foo", nil)
- @rc.validate_lookup_spec!(res).should be_true
+ expect(rc.validate_lookup_spec!(res)).to be_truthy
end
it "rejects a malformed query string" do
- lambda do
- @rc.validate_lookup_spec!("resource_type[missing-end-bracket")
- end.should raise_error(Chef::Exceptions::InvalidResourceSpecification)
+ expect do
+ rc.validate_lookup_spec!("resource_type[missing-end-bracket")
+ end.to raise_error(Chef::Exceptions::InvalidResourceSpecification)
end
it "rejects an argument that is not a String, Hash, or Chef::Resource" do
- lambda do
- @rc.validate_lookup_spec!(Object.new)
- end.should raise_error(Chef::Exceptions::InvalidResourceSpecification)
+ expect do
+ rc.validate_lookup_spec!(Object.new)
+ end.to raise_error(Chef::Exceptions::InvalidResourceSpecification)
end
end
describe "to_json" do
it "should serialize to json" do
- json = @rc.to_json
- json.should =~ /json_class/
- json.should =~ /instance_vars/
+ json = rc.to_json
+ expect(json).to match(/json_class/)
+ expect(json).to match(/instance_vars/)
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
- let(:jsonable) { @rc }
+ let(:jsonable) { rc }
end
end
describe "self.from_json" do
it "should not respond to this method" do
- expect(@rc.respond_to?(:from_json)).to eq(false)
+ expect(rc.respond_to?(:from_json)).to eq(false)
end
it "should convert from json using the CHEF::JSONCompat library" do
- @rc << @resource
- json = Chef::JSONCompat.to_json(@rc)
+ rc << resource
+ json = Chef::JSONCompat.to_json(rc)
s_rc = Chef::JSONCompat.from_json(json)
- s_rc.should be_a_kind_of(Chef::ResourceCollection)
- s_rc[0].name.should eql(@resource.name)
+ expect(s_rc).to be_a_kind_of(Chef::ResourceCollection)
+ expect(s_rc[0].name).to eql(resource.name)
end
end
describe "provides access to the raw resources array" do
it "returns the resources via the all_resources method" do
- @rc.all_resources.should equal(@rc.instance_variable_get(:@resources))
+ expect(rc.all_resources).to equal(rc.instance_variable_get(:@resource_list).instance_variable_get(:@resources))
end
end
describe "provides access to stepable iterator" do
it "returns the iterator object" do
- @rc.instance_variable_set(:@iterator, :fooboar)
- @rc.iterator.should == :fooboar
+ rc.instance_variable_get(:@resource_list).instance_variable_set(:@iterator, :fooboar)
+ expect(rc.iterator).to eq(:fooboar)
end
end
def check_by_names(results, *names)
names.each do |res_name|
- results.detect{ |res| res.name == res_name }.should_not eql(nil)
+ expect(results.detect{ |res| res.name == res_name }).not_to eql(nil)
end
end
def load_up_resources
%w{dog cat monkey}.each do |n|
- @rc << Chef::Resource::ZenMaster.new(n)
+ rc << Chef::Resource::ZenMaster.new(n)
end
- @rc << Chef::Resource::File.new("something")
+ rc << Chef::Resource::File.new("something")
end
end
diff --git a/spec/unit/resource_definition_spec.rb b/spec/unit/resource_definition_spec.rb
index f24254cfce..01e28bf091 100644
--- a/spec/unit/resource_definition_spec.rb
+++ b/spec/unit/resource_definition_spec.rb
@@ -19,24 +19,22 @@
require 'spec_helper'
describe Chef::ResourceDefinition do
- before(:each) do
- @def = Chef::ResourceDefinition.new()
- end
+ let(:defn) { Chef::ResourceDefinition.new() }
describe "initialize" do
it "should be a Chef::ResourceDefinition" do
- @def.should be_a_kind_of(Chef::ResourceDefinition)
+ expect(defn).to be_a_kind_of(Chef::ResourceDefinition)
end
it "should not initialize a new node if one is not provided" do
- @def.node.should eql(nil)
+ expect(defn.node).to eql(nil)
end
it "should accept a node as an argument" do
node = Chef::Node.new
node.name("bobo")
- @def = Chef::ResourceDefinition.new(node)
- @def.node.name.should == "bobo"
+ defn = Chef::ResourceDefinition.new(node)
+ expect(defn.node.name).to eq("bobo")
end
end
@@ -44,76 +42,76 @@ describe Chef::ResourceDefinition do
it "should set the node with node=" do
node = Chef::Node.new
node.name("bobo")
- @def.node = node
- @def.node.name.should == "bobo"
+ defn.node = node
+ expect(defn.node.name).to eq("bobo")
end
it "should return the node" do
- @def.node = Chef::Node.new
- @def.node.should be_a_kind_of(Chef::Node)
+ defn.node = Chef::Node.new
+ expect(defn.node).to be_a_kind_of(Chef::Node)
end
end
it "should accept a new definition with a symbol for a name" do
- lambda {
- @def.define :smoke do
+ expect {
+ defn.define :smoke do
end
- }.should_not raise_error
- lambda {
- @def.define "george washington" do
+ }.not_to raise_error
+ expect {
+ defn.define "george washington" do
end
- }.should raise_error(ArgumentError)
- @def.name.should eql(:smoke)
+ }.to raise_error(ArgumentError)
+ expect(defn.name).to eql(:smoke)
end
it "should accept a new definition with a hash" do
- lambda {
- @def.define :smoke, :cigar => "cuban", :cigarette => "marlboro" do
+ expect {
+ defn.define :smoke, :cigar => "cuban", :cigarette => "marlboro" do
end
- }.should_not raise_error
+ }.not_to raise_error
end
it "should expose the prototype hash params in the params hash" do
- @def.define :smoke, :cigar => "cuban", :cigarette => "marlboro" do; end
- @def.params[:cigar].should eql("cuban")
- @def.params[:cigarette].should eql("marlboro")
+ defn.define :smoke, :cigar => "cuban", :cigarette => "marlboro" do; end
+ expect(defn.params[:cigar]).to eql("cuban")
+ expect(defn.params[:cigarette]).to eql("marlboro")
end
it "should store the block passed to define as a proc under recipe" do
- @def.define :smoke do
+ defn.define :smoke do
"I am what I am"
end
- @def.recipe.should be_a_kind_of(Proc)
- @def.recipe.call.should eql("I am what I am")
+ expect(defn.recipe).to be_a_kind_of(Proc)
+ expect(defn.recipe.call).to eql("I am what I am")
end
it "should set paramaters based on method_missing" do
- @def.mind "to fly"
- @def.params[:mind].should eql("to fly")
+ defn.mind "to fly"
+ expect(defn.params[:mind]).to eql("to fly")
end
it "should raise an exception if prototype_params is not a hash" do
- lambda {
- @def.define :monkey, Array.new do
+ expect {
+ defn.define :monkey, Array.new do
end
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should raise an exception if define is called without a block" do
- lambda {
- @def.define :monkey
- }.should raise_error(ArgumentError)
+ expect {
+ defn.define :monkey
+ }.to raise_error(ArgumentError)
end
it "should load a description from a file" do
- @def.from_file(File.join(CHEF_SPEC_DATA, "definitions", "test.rb"))
- @def.name.should eql(:rico_suave)
- @def.params[:rich].should eql("smooth")
+ defn.from_file(File.join(CHEF_SPEC_DATA, "definitions", "test.rb"))
+ expect(defn.name).to eql(:rico_suave)
+ expect(defn.params[:rich]).to eql("smooth")
end
it "should turn itself into a string based on the name with to_s" do
- @def.name = :woot
- @def.to_s.should eql("woot")
+ defn.name = :woot
+ expect(defn.to_s).to eql("woot")
end
end
diff --git a/spec/unit/resource_platform_map_spec.rb b/spec/unit/resource_platform_map_spec.rb
deleted file mode 100644
index 99673d868f..0000000000
--- a/spec/unit/resource_platform_map_spec.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-# Author:: Seth Chisamore (<schisamo@opscode.com>)
-# Copyright:: Copyright (c) 2011 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require 'spec_helper'
-
-describe Chef::Resource::PlatformMap do
-
- before(:each) do
- @platform_map = Chef::Resource::PlatformMap.new({
- :windows => {
- "6.1" => {
- :file => "softiefile",
- :else => "thing"
- },
- :default => {
- :file => Chef::Resource::File,
- :ping => "pong",
- :cat => "nice"
- }
- },
- :pop_tron => {
- },
- :default => {
- :soundwave => "lazerbeak",
- :directory => Chef::Resource::Directory,
- }
- })
- end
-
- describe 'filtering the map' do
- it "returns resources for platform and version" do
- pmap = @platform_map.filter("Windows", "6.1")
- pmap.should be_a_kind_of(Hash)
- pmap[:file].should eql("softiefile")
- end
-
- it "returns platform default resources if version does not exist" do
- pmap = @platform_map.filter("windows", "1")
- pmap.should be_a_kind_of(Hash)
- pmap[:file].should eql(Chef::Resource::File)
- end
-
- it "returns global default resources if none exist for plaform" do
- pmap = @platform_map.filter("pop_tron", "1")
- pmap.should be_a_kind_of(Hash)
- pmap[:directory].should eql(Chef::Resource::Directory)
- end
-
- it "returns global default resources if platform does not exist" do
- pmap = @platform_map.filter("BeOS", "1")
- pmap.should be_a_kind_of(Hash)
- pmap[:soundwave].should eql("lazerbeak")
- end
-
- it "returns a merged map of platform version and plaform default resources" do
- pmap = @platform_map.filter("Windows", "6.1")
- pmap[:file].should eql("softiefile")
- pmap[:ping].should eql("pong")
- end
-
- it "returns a merged map of platform specific version and global defaults" do
- pmap = @platform_map.filter("Windows", "6.1")
- pmap[:file].should eql("softiefile")
- pmap[:soundwave].should eql("lazerbeak")
- end
- end
-
- describe 'finding a resource' do
- it "returns a resource for a platform directly by short name" do
- @platform_map.get(:file, "windows", "6.1").should eql("softiefile")
- end
-
- it "returns a default resource if platform and version don't exist" do
- @platform_map.get(:remote_file).should eql(Chef::Resource::RemoteFile)
- end
-
- it "raises an exception if a resource cannot be found" do
- lambda { @platform_map.get(:coffee, "windows", "6.1")}.should raise_error(NameError)
- end
-
- it "returns a resource with a Chef::Resource object" do
- kitty = Chef::Resource::Cat.new("loulou")
- @platform_map.get(kitty, "windows", "6.1").should eql("nice")
- end
- end
-
- describe 'building the map' do
- it "allows passing of a resource map at creation time" do
- @new_map = Chef::Resource::PlatformMap.new({:the_dude => {:default => 'abides'}})
- @new_map.map[:the_dude][:default].should eql("abides")
- end
-
- it "defaults to a resource map with :default key" do
- @new_map = Chef::Resource::PlatformMap.new
- @new_map.map.has_key?(:default)
- end
-
- it "updates the resource map with a map" do
- @platform_map.set(
- :platform => :darwin,
- :version => "9.2.2",
- :short_name => :file,
- :resource => "masterful"
- )
- @platform_map.map[:darwin]["9.2.2"][:file].should eql("masterful")
-
- @platform_map.set(
- :platform => :darwin,
- :short_name => :file,
- :resource => "masterful"
- )
- @platform_map.map[:darwin][:default][:file].should eql("masterful")
-
- @platform_map.set(
- :short_name => :file,
- :resource => "masterful"
- )
- @platform_map.map[:default][:file].should eql("masterful")
-
- @platform_map.set(
- :platform => :hero,
- :version => "9.2.2",
- :short_name => :file,
- :resource => "masterful"
- )
- @platform_map.map[:hero]["9.2.2"][:file].should eql("masterful")
-
- @platform_map.set(
- :short_name => :file,
- :resource => "masterful"
- )
- @platform_map.map[:default][:file].should eql("masterful")
-
- @platform_map.set(
- :short_name => :file,
- :resource => "masterful"
- )
- @platform_map.map[:default][:file].should eql("masterful")
-
- @platform_map.set(
- :platform => :neurosis,
- :short_name => :package,
- :resource => "masterful"
- )
- @platform_map.map[:neurosis][:default][:package].should eql("masterful")
- end
- end
-
-end
diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb
index 1a89cbdce1..4f3a085584 100644
--- a/spec/unit/resource_reporter_spec.rb
+++ b/spec/unit/resource_reporter_spec.rb
@@ -37,13 +37,13 @@ describe Chef::ResourceReporter do
@node = Chef::Node.new
@node.name("spitfire")
@rest_client = double("Chef::REST (mock)")
- @rest_client.stub(:post_rest).and_return(true)
+ allow(@rest_client).to receive(:post_rest).and_return(true)
@resource_reporter = Chef::ResourceReporter.new(@rest_client)
@new_resource = Chef::Resource::File.new("/tmp/a-file.txt")
@cookbook_name = "monkey"
@new_resource.cookbook_name = @cookbook_name
@cookbook_version = double("Cookbook::Version", :version => "1.2.3")
- @new_resource.stub(:cookbook_version).and_return(@cookbook_version)
+ allow(@new_resource).to receive(:cookbook_version).and_return(@cookbook_version)
@current_resource = Chef::Resource::File.new("/tmp/a-file.txt")
@start_time = Time.new
@end_time = Time.new + 20
@@ -51,25 +51,25 @@ describe Chef::ResourceReporter do
@run_context = Chef::RunContext.new(@node, {}, @events)
@run_status = Chef::RunStatus.new(@node, @events)
@run_id = @run_status.run_id
- Time.stub(:now).and_return(@start_time, @end_time)
+ allow(Time).to receive(:now).and_return(@start_time, @end_time)
end
context "when first created" do
it "has no updated resources" do
- @resource_reporter.should have(0).updated_resources
+ expect(@resource_reporter.updated_resources.size).to eq(0)
end
it "reports a successful run" do
- @resource_reporter.status.should == "success"
+ expect(@resource_reporter.status).to eq("success")
end
it "assumes the resource history feature is supported" do
- @resource_reporter.reporting_enabled?.should be_true
+ expect(@resource_reporter.reporting_enabled?).to be_truthy
end
it "should have no error_descriptions" do
- @resource_reporter.error_descriptions.should eq({})
+ expect(@resource_reporter.error_descriptions).to eq({})
# @resource_reporter.error_descriptions.should be_empty
# @resource_reporter.should have(0).error_descriptions
end
@@ -82,16 +82,16 @@ describe Chef::ResourceReporter do
end
it "reports a successful run" do
- pending "refactor how node gets set."
- @resource_reporter.status.should == "success"
+ skip "refactor how node gets set."
+ expect(@resource_reporter.status).to eq("success")
end
end
context "when chef fails" do
before do
- @rest_client.stub(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}");
- @rest_client.stub(:raw_http_request).and_return({"result"=>"ok"});
- @rest_client.stub(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"});
+ allow(@rest_client).to receive(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}");
+ allow(@rest_client).to receive(:raw_http_request).and_return({"result"=>"ok"});
+ allow(@rest_client).to receive(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"});
end
@@ -103,11 +103,11 @@ describe Chef::ResourceReporter do
end
it "sets the run status to 'failure'" do
- @resource_reporter.status.should == "failure"
+ expect(@resource_reporter.status).to eq("failure")
end
it "keeps the exception data" do
- @resource_reporter.exception.should == @exception
+ expect(@resource_reporter.exception).to eq(@exception)
end
end
@@ -121,12 +121,12 @@ describe Chef::ResourceReporter do
end
it "collects the resource as an updated resource" do
- @resource_reporter.should have(1).updated_resources
+ expect(@resource_reporter.updated_resources.size).to eq(1)
end
it "collects the desired state of the resource" do
update_record = @resource_reporter.updated_resources.first
- update_record.new_resource.should == @new_resource
+ expect(update_record.new_resource).to eq(@new_resource)
end
end
@@ -145,7 +145,7 @@ describe Chef::ResourceReporter do
end
it "has no updated resources" do
- @resource_reporter.should have(0).updated_resources
+ expect(@resource_reporter.updated_resources.size).to eq(0)
end
end
@@ -158,17 +158,17 @@ describe Chef::ResourceReporter do
end
it "collects the updated resource" do
- @resource_reporter.should have(1).updated_resources
+ expect(@resource_reporter.updated_resources.size).to eq(1)
end
it "collects the old state of the resource" do
update_record = @resource_reporter.updated_resources.first
- update_record.current_resource.should == @current_resource
+ expect(update_record.current_resource).to eq(@current_resource)
end
it "collects the new state of the resource" do
update_record = @resource_reporter.updated_resources.first
- update_record.new_resource.should == @new_resource
+ expect(update_record.new_resource).to eq(@new_resource)
end
context "and a subsequent resource fails before loading current resource" do
@@ -182,12 +182,12 @@ describe Chef::ResourceReporter do
it "collects the desired state of the failed resource" do
failed_resource_update = @resource_reporter.updated_resources.last
- failed_resource_update.new_resource.should == @next_new_resource
+ expect(failed_resource_update.new_resource).to eq(@next_new_resource)
end
it "does not have the current state of the failed resource" do
failed_resource_update = @resource_reporter.updated_resources.last
- failed_resource_update.current_resource.should be_nil
+ expect(failed_resource_update.current_resource).to be_nil
end
end
end
@@ -208,7 +208,7 @@ describe Chef::ResourceReporter do
end
it "does not collect data about the nested resource" do
- @resource_reporter.should have(1).updated_resources
+ expect(@resource_reporter.updated_resources.size).to eq(1)
end
end
@@ -224,7 +224,7 @@ describe Chef::ResourceReporter do
end
it "does not collect data about the nested resource" do
- @resource_reporter.should have(1).updated_resources
+ expect(@resource_reporter.updated_resources.size).to eq(1)
end
end
@@ -237,17 +237,17 @@ describe Chef::ResourceReporter do
end
it "collects the resource as an updated resource" do
- @resource_reporter.should have(1).updated_resources
+ expect(@resource_reporter.updated_resources.size).to eq(1)
end
it "collects the desired state of the resource" do
update_record = @resource_reporter.updated_resources.first
- update_record.new_resource.should == @new_resource
+ expect(update_record.new_resource).to eq(@new_resource)
end
it "collects the current state of the resource" do
update_record = @resource_reporter.updated_resources.first
- update_record.current_resource.should == @current_resource
+ expect(update_record.current_resource).to eq(@current_resource)
end
end
@@ -257,9 +257,9 @@ describe Chef::ResourceReporter do
describe "when generating a report for the server" do
before do
- @rest_client.stub(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}");
- @rest_client.stub(:raw_http_request).and_return({"result"=>"ok"});
- @rest_client.stub(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"});
+ allow(@rest_client).to receive(:create_url).and_return("reports/nodes/spitfire/runs/#{@run_id}");
+ allow(@rest_client).to receive(:raw_http_request).and_return({"result"=>"ok"});
+ allow(@rest_client).to receive(:post_rest).and_return({"uri"=>"https://example.com/reports/nodes/spitfire/runs/#{@run_id}"});
@resource_reporter.run_started(@run_status)
end
@@ -268,8 +268,8 @@ describe Chef::ResourceReporter do
context "the new_resource name and id are nil" do
before do
@bad_resource = Chef::Resource::File.new("/tmp/nameless_file.txt")
- @bad_resource.stub(:name).and_return(nil)
- @bad_resource.stub(:identity).and_return(nil)
+ allow(@bad_resource).to receive(:name).and_return(nil)
+ allow(@bad_resource).to receive(:identity).and_return(nil)
@resource_reporter.resource_action_start(@bad_resource, :create)
@resource_reporter.resource_current_state_loaded(@bad_resource, :create, @current_resource)
@resource_reporter.resource_updated(@bad_resource, :create)
@@ -280,19 +280,19 @@ describe Chef::ResourceReporter do
end
it "resource_name in prepared_run_data is a string" do
- @first_update_report["name"].class.should == String
+ expect(@first_update_report["name"].class).to eq(String)
end
it "resource_id in prepared_run_data is a string" do
- @first_update_report["id"].class.should == String
+ expect(@first_update_report["id"].class).to eq(String)
end
end
context "the new_resource name and id are hashes" do
before do
@bad_resource = Chef::Resource::File.new("/tmp/filename_as_hash.txt")
- @bad_resource.stub(:name).and_return({:foo=>:bar})
- @bad_resource.stub(:identity).and_return({:foo=>:bar})
+ allow(@bad_resource).to receive(:name).and_return({:foo=>:bar})
+ allow(@bad_resource).to receive(:identity).and_return({:foo=>:bar})
@resource_reporter.resource_action_start(@bad_resource, :create)
@resource_reporter.resource_current_state_loaded(@bad_resource, :create, @current_resource)
@resource_reporter.resource_updated(@bad_resource, :create)
@@ -309,11 +309,11 @@ describe Chef::ResourceReporter do
# => "{:foo=>:bar}"
# Hence checking for the class instead of the actual value.
it "resource_name in prepared_run_data is a string" do
- @first_update_report["name"].class.should == String
+ expect(@first_update_report["name"].class).to eq(String)
end
it "resource_id in prepared_run_data is a string" do
- @first_update_report["id"].class.should == String
+ expect(@first_update_report["id"].class).to eq(String)
end
end
end
@@ -360,73 +360,73 @@ describe Chef::ResourceReporter do
end
it "includes the run's status" do
- @report.should have_key("status")
+ expect(@report).to have_key("status")
end
it "includes a list of updated resources" do
- @report.should have_key("resources")
+ expect(@report).to have_key("resources")
end
it "includes an updated resource's type" do
- @first_update_report.should have_key("type")
+ expect(@first_update_report).to have_key("type")
end
it "includes an updated resource's initial state" do
- @first_update_report["before"].should == current_resource.state
+ expect(@first_update_report["before"]).to eq(current_resource.state)
end
it "includes an updated resource's final state" do
- @first_update_report["after"].should == new_resource.state
+ expect(@first_update_report["after"]).to eq(new_resource.state)
end
it "includes the resource's name" do
- @first_update_report["name"].should == new_resource.name
+ expect(@first_update_report["name"]).to eq(new_resource.name)
end
it "includes the resource's id attribute" do
- @first_update_report["id"].should == new_resource.identity
+ expect(@first_update_report["id"]).to eq(new_resource.identity)
end
it "includes the elapsed time for the resource to converge" do
# TODO: API takes integer number of milliseconds as a string. This
# should be an int.
- @first_update_report.should have_key("duration")
- @first_update_report["duration"].to_i.should be_within(100).of(0)
+ expect(@first_update_report).to have_key("duration")
+ expect(@first_update_report["duration"].to_i).to be_within(100).of(0)
end
it "includes the action executed by the resource" do
# TODO: rename as "action"
- @first_update_report["result"].should == "create"
+ expect(@first_update_report["result"]).to eq("create")
end
it "includes the cookbook name of the resource" do
- @first_update_report.should have_key("cookbook_name")
- @first_update_report["cookbook_name"].should == @cookbook_name
+ expect(@first_update_report).to have_key("cookbook_name")
+ expect(@first_update_report["cookbook_name"]).to eq(@cookbook_name)
end
it "includes the cookbook version of the resource" do
- @first_update_report.should have_key("cookbook_version")
- @first_update_report["cookbook_version"].should == "1.2.3"
+ expect(@first_update_report).to have_key("cookbook_version")
+ expect(@first_update_report["cookbook_version"]).to eq("1.2.3")
end
it "includes the total resource count" do
- @report.should have_key("total_res_count")
- @report["total_res_count"].should == "1"
+ expect(@report).to have_key("total_res_count")
+ expect(@report["total_res_count"]).to eq("1")
end
it "includes the data hash" do
- @report.should have_key("data")
- @report["data"].should == {}
+ expect(@report).to have_key("data")
+ expect(@report["data"]).to eq({})
end
it "includes the run_list" do
- @report.should have_key("run_list")
- @report["run_list"].should == Chef::JSONCompat.to_json(@run_status.node.run_list)
+ expect(@report).to have_key("run_list")
+ expect(@report["run_list"]).to eq(Chef::JSONCompat.to_json(@run_status.node.run_list))
end
it "includes the end_time" do
- @report.should have_key("end_time")
- @report["end_time"].should == @run_status.end_time.to_s
+ expect(@report).to have_key("end_time")
+ expect(@report["end_time"]).to eq(@run_status.end_time.to_s)
end
end
@@ -442,8 +442,8 @@ describe Chef::ResourceReporter do
let(:new_resource) do
resource = Chef::Resource::RegistryKey.new('Wubba\Lubba\Dub\Dubs')
resource.values([ { :name => 'rick', :type => :binary, :data => 255.chr * 1 } ])
- resource.stub(:cookbook_name).and_return(@cookbook_name)
- resource.stub(:cookbook_version).and_return(@cookbook_version)
+ allow(resource).to receive(:cookbook_name).and_return(@cookbook_name)
+ allow(resource).to receive(:cookbook_version).and_return(@cookbook_version)
resource
end
@@ -463,33 +463,33 @@ describe Chef::ResourceReporter do
@node = Chef::Node.new
@node.name("spitfire")
@exception = ArgumentError.new
- @exception.stub(:inspect).and_return("Net::HTTPServerException")
- @exception.stub(:message).and_return("Object not found")
- @exception.stub(:backtrace).and_return(@backtrace)
+ allow(@exception).to receive(:inspect).and_return("Net::HTTPServerException")
+ allow(@exception).to receive(:message).and_return("Object not found")
+ allow(@exception).to receive(:backtrace).and_return(@backtrace)
@resource_reporter.run_list_expand_failed(@node, @exception)
@resource_reporter.run_failed(@exception)
@report = @resource_reporter.prepare_run_data
end
it "includes the exception type in the event data" do
- @report.should have_key("data")
- @report["data"]["exception"].should have_key("class")
- @report["data"]["exception"]["class"].should == "Net::HTTPServerException"
+ expect(@report).to have_key("data")
+ expect(@report["data"]["exception"]).to have_key("class")
+ expect(@report["data"]["exception"]["class"]).to eq("Net::HTTPServerException")
end
it "includes the exception message in the event data" do
- @report["data"]["exception"].should have_key("message")
- @report["data"]["exception"]["message"].should == "Object not found"
+ expect(@report["data"]["exception"]).to have_key("message")
+ expect(@report["data"]["exception"]["message"]).to eq("Object not found")
end
it "includes the exception trace in the event data" do
- @report["data"]["exception"].should have_key("backtrace")
- @report["data"]["exception"]["backtrace"].should == Chef::JSONCompat.to_json(@backtrace)
+ expect(@report["data"]["exception"]).to have_key("backtrace")
+ expect(@report["data"]["exception"]["backtrace"]).to eq(Chef::JSONCompat.to_json(@backtrace))
end
it "includes the error inspector output in the event data" do
- @report["data"]["exception"].should have_key("description")
- @report["data"]["exception"]["description"].should include({"title"=>"Error expanding the run_list:", "sections"=>[{"Unexpected Error:" => "ArgumentError: Object not found"}]})
+ expect(@report["data"]["exception"]).to have_key("description")
+ expect(@report["data"]["exception"]["description"]).to include({"title"=>"Error expanding the run_list:", "sections"=>[{"Unexpected Error:" => "ArgumentError: Object not found"}]})
end
end
@@ -509,39 +509,39 @@ describe Chef::ResourceReporter do
end
it "includes an updated resource's initial state" do
- @first_update_report["before"].should == @current_resource.state
+ expect(@first_update_report["before"]).to eq(@current_resource.state)
end
it "includes an updated resource's final state" do
- @first_update_report["after"].should == @new_resource.state
+ expect(@first_update_report["after"]).to eq(@new_resource.state)
end
it "includes the resource's name" do
- @first_update_report["name"].should == @new_resource.name
+ expect(@first_update_report["name"]).to eq(@new_resource.name)
end
it "includes the resource's id attribute" do
- @first_update_report["id"].should == @new_resource.identity
+ expect(@first_update_report["id"]).to eq(@new_resource.identity)
end
it "includes the elapsed time for the resource to converge" do
# TODO: API takes integer number of milliseconds as a string. This
# should be an int.
- @first_update_report.should have_key("duration")
- @first_update_report["duration"].to_i.should be_within(100).of(0)
+ expect(@first_update_report).to have_key("duration")
+ expect(@first_update_report["duration"].to_i).to be_within(100).of(0)
end
it "includes the action executed by the resource" do
# TODO: rename as "action"
- @first_update_report["result"].should == "create"
+ expect(@first_update_report["result"]).to eq("create")
end
it "does not include a cookbook name for the resource" do
- @first_update_report.should_not have_key("cookbook_name")
+ expect(@first_update_report).not_to have_key("cookbook_name")
end
it "does not include a cookbook version for the resource" do
- @first_update_report.should_not have_key("cookbook_version")
+ expect(@first_update_report).not_to have_key("cookbook_version")
end
end
@@ -562,13 +562,13 @@ describe Chef::ResourceReporter do
end
it "sets before to {} instead of nil" do
- @first_update_report.should have_key("before")
- @first_update_report['before'].should eq({})
+ expect(@first_update_report).to have_key("before")
+ expect(@first_update_report['before']).to eq({})
end
it "sets after to {} instead of 'Running'" do
- @first_update_report.should have_key("after")
- @first_update_report['after'].should eq({})
+ expect(@first_update_report).to have_key("after")
+ expect(@first_update_report['after']).to eq({})
end
end
@@ -585,7 +585,7 @@ describe Chef::ResourceReporter do
# 404 getting the run_id
@response = Net::HTTPNotFound.new("a response body", "404", "Not Found")
@error = Net::HTTPServerException.new("404 message", @response)
- @rest_client.should_receive(:post_rest).
+ expect(@rest_client).to receive(:post_rest).
with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id,
:start_time => @start_time.to_s},
{'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}).
@@ -594,17 +594,17 @@ describe Chef::ResourceReporter do
it "assumes the feature is not enabled" do
@resource_reporter.run_started(@run_status)
- @resource_reporter.reporting_enabled?.should be_false
+ expect(@resource_reporter.reporting_enabled?).to be_falsey
end
it "does not send a resource report to the server" do
@resource_reporter.run_started(@run_status)
- @rest_client.should_not_receive(:post_rest)
+ expect(@rest_client).not_to receive(:post_rest)
@resource_reporter.run_completed(@node)
end
it "prints an error about the 404" do
- Chef::Log.should_receive(:debug).with(/404/)
+ expect(Chef::Log).to receive(:debug).with(/404/)
@resource_reporter.run_started(@run_status)
end
@@ -615,7 +615,7 @@ describe Chef::ResourceReporter do
# 500 getting the run_id
@response = Net::HTTPInternalServerError.new("a response body", "500", "Internal Server Error")
@error = Net::HTTPServerException.new("500 message", @response)
- @rest_client.should_receive(:post_rest).
+ expect(@rest_client).to receive(:post_rest).
with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id, :start_time => @start_time.to_s},
{'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}).
and_raise(@error)
@@ -623,17 +623,17 @@ describe Chef::ResourceReporter do
it "assumes the feature is not enabled" do
@resource_reporter.run_started(@run_status)
- @resource_reporter.reporting_enabled?.should be_false
+ expect(@resource_reporter.reporting_enabled?).to be_falsey
end
it "does not send a resource report to the server" do
@resource_reporter.run_started(@run_status)
- @rest_client.should_not_receive(:post_rest)
+ expect(@rest_client).not_to receive(:post_rest)
@resource_reporter.run_completed(@node)
end
it "prints an error about the error" do
- Chef::Log.should_receive(:info).with(/500/)
+ expect(Chef::Log).to receive(:info).with(/500/)
@resource_reporter.run_started(@run_status)
end
end
@@ -645,7 +645,7 @@ describe Chef::ResourceReporter do
# 500 getting the run_id
@response = Net::HTTPInternalServerError.new("a response body", "500", "Internal Server Error")
@error = Net::HTTPServerException.new("500 message", @response)
- @rest_client.should_receive(:post_rest).
+ expect(@rest_client).to receive(:post_rest).
with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id, :start_time => @start_time.to_s},
{'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}).
and_raise(@error)
@@ -656,17 +656,17 @@ describe Chef::ResourceReporter do
end
it "fails the run and prints an message about the error" do
- Chef::Log.should_receive(:error).with(/500/)
- lambda {
+ expect(Chef::Log).to receive(:error).with(/500/)
+ expect {
@resource_reporter.run_started(@run_status)
- }.should raise_error(Net::HTTPServerException)
+ }.to raise_error(Net::HTTPServerException)
end
end
context "after creating the run history document" do
before do
response = {"uri"=>"https://example.com/reports/nodes/spitfire/runs/@run_id"}
- @rest_client.should_receive(:post_rest).
+ expect(@rest_client).to receive(:post_rest).
with("reports/nodes/spitfire/runs", {:action => :start, :run_id => @run_id, :start_time => @start_time.to_s},
{'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION}).
and_return(response)
@@ -674,7 +674,7 @@ describe Chef::ResourceReporter do
end
it "creates a run document on the server at the start of the run" do
- @resource_reporter.run_id.should == @run_id
+ expect(@resource_reporter.run_id).to eq(@run_id)
end
it "updates the run document with resource updates at the end of the run" do
@@ -683,25 +683,25 @@ describe Chef::ResourceReporter do
@resource_reporter.resource_current_state_loaded(@new_resource, :create, @current_resource)
@resource_reporter.resource_updated(@new_resource, :create)
- @resource_reporter.stub(:end_time).and_return(@end_time)
+ allow(@resource_reporter).to receive(:end_time).and_return(@end_time)
@expected_data = @resource_reporter.prepare_run_data
post_url = "https://chef_server/example_url"
response = {"result"=>"ok"}
- @rest_client.should_receive(:create_url).
+ expect(@rest_client).to receive(:create_url).
with("reports/nodes/spitfire/runs/#{@run_id}").
ordered.
and_return(post_url)
- @rest_client.should_receive(:raw_http_request).ordered do |method, url, headers, data|
- method.should eq(:POST)
- url.should eq(post_url)
- headers.should eq({'Content-Encoding' => 'gzip',
+ expect(@rest_client).to receive(:raw_http_request).ordered do |method, url, headers, data|
+ expect(method).to eq(:POST)
+ expect(url).to eq(post_url)
+ expect(headers).to eq({'Content-Encoding' => 'gzip',
'X-Ops-Reporting-Protocol-Version' => Chef::ResourceReporter::PROTOCOL_VERSION
})
data_stream = Zlib::GzipReader.new(StringIO.new(data))
data = data_stream.read
- data.should eq(Chef::JSONCompat.to_json(@expected_data))
+ expect(data).to eq(Chef::JSONCompat.to_json(@expected_data))
response
end
@@ -714,7 +714,7 @@ describe Chef::ResourceReporter do
@enable_reporting_url_fatals = Chef::Config[:enable_reporting_url_fatals]
Chef::Config[:enable_reporting_url_fatals] = true
# this call doesn't matter for this context
- @rest_client.stub(:create_url)
+ allow(@rest_client).to receive(:create_url)
end
after do
@@ -724,8 +724,8 @@ describe Chef::ResourceReporter do
it "should log 4xx errors" do
response = Net::HTTPClientError.new("forbidden", "403", "Forbidden")
error = Net::HTTPServerException.new("403 message", response)
- @rest_client.stub(:raw_http_request).and_raise(error)
- Chef::Log.should_receive(:error).with(/403/)
+ allow(@rest_client).to receive(:raw_http_request).and_raise(error)
+ expect(Chef::Log).to receive(:error).with(/403/)
@resource_reporter.post_reporting_data
end
@@ -733,26 +733,26 @@ describe Chef::ResourceReporter do
it "should log error 5xx errors" do
response = Net::HTTPServerError.new("internal error", "500", "Internal Server Error")
error = Net::HTTPFatalError.new("500 message", response)
- @rest_client.stub(:raw_http_request).and_raise(error)
- Chef::Log.should_receive(:error).with(/500/)
+ allow(@rest_client).to receive(:raw_http_request).and_raise(error)
+ expect(Chef::Log).to receive(:error).with(/500/)
@resource_reporter.post_reporting_data
end
it "should log if a socket error happens" do
- @rest_client.stub(:raw_http_request).and_raise(SocketError.new("test socket error"))
- Chef::Log.should_receive(:error).with(/test socket error/)
+ allow(@rest_client).to receive(:raw_http_request).and_raise(SocketError.new("test socket error"))
+ expect(Chef::Log).to receive(:error).with(/test socket error/)
@resource_reporter.post_reporting_data
end
it "should raise if an unkwown error happens" do
- @rest_client.stub(:raw_http_request).and_raise(Exception.new)
+ allow(@rest_client).to receive(:raw_http_request).and_raise(Exception.new)
- lambda {
+ expect {
@resource_reporter.post_reporting_data
- }.should raise_error(Exception)
+ }.to raise_error(Exception)
end
end
end
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 692345c943..bb02d91b23 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -39,33 +39,33 @@ describe Chef::Resource do
it "adds an entry to a list of subclasses" do
subclass = Class.new(Chef::Resource)
- Chef::Resource.resource_classes.should include(subclass)
+ expect(Chef::Resource.resource_classes).to include(subclass)
end
it "keeps track of subclasses of subclasses" do
subclass = Class.new(Chef::Resource)
subclass_of_subclass = Class.new(subclass)
- Chef::Resource.resource_classes.should include(subclass_of_subclass)
+ expect(Chef::Resource.resource_classes).to include(subclass_of_subclass)
end
end
describe "when declaring the identity attribute" do
it "has no identity attribute by default" do
- Chef::Resource.identity_attr.should be_nil
+ expect(Chef::Resource.identity_attr).to be_nil
end
it "sets an identity attribute" do
resource_class = Class.new(Chef::Resource)
resource_class.identity_attr(:path)
- resource_class.identity_attr.should == :path
+ expect(resource_class.identity_attr).to eq(:path)
end
it "inherits an identity attribute from a superclass" do
resource_class = Class.new(Chef::Resource)
resource_subclass = Class.new(resource_class)
resource_class.identity_attr(:package_name)
- resource_subclass.identity_attr.should == :package_name
+ expect(resource_subclass.identity_attr).to eq(:package_name)
end
it "overrides the identity attribute from a superclass when the identity attr is set" do
@@ -73,7 +73,7 @@ describe Chef::Resource do
resource_subclass = Class.new(resource_class)
resource_class.identity_attr(:package_name)
resource_subclass.identity_attr(:something_else)
- resource_subclass.identity_attr.should == :something_else
+ expect(resource_subclass.identity_attr).to eq(:something_else)
end
end
@@ -85,7 +85,7 @@ describe Chef::Resource do
# Would rather force identity attributes to be set for everything,
# but that's not plausible for back compat reasons.
it "uses the name as the identity" do
- @resource_sans_id.identity.should == "my-name"
+ expect(@resource_sans_id.identity).to eq("my-name")
end
end
@@ -101,26 +101,26 @@ describe Chef::Resource do
end
it "gives the value of its identity attribute" do
- @file_resource.identity.should == "/tmp/foo.txt"
+ expect(@file_resource.identity).to eq("/tmp/foo.txt")
end
end
describe "when declaring state attributes" do
it "has no state_attrs by default" do
- Chef::Resource.state_attrs.should be_empty
+ expect(Chef::Resource.state_attrs).to be_empty
end
it "sets a list of state attributes" do
resource_class = Class.new(Chef::Resource)
resource_class.state_attrs(:checksum, :owner, :group, :mode)
- resource_class.state_attrs.should =~ [:checksum, :owner, :group, :mode]
+ expect(resource_class.state_attrs).to match_array([:checksum, :owner, :group, :mode])
end
it "inherits state attributes from the superclass" do
resource_class = Class.new(Chef::Resource)
resource_subclass = Class.new(resource_class)
resource_class.state_attrs(:checksum, :owner, :group, :mode)
- resource_subclass.state_attrs.should =~ [:checksum, :owner, :group, :mode]
+ expect(resource_subclass.state_attrs).to match_array([:checksum, :owner, :group, :mode])
end
it "combines inherited state attributes with non-inherited state attributes" do
@@ -128,7 +128,7 @@ describe Chef::Resource do
resource_subclass = Class.new(resource_class)
resource_class.state_attrs(:checksum, :owner)
resource_subclass.state_attrs(:group, :mode)
- resource_subclass.state_attrs.should =~ [:checksum, :owner, :group, :mode]
+ expect(resource_subclass.state_attrs).to match_array([:checksum, :owner, :group, :mode])
end
end
@@ -154,11 +154,11 @@ describe Chef::Resource do
it "describes its state" do
resource_state = @file_resource.state
- resource_state.keys.should =~ [:checksum, :owner, :group, :mode]
- resource_state[:checksum].should == "abc123"
- resource_state[:owner].should == "root"
- resource_state[:group].should == "wheel"
- resource_state[:mode].should == "0644"
+ expect(resource_state.keys).to match_array([:checksum, :owner, :group, :mode])
+ expect(resource_state[:checksum]).to eq("abc123")
+ expect(resource_state[:owner]).to eq("root")
+ expect(resource_state[:group]).to eq("wheel")
+ expect(resource_state[:mode]).to eq("0644")
end
end
@@ -174,40 +174,40 @@ describe Chef::Resource do
end
it "should load the attributes of a prior resource" do
- @resource.load_prior_resource
- @resource.supports.should == { :funky => true }
+ @resource.load_prior_resource(@resource.resource_name, @resource.name)
+ expect(@resource.supports).to eq({ :funky => true })
end
it "should not inherit the action from the prior resource" do
- @resource.load_prior_resource
- @resource.action.should_not == @prior_resource.action
+ @resource.load_prior_resource(@resource.resource_name, @resource.name)
+ expect(@resource.action).not_to eq(@prior_resource.action)
end
end
describe "name" do
it "should have a name" do
- @resource.name.should eql("funk")
+ expect(@resource.name).to eql("funk")
end
it "should let you set a new name" do
@resource.name "monkey"
- @resource.name.should eql("monkey")
+ expect(@resource.name).to eql("monkey")
end
it "should not be valid without a name" do
- lambda { @resource.name false }.should raise_error(ArgumentError)
+ expect { @resource.name false }.to raise_error(ArgumentError)
end
it "should always have a string for name" do
- lambda { @resource.name Hash.new }.should raise_error(ArgumentError)
+ expect { @resource.name Hash.new }.to raise_error(ArgumentError)
end
end
describe "noop" do
it "should accept true or false for noop" do
- lambda { @resource.noop true }.should_not raise_error
- lambda { @resource.noop false }.should_not raise_error
- lambda { @resource.noop "eat it" }.should raise_error(ArgumentError)
+ expect { @resource.noop true }.not_to raise_error
+ expect { @resource.noop false }.not_to raise_error
+ expect { @resource.noop "eat it" }.to raise_error(ArgumentError)
end
end
@@ -215,48 +215,48 @@ describe Chef::Resource do
it "should make notified resources appear in the actions hash" do
@run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
@resource.notifies :reload, @run_context.resource_collection.find(:zen_master => "coffee")
- @resource.delayed_notifications.detect{|e| e.resource.name == "coffee" && e.action == :reload}.should_not be_nil
+ expect(@resource.delayed_notifications.detect{|e| e.resource.name == "coffee" && e.action == :reload}).not_to be_nil
end
it "should make notified resources be capable of acting immediately" do
@run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
@resource.notifies :reload, @run_context.resource_collection.find(:zen_master => "coffee"), :immediate
- @resource.immediate_notifications.detect{|e| e.resource.name == "coffee" && e.action == :reload}.should_not be_nil
+ expect(@resource.immediate_notifications.detect{|e| e.resource.name == "coffee" && e.action == :reload}).not_to be_nil
end
it "should raise an exception if told to act in other than :delay or :immediate(ly)" do
@run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
- lambda {
+ expect {
@resource.notifies :reload, @run_context.resource_collection.find(:zen_master => "coffee"), :someday
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
it "should allow multiple notified resources appear in the actions hash" do
@run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
@resource.notifies :reload, @run_context.resource_collection.find(:zen_master => "coffee")
- @resource.delayed_notifications.detect{|e| e.resource.name == "coffee" && e.action == :reload}.should_not be_nil
+ expect(@resource.delayed_notifications.detect{|e| e.resource.name == "coffee" && e.action == :reload}).not_to be_nil
@run_context.resource_collection << Chef::Resource::ZenMaster.new("beans")
@resource.notifies :reload, @run_context.resource_collection.find(:zen_master => "beans")
- @resource.delayed_notifications.detect{|e| e.resource.name == "beans" && e.action == :reload}.should_not be_nil
+ expect(@resource.delayed_notifications.detect{|e| e.resource.name == "beans" && e.action == :reload}).not_to be_nil
end
it "creates a notification for a resource that is not yet in the resource collection" do
@resource.notifies(:restart, :service => 'apache')
expected_notification = Chef::Resource::Notification.new({:service => "apache"}, :restart, @resource)
- @resource.delayed_notifications.should include(expected_notification)
+ expect(@resource.delayed_notifications).to include(expected_notification)
end
it "notifies another resource immediately" do
@resource.notifies_immediately(:restart, :service => 'apache')
expected_notification = Chef::Resource::Notification.new({:service => "apache"}, :restart, @resource)
- @resource.immediate_notifications.should include(expected_notification)
+ expect(@resource.immediate_notifications).to include(expected_notification)
end
it "notifies a resource to take action at the end of the chef run" do
@resource.notifies_delayed(:restart, :service => "apache")
expected_notification = Chef::Resource::Notification.new({:service => "apache"}, :restart, @resource)
- @resource.delayed_notifications.should include(expected_notification)
+ expect(@resource.delayed_notifications).to include(expected_notification)
end
end
@@ -265,76 +265,76 @@ describe Chef::Resource do
@run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
zr = @run_context.resource_collection.find(:zen_master => "coffee")
@resource.subscribes :reload, zr
- zr.delayed_notifications.detect{|e| e.resource.name == "funk" && e.action == :reload}.should_not be_nil
+ expect(zr.delayed_notifications.detect{|e| e.resource.name == "funk" && e.action == :reload}).not_to be_nil
end
it "should make resources appear in the actions hash of subscribed nodes" do
@run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
zr = @run_context.resource_collection.find(:zen_master => "coffee")
@resource.subscribes :reload, zr
- zr.delayed_notifications.detect{|e| e.resource.name == @resource.name && e.action == :reload}.should_not be_nil
+ expect(zr.delayed_notifications.detect{|e| e.resource.name == @resource.name && e.action == :reload}).not_to be_nil
@run_context.resource_collection << Chef::Resource::ZenMaster.new("bean")
zrb = @run_context.resource_collection.find(:zen_master => "bean")
zrb.subscribes :reload, zr
- zr.delayed_notifications.detect{|e| e.resource.name == @resource.name && e.action == :reload}.should_not be_nil
+ expect(zr.delayed_notifications.detect{|e| e.resource.name == @resource.name && e.action == :reload}).not_to be_nil
end
it "should make subscribed resources be capable of acting immediately" do
@run_context.resource_collection << Chef::Resource::ZenMaster.new("coffee")
zr = @run_context.resource_collection.find(:zen_master => "coffee")
@resource.subscribes :reload, zr, :immediately
- zr.immediate_notifications.detect{|e| e.resource.name == @resource.name && e.action == :reload}.should_not be_nil
+ expect(zr.immediate_notifications.detect{|e| e.resource.name == @resource.name && e.action == :reload}).not_to be_nil
end
end
describe "defined_at" do
it "should correctly parse source_line on unix-like operating systems" do
@resource.source_line = "/some/path/to/file.rb:80:in `wombat_tears'"
- @resource.defined_at.should == "/some/path/to/file.rb line 80"
+ expect(@resource.defined_at).to eq("/some/path/to/file.rb line 80")
end
it "should correctly parse source_line on Windows" do
@resource.source_line = "C:/some/path/to/file.rb:80 in 1`wombat_tears'"
- @resource.defined_at.should == "C:/some/path/to/file.rb line 80"
+ expect(@resource.defined_at).to eq("C:/some/path/to/file.rb line 80")
end
it "should include the cookbook and recipe when it knows it" do
@resource.source_line = "/some/path/to/file.rb:80:in `wombat_tears'"
@resource.recipe_name = "wombats"
@resource.cookbook_name = "animals"
- @resource.defined_at.should == "animals::wombats line 80"
+ expect(@resource.defined_at).to eq("animals::wombats line 80")
end
it "should recognize dynamically defined resources" do
- @resource.defined_at.should == "dynamically defined"
+ expect(@resource.defined_at).to eq("dynamically defined")
end
end
describe "to_s" do
it "should become a string like resource_name[name]" do
zm = Chef::Resource::ZenMaster.new("coffee")
- zm.to_s.should eql("zen_master[coffee]")
+ expect(zm.to_s).to eql("zen_master[coffee]")
end
end
describe "is" do
it "should return the arguments passed with 'is'" do
zm = Chef::Resource::ZenMaster.new("coffee")
- zm.is("one", "two", "three").should == %w|one two three|
+ expect(zm.is("one", "two", "three")).to eq(%w|one two three|)
end
it "should allow arguments preceeded by is to methods" do
@resource.noop(@resource.is(true))
- @resource.noop.should eql(true)
+ expect(@resource.noop).to eql(true)
end
end
describe "to_json" do
it "should serialize to json" do
json = @resource.to_json
- json.should =~ /json_class/
- json.should =~ /instance_vars/
+ expect(json).to match(/json_class/)
+ expect(json).to match(/instance_vars/)
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
@@ -349,10 +349,10 @@ describe Chef::Resource do
:updated_by_last_action, :before, :supports,
:noop, :ignore_failure, :name, :source_line,
:action, :retries, :retry_delay, :elapsed_time,
- :guard_interpreter, :sensitive ]
- (hash.keys - expected_keys).should == []
- (expected_keys - hash.keys).should == []
- hash[:name].should eql("funk")
+ :default_guard_interpreter, :guard_interpreter, :sensitive ]
+ expect(hash.keys - expected_keys).to eq([])
+ expect(expected_keys - hash.keys).to eq([])
+ expect(hash[:name]).to eql("funk")
end
end
@@ -360,8 +360,8 @@ describe Chef::Resource do
it "should deserialize itself from json" do
json = Chef::JSONCompat.to_json(@resource)
serialized_node = Chef::JSONCompat.from_json(json)
- serialized_node.should be_a_kind_of(Chef::Resource)
- serialized_node.name.should eql(@resource.name)
+ expect(serialized_node).to be_a_kind_of(Chef::Resource)
+ expect(serialized_node.name).to eql(@resource.name)
end
end
@@ -369,64 +369,86 @@ describe Chef::Resource do
it "should allow you to set what features this resource supports" do
support_hash = { :one => :two }
@resource.supports(support_hash)
- @resource.supports.should eql(support_hash)
+ expect(@resource.supports).to eql(support_hash)
end
it "should return the current value of supports" do
- @resource.supports.should == {}
+ expect(@resource.supports).to eq({})
end
end
describe "ignore_failure" do
it "should default to throwing an error if a provider fails for a resource" do
- @resource.ignore_failure.should == false
+ expect(@resource.ignore_failure).to eq(false)
end
it "should allow you to set whether a provider should throw exceptions with ignore_failure" do
@resource.ignore_failure(true)
- @resource.ignore_failure.should == true
+ expect(@resource.ignore_failure).to eq(true)
end
it "should allow you to epic_fail" do
@resource.epic_fail(true)
- @resource.epic_fail.should == true
+ expect(@resource.epic_fail).to eq(true)
end
end
describe "retries" do
+ before do
+ @retriable_resource = Chef::Resource::Cat.new("precious", @run_context)
+ @retriable_resource.provider = Chef::Provider::SnakeOil
+ @retriable_resource.action = :purr
+
+ @node.automatic_attrs[:platform] = "fubuntu"
+ @node.automatic_attrs[:platform_version] = '10.04'
+ end
+
it "should default to not retrying if a provider fails for a resource" do
- @resource.retries.should == 0
+ expect(@retriable_resource.retries).to eq(0)
end
it "should allow you to set how many retries a provider should attempt after a failure" do
- @resource.retries(2)
- @resource.retries.should == 2
+ @retriable_resource.retries(2)
+ expect(@retriable_resource.retries).to eq(2)
end
it "should default to a retry delay of 2 seconds" do
- @resource.retry_delay.should == 2
+ expect(@retriable_resource.retry_delay).to eq(2)
end
it "should allow you to set the retry delay" do
- @resource.retry_delay(10)
- @resource.retry_delay.should == 10
+ @retriable_resource.retry_delay(10)
+ expect(@retriable_resource.retry_delay).to eq(10)
+ end
+
+ it "should keep given value of retries intact after the provider fails for a resource" do
+ @retriable_resource.retries(3)
+ @retriable_resource.retry_delay(0) # No need to wait.
+
+ provider = Chef::Provider::SnakeOil.new(@retriable_resource, @run_context)
+ allow(Chef::Provider::SnakeOil).to receive(:new).and_return(provider)
+ allow(provider).to receive(:action_purr).and_raise
+
+ expect(@retriable_resource).to receive(:sleep).exactly(3).times
+ expect { @retriable_resource.run_action(:purr) }.to raise_error
+ expect(@retriable_resource.retries).to eq(3)
end
end
describe "setting the base provider class for the resource" do
it "defaults to Chef::Provider for the base class" do
- Chef::Resource.provider_base.should == Chef::Provider
+ expect(Chef::Resource.provider_base).to eq(Chef::Provider)
end
it "allows the base provider to be overriden by a " do
- ResourceTestHarness.provider_base.should == Chef::Provider::Package
+ expect(ResourceTestHarness.provider_base).to eq(Chef::Provider::Package)
end
end
it "runs an action by finding its provider, loading the current resource and then running the action" do
- pending
+ skip
end
describe "when updated by a provider" do
@@ -435,11 +457,11 @@ describe Chef::Resource do
end
it "records that it was updated" do
- @resource.should be_updated
+ expect(@resource).to be_updated
end
it "records that the last action updated the resource" do
- @resource.should be_updated_by_last_action
+ expect(@resource).to be_updated_by_last_action
end
describe "and then run again without being updated" do
@@ -448,11 +470,11 @@ describe Chef::Resource do
end
it "reports that it is updated" do
- @resource.should be_updated
+ expect(@resource).to be_updated
end
it "reports that it was not updated by the last action" do
- @resource.should_not be_updated_by_last_action
+ expect(@resource).not_to be_updated_by_last_action
end
end
@@ -476,10 +498,10 @@ describe Chef::Resource do
it "runs runs an only_if when one is given" do
snitch_variable = nil
@resource.only_if { snitch_variable = true }
- @resource.only_if.first.positivity.should == :only_if
+ expect(@resource.only_if.first.positivity).to eq(:only_if)
#Chef::Mixin::Command.should_receive(:only_if).with(true, {}).and_return(false)
@resource.run_action(:purr)
- snitch_variable.should be_true
+ expect(snitch_variable).to be_truthy
end
it "runs multiple only_if conditionals" do
@@ -487,25 +509,25 @@ describe Chef::Resource do
@resource.only_if { snitch_var1 = 1 }
@resource.only_if { snitch_var2 = 2 }
@resource.run_action(:purr)
- snitch_var1.should == 1
- snitch_var2.should == 2
+ expect(snitch_var1).to eq(1)
+ expect(snitch_var2).to eq(2)
end
it "accepts command options for only_if conditionals" do
- Chef::Resource::Conditional.any_instance.should_receive(:evaluate_command).at_least(1).times
+ expect_any_instance_of(Chef::Resource::Conditional).to receive(:evaluate_command).at_least(1).times
@resource.only_if("true", :cwd => '/tmp')
- @resource.only_if.first.command_opts.should == {:cwd => '/tmp'}
+ expect(@resource.only_if.first.command_opts).to eq({:cwd => '/tmp'})
@resource.run_action(:purr)
end
it "runs not_if as a command when it is a string" do
- Chef::Resource::Conditional.any_instance.should_receive(:evaluate_command).at_least(1).times
+ expect_any_instance_of(Chef::Resource::Conditional).to receive(:evaluate_command).at_least(1).times
@resource.not_if "pwd"
@resource.run_action(:purr)
end
it "runs not_if as a block when it is a ruby block" do
- Chef::Resource::Conditional.any_instance.should_receive(:evaluate_block).at_least(1).times
+ expect_any_instance_of(Chef::Resource::Conditional).to receive(:evaluate_block).at_least(1).times
@resource.not_if { puts 'foo' }
@resource.run_action(:purr)
end
@@ -518,7 +540,7 @@ describe Chef::Resource do
it "accepts command options for not_if conditionals" do
@resource.not_if("pwd" , :cwd => '/tmp')
- @resource.not_if.first.command_opts.should == {:cwd => '/tmp'}
+ expect(@resource.not_if.first.command_opts).to eq({:cwd => '/tmp'})
end
it "accepts multiple not_if conditionals" do
@@ -526,27 +548,27 @@ describe Chef::Resource do
@resource.not_if {snitch_var1 = nil}
@resource.not_if {snitch_var2 = false}
@resource.run_action(:purr)
- snitch_var1.should be_nil
- snitch_var2.should be_false
+ expect(snitch_var1).to be_nil
+ expect(snitch_var2).to be_falsey
end
it "reports 0 elapsed time if actual elapsed time is < 0" do
expected = Time.now
- Time.stub(:now).and_return(expected, expected - 1)
+ allow(Time).to receive(:now).and_return(expected, expected - 1)
@resource.run_action(:purr)
- @resource.elapsed_time.should == 0
+ expect(@resource.elapsed_time).to eq(0)
end
describe "guard_interpreter attribute" do
let(:resource) { @resource }
it "should be set to :default by default" do
- resource.guard_interpreter.should == :default
+ expect(resource.guard_interpreter).to eq(:default)
end
it "if set to :default should return :default when read" do
resource.guard_interpreter(:default)
- resource.guard_interpreter.should == :default
+ expect(resource.guard_interpreter).to eq(:default)
end
it "should raise Chef::Exceptions::ValidationFailed on an attempt to set the guard_interpreter attribute to something other than a Symbol" do
@@ -554,7 +576,7 @@ describe Chef::Resource do
end
it "should not raise an exception when setting the guard interpreter attribute to a Symbol" do
- Chef::GuardInterpreter::ResourceGuardInterpreter.stub(:new).and_return(nil)
+ allow(Chef::GuardInterpreter::ResourceGuardInterpreter).to receive(:new).and_return(nil)
expect { resource.guard_interpreter(:command_dot_com) }.not_to raise_error
end
end
@@ -566,63 +588,63 @@ describe Chef::Resource do
end
it "should return false by default" do
- @resource.should_skip?(:purr).should be_false
+ expect(@resource.should_skip?(:purr)).to be_falsey
end
it "should return false when only_if is met" do
@resource.only_if { true }
- @resource.should_skip?(:purr).should be_false
+ expect(@resource.should_skip?(:purr)).to be_falsey
end
it "should return true when only_if is not met" do
@resource.only_if { false }
- @resource.should_skip?(:purr).should be_true
+ expect(@resource.should_skip?(:purr)).to be_truthy
end
it "should return true when not_if is met" do
@resource.not_if { true }
- @resource.should_skip?(:purr).should be_true
+ expect(@resource.should_skip?(:purr)).to be_truthy
end
it "should return false when not_if is not met" do
@resource.not_if { false }
- @resource.should_skip?(:purr).should be_false
+ expect(@resource.should_skip?(:purr)).to be_falsey
end
it "should return true when only_if is met but also not_if is met" do
@resource.only_if { true }
@resource.not_if { true }
- @resource.should_skip?(:purr).should be_true
+ expect(@resource.should_skip?(:purr)).to be_truthy
end
it "should return true when one of multiple only_if's is not met" do
@resource.only_if { true }
@resource.only_if { false }
@resource.only_if { true }
- @resource.should_skip?(:purr).should be_true
+ expect(@resource.should_skip?(:purr)).to be_truthy
end
it "should return true when one of multiple not_if's is met" do
@resource.not_if { false }
@resource.not_if { true }
@resource.not_if { false }
- @resource.should_skip?(:purr).should be_true
+ expect(@resource.should_skip?(:purr)).to be_truthy
end
it "should return true when action is :nothing" do
- @resource.should_skip?(:nothing).should be_true
+ expect(@resource.should_skip?(:nothing)).to be_truthy
end
it "should return true when action is :nothing ignoring only_if/not_if conditionals" do
@resource.only_if { true }
@resource.not_if { false }
- @resource.should_skip?(:nothing).should be_true
+ expect(@resource.should_skip?(:nothing)).to be_truthy
end
it "should print \"skipped due to action :nothing\" message for doc formatter when action is :nothing" do
fdoc = Chef::Formatters.new(:doc, STDOUT, STDERR)
- @run_context.stub(:events).and_return(fdoc)
- fdoc.should_receive(:puts).with(" (skipped due to action :nothing)", anything())
+ allow(@run_context).to receive(:events).and_return(fdoc)
+ expect(fdoc).to receive(:puts).with(" (skipped due to action :nothing)", anything())
@resource.should_skip?(:nothing)
end
@@ -642,7 +664,7 @@ describe Chef::Resource do
@resource1.only_if { snitch_var1 = 1 }
@resource1.not_if { snitch_var1 = 2 }
@resource1.run_action(:nothing)
- snitch_var1.should == 0
+ expect(snitch_var1).to eq(0)
end
it "should run only_if/not_if conditionals when notified to run another action (CHEF-972)" do
@@ -663,31 +685,40 @@ describe Chef::Resource do
@run_context.resource_collection << @resource2
@runner.converge
- snitch_var1.should == 1
- snitch_var2.should == 2
+ expect(snitch_var1).to eq(1)
+ expect(snitch_var2).to eq(2)
end
end
describe "building the platform map" do
+ let(:klz) { Class.new(Chef::Resource) }
+
+ before do
+ Chef::Resource::Klz = klz
+ end
+
+ after do
+ Chef::Resource.send(:remove_const, :Klz)
+ end
+
it 'adds mappings for a single platform' do
- klz = Class.new(Chef::Resource)
- Chef::Resource.platform_map.should_receive(:set).with(
- :platform => :autobots, :short_name => :dinobot, :resource => klz
+ expect(Chef::Resource.node_map).to receive(:set).with(
+ :dinobot, Chef::Resource::Klz, { platform: ['autobots'] }
)
- klz.provides :dinobot, :on_platforms => ['autobots']
+ klz.provides :dinobot, platform: ['autobots']
end
it 'adds mappings for multiple platforms' do
- klz = Class.new(Chef::Resource)
- Chef::Resource.platform_map.should_receive(:set).twice
- klz.provides :energy, :on_platforms => ['autobots','decepticons']
+ expect(Chef::Resource.node_map).to receive(:set).with(
+ :energy, Chef::Resource::Klz, { platform: ['autobots', 'decepticons']}
+ )
+ klz.provides :energy, platform: ['autobots', 'decepticons']
end
it 'adds mappings for all platforms' do
- klz = Class.new(Chef::Resource)
- Chef::Resource.platform_map.should_receive(:set).with(
- :short_name => :tape_deck, :resource => klz
+ expect(Chef::Resource.node_map).to receive(:set).with(
+ :tape_deck, Chef::Resource::Klz, {}
)
klz.provides :tape_deck
end
@@ -695,36 +726,34 @@ describe Chef::Resource do
end
describe "lookups from the platform map" do
+ let(:klz1) { Class.new(Chef::Resource) }
+ let(:klz2) { Class.new(Chef::Resource) }
before(:each) do
+ Chef::Resource::Klz1 = klz1
+ Chef::Resource::Klz2 = klz2
@node = Chef::Node.new
@node.name("bumblebee")
@node.automatic[:platform] = "autobots"
@node.automatic[:platform_version] = "6.1"
- Object.const_set('Soundwave', Class.new(Chef::Resource))
- Object.const_set('Grimlock', Class.new(Chef::Resource){ provides :dinobot, :on_platforms => ['autobots'] })
+ Object.const_set('Soundwave', klz1)
+ klz2.provides :dinobot, :on_platforms => ['autobots']
+ Object.const_set('Grimlock', klz2)
end
after(:each) do
Object.send(:remove_const, :Soundwave)
Object.send(:remove_const, :Grimlock)
- end
-
- describe "resource_for_platform" do
- it 'return a resource by short_name and platform' do
- Chef::Resource.resource_for_platform(:dinobot,'autobots','6.1').should eql(Grimlock)
- end
- it "returns a resource by short_name if nothing else matches" do
- Chef::Resource.resource_for_node(:soundwave, @node).should eql(Soundwave)
- end
+ Chef::Resource.send(:remove_const, :Klz1)
+ Chef::Resource.send(:remove_const, :Klz2)
end
describe "resource_for_node" do
it "returns a resource by short_name and node" do
- Chef::Resource.resource_for_node(:dinobot, @node).should eql(Grimlock)
+ expect(Chef::Resource.resource_for_node(:dinobot, @node)).to eql(Grimlock)
end
it "returns a resource by short_name if nothing else matches" do
- Chef::Resource.resource_for_node(:soundwave, @node).should eql(Soundwave)
+ expect(Chef::Resource.resource_for_node(:soundwave, @node)).to eql(Soundwave)
end
end
@@ -736,30 +765,30 @@ describe Chef::Resource do
it "creates a delayed notification when timing is not specified" do
@resource.notifies(:run, "execute[foo]")
- @run_context.delayed_notification_collection.should have(1).notifications
+ expect(@run_context.delayed_notification_collection.size).to eq(1)
end
it "creates a delayed notification when :delayed is not specified" do
@resource.notifies(:run, "execute[foo]", :delayed)
- @run_context.delayed_notification_collection.should have(1).notifications
+ expect(@run_context.delayed_notification_collection.size).to eq(1)
end
it "creates an immediate notification when :immediate is specified" do
@resource.notifies(:run, "execute[foo]", :immediate)
- @run_context.immediate_notification_collection.should have(1).notifications
+ expect(@run_context.immediate_notification_collection.size).to eq(1)
end
it "creates an immediate notification when :immediately is specified" do
@resource.notifies(:run, "execute[foo]", :immediately)
- @run_context.immediate_notification_collection.should have(1).notifications
+ expect(@run_context.immediate_notification_collection.size).to eq(1)
end
describe "with a syntax error in the resource spec" do
it "raises an exception immmediately" do
- lambda do
+ expect do
@resource.notifies(:run, "typo[missing-closing-bracket")
- end.should raise_error(Chef::Exceptions::InvalidResourceSpecification)
+ end.to raise_error(Chef::Exceptions::InvalidResourceSpecification)
end
end
end
@@ -771,22 +800,22 @@ describe Chef::Resource do
it "creates a delayed notification when timing is not specified" do
@resource.notifies(:run, @notified_resource)
- @run_context.delayed_notification_collection.should have(1).notifications
+ expect(@run_context.delayed_notification_collection.size).to eq(1)
end
it "creates a delayed notification when :delayed is not specified" do
@resource.notifies(:run, @notified_resource, :delayed)
- @run_context.delayed_notification_collection.should have(1).notifications
+ expect(@run_context.delayed_notification_collection.size).to eq(1)
end
it "creates an immediate notification when :immediate is specified" do
@resource.notifies(:run, @notified_resource, :immediate)
- @run_context.immediate_notification_collection.should have(1).notifications
+ expect(@run_context.immediate_notification_collection.size).to eq(1)
end
it "creates an immediate notification when :immediately is specified" do
@resource.notifies(:run, @notified_resource, :immediately)
- @run_context.immediate_notification_collection.should have(1).notifications
+ expect(@run_context.immediate_notification_collection.size).to eq(1)
end
end
@@ -808,19 +837,19 @@ describe Chef::Resource do
end
it "set to false by default" do
- @resource.sensitive.should be_false
+ expect(@resource.sensitive).to be_falsey
end
it "when set to false should show compiled resource for failed resource" do
expect { @resource_file.run_action(@action) }.to raise_error { |err|
- compiled_resource_data(@resource_file, @action, err).should match 'path "/nonexistent/CHEF-5098/file"'
+ expect(compiled_resource_data(@resource_file, @action, err)).to match 'path "/nonexistent/CHEF-5098/file"'
}
end
it "when set to true should show compiled resource for failed resource" do
@resource_file.sensitive true
expect { @resource_file.run_action(@action) }.to raise_error { |err|
- compiled_resource_data(@resource_file, @action, err).should eql("suppressed sensitive resource output")
+ expect(compiled_resource_data(@resource_file, @action, err)).to eql("suppressed sensitive resource output")
}
end
@@ -833,34 +862,34 @@ describe Chef::Resource::Notification do
end
it "has a resource to be notified" do
- @notification.resource.should == :service_apache
+ expect(@notification.resource).to eq(:service_apache)
end
it "has an action to take on the service" do
- @notification.action.should == :restart
+ expect(@notification.action).to eq(:restart)
end
it "has a notifying resource" do
- @notification.notifying_resource.should == :template_httpd_conf
+ expect(@notification.notifying_resource).to eq(:template_httpd_conf)
end
it "is a duplicate of another notification with the same target resource and action" do
other = Chef::Resource::Notification.new(:service_apache, :restart, :sync_web_app_code)
- @notification.duplicates?(other).should be_true
+ expect(@notification.duplicates?(other)).to be_truthy
end
it "is not a duplicate of another notification if the actions differ" do
other = Chef::Resource::Notification.new(:service_apache, :enable, :install_apache)
- @notification.duplicates?(other).should be_false
+ expect(@notification.duplicates?(other)).to be_falsey
end
it "is not a duplicate of another notification if the target resources differ" do
other = Chef::Resource::Notification.new(:service_sshd, :restart, :template_httpd_conf)
- @notification.duplicates?(other).should be_false
+ expect(@notification.duplicates?(other)).to be_falsey
end
it "raises an ArgumentError if you try to check a non-ducktype object for duplication" do
- lambda {@notification.duplicates?(:not_a_notification)}.should raise_error(ArgumentError)
+ expect {@notification.duplicates?(:not_a_notification)}.to raise_error(ArgumentError)
end
it "takes no action to resolve a resource reference that doesn't need to be resolved" do
@@ -871,7 +900,7 @@ describe Chef::Resource::Notification do
@resource_collection = Chef::ResourceCollection.new
# would raise an error since the resource is not in the collection
@notification.resolve_resource_reference(@resource_collection)
- @notification.resource.should == @keyboard_cat
+ expect(@notification.resource).to eq(@keyboard_cat)
end
it "resolves a lazy reference to a resource" do
@@ -882,7 +911,7 @@ describe Chef::Resource::Notification do
@long_cat = Chef::Resource::Cat.new("long_cat")
@notification.notifying_resource = @long_cat
@notification.resolve_resource_reference(@resource_collection)
- @notification.resource.should == @keyboard_cat
+ expect(@notification.resource).to eq(@keyboard_cat)
end
it "resolves a lazy reference to its notifying resource" do
@@ -893,7 +922,7 @@ describe Chef::Resource::Notification do
@resource_collection = Chef::ResourceCollection.new
@resource_collection << @long_cat
@notification.resolve_resource_reference(@resource_collection)
- @notification.notifying_resource.should == @long_cat
+ expect(@notification.notifying_resource).to eq(@long_cat)
end
it "resolves lazy references to both its resource and its notifying resource" do
@@ -905,8 +934,8 @@ describe Chef::Resource::Notification do
@long_cat = Chef::Resource::Cat.new("long_cat")
@resource_collection << @long_cat
@notification.resolve_resource_reference(@resource_collection)
- @notification.resource.should == @keyboard_cat
- @notification.notifying_resource.should == @long_cat
+ expect(@notification.resource).to eq(@keyboard_cat)
+ expect(@notification.notifying_resource).to eq(@long_cat)
end
it "raises a RuntimeError if you try to reference multiple resources" do
@@ -918,7 +947,7 @@ describe Chef::Resource::Notification do
@resource_collection << @cheez_cat
@long_cat = Chef::Resource::Cat.new("long_cat")
@notification.notifying_resource = @long_cat
- lambda {@notification.resolve_resource_reference(@resource_collection)}.should raise_error(RuntimeError)
+ expect {@notification.resolve_resource_reference(@resource_collection)}.to raise_error(RuntimeError)
end
it "raises a RuntimeError if you try to reference multiple notifying resources" do
@@ -930,7 +959,7 @@ describe Chef::Resource::Notification do
@resource_collection << @cheez_cat
@keyboard_cat = Chef::Resource::Cat.new("keyboard_cat")
@notification.resource = @keyboard_cat
- lambda {@notification.resolve_resource_reference(@resource_collection)}.should raise_error(RuntimeError)
+ expect {@notification.resolve_resource_reference(@resource_collection)}.to raise_error(RuntimeError)
end
it "raises a RuntimeError if it can't find a resource in the resource collection when resolving a lazy reference" do
@@ -940,7 +969,7 @@ describe Chef::Resource::Notification do
@resource_collection << @cheez_cat
@long_cat = Chef::Resource::Cat.new("long_cat")
@notification.notifying_resource = @long_cat
- lambda {@notification.resolve_resource_reference(@resource_collection)}.should raise_error(RuntimeError)
+ expect {@notification.resolve_resource_reference(@resource_collection)}.to raise_error(RuntimeError)
end
it "raises a RuntimeError if it can't find a notifying resource in the resource collection when resolving a lazy reference" do
@@ -950,7 +979,7 @@ describe Chef::Resource::Notification do
@resource_collection << @cheez_cat
@keyboard_cat = Chef::Resource::Cat.new("keyboard_cat")
@notification.resource = @keyboard_cat
- lambda {@notification.resolve_resource_reference(@resource_collection)}.should raise_error(RuntimeError)
+ expect {@notification.resolve_resource_reference(@resource_collection)}.to raise_error(RuntimeError)
end
it "raises an ArgumentError if improper syntax is used in the lazy reference to its resource" do
@@ -960,7 +989,7 @@ describe Chef::Resource::Notification do
@resource_collection << @keyboard_cat
@long_cat = Chef::Resource::Cat.new("long_cat")
@notification.notifying_resource = @long_cat
- lambda {@notification.resolve_resource_reference(@resource_collection)}.should raise_error(ArgumentError)
+ expect {@notification.resolve_resource_reference(@resource_collection)}.to raise_error(ArgumentError)
end
it "raises an ArgumentError if improper syntax is used in the lazy reference to its notifying resource" do
@@ -970,7 +999,7 @@ describe Chef::Resource::Notification do
@resource_collection << @long_cat
@keyboard_cat = Chef::Resource::Cat.new("keyboard_cat")
@notification.resource = @keyboard_cat
- lambda {@notification.resolve_resource_reference(@resource_collection)}.should raise_error(ArgumentError)
+ expect {@notification.resolve_resource_reference(@resource_collection)}.to raise_error(ArgumentError)
end
# Create test to resolve lazy references to both notifying resource and dest. resource
diff --git a/spec/unit/rest/auth_credentials_spec.rb b/spec/unit/rest/auth_credentials_spec.rb
index 477da0faec..3465156b90 100644
--- a/spec/unit/rest/auth_credentials_spec.rb
+++ b/spec/unit/rest/auth_credentials_spec.rb
@@ -62,18 +62,18 @@ describe Chef::REST::AuthCredentials do
end
it "has a client name" do
- @auth_credentials.client_name.should == "client-name"
+ expect(@auth_credentials.client_name).to eq("client-name")
end
it "loads the private key when initialized with the path to the key" do
- @auth_credentials.key.should respond_to(:private_encrypt)
- @auth_credentials.key.to_s.should == KEY_DOT_PEM
+ expect(@auth_credentials.key).to respond_to(:private_encrypt)
+ expect(@auth_credentials.key.to_s).to eq(KEY_DOT_PEM)
end
describe "when loading the private key" do
it "strips extra whitespace before checking the key" do
key_file_fixture = CHEF_SPEC_DATA + '/ssl/private_key_with_whitespace.pem'
- lambda {Chef::REST::AuthCredentials.new("client-name", @key_file_fixture)}.should_not raise_error
+ expect {Chef::REST::AuthCredentials.new("client-name", @key_file_fixture)}.not_to raise_error
end
end
@@ -84,19 +84,19 @@ describe Chef::REST::AuthCredentials do
end
it "generates signature headers for the request" do
- Time.stub(:now).and_return(@request_time)
+ allow(Time).to receive(:now).and_return(@request_time)
actual = @auth_credentials.signature_headers(@request_params)
- actual["HOST"].should == "localhost"
- actual["X-OPS-AUTHORIZATION-1"].should == "kBssX1ENEwKtNYFrHElN9vYGWS7OeowepN9EsYc9csWfh8oUovryPKDxytQ/"
- actual["X-OPS-AUTHORIZATION-2"].should == "Wc2/nSSyxdWJjjfHzrE+YrqNQTaArOA7JkAf5p75eTUonCWcvNPjFrZVgKGS"
- actual["X-OPS-AUTHORIZATION-3"].should == "yhzHJQh+lcVA9wwARg5Hu9q+ddS8xBOdm3Vp5atl5NGHiP0loiigMYvAvzPO"
- actual["X-OPS-AUTHORIZATION-4"].should == "r9853eIxwYMhn5hLGhAGFQznJbE8+7F/lLU5Zmk2t2MlPY8q3o1Q61YD8QiJ"
- actual["X-OPS-AUTHORIZATION-5"].should == "M8lIt53ckMyUmSU0DDURoiXLVkE9mag/6Yq2tPNzWq2AdFvBqku9h2w+DY5k"
- actual["X-OPS-AUTHORIZATION-6"].should == "qA5Rnzw5rPpp3nrWA9jKkPw4Wq3+4ufO2Xs6w7GCjA=="
- actual["X-OPS-CONTENT-HASH"].should == "1tuzs5XKztM1ANrkGNPah6rW9GY="
- actual["X-OPS-SIGN"].should =~ %r{(version=1\.0)|(algorithm=sha1;version=1.0;)}
- actual["X-OPS-TIMESTAMP"].should == "2010-04-10T17:34:20Z"
- actual["X-OPS-USERID"].should == "client-name"
+ expect(actual["HOST"]).to eq("localhost")
+ expect(actual["X-OPS-AUTHORIZATION-1"]).to eq("kBssX1ENEwKtNYFrHElN9vYGWS7OeowepN9EsYc9csWfh8oUovryPKDxytQ/")
+ expect(actual["X-OPS-AUTHORIZATION-2"]).to eq("Wc2/nSSyxdWJjjfHzrE+YrqNQTaArOA7JkAf5p75eTUonCWcvNPjFrZVgKGS")
+ expect(actual["X-OPS-AUTHORIZATION-3"]).to eq("yhzHJQh+lcVA9wwARg5Hu9q+ddS8xBOdm3Vp5atl5NGHiP0loiigMYvAvzPO")
+ expect(actual["X-OPS-AUTHORIZATION-4"]).to eq("r9853eIxwYMhn5hLGhAGFQznJbE8+7F/lLU5Zmk2t2MlPY8q3o1Q61YD8QiJ")
+ expect(actual["X-OPS-AUTHORIZATION-5"]).to eq("M8lIt53ckMyUmSU0DDURoiXLVkE9mag/6Yq2tPNzWq2AdFvBqku9h2w+DY5k")
+ expect(actual["X-OPS-AUTHORIZATION-6"]).to eq("qA5Rnzw5rPpp3nrWA9jKkPw4Wq3+4ufO2Xs6w7GCjA==")
+ expect(actual["X-OPS-CONTENT-HASH"]).to eq("1tuzs5XKztM1ANrkGNPah6rW9GY=")
+ expect(actual["X-OPS-SIGN"]).to match(%r{(version=1\.0)|(algorithm=sha1;version=1.0;)})
+ expect(actual["X-OPS-TIMESTAMP"]).to eq("2010-04-10T17:34:20Z")
+ expect(actual["X-OPS-USERID"]).to eq("client-name")
end
@@ -110,13 +110,13 @@ describe Chef::REST::AuthCredentials do
end
it "generates the correct signature for version 1.1" do
- Time.stub(:now).and_return(@request_time)
+ allow(Time).to receive(:now).and_return(@request_time)
actual = @auth_credentials.signature_headers(@request_params)
- actual["HOST"].should == "localhost"
- actual["X-OPS-CONTENT-HASH"].should == "1tuzs5XKztM1ANrkGNPah6rW9GY="
- actual["X-OPS-SIGN"].should == "algorithm=sha1;version=1.1;"
- actual["X-OPS-TIMESTAMP"].should == "2010-04-10T17:34:20Z"
- actual["X-OPS-USERID"].should == "client-name"
+ expect(actual["HOST"]).to eq("localhost")
+ expect(actual["X-OPS-CONTENT-HASH"]).to eq("1tuzs5XKztM1ANrkGNPah6rW9GY=")
+ expect(actual["X-OPS-SIGN"]).to eq("algorithm=sha1;version=1.1;")
+ expect(actual["X-OPS-TIMESTAMP"]).to eq("2010-04-10T17:34:20Z")
+ expect(actual["X-OPS-USERID"]).to eq("client-name")
# mixlib-authN will test the actual signature stuff for each version of
# the protocol so we won't test it again here.
@@ -143,63 +143,63 @@ describe Chef::REST::RESTRequest do
end
it "stores the url it was created with" do
- @request.url.should == @url
+ expect(@request.url).to eq(@url)
end
it "stores the HTTP method" do
- @request.method.should == :POST
+ expect(@request.method).to eq(:POST)
end
it "adds the chef version header" do
- @request.headers.should == @headers.merge("X-Chef-Version" => ::Chef::VERSION)
+ expect(@request.headers).to eq(@headers.merge("X-Chef-Version" => ::Chef::VERSION))
end
describe "configuring the HTTP request" do
it "configures GET requests" do
@req_body = nil
rest_req = new_request(:GET)
- rest_req.http_request.should be_a_kind_of(Net::HTTP::Get)
- rest_req.http_request.path.should == "/?q=chef_is_awesome"
- rest_req.http_request.body.should be_nil
+ expect(rest_req.http_request).to be_a_kind_of(Net::HTTP::Get)
+ expect(rest_req.http_request.path).to eq("/?q=chef_is_awesome")
+ expect(rest_req.http_request.body).to be_nil
end
it "configures POST requests, including the body" do
- @request.http_request.should be_a_kind_of(Net::HTTP::Post)
- @request.http_request.path.should == "/?q=chef_is_awesome"
- @request.http_request.body.should == @req_body
+ expect(@request.http_request).to be_a_kind_of(Net::HTTP::Post)
+ expect(@request.http_request.path).to eq("/?q=chef_is_awesome")
+ expect(@request.http_request.body).to eq(@req_body)
end
it "configures PUT requests, including the body" do
rest_req = new_request(:PUT)
- rest_req.http_request.should be_a_kind_of(Net::HTTP::Put)
- rest_req.http_request.path.should == "/?q=chef_is_awesome"
- rest_req.http_request.body.should == @req_body
+ expect(rest_req.http_request).to be_a_kind_of(Net::HTTP::Put)
+ expect(rest_req.http_request.path).to eq("/?q=chef_is_awesome")
+ expect(rest_req.http_request.body).to eq(@req_body)
end
it "configures DELETE requests" do
rest_req = new_request(:DELETE)
- rest_req.http_request.should be_a_kind_of(Net::HTTP::Delete)
- rest_req.http_request.path.should == "/?q=chef_is_awesome"
- rest_req.http_request.body.should be_nil
+ expect(rest_req.http_request).to be_a_kind_of(Net::HTTP::Delete)
+ expect(rest_req.http_request.path).to eq("/?q=chef_is_awesome")
+ expect(rest_req.http_request.body).to be_nil
end
it "configures HTTP basic auth" do
@url = URI.parse("http://homie:theclown@chef.example.com:4000/?q=chef_is_awesome")
rest_req = new_request(:GET)
- rest_req.http_request.to_hash["authorization"].should == ["Basic aG9taWU6dGhlY2xvd24="]
+ expect(rest_req.http_request.to_hash["authorization"]).to eq(["Basic aG9taWU6dGhlY2xvd24="])
end
end
describe "configuring the HTTP client" do
it "configures the HTTP client for the host and port" do
http_client = new_request.http_client
- http_client.address.should == "chef.example.com"
- http_client.port.should == 4000
+ expect(http_client.address).to eq("chef.example.com")
+ expect(http_client.port).to eq(4000)
end
it "configures the HTTP client with the read timeout set in the config file" do
Chef::Config[:rest_timeout] = 9001
- new_request.http_client.read_timeout.should == 9001
+ expect(new_request.http_client.read_timeout).to eq(9001)
end
describe "for proxy" do
@@ -226,21 +226,21 @@ describe Chef::REST::RESTRequest do
describe "with :no_proxy nil" do
it "configures the proxy address and port when using http scheme" do
http_client = new_request.http_client
- http_client.proxy?.should == true
- http_client.proxy_address.should == "proxy.example.com"
- http_client.proxy_port.should == 3128
- http_client.proxy_user.should be_nil
- http_client.proxy_pass.should be_nil
+ expect(http_client.proxy?).to eq(true)
+ expect(http_client.proxy_address).to eq("proxy.example.com")
+ expect(http_client.proxy_port).to eq(3128)
+ expect(http_client.proxy_user).to be_nil
+ expect(http_client.proxy_pass).to be_nil
end
it "configures the proxy address and port when using https scheme" do
@url.scheme = "https"
http_client = new_request.http_client
- http_client.proxy?.should == true
- http_client.proxy_address.should == "sproxy.example.com"
- http_client.proxy_port.should == 3129
- http_client.proxy_user.should be_nil
- http_client.proxy_pass.should be_nil
+ expect(http_client.proxy?).to eq(true)
+ expect(http_client.proxy_address).to eq("sproxy.example.com")
+ expect(http_client.proxy_port).to eq(3129)
+ expect(http_client.proxy_user).to be_nil
+ expect(http_client.proxy_pass).to be_nil
end
end
@@ -251,21 +251,21 @@ describe Chef::REST::RESTRequest do
it "does not configure the proxy address and port when using http scheme" do
http_client = new_request.http_client
- http_client.proxy?.should == false
- http_client.proxy_address.should be_nil
- http_client.proxy_port.should be_nil
- http_client.proxy_user.should be_nil
- http_client.proxy_pass.should be_nil
+ expect(http_client.proxy?).to eq(false)
+ expect(http_client.proxy_address).to be_nil
+ expect(http_client.proxy_port).to be_nil
+ expect(http_client.proxy_user).to be_nil
+ expect(http_client.proxy_pass).to be_nil
end
it "does not configure the proxy address and port when using https scheme" do
@url.scheme = "https"
http_client = new_request.http_client
- http_client.proxy?.should == false
- http_client.proxy_address.should be_nil
- http_client.proxy_port.should be_nil
- http_client.proxy_user.should be_nil
- http_client.proxy_pass.should be_nil
+ expect(http_client.proxy?).to eq(false)
+ expect(http_client.proxy_address).to be_nil
+ expect(http_client.proxy_port).to be_nil
+ expect(http_client.proxy_user).to be_nil
+ expect(http_client.proxy_pass).to be_nil
end
end
@@ -282,17 +282,17 @@ describe Chef::REST::RESTRequest do
it "configures the proxy user and pass when using http scheme" do
http_client = new_request.http_client
- http_client.proxy?.should == true
- http_client.proxy_user.should == "homie"
- http_client.proxy_pass.should == "theclown"
+ expect(http_client.proxy?).to eq(true)
+ expect(http_client.proxy_user).to eq("homie")
+ expect(http_client.proxy_pass).to eq("theclown")
end
it "does not configure the proxy user and pass when using https scheme" do
@url.scheme = "https"
http_client = new_request.http_client
- http_client.proxy?.should == true
- http_client.proxy_user.should be_nil
- http_client.proxy_pass.should be_nil
+ expect(http_client.proxy?).to eq(true)
+ expect(http_client.proxy_user).to be_nil
+ expect(http_client.proxy_pass).to be_nil
end
end
@@ -309,17 +309,17 @@ describe Chef::REST::RESTRequest do
it "does not configure the proxy user and pass when using http scheme" do
http_client = new_request.http_client
- http_client.proxy?.should == true
- http_client.proxy_user.should be_nil
- http_client.proxy_pass.should be_nil
+ expect(http_client.proxy?).to eq(true)
+ expect(http_client.proxy_user).to be_nil
+ expect(http_client.proxy_pass).to be_nil
end
it "configures the proxy user and pass when using https scheme" do
@url.scheme = "https"
http_client = new_request.http_client
- http_client.proxy?.should == true
- http_client.proxy_user.should == "homie"
- http_client.proxy_pass.should == "theclown"
+ expect(http_client.proxy?).to eq(true)
+ expect(http_client.proxy_user).to eq("homie")
+ expect(http_client.proxy_pass).to eq("theclown")
end
end
end
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb
index 424fd12ee9..1aa7ac84ee 100644
--- a/spec/unit/rest_spec.rb
+++ b/spec/unit/rest_spec.rb
@@ -62,8 +62,8 @@ describe Chef::REST do
let(:request_id) {"1234"}
let(:rest) do
- Chef::REST::CookieJar.stub(:instance).and_return({})
- Chef::RequestID.instance.stub(:request_id).and_return(request_id)
+ allow(Chef::REST::CookieJar).to receive(:instance).and_return({})
+ allow(Chef::RequestID.instance).to receive(:request_id).and_return(request_id)
rest = Chef::REST.new(base_url, nil, nil)
Chef::REST::CookieJar.instance.clear
rest
@@ -81,9 +81,9 @@ describe Chef::REST do
content_length = middlewares.find_index { |e| e.is_a? Chef::HTTP::ValidateContentLength }
decompressor = middlewares.find_index { |e| e.is_a? Chef::HTTP::Decompressor }
- content_length.should_not be_nil
- decompressor.should_not be_nil
- (decompressor < content_length).should be_true
+ expect(content_length).not_to be_nil
+ expect(decompressor).not_to be_nil
+ expect(decompressor < content_length).to be_truthy
end
it "should allow the options hash to be frozen" do
@@ -102,43 +102,43 @@ describe Chef::REST do
end
it "makes a :GET request with the composed url object" do
- rest.should_receive(:send_http_request).
+ expect(rest).to receive(:send_http_request).
with(:GET, monkey_uri, standard_read_headers, false).
and_return([1,2,3])
- rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
- rest.should_receive('success_response?'.to_sym).with(1).and_return(true)
+ expect(rest).to receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
+ expect(rest).to receive('success_response?'.to_sym).with(1).and_return(true)
rest.get_rest("monkey")
end
it "makes a :GET reqest for a streaming download with the composed url" do
- rest.should_receive(:streaming_request).with('monkey', {})
+ expect(rest).to receive(:streaming_request).with('monkey', {})
rest.get_rest("monkey", true)
end
it "makes a :DELETE request with the composed url object" do
- rest.should_receive(:send_http_request).
+ expect(rest).to receive(:send_http_request).
with(:DELETE, monkey_uri, standard_read_headers, false).
and_return([1,2,3])
- rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
- rest.should_receive('success_response?'.to_sym).with(1).and_return(true)
+ expect(rest).to receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
+ expect(rest).to receive('success_response?'.to_sym).with(1).and_return(true)
rest.delete_rest("monkey")
end
it "makes a :POST request with the composed url object and data" do
- rest.should_receive(:send_http_request).
+ expect(rest).to receive(:send_http_request).
with(:POST, monkey_uri, standard_write_headers, "\"data\"").
and_return([1,2,3])
- rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
- rest.should_receive('success_response?'.to_sym).with(1).and_return(true)
+ expect(rest).to receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
+ expect(rest).to receive('success_response?'.to_sym).with(1).and_return(true)
rest.post_rest("monkey", "data")
end
it "makes a :PUT request with the composed url object and data" do
- rest.should_receive(:send_http_request).
+ expect(rest).to receive(:send_http_request).
with(:PUT, monkey_uri, standard_write_headers, "\"data\"").
and_return([1,2,3])
- rest.should_receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
- rest.should_receive('success_response?'.to_sym).with(1).and_return(true)
+ expect(rest).to receive(:apply_response_middleware).with(1,2,3).and_return([1,2,3])
+ expect(rest).to receive('success_response?'.to_sym).with(1).and_return(true)
rest.put_rest("monkey", "data")
end
end
@@ -162,13 +162,13 @@ describe Chef::REST do
auth_headers = standard_write_headers.merge({"auth_done"=>"yep"})
- rest.authenticator.should_receive(:handle_request).
+ expect(rest.authenticator).to receive(:handle_request).
with(:POST, monkey_uri, standard_write_headers, data).
and_return([:POST, monkey_uri, auth_headers, data])
- rest.should_receive(:send_http_request).
+ expect(rest).to receive(:send_http_request).
with(:POST, monkey_uri, auth_headers, data).
and_return([1,2,3])
- rest.should_receive('success_response?'.to_sym).with(1).and_return(true)
+ expect(rest).to receive('success_response?'.to_sym).with(1).and_return(true)
rest.raw_http_request(:POST, monkey_uri, standard_write_headers, data)
end
@@ -176,10 +176,10 @@ describe Chef::REST do
data = "\"secure data\""
method, uri, auth_headers, d = rest.authenticator.handle_request(:POST, monkey_uri, standard_write_headers, data)
- rest.should_receive(:send_http_request).
+ expect(rest).to receive(:send_http_request).
with(:POST, monkey_uri, auth_headers, data).
and_return([1,2,3])
- rest.should_receive('success_response?'.to_sym).with(1).and_return(true)
+ expect(rest).to receive('success_response?'.to_sym).with(1).and_return(true)
rest.raw_http_request(:POST, monkey_uri, standard_write_headers, data)
end
end
@@ -214,7 +214,7 @@ describe Chef::REST do
it "indicates that requests should not be signed when it has no credentials" do
rest = Chef::REST.new(base_url, nil, nil)
- expect(rest.sign_requests?).to be_false
+ expect(rest.sign_requests?).to be_falsey
end
it "raises PrivateKeyMissing when the key file doesn't exist" do
@@ -241,8 +241,8 @@ describe Chef::REST do
let(:http_response) do
http_response = Net::HTTPSuccess.new("1.1", "200", "successful rest req")
- http_response.stub(:read_body)
- http_response.stub(:body).and_return(body)
+ allow(http_response).to receive(:read_body)
+ allow(http_response).to receive(:body).and_return(body)
http_response["Content-Length"] = body.bytesize.to_s
http_response
end
@@ -255,14 +255,14 @@ describe Chef::REST do
let!(:http_client) do
http_client = Net::HTTP.new(url.host, url.port)
- http_client.stub(:request).and_yield(http_response).and_return(http_response)
+ allow(http_client).to receive(:request).and_yield(http_response).and_return(http_response)
http_client
end
let(:rest) do
- Net::HTTP.stub(:new).and_return(http_client)
- Chef::REST::CookieJar.stub(:instance).and_return({})
- Chef::RequestID.instance.stub(:request_id).and_return(request_id)
+ allow(Net::HTTP).to receive(:new).and_return(http_client)
+ allow(Chef::REST::CookieJar).to receive(:instance).and_return({})
+ allow(Chef::RequestID.instance).to receive(:request_id).and_return(request_id)
rest = Chef::REST.new(base_url, nil, nil)
Chef::REST::CookieJar.instance.clear
rest
@@ -300,16 +300,16 @@ describe Chef::REST do
end
before do
- Net::HTTP::Get.stub(:new).and_return(request_mock)
+ allow(Net::HTTP::Get).to receive(:new).and_return(request_mock)
end
it "should always include the X-Chef-Version header" do
- Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
+ expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
rest.request(:GET, url, {})
end
it "should always include the X-Remote-Request-Id header" do
- Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
+ expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
rest.request(:GET, url, {})
end
@@ -323,7 +323,7 @@ describe Chef::REST do
# CHEF-3140
context "when configured to disable compression" do
let(:rest) do
- Net::HTTP.stub(:new).and_return(http_client)
+ allow(Net::HTTP).to receive(:new).and_return(http_client)
Chef::REST.new(base_url, nil, nil, :disable_gzip => true)
end
@@ -334,7 +334,7 @@ describe Chef::REST do
it "does not decompress a response encoded as gzip" do
http_response.add_field("content-encoding", "gzip")
request = Net::HTTP::Get.new(url.path)
- Net::HTTP::Get.should_receive(:new).and_return(request)
+ expect(Net::HTTP::Get).to receive(:new).and_return(request)
# will raise a Zlib error if incorrect
expect(rest.request(:GET, url, {})).to eq("ninja")
end
@@ -359,28 +359,28 @@ describe Chef::REST do
it "should set them on the http request" do
url_string = an_instance_of(String)
header_hash = hash_including(custom_headers)
- Net::HTTP::Get.should_receive(:new).with(url_string, header_hash)
+ expect(Net::HTTP::Get).to receive(:new).with(url_string, header_hash)
rest.request(:GET, url, {})
end
end
context "when setting cookies" do
let(:rest) do
- Net::HTTP.stub(:new).and_return(http_client)
+ allow(Net::HTTP).to receive(:new).and_return(http_client)
Chef::REST::CookieJar.instance["#{url.host}:#{url.port}"] = "cookie monster"
- Chef::RequestID.instance.stub(:request_id).and_return(request_id)
+ allow(Chef::RequestID.instance).to receive(:request_id).and_return(request_id)
rest = Chef::REST.new(base_url, nil, nil)
rest
end
it "should set the cookie for this request if one exists for the given host:port" do
- Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers.merge('Cookie' => "cookie monster")).and_return(request_mock)
+ expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", base_headers.merge('Cookie' => "cookie monster")).and_return(request_mock)
rest.request(:GET, url, {})
end
end
it "should build a new HTTP GET request" do
- Net::HTTP::Get.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
+ expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
rest.request(:GET, url, {})
end
@@ -388,7 +388,7 @@ describe Chef::REST do
request = Net::HTTP::Post.new(url.path)
expected_headers = base_headers.merge("Content-Type" => 'application/json', 'Content-Length' => '13')
- Net::HTTP::Post.should_receive(:new).with("/?foo=bar", expected_headers).and_return(request)
+ expect(Net::HTTP::Post).to receive(:new).with("/?foo=bar", expected_headers).and_return(request)
rest.request(:POST, url, {}, {:one=>:two})
expect(request.body).to eq('{"one":"two"}')
end
@@ -396,13 +396,13 @@ describe Chef::REST do
it "should build a new HTTP PUT request" do
request = Net::HTTP::Put.new(url.path)
expected_headers = base_headers.merge("Content-Type" => 'application/json', 'Content-Length' => '13')
- Net::HTTP::Put.should_receive(:new).with("/?foo=bar",expected_headers).and_return(request)
+ expect(Net::HTTP::Put).to receive(:new).with("/?foo=bar",expected_headers).and_return(request)
rest.request(:PUT, url, {}, {:one=>:two})
expect(request.body).to eq('{"one":"two"}')
end
it "should build a new HTTP DELETE request" do
- Net::HTTP::Delete.should_receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
+ expect(Net::HTTP::Delete).to receive(:new).with("/?foo=bar", base_headers).and_return(request_mock)
rest.request(:DELETE, url)
end
@@ -440,7 +440,7 @@ describe Chef::REST do
resp_code = Net::HTTPResponse::CODE_TO_OBJ.keys.detect { |k| Net::HTTPResponse::CODE_TO_OBJ[k] == resp_cls }
http_response = Net::HTTPFound.new("1.1", resp_code, "bob is somewhere else again")
http_response.add_field("location", url.path)
- http_response.stub(:read_body)
+ allow(http_response).to receive(:read_body)
http_response
end
it "should call request again" do
@@ -457,12 +457,12 @@ describe Chef::REST do
context "when the response is 304 NotModified" do
let (:http_response) do
http_response = Net::HTTPNotModified.new("1.1", "304", "it's the same as when you asked 5 minutes ago")
- http_response.stub(:read_body)
+ allow(http_response).to receive(:read_body)
http_response
end
it "should return `false`" do
- expect(rest.request(:GET, url)).to be_false
+ expect(rest.request(:GET, url)).to be_falsey
end
end
@@ -480,13 +480,13 @@ describe Chef::REST do
let(:http_response) do
http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth")
http_response.add_field("content-type", "application/json")
- http_response.stub(:body).and_return('{ "error":[ "Ears get sore!", "Not even four" ] }')
- http_response.stub(:read_body)
+ allow(http_response).to receive(:body).and_return('{ "error":[ "Ears get sore!", "Not even four" ] }')
+ allow(http_response).to receive(:read_body)
http_response
end
it "should show the JSON error message" do
- rest.stub(:sleep)
+ allow(rest).to receive(:sleep)
expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError)
expect(log_stringio.string).to match(Regexp.escape('INFO: HTTP Request Returned 500 drooling from inside of mouth: Ears get sore!, Not even four'))
@@ -502,17 +502,21 @@ describe Chef::REST do
gzipped_body = Zlib::Deflate.deflate(unzipped_body)
gzipped_body.force_encoding(Encoding::BINARY) if "strings".respond_to?(:force_encoding)
- http_response.stub(:body).and_return gzipped_body
- http_response.stub(:read_body)
+ allow(http_response).to receive(:body).and_return gzipped_body
+ allow(http_response).to receive(:read_body)
http_response
end
- it "decompresses the JSON error message" do
- rest.stub(:sleep)
- rest.stub(:http_retry_count).and_return(0)
+ before do
+ allow(rest).to receive(:sleep)
+ allow(rest).to receive(:http_retry_count).and_return(0)
+ end
+
+ it "decompresses the JSON error message" do
expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError)
expect(log_stringio.string).to match(Regexp.escape('INFO: HTTP Request Returned 500 drooling from inside of mouth: Ears get sore!, Not even four'))
end
+
it "fails when the compressed body is truncated" do
http_response["Content-Length"] = (body.bytesize + 99).to_s
expect {rest.request(:GET, url)}.to raise_error(Chef::Exceptions::ContentLengthMismatch)
@@ -522,13 +526,13 @@ describe Chef::REST do
context "on a generic unsuccessful request" do
let(:http_response) do
http_response = Net::HTTPServerError.new("1.1", "500", "drooling from inside of mouth")
- http_response.stub(:body)
- http_response.stub(:read_body)
+ allow(http_response).to receive(:body)
+ allow(http_response).to receive(:read_body)
http_response
end
it "retries then throws an exception" do
- rest.stub(:sleep)
+ allow(rest).to receive(:sleep)
expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError)
count = Chef::Config[:http_retry_count]
expect(log_stringio.string).to match(Regexp.escape("ERROR: Server returned error 500 for #{url}, retrying #{count}/#{count}"))
@@ -545,8 +549,8 @@ describe Chef::REST do
let(:http_response) do
http_response = Net::HTTPSuccess.new("1.1",'200', "it-works")
- http_response.stub(:read_body)
- http_response.should_not_receive(:body)
+ allow(http_response).to receive(:read_body)
+ expect(http_response).not_to receive(:body)
http_response["Content-Length"] = "0" # call set_content_length (in test), if otherwise
http_response
end
@@ -560,8 +564,8 @@ describe Chef::REST do
end
before do
- Tempfile.stub(:new).with("chef-rest").and_return(tempfile)
- Net::HTTP::Get.stub(:new).and_return(request_mock)
+ allow(Tempfile).to receive(:new).with("chef-rest").and_return(tempfile)
+ allow(Net::HTTP::Get).to receive(:new).and_return(request_mock)
end
after do
@@ -575,7 +579,7 @@ describe Chef::REST do
'Host' => host_header,
'X-REMOTE-REQUEST-ID'=> request_id
}
- Net::HTTP::Get.should_receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock)
+ expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock)
rest.streaming_request(url, {})
end
@@ -586,7 +590,7 @@ describe Chef::REST do
'Host' => host_header,
'X-REMOTE-REQUEST-ID'=> request_id
}
- Net::HTTP::Get.should_receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock)
+ expect(Net::HTTP::Get).to receive(:new).with("/?foo=bar", expected_headers).and_return(request_mock)
rest.streaming_request(url, {})
end
@@ -595,7 +599,7 @@ describe Chef::REST do
end
it "writes the response body to a tempfile" do
- http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power")
+ allow(http_response).to receive(:read_body).and_yield("real").and_yield("ultimate").and_yield("power")
set_content_length
rest.streaming_request(url, {})
expect(IO.read(tempfile.path).chomp).to eq("realultimatepower")
@@ -607,79 +611,79 @@ describe Chef::REST do
end
it "yields the tempfile containing the streamed response body and then unlinks it when given a block" do
- http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power")
+ allow(http_response).to receive(:read_body).and_yield("real").and_yield("ultimate").and_yield("power")
set_content_length
tempfile_path = nil
rest.streaming_request(url, {}) do |tempfile|
tempfile_path = tempfile.path
- expect(File.exist?(tempfile.path)).to be_true
+ expect(File.exist?(tempfile.path)).to be_truthy
expect(IO.read(tempfile.path).chomp).to eq("realultimatepower")
end
- expect(File.exist?(tempfile_path)).to be_false
+ expect(File.exist?(tempfile_path)).to be_falsey
end
it "does not raise a divide by zero exception if the content's actual size is 0" do
http_response['Content-Length'] = "5"
- http_response.stub(:read_body).and_yield('')
+ allow(http_response).to receive(:read_body).and_yield('')
expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
end
it "does not raise a divide by zero exception when the Content-Length is 0" do
http_response['Content-Length'] = "0"
- http_response.stub(:read_body).and_yield("ninja")
+ allow(http_response).to receive(:read_body).and_yield("ninja")
expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
end
it "it raises an exception when the download is truncated" do
http_response["Content-Length"] = (body.bytesize + 99).to_s
- http_response.stub(:read_body).and_yield("ninja")
+ allow(http_response).to receive(:read_body).and_yield("ninja")
expect { rest.streaming_request(url, {}) }.to raise_error(Chef::Exceptions::ContentLengthMismatch)
end
it "fetches a file and yields the tempfile it is streamed to" do
- http_response.stub(:read_body).and_yield("real").and_yield("ultimate").and_yield("power")
+ allow(http_response).to receive(:read_body).and_yield("real").and_yield("ultimate").and_yield("power")
set_content_length
tempfile_path = nil
rest.fetch("cookbooks/a_cookbook") do |tempfile|
tempfile_path = tempfile.path
expect(IO.read(tempfile.path).chomp).to eq("realultimatepower")
end
- expect(File.exist?(tempfile_path)).to be_false
+ expect(File.exist?(tempfile_path)).to be_falsey
end
it "closes and unlinks the tempfile if there is an error while streaming the content to the tempfile" do
path = tempfile.path
expect(path).not_to be_nil
- tempfile.stub(:write).and_raise(IOError)
+ allow(tempfile).to receive(:write).and_raise(IOError)
rest.fetch("cookbooks/a_cookbook") {|tmpfile| "shouldn't get here"}
- expect(File.exists?(path)).to be_false
+ expect(File.exists?(path)).to be_falsey
end
it "closes and unlinks the tempfile when the response is a redirect" do
tempfile = double("A tempfile", :path => "/tmp/ragefist", :close => true, :binmode => true)
- tempfile.should_receive(:close!).at_least(1).times
- Tempfile.stub(:new).with("chef-rest").and_return(tempfile)
+ expect(tempfile).to receive(:close!).at_least(1).times
+ allow(Tempfile).to receive(:new).with("chef-rest").and_return(tempfile)
redirect = Net::HTTPFound.new("1.1", "302", "bob is taking care of that one for me today")
redirect.add_field("location", url.path)
- redirect.stub(:read_body)
+ allow(redirect).to receive(:read_body)
- http_client.should_receive(:request).and_yield(redirect).and_return(redirect)
- http_client.should_receive(:request).and_yield(http_response).and_return(http_response)
+ expect(http_client).to receive(:request).and_yield(redirect).and_return(redirect)
+ expect(http_client).to receive(:request).and_yield(http_response).and_return(http_response)
rest.fetch("cookbooks/a_cookbook") {|tmpfile| "shouldn't get here"}
end
it "passes the original block to the redirected request" do
http_redirect = Net::HTTPFound.new("1.1", "302", "bob is taking care of that one for me today")
http_redirect.add_field("location","/that-thing-is-here-now")
- http_redirect.stub(:read_body)
+ allow(http_redirect).to receive(:read_body)
block_called = false
- http_client.stub(:request).and_yield(http_response).and_return(http_redirect, http_response)
+ allow(http_client).to receive(:request).and_yield(http_response).and_return(http_redirect, http_response)
rest.fetch("cookbooks/a_cookbook") do |tmpfile|
block_called = true
end
- expect(block_called).to be_true
+ expect(block_called).to be_truthy
end
end
end
@@ -714,15 +718,15 @@ describe Chef::REST do
it "does not sign the redirected request when sign_on_redirect is false" do
rest.sign_on_redirect = false
- rest.follow_redirect { expect(rest.sign_requests?).to be_false }
+ rest.follow_redirect { expect(rest.sign_requests?).to be_falsey }
end
it "resets sign_requests to the original value after following an unsigned redirect" do
rest.sign_on_redirect = false
- expect(rest.sign_requests?).to be_true
+ expect(rest.sign_requests?).to be_truthy
- rest.follow_redirect { expect(rest.sign_requests?).to be_false }
- expect(rest.sign_requests?).to be_true
+ rest.follow_redirect { expect(rest.sign_requests?).to be_falsey }
+ expect(rest.sign_requests?).to be_truthy
end
it "configures the redirect limit" do
diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb
index 1a108c4247..5421b5a7b3 100644
--- a/spec/unit/role_spec.rb
+++ b/spec/unit/role_spec.rb
@@ -21,21 +21,21 @@ require 'chef/role'
describe Chef::Role do
before(:each) do
- Chef::Platform.stub(:windows?) { false }
+ allow(Chef::Platform).to receive(:windows?) { false }
@role = Chef::Role.new
@role.name("ops_master")
end
it "has a name" do
- @role.name("ops_master").should == "ops_master"
+ expect(@role.name("ops_master")).to eq("ops_master")
end
it "does not accept a name with spaces" do
- lambda { @role.name "ops master" }.should raise_error(ArgumentError)
+ expect { @role.name "ops master" }.to raise_error(ArgumentError)
end
it "does not accept non-String objects for the name" do
- lambda { @role.name({}) }.should raise_error(ArgumentError)
+ expect { @role.name({}) }.to raise_error(ArgumentError)
end
describe "when a run list is set" do
@@ -46,7 +46,7 @@ describe Chef::Role do
it "returns the run list" do
- @role.run_list.should == %w{ nginx recipe[ree] role[base]}
+ expect(@role.run_list).to eq(%w{ nginx recipe[ree] role[base]})
end
describe "and per-environment run lists are set" do
@@ -58,28 +58,28 @@ describe Chef::Role do
end
it "uses the default run list as *the* run_list" do
- @role.run_list.should == Chef::RunList.new("recipe[nagios::client]", "recipe[tims-acl::bork]")
+ expect(@role.run_list).to eq(Chef::RunList.new("recipe[nagios::client]", "recipe[tims-acl::bork]"))
end
it "gives the default run list as the when getting the _default run list" do
- @role.run_list_for("_default").should == @role.run_list
+ expect(@role.run_list_for("_default")).to eq(@role.run_list)
end
it "gives an environment specific run list" do
- @role.run_list_for("prod").should == Chef::RunList.new("recipe[nagios::client]", "recipe[tims-acl::bork]", "recipe[prod-base]")
+ expect(@role.run_list_for("prod")).to eq(Chef::RunList.new("recipe[nagios::client]", "recipe[tims-acl::bork]", "recipe[prod-base]"))
end
it "gives the default run list when no run list exists for the given environment" do
- @role.run_list_for("qa").should == @role.run_list
+ expect(@role.run_list_for("qa")).to eq(@role.run_list)
end
it "gives the environment specific run list even if it is empty" do
- @role.run_list_for("dev").should == Chef::RunList.new
+ expect(@role.run_list_for("dev")).to eq(Chef::RunList.new)
end
it "env_run_lists can only be set with _default run list in it" do
long_exception_name = Chef::Exceptions::InvalidEnvironmentRunListSpecification
- lambda {@role.env_run_lists({})}.should raise_error(long_exception_name)
+ expect {@role.env_run_lists({})}.to raise_error(long_exception_name)
end
end
@@ -87,17 +87,17 @@ describe Chef::Role do
describe "using the old #recipes API" do
it "should let you set the recipe array" do
- @role.recipes([ "one", "two" ]).should == [ "one", "two" ]
+ expect(@role.recipes([ "one", "two" ])).to eq([ "one", "two" ])
end
it "should let you return the recipe array" do
@role.recipes([ "one", "two" ])
- @role.recipes.should == [ "one", "two" ]
+ expect(@role.recipes).to eq([ "one", "two" ])
end
it "should not list roles in the recipe array" do
@role.run_list([ "one", "role[two]"])
- @role.recipes.should == [ "recipe[one]", "role[two]" ]
+ expect(@role.recipes).to eq([ "recipe[one]", "role[two]" ])
end
end
@@ -108,31 +108,31 @@ describe Chef::Role do
describe "default_attributes" do
it "should let you set the default attributes hash explicitly" do
- @role.default_attributes({ :one => 'two' }).should == { :one => 'two' }
+ expect(@role.default_attributes({ :one => 'two' })).to eq({ :one => 'two' })
end
it "should let you return the default attributes hash" do
@role.default_attributes({ :one => 'two' })
- @role.default_attributes.should == { :one => 'two' }
+ expect(@role.default_attributes).to eq({ :one => 'two' })
end
it "should throw an ArgumentError if we aren't a kind of hash" do
- lambda { @role.default_attributes(Array.new) }.should raise_error(ArgumentError)
+ expect { @role.default_attributes(Array.new) }.to raise_error(ArgumentError)
end
end
describe "override_attributes" do
it "should let you set the override attributes hash explicitly" do
- @role.override_attributes({ :one => 'two' }).should == { :one => 'two' }
+ expect(@role.override_attributes({ :one => 'two' })).to eq({ :one => 'two' })
end
it "should let you return the override attributes hash" do
@role.override_attributes({ :one => 'two' })
- @role.override_attributes.should == { :one => 'two' }
+ expect(@role.override_attributes).to eq({ :one => 'two' })
end
it "should throw an ArgumentError if we aren't a kind of hash" do
- lambda { @role.override_attributes(Array.new) }.should raise_error(ArgumentError)
+ expect { @role.override_attributes(Array.new) }.to raise_error(ArgumentError)
end
end
@@ -154,11 +154,11 @@ describe Chef::Role do
it "should update all fields except for name" do
@role.update_from!(@example)
- @role.name.should == "mars_volta"
- @role.description.should == @example.description
- @role.run_list.should == @example.run_list
- @role.default_attributes.should == @example.default_attributes
- @role.override_attributes.should == @example.override_attributes
+ expect(@role.name).to eq("mars_volta")
+ expect(@role.description).to eq(@example.description)
+ expect(@role.run_list).to eq(@example.run_list)
+ expect(@role.default_attributes).to eq(@example.default_attributes)
+ expect(@role.override_attributes).to eq(@example.override_attributes)
end
end
@@ -173,29 +173,29 @@ describe Chef::Role do
end
it "should serialize to a json hash" do
- Chef::JSONCompat.to_json(@role).should match(/^\{.+\}$/)
+ expect(Chef::JSONCompat.to_json(@role)).to match(/^\{.+\}$/)
end
it "includes the name in the JSON output" do
- @serialized_role.should =~ /"name":"mars_volta"/
+ expect(@serialized_role).to match(/"name":"mars_volta"/)
end
it "includes its description in the JSON" do
- @serialized_role.should match(/"description":"Great band!"/)
+ expect(@serialized_role).to match(/"description":"Great band!"/)
end
it "should include 'default_attributes'" do
- @serialized_role.should =~ /"default_attributes":\{"el_groupo":"nuevo"\}/
+ expect(@serialized_role).to match(/"default_attributes":\{"el_groupo":"nuevo"\}/)
end
it "should include 'override_attributes'" do
- @serialized_role.should =~ /"override_attributes":\{"deloused":"in the comatorium"\}/
+ expect(@serialized_role).to match(/"override_attributes":\{"deloused":"in the comatorium"\}/)
end
it "should include 'run_list'" do
#Activesupport messes with Chef json formatting
#This test should pass with and without activesupport
- @serialized_role.should =~ /"run_list":\["recipe\[one\]","recipe\[two\]","role\[a\]"\]/
+ expect(@serialized_role).to match(/"run_list":\["recipe\[one\]","recipe\[two\]","role\[a\]"\]/)
end
describe "and it has per-environment run lists" do
@@ -207,12 +207,12 @@ describe Chef::Role do
it "includes the per-environment run lists" do
#Activesupport messes with Chef json formatting
#This test should pass with and without activesupport
- @serialized_role["env_run_lists"]["production"].should == ['role[monitoring]', 'role[auditing]', 'role[apache]']
- @serialized_role["env_run_lists"]["dev"].should == ["role[nginx]"]
+ expect(@serialized_role["env_run_lists"]["production"]).to eq(['role[monitoring]', 'role[auditing]', 'role[apache]'])
+ expect(@serialized_role["env_run_lists"]["dev"]).to eq(["role[nginx]"])
end
it "does not include the default environment in the per-environment run lists" do
- @serialized_role["env_run_lists"].should_not have_key("_default")
+ expect(@serialized_role["env_run_lists"]).not_to have_key("_default")
end
end
@@ -233,7 +233,7 @@ describe Chef::Role do
end
it "should deserialize to a Chef::Role object" do
- @deserial.should be_a_kind_of(Chef::Role)
+ expect(@deserial).to be_a_kind_of(Chef::Role)
end
%w{
@@ -244,7 +244,7 @@ describe Chef::Role do
run_list
}.each do |t|
it "should preserves the '#{t}' attribute from the JSON object" do
- @deserial.send(t.to_sym).should == @role.send(t.to_sym)
+ expect(@deserial.send(t.to_sym)).to eq(@role.send(t.to_sym))
end
end
end
@@ -257,56 +257,57 @@ EOR
describe "when loading from disk" do
before do
default_cache_path = windows? ? 'C:\chef' : '/var/chef'
- Chef::Config.stub(:cache_path).and_return(default_cache_path)
+ allow(Chef::Config).to receive(:cache_path).and_return(default_cache_path)
end
it "should return a Chef::Role object from JSON" do
- Dir.should_receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes", "#{Chef::Config[:role_path]}/memes/lolcat.json"])
+ expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes", "#{Chef::Config[:role_path]}/memes/lolcat.json"])
file_path = File.join(Chef::Config[:role_path], 'memes/lolcat.json')
- File.should_receive(:exists?).with(file_path).exactly(1).times.and_return(true)
- IO.should_receive(:read).with(file_path).and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
- @role.should be_a_kind_of(Chef::Role)
+ expect(File).to receive(:exists?).with(file_path).exactly(1).times.and_return(true)
+ expect(IO).to receive(:read).with(file_path).and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
+ expect(@role).to be_a_kind_of(Chef::Role)
@role.class.from_disk("lolcat")
end
it "should return a Chef::Role object from a Ruby DSL" do
- Dir.should_receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes", "#{Chef::Config[:role_path]}/memes/lolcat.rb"])
+ expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes", "#{Chef::Config[:role_path]}/memes/lolcat.rb"])
rb_path = File.join(Chef::Config[:role_path], 'memes/lolcat.rb')
- File.should_receive(:exists?).with(rb_path).exactly(2).times.and_return(true)
- File.should_receive(:readable?).with(rb_path).exactly(1).times.and_return(true)
- IO.should_receive(:read).with(rb_path).and_return(ROLE_DSL)
- @role.should be_a_kind_of(Chef::Role)
+ expect(File).to receive(:exists?).with(rb_path).exactly(2).times.and_return(true)
+ expect(File).to receive(:readable?).with(rb_path).exactly(1).times.and_return(true)
+ expect(IO).to receive(:read).with(rb_path).and_return(ROLE_DSL)
+ expect(@role).to be_a_kind_of(Chef::Role)
@role.class.from_disk("lolcat")
end
it "should prefer a Chef::Role Object from JSON over one from a Ruby DSL" do
- Dir.should_receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes", "#{Chef::Config[:role_path]}/memes/lolcat.json", "#{Chef::Config[:role_path]}/memes/lolcat.rb"])
+ expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes", "#{Chef::Config[:role_path]}/memes/lolcat.json", "#{Chef::Config[:role_path]}/memes/lolcat.rb"])
js_path = File.join(Chef::Config[:role_path], 'memes/lolcat.json')
rb_path = File.join(Chef::Config[:role_path], 'memes/lolcat.rb')
- File.should_receive(:exists?).with(js_path).exactly(1).times.and_return(true)
- File.should_not_receive(:exists?).with(rb_path)
- IO.should_receive(:read).with(js_path).and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
- @role.should be_a_kind_of(Chef::Role)
+ expect(File).to receive(:exists?).with(js_path).exactly(1).times.and_return(true)
+ expect(File).not_to receive(:exists?).with(rb_path)
+ expect(IO).to receive(:read).with(js_path).and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
+ expect(@role).to be_a_kind_of(Chef::Role)
@role.class.from_disk("lolcat")
end
it "should raise an exception if the file does not exist" do
- Dir.should_receive(:glob).and_return(["#{Chef::Config[:role_path]}/meme.rb"])
- File.should_not_receive(:exists?)
- lambda {@role.class.from_disk("lolcat")}.should raise_error(Chef::Exceptions::RoleNotFound)
+ expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/meme.rb"])
+ expect(File).not_to receive(:exists?)
+ expect {@role.class.from_disk("lolcat")}.to raise_error(Chef::Exceptions::RoleNotFound)
end
it "should raise an exception if two files exist with the same name" do
- Dir.should_receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes/lolcat.rb", "#{Chef::Config[:role_path]}/lolcat.rb"])
- File.should_not_receive(:exists?)
- lambda {@role.class.from_disk("lolcat")}.should raise_error(Chef::Exceptions::DuplicateRole)
+ expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes/lolcat.rb", "#{Chef::Config[:role_path]}/lolcat.rb"])
+ expect(File).not_to receive(:exists?)
+ expect {@role.class.from_disk("lolcat")}.to raise_error(Chef::Exceptions::DuplicateRole)
end
it "should not raise an exception if two files exist with a similar name" do
- Dir.should_receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes/lolcat.rb", "#{Chef::Config[:role_path]}/super_lolcat.rb"])
- File.should_not_receive(:exists?)
- lambda {@role.class.from_disk("lolcat")}.should_not raise_error(Chef::Exceptions::DuplicateRole)
- end
+ expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes/lolcat.rb", "#{Chef::Config[:role_path]}/super_lolcat.rb"])
+ expect(File).to receive(:exists?).with("#{Chef::Config[:role_path]}/memes/lolcat.rb").and_return(true)
+ allow_any_instance_of(Chef::Role).to receive(:from_file).with("#{Chef::Config[:role_path]}/memes/lolcat.rb")
+ expect{ @role.class.from_disk("lolcat") }.not_to raise_error
+ end
end
describe "when loading from disk and role_path is an array" do
@@ -316,45 +317,45 @@ EOR
end
it "should return a Chef::Role object from JSON" do
- Dir.should_receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return(['/path1/lolcat.json'])
- File.should_receive(:exists?).with('/path1/lolcat.json').exactly(1).times.and_return(true)
- IO.should_receive(:read).with('/path1/lolcat.json').and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
- @role.should be_a_kind_of(Chef::Role)
+ expect(Dir).to receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return(['/path1/lolcat.json'])
+ expect(File).to receive(:exists?).with('/path1/lolcat.json').exactly(1).times.and_return(true)
+ expect(IO).to receive(:read).with('/path1/lolcat.json').and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
+ expect(@role).to be_a_kind_of(Chef::Role)
@role.class.from_disk("lolcat")
end
it "should return a Chef::Role object from JSON when role is in the second path" do
- Dir.should_receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return([])
- Dir.should_receive(:glob).with(File.join('/path/path2', '**', '**')).exactly(1).times.and_return(['/path/path2/lolcat.json'])
- File.should_receive(:exists?).with('/path/path2/lolcat.json').exactly(1).times.and_return(true)
- IO.should_receive(:read).with('/path/path2/lolcat.json').and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
- @role.should be_a_kind_of(Chef::Role)
+ expect(Dir).to receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return([])
+ expect(Dir).to receive(:glob).with(File.join('/path/path2', '**', '**')).exactly(1).times.and_return(['/path/path2/lolcat.json'])
+ expect(File).to receive(:exists?).with('/path/path2/lolcat.json').exactly(1).times.and_return(true)
+ expect(IO).to receive(:read).with('/path/path2/lolcat.json').and_return('{"name": "ceiling_cat", "json_class": "Chef::Role" }')
+ expect(@role).to be_a_kind_of(Chef::Role)
@role.class.from_disk("lolcat")
end
it "should return a Chef::Role object from a Ruby DSL" do
- Dir.should_receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return(['/path1/lolcat.rb'])
- File.should_receive(:exists?).with('/path1/lolcat.rb').exactly(2).times.and_return(true)
- File.should_receive(:readable?).with('/path1/lolcat.rb').and_return(true)
- IO.should_receive(:read).with('/path1/lolcat.rb').exactly(1).times.and_return(ROLE_DSL)
- @role.should be_a_kind_of(Chef::Role)
+ expect(Dir).to receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return(['/path1/lolcat.rb'])
+ expect(File).to receive(:exists?).with('/path1/lolcat.rb').exactly(2).times.and_return(true)
+ expect(File).to receive(:readable?).with('/path1/lolcat.rb').and_return(true)
+ expect(IO).to receive(:read).with('/path1/lolcat.rb').exactly(1).times.and_return(ROLE_DSL)
+ expect(@role).to be_a_kind_of(Chef::Role)
@role.class.from_disk("lolcat")
end
it "should return a Chef::Role object from a Ruby DSL when role is in the second path" do
- Dir.should_receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return([])
- Dir.should_receive(:glob).with(File.join('/path/path2', '**', '**')).exactly(1).times.and_return(['/path/path2/lolcat.rb'])
- File.should_receive(:exists?).with('/path/path2/lolcat.rb').exactly(2).times.and_return(true)
- File.should_receive(:readable?).with('/path/path2/lolcat.rb').and_return(true)
- IO.should_receive(:read).with('/path/path2/lolcat.rb').exactly(1).times.and_return(ROLE_DSL)
- @role.should be_a_kind_of(Chef::Role)
+ expect(Dir).to receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return([])
+ expect(Dir).to receive(:glob).with(File.join('/path/path2', '**', '**')).exactly(1).times.and_return(['/path/path2/lolcat.rb'])
+ expect(File).to receive(:exists?).with('/path/path2/lolcat.rb').exactly(2).times.and_return(true)
+ expect(File).to receive(:readable?).with('/path/path2/lolcat.rb').and_return(true)
+ expect(IO).to receive(:read).with('/path/path2/lolcat.rb').exactly(1).times.and_return(ROLE_DSL)
+ expect(@role).to be_a_kind_of(Chef::Role)
@role.class.from_disk("lolcat")
end
it "should raise an exception if the file does not exist" do
- Dir.should_receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return([])
- Dir.should_receive(:glob).with(File.join('/path/path2', '**', '**')).exactly(1).times.and_return([])
- lambda {@role.class.from_disk("lolcat")}.should raise_error(Chef::Exceptions::RoleNotFound)
+ expect(Dir).to receive(:glob).with(File.join('/path1', '**', '**')).exactly(1).times.and_return([])
+ expect(Dir).to receive(:glob).with(File.join('/path/path2', '**', '**')).exactly(1).times.and_return([])
+ expect {@role.class.from_disk("lolcat")}.to raise_error(Chef::Exceptions::RoleNotFound)
end
end
diff --git a/spec/unit/run_context/cookbook_compiler_spec.rb b/spec/unit/run_context/cookbook_compiler_spec.rb
index 5c50c3dd4b..20ec1d2ef7 100644
--- a/spec/unit/run_context/cookbook_compiler_spec.rb
+++ b/spec/unit/run_context/cookbook_compiler_spec.rb
@@ -62,7 +62,7 @@ describe Chef::RunContext::CookbookCompiler do
node.run_list("dependency1::default")
compiler.compile_attributes
- node[:attr_load_order].should == ["dependency1::default", "dependency1::aa_first", "dependency1::zz_last"]
+ expect(node[:attr_load_order]).to eq(["dependency1::default", "dependency1::aa_first", "dependency1::zz_last"])
end
it "loads dependencies before loading the depending cookbook's attributes" do
@@ -73,11 +73,11 @@ describe Chef::RunContext::CookbookCompiler do
compiler.compile_attributes
# dependencies are stored in a hash so therefore unordered, but they should be loaded in sort order
- node[:attr_load_order].should == ["dependency1::default",
+ expect(node[:attr_load_order]).to eq(["dependency1::default",
"dependency1::aa_first",
"dependency1::zz_last",
"dependency2::default",
- "test-with-deps::default"]
+ "test-with-deps::default"])
end
it "does not follow infinite dependency loops" do
@@ -86,7 +86,7 @@ describe Chef::RunContext::CookbookCompiler do
# Circular deps should not cause infinite loops
compiler.compile_attributes
- node[:attr_load_order].should == ["circular-dep2::default", "circular-dep1::default", "test-with-circular-deps::default"]
+ expect(node[:attr_load_order]).to eq(["circular-dep2::default", "circular-dep1::default", "test-with-circular-deps::default"])
end
it "loads attributes from cookbooks that don't have a default.rb attribute file" do
@@ -94,7 +94,7 @@ describe Chef::RunContext::CookbookCompiler do
compiler.compile_attributes
- node[:attr_load_order].should == ["no-default-attr::server"]
+ expect(node[:attr_load_order]).to eq(["no-default-attr::server"])
end
end
@@ -108,7 +108,7 @@ describe Chef::RunContext::CookbookCompiler do
node.run_list("test-with-deps::default", "test-with-circular-deps::default")
compiler.compile_libraries
- LibraryLoadOrder.load_order.should == ["dependency1", "dependency2", "test-with-deps", "circular-dep2", "circular-dep1", "test-with-circular-deps"]
+ expect(LibraryLoadOrder.load_order).to eq(["dependency1", "dependency2", "test-with-deps", "circular-dep2", "circular-dep1", "test-with-circular-deps"])
end
end
@@ -122,7 +122,7 @@ describe Chef::RunContext::CookbookCompiler do
node.run_list("test-with-deps::default", "test-with-circular-deps::default")
compiler.compile_lwrps
- LibraryLoadOrder.load_order.should == ["dependency1-provider",
+ expect(LibraryLoadOrder.load_order).to eq(["dependency1-provider",
"dependency1-resource",
"dependency2-provider",
"dependency2-resource",
@@ -133,7 +133,7 @@ describe Chef::RunContext::CookbookCompiler do
"circular-dep1-provider",
"circular-dep1-resource",
"test-with-circular-deps-provider",
- "test-with-circular-deps-resource"]
+ "test-with-circular-deps-resource"])
end
end
@@ -148,12 +148,12 @@ describe Chef::RunContext::CookbookCompiler do
node.run_list("test-with-deps::default", "test-with-circular-deps::default")
compiler.compile_resource_definitions
- LibraryLoadOrder.load_order.should == ["dependency1-definition",
+ expect(LibraryLoadOrder.load_order).to eq(["dependency1-definition",
"dependency2-definition",
"test-with-deps-definition",
"circular-dep2-definition",
"circular-dep1-definition",
- "test-with-circular-deps-definition"]
+ "test-with-circular-deps-definition"])
end
end
@@ -166,19 +166,19 @@ describe Chef::RunContext::CookbookCompiler do
it "should return an array of cookbook names as symbols without duplicates" do
node.run_list("test-with-circular-deps::default", "circular-dep1::default", "circular-dep2::default")
- compiler.cookbook_order.should == [:"circular-dep2",
+ expect(compiler.cookbook_order).to eq([:"circular-dep2",
:"circular-dep1",
- :"test-with-circular-deps"]
+ :"test-with-circular-deps"])
end
it "determines if a cookbook is in the list of cookbooks reachable by dependency" do
node.run_list("test-with-deps::default", "test-with-deps::server")
- compiler.cookbook_order.should == [:dependency1, :dependency2, :"test-with-deps"]
- compiler.unreachable_cookbook?(:dependency1).should be_false
- compiler.unreachable_cookbook?(:dependency2).should be_false
- compiler.unreachable_cookbook?(:'test-with-deps').should be_false
- compiler.unreachable_cookbook?(:'circular-dep1').should be_true
- compiler.unreachable_cookbook?(:'circular-dep2').should be_true
+ expect(compiler.cookbook_order).to eq([:dependency1, :dependency2, :"test-with-deps"])
+ expect(compiler.unreachable_cookbook?(:dependency1)).to be_falsey
+ expect(compiler.unreachable_cookbook?(:dependency2)).to be_falsey
+ expect(compiler.unreachable_cookbook?(:'test-with-deps')).to be_falsey
+ expect(compiler.unreachable_cookbook?(:'circular-dep1')).to be_truthy
+ expect(compiler.unreachable_cookbook?(:'circular-dep2')).to be_truthy
end
diff --git a/spec/unit/run_context_spec.rb b/spec/unit/run_context_spec.rb
index 21ece2abaa..bb251c9cf4 100644
--- a/spec/unit/run_context_spec.rb
+++ b/spec/unit/run_context_spec.rb
@@ -36,11 +36,11 @@ describe Chef::RunContext do
end
it "has a cookbook collection" do
- @run_context.cookbook_collection.should == @cookbook_collection
+ expect(@run_context.cookbook_collection).to eq(@cookbook_collection)
end
it "has a node" do
- @run_context.node.should == @node
+ expect(@run_context.node).to eq(@node)
end
describe "loading cookbooks for a run list" do
@@ -53,45 +53,45 @@ describe Chef::RunContext do
end
@node.run_list << "test" << "test::one" << "test::two"
- @node.should_receive(:loaded_recipe).with(:test, "default")
- @node.should_receive(:loaded_recipe).with(:test, "one")
- @node.should_receive(:loaded_recipe).with(:test, "two")
+ expect(@node).to receive(:loaded_recipe).with(:test, "default")
+ expect(@node).to receive(:loaded_recipe).with(:test, "one")
+ expect(@node).to receive(:loaded_recipe).with(:test, "two")
@run_context.load(@node.run_list.expand('_default'))
end
it "should load all the definitions in the cookbooks for this node" do
- @run_context.definitions.should have_key(:new_cat)
- @run_context.definitions.should have_key(:new_badger)
- @run_context.definitions.should have_key(:new_dog)
+ expect(@run_context.definitions).to have_key(:new_cat)
+ expect(@run_context.definitions).to have_key(:new_badger)
+ expect(@run_context.definitions).to have_key(:new_dog)
end
it "should load all the recipes specified for this node" do
- @run_context.resource_collection[0].to_s.should == "cat[einstein]"
- @run_context.resource_collection[1].to_s.should == "cat[loulou]"
- @run_context.resource_collection[2].to_s.should == "cat[birthday]"
- @run_context.resource_collection[3].to_s.should == "cat[peanut]"
- @run_context.resource_collection[4].to_s.should == "cat[fat peanut]"
+ expect(@run_context.resource_collection[0].to_s).to eq("cat[einstein]")
+ expect(@run_context.resource_collection[1].to_s).to eq("cat[loulou]")
+ expect(@run_context.resource_collection[2].to_s).to eq("cat[birthday]")
+ expect(@run_context.resource_collection[3].to_s).to eq("cat[peanut]")
+ expect(@run_context.resource_collection[4].to_s).to eq("cat[fat peanut]")
end
it "loads all the attribute files in the cookbook collection" do
- @run_context.loaded_fully_qualified_attribute?("test", "george").should be_true
- @node[:george].should == "washington"
+ expect(@run_context.loaded_fully_qualified_attribute?("test", "george")).to be_truthy
+ expect(@node[:george]).to eq("washington")
end
it "registers attributes files as loaded so they won't be reloaded" do
# This test unfortunately is pretty tightly intertwined with the
# implementation of how nodes load attribute files, but is the only
# convenient way to test this behavior.
- @node.should_not_receive(:from_file)
+ expect(@node).not_to receive(:from_file)
@node.include_attribute("test::george")
end
it "raises an error when attempting to include_recipe from a cookbook not reachable by run list or dependencies" do
- @node.should_receive(:loaded_recipe).with(:ancient, "aliens")
- lambda do
+ expect(@node).to receive(:loaded_recipe).with(:ancient, "aliens")
+ expect do
@run_context.include_recipe("ancient::aliens")
# In CHEF-5120, this becomes a Chef::Exceptions::MissingCookbookDependency error:
- end.should raise_error(Chef::Exceptions::CookbookNotFound)
+ end.to raise_error(Chef::Exceptions::CookbookNotFound)
end
end
@@ -112,8 +112,8 @@ describe Chef::RunContext do
it "queries whether a given cookbook has a specific template" do
- @run_context.should have_template_in_cookbook("openldap", "test.erb")
- @run_context.should_not have_template_in_cookbook("openldap", "missing.erb")
+ expect(@run_context).to have_template_in_cookbook("openldap", "test.erb")
+ expect(@run_context).not_to have_template_in_cookbook("openldap", "missing.erb")
end
it "errors when querying for a template in a not-available cookbook" do
@@ -123,8 +123,8 @@ describe Chef::RunContext do
end
it "queries whether a given cookbook has a specific cookbook_file" do
- @run_context.should have_cookbook_file_in_cookbook("java", "java.response")
- @run_context.should_not have_cookbook_file_in_cookbook("java", "missing.txt")
+ expect(@run_context).to have_cookbook_file_in_cookbook("java", "java.response")
+ expect(@run_context).not_to have_cookbook_file_in_cookbook("java", "missing.txt")
end
it "errors when querying for a cookbook_file in a not-available cookbook" do
@@ -142,11 +142,11 @@ describe Chef::RunContext do
it "stores and deletes the reboot request" do
@run_context.request_reboot(expected)
expect(@run_context.reboot_info).to eq(expected)
- expect(@run_context.reboot_requested?).to be_true
+ expect(@run_context.reboot_requested?).to be_truthy
@run_context.cancel_reboot
expect(@run_context.reboot_info).to eq({})
- expect(@run_context.reboot_requested?).to be_false
+ expect(@run_context.reboot_requested?).to be_falsey
end
end
end
diff --git a/spec/unit/run_list/run_list_expansion_spec.rb b/spec/unit/run_list/run_list_expansion_spec.rb
index 907e3d3985..927257875e 100644
--- a/spec/unit/run_list/run_list_expansion_spec.rb
+++ b/spec/unit/run_list/run_list_expansion_spec.rb
@@ -27,23 +27,23 @@ describe Chef::RunList::RunListExpansion do
describe "before expanding the run list" do
it "has an array of run list items" do
- @expansion.run_list_items.should == @run_list.run_list_items
+ expect(@expansion.run_list_items).to eq(@run_list.run_list_items)
end
it "has default_attrs" do
- @expansion.default_attrs.should == Mash.new
+ expect(@expansion.default_attrs).to eq(Mash.new)
end
it "has override attrs" do
- @expansion.override_attrs.should == Mash.new
+ expect(@expansion.override_attrs).to eq(Mash.new)
end
it "it has an empty list of recipes" do
- @expansion.should have(0).recipes
+ expect(@expansion.recipes.size).to eq(0)
end
it "has not applied its roles" do
- @expansion.applied_role?('rage').should be_false
+ expect(@expansion.applied_role?('rage')).to be_falsey
end
end
@@ -54,28 +54,28 @@ describe Chef::RunList::RunListExpansion do
r.env_run_lists('_default' => [], "prod" => ["recipe[prod-only]"])
end
@expansion = Chef::RunList::RunListExpansion.new("prod", @run_list.run_list_items)
- @expansion.should_receive(:fetch_role).and_return(@rage_role)
+ expect(@expansion).to receive(:fetch_role).and_return(@rage_role)
@expansion.expand
end
it "has the correct list of recipes for the given environment" do
- @expansion.recipes.should == ["lobster", "prod-only", "fist"]
+ expect(@expansion.recipes).to eq(["lobster", "prod-only", "fist"])
end
end
describe "after applying a role" do
before do
- @expansion.stub(:fetch_role).and_return(Chef::Role.new)
+ allow(@expansion).to receive(:fetch_role).and_return(Chef::Role.new)
@expansion.inflate_role('rage', "role[base]")
end
it "tracks the applied role" do
- @expansion.applied_role?('rage').should be_true
+ expect(@expansion.applied_role?('rage')).to be_truthy
end
it "does not inflate the role again" do
- @expansion.inflate_role('rage', "role[base]").should be_false
+ expect(@expansion.inflate_role('rage', "role[base]")).to be_falsey
end
end
@@ -89,39 +89,39 @@ describe Chef::RunList::RunListExpansion do
@second_role.run_list('recipe[crabrevenge]')
@second_role.default_attributes({'foo' => 'boo'})
@second_role.override_attributes({'baz' => 'bux'})
- @expansion.stub(:fetch_role).and_return(@first_role, @second_role)
+ allow(@expansion).to receive(:fetch_role).and_return(@first_role, @second_role)
@expansion.expand
end
it "has the ordered list of recipes" do
- @expansion.recipes.should == ['lobster', 'crabrevenge', 'fist']
+ expect(@expansion.recipes).to eq(['lobster', 'crabrevenge', 'fist'])
end
it "has the merged attributes from the roles with outer roles overridding inner" do
- @expansion.default_attrs.should == {'foo' => 'bar'}
- @expansion.override_attrs.should == {'baz' => 'qux'}
+ expect(@expansion.default_attrs).to eq({'foo' => 'bar'})
+ expect(@expansion.override_attrs).to eq({'baz' => 'qux'})
end
it "has the list of all roles applied" do
# this is the correct order, but 1.8 hash order is not stable
- @expansion.roles.should =~ ['rage', 'mollusk']
+ expect(@expansion.roles).to match_array(['rage', 'mollusk'])
end
end
describe "after expanding a run list with a non existant role" do
before do
- @expansion.stub(:fetch_role) { @expansion.role_not_found('crabrevenge', "role[base]") }
+ allow(@expansion).to receive(:fetch_role) { @expansion.role_not_found('crabrevenge', "role[base]") }
@expansion.expand
end
it "is invalid" do
- @expansion.should be_invalid
- @expansion.errors?.should be_true # aliases
+ expect(@expansion).to be_invalid
+ expect(@expansion.errors?).to be_truthy # aliases
end
it "has a list of invalid role names" do
- @expansion.errors.should include('crabrevenge')
+ expect(@expansion.errors).to include('crabrevenge')
end
end
diff --git a/spec/unit/run_list/run_list_item_spec.rb b/spec/unit/run_list/run_list_item_spec.rb
index 6b9de713da..16832c1b7d 100644
--- a/spec/unit/run_list/run_list_item_spec.rb
+++ b/spec/unit/run_list/run_list_item_spec.rb
@@ -22,16 +22,16 @@ describe Chef::RunList::RunListItem do
describe "when creating from a Hash" do
it "raises an exception when the hash doesn't have a :type key" do
- lambda {Chef::RunList::RunListItem.new(:name => "tatft")}.should raise_error(ArgumentError)
+ expect {Chef::RunList::RunListItem.new(:name => "tatft")}.to raise_error(ArgumentError)
end
it "raises an exception when the hash doesn't have an :name key" do
- lambda {Chef::RunList::RunListItem.new(:type => 'R') }.should raise_error(ArgumentError)
+ expect {Chef::RunList::RunListItem.new(:type => 'R') }.to raise_error(ArgumentError)
end
it "sets the name and type as given in the hash" do
item = Chef::RunList::RunListItem.new(:type => 'fuuu', :name => 'uuuu')
- item.to_s.should == 'fuuu[uuuu]'
+ expect(item.to_s).to eq('fuuu[uuuu]')
end
end
@@ -39,47 +39,47 @@ describe Chef::RunList::RunListItem do
describe "when creating an item from a string" do
it "parses a qualified recipe" do
item = Chef::RunList::RunListItem.new("recipe[rage]")
- item.should be_a_recipe
- item.should_not be_a_role
- item.to_s.should == 'recipe[rage]'
- item.name.should == 'rage'
+ expect(item).to be_a_recipe
+ expect(item).not_to be_a_role
+ expect(item.to_s).to eq('recipe[rage]')
+ expect(item.name).to eq('rage')
end
it "parses a qualified recipe with a version" do
item = Chef::RunList::RunListItem.new("recipe[rage@0.1.0]")
- item.should be_a_recipe
- item.should_not be_a_role
- item.to_s.should == 'recipe[rage@0.1.0]'
- item.name.should == 'rage'
- item.version.should == '0.1.0'
+ expect(item).to be_a_recipe
+ expect(item).not_to be_a_role
+ expect(item.to_s).to eq('recipe[rage@0.1.0]')
+ expect(item.name).to eq('rage')
+ expect(item.version).to eq('0.1.0')
end
it "parses a qualified role" do
item = Chef::RunList::RunListItem.new("role[fist]")
- item.should be_a_role
- item.should_not be_a_recipe
- item.to_s.should == 'role[fist]'
- item.name.should == 'fist'
+ expect(item).to be_a_role
+ expect(item).not_to be_a_recipe
+ expect(item.to_s).to eq('role[fist]')
+ expect(item.name).to eq('fist')
end
it "parses an unqualified recipe" do
item = Chef::RunList::RunListItem.new("lobster")
- item.should be_a_recipe
- item.should_not be_a_role
- item.to_s.should == 'recipe[lobster]'
- item.name.should == 'lobster'
+ expect(item).to be_a_recipe
+ expect(item).not_to be_a_role
+ expect(item.to_s).to eq('recipe[lobster]')
+ expect(item.name).to eq('lobster')
end
it "raises an exception when the string has typo on the type part" do
- lambda {Chef::RunList::RunListItem.new("Recipe[lobster]") }.should raise_error(ArgumentError)
+ expect {Chef::RunList::RunListItem.new("Recipe[lobster]") }.to raise_error(ArgumentError)
end
it "raises an exception when the string has extra space between the type and the name" do
- lambda {Chef::RunList::RunListItem.new("recipe [lobster]") }.should raise_error(ArgumentError)
+ expect {Chef::RunList::RunListItem.new("recipe [lobster]") }.to raise_error(ArgumentError)
end
it "raises an exception when the string does not close the bracket" do
- lambda {Chef::RunList::RunListItem.new("recipe[lobster") }.should raise_error(ArgumentError)
+ expect {Chef::RunList::RunListItem.new("recipe[lobster") }.to raise_error(ArgumentError)
end
end
@@ -87,31 +87,31 @@ describe Chef::RunList::RunListItem do
it "is equal to another run list item that has the same name and type" do
item1 = Chef::RunList::RunListItem.new('recipe[lrf]')
item2 = Chef::RunList::RunListItem.new('recipe[lrf]')
- item1.should == item2
+ expect(item1).to eq(item2)
end
it "is not equal to another run list item with the same name and different type" do
item1 = Chef::RunList::RunListItem.new('recipe[lrf]')
item2 = Chef::RunList::RunListItem.new('role[lrf]')
- item1.should_not == item2
+ expect(item1).not_to eq(item2)
end
it "is not equal to another run list item with the same type and different name" do
item1 = Chef::RunList::RunListItem.new('recipe[lrf]')
item2 = Chef::RunList::RunListItem.new('recipe[lobsterragefist]')
- item1.should_not == item2
+ expect(item1).not_to eq(item2)
end
it "is not equal to another run list item with the same name and type but different version" do
item1 = Chef::RunList::RunListItem.new('recipe[lrf,0.1.0]')
item2 = Chef::RunList::RunListItem.new('recipe[lrf,0.2.0]')
- item1.should_not == item2
+ expect(item1).not_to eq(item2)
end
end
describe "comparing to strings" do
it "is equal to a string if that string matches its to_s representation" do
- Chef::RunList::RunListItem.new('recipe[lrf]').should == 'recipe[lrf]'
+ expect(Chef::RunList::RunListItem.new('recipe[lrf]')).to eq('recipe[lrf]')
end
end
end
diff --git a/spec/unit/run_list/versioned_recipe_list_spec.rb b/spec/unit/run_list/versioned_recipe_list_spec.rb
index 5cef32c32b..209ac37fc1 100644
--- a/spec/unit/run_list/versioned_recipe_list_spec.rb
+++ b/spec/unit/run_list/versioned_recipe_list_spec.rb
@@ -22,7 +22,7 @@ describe Chef::RunList::VersionedRecipeList do
describe "initialize" do
it "should create an empty array" do
l = Chef::RunList::VersionedRecipeList.new
- l.should == []
+ expect(l).to eq([])
end
end
@@ -36,41 +36,41 @@ describe Chef::RunList::VersionedRecipeList do
it "should append the recipe to the end of the list" do
@list.add_recipe "rails"
- @list.should == ["apt", "god", "apache2", "rails"]
+ expect(@list).to eq(["apt", "god", "apache2", "rails"])
end
it "should not duplicate entries" do
@list.add_recipe "apt"
- @list.should == ["apt", "god", "apache2"]
+ expect(@list).to eq(["apt", "god", "apache2"])
end
it "should allow you to specify a version" do
@list.add_recipe "rails", "1.0.0"
- @list.should == ["apt", "god", "apache2", "rails"]
- @list.with_versions.should include({:name => "rails", :version => "1.0.0"})
+ expect(@list).to eq(["apt", "god", "apache2", "rails"])
+ expect(@list.with_versions).to include({:name => "rails", :version => "1.0.0"})
end
it "should allow you to specify a version for a recipe that already exists" do
@list.add_recipe "apt", "1.2.3"
- @list.should == ["apt", "god", "apache2"]
- @list.with_versions.should include({:name => "apt", :version => "1.2.3"})
+ expect(@list).to eq(["apt", "god", "apache2"])
+ expect(@list.with_versions).to include({:name => "apt", :version => "1.2.3"})
end
it "should allow you to specify the same version of a recipe twice" do
@list.add_recipe "rails", "1.0.0"
@list.add_recipe "rails", "1.0.0"
- @list.with_versions.should include({:name => "rails", :version => "1.0.0"})
+ expect(@list.with_versions).to include({:name => "rails", :version => "1.0.0"})
end
it "should allow you to spcify no version, even when a version already exists" do
@list.add_recipe "rails", "1.0.0"
@list.add_recipe "rails"
- @list.with_versions.should include({:name => "rails", :version => "1.0.0"})
+ expect(@list.with_versions).to include({:name => "rails", :version => "1.0.0"})
end
it "should not allow multiple versions of the same recipe" do
@list.add_recipe "rails", "1.0.0"
- lambda {@list.add_recipe "rails", "0.1.0"}.should raise_error Chef::Exceptions::CookbookVersionConflict
+ expect {@list.add_recipe "rails", "0.1.0"}.to raise_error Chef::Exceptions::CookbookVersionConflict
end
end
@@ -86,13 +86,13 @@ describe Chef::RunList::VersionedRecipeList do
end
it "should return an array of hashes with :name and :version" do
- @list.with_versions.should == @recipes
+ expect(@list.with_versions).to eq(@recipes)
end
it "should retain the same order as the version-less list" do
with_versions = @list.with_versions
@list.each_with_index do |item, index|
- with_versions[index][:name].should == item
+ expect(with_versions[index][:name]).to eq(item)
end
end
end
@@ -115,8 +115,8 @@ describe Chef::RunList::VersionedRecipeList do
it "should return an array of hashes with :name and :version_constraint" do
@list.with_version_constraints.each do |x|
- x.should have_key :name
- x[:version_constraint].should_not be nil
+ expect(x).to have_key :name
+ expect(x[:version_constraint]).not_to be nil
end
end
end
diff --git a/spec/unit/run_list_spec.rb b/spec/unit/run_list_spec.rb
index cc7e29af0f..bf996de8c1 100644
--- a/spec/unit/run_list_spec.rb
+++ b/spec/unit/run_list_spec.rb
@@ -31,42 +31,42 @@ describe Chef::RunList do
describe "<<" do
it "should add a recipe to the run list and recipe list with the fully qualified name" do
@run_list << 'recipe[needy]'
- @run_list.should include('recipe[needy]')
- @run_list.recipes.should include("needy")
+ expect(@run_list).to include('recipe[needy]')
+ expect(@run_list.recipes).to include("needy")
end
it "should add a role to the run list and role list with the fully qualified name" do
@run_list << "role[woot]"
- @run_list.should include('role[woot]')
- @run_list.roles.should include('woot')
+ expect(@run_list).to include('role[woot]')
+ expect(@run_list.roles).to include('woot')
end
it "should accept recipes that are unqualified" do
@run_list << "needy"
- @run_list.should include('recipe[needy]')
- @run_list.recipes.include?('needy').should == true
+ expect(@run_list).to include('recipe[needy]')
+ expect(@run_list.recipes.include?('needy')).to eq(true)
end
it "should not allow duplicates" do
@run_list << "needy"
@run_list << "needy"
- @run_list.run_list.length.should == 1
- @run_list.recipes.length.should == 1
+ expect(@run_list.run_list.length).to eq(1)
+ expect(@run_list.recipes.length).to eq(1)
end
it "should allow two versions of a recipe" do
@run_list << "recipe[needy@0.2.0]"
@run_list << "recipe[needy@0.1.0]"
- @run_list.run_list.length.should == 2
- @run_list.recipes.length.should == 2
- @run_list.recipes.include?('needy').should == true
+ expect(@run_list.run_list.length).to eq(2)
+ expect(@run_list.recipes.length).to eq(2)
+ expect(@run_list.recipes.include?('needy')).to eq(true)
end
it "should not allow duplicate versions of a recipe" do
@run_list << "recipe[needy@0.2.0]"
@run_list << "recipe[needy@0.2.0]"
- @run_list.run_list.length.should == 1
- @run_list.recipes.length.should == 1
+ expect(@run_list.run_list.length).to eq(1)
+ expect(@run_list.recipes.length).to eq(1)
end
end
@@ -75,12 +75,12 @@ describe Chef::RunList do
# since full behavior is tested above.
it "should add a recipe to the run_list" do
@run_list.add 'recipe[needy]'
- @run_list.should include('recipe[needy]')
+ expect(@run_list).to include('recipe[needy]')
end
it "should add a role to the run_list" do
@run_list.add 'role[needy]'
- @run_list.should include('role[needy]')
+ expect(@run_list).to include('role[needy]')
end
end
@@ -89,43 +89,43 @@ describe Chef::RunList do
@run_list << "foo"
r = Chef::RunList.new
r << "foo"
- @run_list.should == r
+ expect(@run_list).to eq(r)
end
it "should believe a RunList is equal to an array named after it's members" do
@run_list << "foo"
@run_list << "baz"
- @run_list.should == [ "foo", "baz" ]
+ expect(@run_list).to eq([ "foo", "baz" ])
end
end
describe "empty?" do
it "should be emtpy if the run list has no members" do
- @run_list.empty?.should == true
+ expect(@run_list.empty?).to eq(true)
end
it "should not be empty if the run list has members" do
@run_list << "chromeo"
- @run_list.empty?.should == false
+ expect(@run_list.empty?).to eq(false)
end
end
describe "[]" do
it "should let you look up a member in the run list by position" do
@run_list << 'recipe[loulou]'
- @run_list[0].should == 'recipe[loulou]'
+ expect(@run_list[0]).to eq('recipe[loulou]')
end
end
describe "[]=" do
it "should let you set a member of the run list by position" do
@run_list[0] = 'recipe[loulou]'
- @run_list[0].should == 'recipe[loulou]'
+ expect(@run_list[0]).to eq('recipe[loulou]')
end
it "should properly expand a member of the run list given by position" do
@run_list[0] = 'loulou'
- @run_list[0].should == 'recipe[loulou]'
+ expect(@run_list[0]).to eq('recipe[loulou]')
end
end
@@ -135,8 +135,8 @@ describe Chef::RunList do
@run_list << "bar"
seen = Array.new
@run_list.each { |r| seen << r }
- seen.should be_include("recipe[foo]")
- seen.should be_include("recipe[bar]")
+ expect(seen).to be_include("recipe[foo]")
+ expect(seen).to be_include("recipe[bar]")
end
end
@@ -144,7 +144,7 @@ describe Chef::RunList do
it "should yield each members index to your block" do
to_add = [ "recipe[foo]", "recipe[bar]", "recipe[baz]" ]
to_add.each { |i| @run_list << i }
- @run_list.each_index { |i| @run_list[i].should == to_add[i] }
+ @run_list.each_index { |i| expect(@run_list[i]).to eq(to_add[i]) }
end
end
@@ -160,8 +160,8 @@ describe Chef::RunList do
@run_list << "chromeo"
list = %w{camp chairs snakes clowns}
@run_list.reset!(list)
- list.each { |i| @run_list.should be_include(i) }
- @run_list.include?("chromeo").should == false
+ list.each { |i| expect(@run_list).to be_include(i) }
+ expect(@run_list.include?("chromeo")).to eq(false)
end
end
@@ -173,9 +173,9 @@ describe Chef::RunList do
@role.default_attributes :one => :two
@role.override_attributes :three => :four
- Chef::Role.stub(:load).and_return(@role)
+ allow(Chef::Role).to receive(:load).and_return(@role)
@rest = double("Chef::REST", { :get_rest => @role, :url => "/" })
- Chef::REST.stub(:new).and_return(@rest)
+ allow(Chef::REST).to receive(:new).and_return(@rest)
@run_list << "role[stubby]"
@run_list << "kitty"
@@ -183,13 +183,13 @@ describe Chef::RunList do
describe "from disk" do
it "should load the role from disk" do
- Chef::Role.should_receive(:from_disk).with("stubby")
+ expect(Chef::Role).to receive(:from_disk).with("stubby")
@run_list.expand("_default", "disk")
end
it "should log a helpful error if the role is not available" do
- Chef::Role.stub(:from_disk).and_raise(Chef::Exceptions::RoleNotFound)
- Chef::Log.should_receive(:error).with("Role stubby (included by 'top level') is in the runlist but does not exist. Skipping expand.")
+ allow(Chef::Role).to receive(:from_disk).and_raise(Chef::Exceptions::RoleNotFound)
+ expect(Chef::Log).to receive(:error).with("Role stubby (included by 'top level') is in the runlist but does not exist. Skipping expand.")
@run_list.expand("_default", "disk")
end
end
@@ -198,11 +198,11 @@ describe Chef::RunList do
it "should load the role from the chef server" do
#@rest.should_receive(:get_rest).with("roles/stubby")
expansion = @run_list.expand("_default", "server")
- expansion.recipes.should == ['one', 'two', 'kitty']
+ expect(expansion.recipes).to eq(['one', 'two', 'kitty'])
end
it "should default to expanding from the server" do
- @rest.should_receive(:get_rest).with("roles/stubby")
+ expect(@rest).to receive(:get_rest).with("roles/stubby")
@run_list.expand("_default")
end
@@ -213,7 +213,7 @@ describe Chef::RunList do
it "expands the run list using the environment specific run list" do
expansion = @run_list.expand("production", "server")
- expansion.recipes.should == %w{one two five kitty}
+ expect(expansion.recipes).to eq(%w{one two five kitty})
end
describe "and multiply nested roles" do
@@ -233,13 +233,13 @@ describe Chef::RunList do
end
it "expands the run list using the specified environment for all nested roles" do
- Chef::REST.stub(:new).and_return(@multiple_rest_requests)
- @multiple_rest_requests.should_receive(:get_rest).with("roles/stubby").and_return(@role)
- @multiple_rest_requests.should_receive(:get_rest).with("roles/prod-base").and_return(@role_prod_base)
- @multiple_rest_requests.should_receive(:get_rest).with("roles/nested-deeper").and_return(@role_nested_deeper)
+ allow(Chef::REST).to receive(:new).and_return(@multiple_rest_requests)
+ expect(@multiple_rest_requests).to receive(:get_rest).with("roles/stubby").and_return(@role)
+ expect(@multiple_rest_requests).to receive(:get_rest).with("roles/prod-base").and_return(@role_prod_base)
+ expect(@multiple_rest_requests).to receive(:get_rest).with("roles/nested-deeper").and_return(@role_nested_deeper)
expansion = @run_list.expand("production", "server")
- expansion.recipes.should == %w{one two five prod-secret-sauce kitty}
+ expect(expansion.recipes).to eq(%w{one two five prod-secret-sauce kitty})
end
end
@@ -250,18 +250,18 @@ describe Chef::RunList do
it "should return the list of expanded recipes" do
expansion = @run_list.expand("_default")
- expansion.recipes[0].should == "one"
- expansion.recipes[1].should == "two"
+ expect(expansion.recipes[0]).to eq("one")
+ expect(expansion.recipes[1]).to eq("two")
end
it "should return the list of default attributes" do
expansion = @run_list.expand("_default")
- expansion.default_attrs[:one].should == :two
+ expect(expansion.default_attrs[:one]).to eq(:two)
end
it "should return the list of override attributes" do
expansion = @run_list.expand("_default")
- expansion.override_attrs[:three].should == :four
+ expect(expansion.override_attrs[:three]).to eq(:four)
end
it "should recurse into a child role" do
@@ -270,12 +270,12 @@ describe Chef::RunList do
dog.default_attributes :seven => :nine
dog.run_list "three"
@role.run_list << "role[dog]"
- Chef::Role.stub(:from_disk).with("stubby").and_return(@role)
- Chef::Role.stub(:from_disk).with("dog").and_return(dog)
+ allow(Chef::Role).to receive(:from_disk).with("stubby").and_return(@role)
+ allow(Chef::Role).to receive(:from_disk).with("dog").and_return(dog)
expansion = @run_list.expand("_default", 'disk')
- expansion.recipes[2].should == "three"
- expansion.default_attrs[:seven].should == :nine
+ expect(expansion.recipes[2]).to eq("three")
+ expect(expansion.default_attrs[:seven]).to eq(:nine)
end
it "should not recurse infinitely" do
@@ -284,13 +284,13 @@ describe Chef::RunList do
dog.default_attributes :seven => :nine
dog.run_list "role[dog]", "three"
@role.run_list << "role[dog]"
- Chef::Role.stub(:from_disk).with("stubby").and_return(@role)
- Chef::Role.should_receive(:from_disk).with("dog").once.and_return(dog)
+ allow(Chef::Role).to receive(:from_disk).with("stubby").and_return(@role)
+ expect(Chef::Role).to receive(:from_disk).with("dog").once.and_return(dog)
expansion = @run_list.expand("_default", 'disk')
- expansion.recipes[2].should == "three"
- expansion.recipes[3].should == "kitty"
- expansion.default_attrs[:seven].should == :nine
+ expect(expansion.recipes[2]).to eq("three")
+ expect(expansion.recipes[3]).to eq("kitty")
+ expect(expansion.default_attrs[:seven]).to eq(:nine)
end
end
@@ -300,11 +300,11 @@ describe Chef::RunList do
end
it "converts to an array of the string forms of its items" do
- @run_list.to_a.should == ["recipe[nagios::client]", "role[production]", "recipe[apache2]"]
+ expect(@run_list.to_a).to eq(["recipe[nagios::client]", "role[production]", "recipe[apache2]"])
end
it "converts to json by converting its array form" do
- Chef::JSONCompat.to_json(@run_list).should == Chef::JSONCompat.to_json(["recipe[nagios::client]", "role[production]", "recipe[apache2]"])
+ expect(Chef::JSONCompat.to_json(@run_list)).to eq(Chef::JSONCompat.to_json(["recipe[nagios::client]", "role[production]", "recipe[apache2]"]))
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
diff --git a/spec/unit/run_lock_spec.rb b/spec/unit/run_lock_spec.rb
index 80140dfcce..51e6ba1b84 100644
--- a/spec/unit/run_lock_spec.rb
+++ b/spec/unit/run_lock_spec.rb
@@ -25,15 +25,15 @@ describe Chef::RunLock do
describe "when first created" do
it "locates the lockfile in the file cache path by default" do
- Chef::Config.stub(:cache_path).and_return(default_cache_path)
+ allow(Chef::Config).to receive(:cache_path).and_return(default_cache_path)
run_lock = Chef::RunLock.new(Chef::Config.lockfile)
- run_lock.runlock_file.should == default_pid_location
+ expect(run_lock.runlock_file).to eq(default_pid_location)
end
it "locates the lockfile in the user-configured path when set" do
Chef::Config.lockfile = "/tmp/chef-client-running.pid"
run_lock = Chef::RunLock.new(Chef::Config.lockfile)
- run_lock.runlock_file.should == "/tmp/chef-client-running.pid"
+ expect(run_lock.runlock_file).to eq("/tmp/chef-client-running.pid")
end
end
@@ -42,20 +42,20 @@ describe Chef::RunLock do
subject(:runlock) { Chef::RunLock.new(lockfile) }
def stub_unblocked_run
- runlock.stub(:test).and_return(true)
+ allow(runlock).to receive(:test).and_return(true)
end
def stub_blocked_run(duration)
- runlock.stub(:test).and_return(false)
- runlock.stub(:wait) { sleep(duration) }
- runlock.stub(:runpid).and_return(666) # errors read blocking pid
+ allow(runlock).to receive(:test).and_return(false)
+ allow(runlock).to receive(:wait) { sleep(duration) }
+ allow(runlock).to receive(:runpid).and_return(666) # errors read blocking pid
end
describe "when Chef::Config[:run_lock_timeout] is not set (set to default)" do
describe "and the lockfile is not locked by another client run" do
it "should not wait" do
stub_unblocked_run
- Chef::RunLock.any_instance.should_not_receive(:wait)
+ expect_any_instance_of(Chef::RunLock).not_to receive(:wait)
runlock.acquire
end
end
@@ -63,7 +63,7 @@ describe Chef::RunLock do
describe "and the lockfile is locked by another client run" do
it "should wait for the lock to be released" do
stub_blocked_run(0.001)
- runlock.should_receive(:wait)
+ expect(runlock).to receive(:wait)
runlock.acquire
end
end
@@ -82,7 +82,7 @@ describe Chef::RunLock do
describe "and the lockfile is not locked by another client run" do
it "should acquire the lock" do
stub_unblocked_run
- runlock.should_not_receive(:wait)
+ expect(runlock).not_to receive(:wait)
runlock.acquire
end
end
@@ -90,7 +90,7 @@ describe Chef::RunLock do
describe "and the lockfile is locked by another client run" do
it "should raise Chef::Exceptions::RunLockTimeout" do
stub_blocked_run(0.001)
- runlock.should_not_receive(:wait)
+ expect(runlock).not_to receive(:wait)
expect{ runlock.acquire }.to raise_error(Chef::Exceptions::RunLockTimeout)
end
end
@@ -110,7 +110,7 @@ describe Chef::RunLock do
describe "and the lockfile is not locked by another client run" do
it "should acquire the lock" do
stub_unblocked_run
- runlock.should_not_receive(:wait)
+ expect(runlock).not_to receive(:wait)
runlock.acquire
end
end
@@ -119,7 +119,7 @@ describe Chef::RunLock do
describe "and the lock is released before the timeout expires" do
it "should acquire the lock" do
stub_blocked_run(@timeout/2.0)
- runlock.should_receive(:wait)
+ expect(runlock).to receive(:wait)
expect{ runlock.acquire }.not_to raise_error
end
end
@@ -127,7 +127,7 @@ describe Chef::RunLock do
describe "and the lock is not released before the timeout expires" do
it "should raise a RunLockTimeout exception" do
stub_blocked_run(2.0)
- runlock.should_receive(:wait)
+ expect(runlock).to receive(:wait)
expect{ runlock.acquire }.to raise_error(Chef::Exceptions::RunLockTimeout)
end
end
diff --git a/spec/unit/run_status_spec.rb b/spec/unit/run_status_spec.rb
index 6c85364871..d658cb5a5a 100644
--- a/spec/unit/run_status_spec.rb
+++ b/spec/unit/run_status_spec.rb
@@ -39,43 +39,43 @@ describe Chef::RunStatus do
end
it "has a run context" do
- @run_status.run_context.should equal(@run_context)
+ expect(@run_status.run_context).to equal(@run_context)
end
it "provides access to the run context's node" do
- @run_status.node.should equal(@node)
+ expect(@run_status.node).to equal(@node)
end
it "converts to a hash" do
- @run_status.to_hash[:node].should equal(@node)
- @run_status.to_hash[:success].should be_true
+ expect(@run_status.to_hash[:node]).to equal(@node)
+ expect(@run_status.to_hash[:success]).to be_truthy
end
describe "after it has recorded timing information" do
before do
@start_time = Time.new
@end_time = @start_time + 23
- Time.stub(:now).and_return(@start_time, @end_time)
+ allow(Time).to receive(:now).and_return(@start_time, @end_time)
@run_status.start_clock
@run_status.stop_clock
end
it "records the start time of the run" do
- @run_status.start_time.should == @start_time
+ expect(@run_status.start_time).to eq(@start_time)
end
it "records the end time of the run" do
- @run_status.end_time.should == @end_time
+ expect(@run_status.end_time).to eq(@end_time)
end
it "gives the elapsed time of the chef run" do
- @run_status.elapsed_time.should == 23
+ expect(@run_status.elapsed_time).to eq(23)
end
it "includes timing information in its hash form" do
- @run_status.to_hash[:start_time].should == @start_time
- @run_status.to_hash[:end_time].should == @end_time
- @run_status.to_hash[:elapsed_time].should == 23
+ expect(@run_status.to_hash[:start_time]).to eq(@start_time)
+ expect(@run_status.to_hash[:end_time]).to eq(@end_time)
+ expect(@run_status.to_hash[:elapsed_time]).to eq(23)
end
end
@@ -87,16 +87,16 @@ describe Chef::RunStatus do
end
it "lists all resources" do
- @run_status.all_resources.should == @all_resources
+ expect(@run_status.all_resources).to eq(@all_resources)
end
it "has no updated resources" do
- @run_status.updated_resources.should be_empty
+ expect(@run_status.updated_resources).to be_empty
end
it "includes the list of all resources in its hash form" do
- @run_status.to_hash[:all_resources].should == @all_resources
- @run_status.to_hash[:updated_resources].should be_empty
+ expect(@run_status.to_hash[:all_resources]).to eq(@all_resources)
+ expect(@run_status.to_hash[:updated_resources]).to be_empty
end
describe "and some have been updated" do
@@ -105,11 +105,11 @@ describe Chef::RunStatus do
end
it "lists the updated resources" do
- @run_status.updated_resources.should == [@all_resources.first]
+ expect(@run_status.updated_resources).to eq([@all_resources.first])
end
it "includes the list of updated resources in its hash form" do
- @run_status.to_hash[:updated_resources].should == [@all_resources.first]
+ expect(@run_status.to_hash[:updated_resources]).to eq([@all_resources.first])
end
end
end
@@ -123,22 +123,22 @@ describe Chef::RunStatus do
end
it "stores the exception" do
- @run_status.exception.should equal(@exception)
+ expect(@run_status.exception).to equal(@exception)
end
it "stores the backtrace" do
- @run_status.backtrace.should == @backtrace
+ expect(@run_status.backtrace).to eq(@backtrace)
end
it "says the run was not successful" do
- @run_status.success?.should be_false
- @run_status.failed?.should be_true
+ expect(@run_status.success?).to be_falsey
+ expect(@run_status.failed?).to be_truthy
end
it "converts to a hash including the exception information" do
- @run_status.to_hash[:success].should be_false
- @run_status.to_hash[:exception].should == "Exception: just testing"
- @run_status.to_hash[:backtrace].should == @backtrace
+ expect(@run_status.to_hash[:success]).to be_falsey
+ expect(@run_status.to_hash[:exception]).to eq("Exception: just testing")
+ expect(@run_status.to_hash[:backtrace]).to eq(@backtrace)
end
end
end
diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb
index 68d8b0e011..b30f818da1 100644
--- a/spec/unit/runner_spec.rb
+++ b/spec/unit/runner_spec.rb
@@ -81,322 +81,331 @@ end
describe Chef::Runner do
- before(:each) do
- @node = Chef::Node.new
- @node.name "latte"
- @node.automatic[:platform] = "mac_os_x"
- @node.automatic[:platform_version] = "10.5.1"
- @events = Chef::EventDispatch::Dispatcher.new
- @run_context = Chef::RunContext.new(@node, Chef::CookbookCollection.new({}), @events)
- @first_resource = Chef::Resource::Cat.new("loulou1", @run_context)
- @run_context.resource_collection << @first_resource
- Chef::Platform.set(
- :resource => :cat,
- :provider => Chef::Provider::SnakeOil
- )
- @runner = Chef::Runner.new(@run_context)
+ let(:node) do
+ node = Chef::Node.new
+ node.name "latte"
+ node.automatic[:platform] = "mac_os_x"
+ node.automatic[:platform_version] = "10.5.1"
+ node
end
- it "should pass each resource in the collection to a provider" do
- @run_context.resource_collection.should_receive(:execute_each_resource).once
- @runner.converge
- end
+ let(:events) { Chef::EventDispatch::Dispatcher.new }
+ let(:run_context) { Chef::RunContext.new(node, Chef::CookbookCollection.new({}), events) }
+ let(:first_resource) { Chef::Resource::Cat.new("loulou1", run_context) }
+ let(:runner) { Chef::Runner.new(run_context) }
- it "should use the provider specified by the resource (if it has one)" do
- provider = Chef::Provider::Easy.new(@run_context.resource_collection[0], @run_context)
- # Expect provider to be called twice, because will fall back to old provider lookup
- @run_context.resource_collection[0].should_receive(:provider).twice.and_return(Chef::Provider::Easy)
- Chef::Provider::Easy.should_receive(:new).once.and_return(provider)
- @runner.converge
+ before do
+ run_context.resource_collection << first_resource
end
- it "should use the platform provider if it has one" do
- Chef::Platform.should_receive(:find_provider_for_node).once.and_return(Chef::Provider::SnakeOil)
- @runner.converge
- end
+ context "when we fall through to old Chef::Platform resolution" do
+ let(:provider_resolver) { Chef::ProviderResolver.new(node, first_resource, nil) }
+ before do
+ # set up old Chef::Platform resolution instead of provider_resolver
+ Chef::Platform.set(
+ :resource => :cat,
+ :provider => Chef::Provider::SnakeOil
+ )
+ allow(Chef::ProviderResolver).to receive(:new).and_return(provider_resolver)
+ allow(provider_resolver).to receive(:maybe_dynamic_provider_resolution).with(first_resource, anything()).and_return(nil)
+ end
- it "should run the action for each resource" do
- Chef::Platform.should_receive(:find_provider_for_node).once.and_return(Chef::Provider::SnakeOil)
- provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context)
- provider.should_receive(:action_sell).once.and_return(true)
- Chef::Provider::SnakeOil.should_receive(:new).once.and_return(provider)
- @runner.converge
+ it "should use the platform provider if it has one" do
+ expect(Chef::Platform).to receive(:find_provider_for_node).with(node, first_resource).and_call_original
+ runner.converge
+ end
end
- it "should raise exceptions as thrown by a provider" do
- provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context)
- Chef::Provider::SnakeOil.stub(:new).once.and_return(provider)
- provider.stub(:action_sell).once.and_raise(ArgumentError)
- lambda { @runner.converge }.should raise_error(ArgumentError)
- end
+ context "when we are doing dynamic provider resolution" do
- it "should not raise exceptions thrown by providers if the resource has ignore_failure set to true" do
- @run_context.resource_collection[0].stub(:ignore_failure).and_return(true)
- provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context)
- Chef::Provider::SnakeOil.stub(:new).once.and_return(provider)
- provider.stub(:action_sell).once.and_raise(ArgumentError)
- lambda { @runner.converge }.should_not raise_error
- end
+ it "should pass each resource in the collection to a provider" do
+ expect(run_context.resource_collection).to receive(:execute_each_resource).once
+ runner.converge
+ end
- it "should retry with the specified delay if retries are specified" do
- @first_resource.retries 3
- provider = Chef::Provider::SnakeOil.new(@run_context.resource_collection[0], @run_context)
- Chef::Provider::SnakeOil.stub(:new).once.and_return(provider)
- provider.stub(:action_sell).and_raise(ArgumentError)
- @first_resource.should_receive(:sleep).with(2).exactly(3).times
- lambda { @runner.converge }.should raise_error(ArgumentError)
- end
+ it "should use the provider specified by the resource (if it has one)" do
+ provider = Chef::Provider::Easy.new(run_context.resource_collection[0], run_context)
+ # Expect provider to be called twice, because will fall back to old provider lookup
+ expect(run_context.resource_collection[0]).to receive(:provider).twice.and_return(Chef::Provider::Easy)
+ expect(Chef::Provider::Easy).to receive(:new).once.and_return(provider)
+ runner.converge
+ end
- it "should execute immediate actions on changed resources" do
- notifying_resource = Chef::Resource::Cat.new("peanut", @run_context)
- notifying_resource.action = :purr # only action that will set updated on the resource
+ it "should run the action for each resource" do
+ provider = Chef::Provider::SnakeOil.new(run_context.resource_collection[0], run_context)
+ expect(provider).to receive(:action_sell).once.and_return(true)
+ expect(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider)
+ runner.converge
+ end
- @run_context.resource_collection << notifying_resource
- @first_resource.action = :nothing # won't be updated unless notified by other resource
+ it "should raise exceptions as thrown by a provider" do
+ provider = Chef::Provider::SnakeOil.new(run_context.resource_collection[0], run_context)
+ allow(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider)
+ allow(provider).to receive(:action_sell).once.and_raise(ArgumentError)
+ expect { runner.converge }.to raise_error(ArgumentError)
+ end
- notifying_resource.notifies(:purr, @first_resource, :immediately)
+ it "should not raise exceptions thrown by providers if the resource has ignore_failure set to true" do
+ allow(run_context.resource_collection[0]).to receive(:ignore_failure).and_return(true)
+ provider = Chef::Provider::SnakeOil.new(run_context.resource_collection[0], run_context)
+ allow(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider)
+ allow(provider).to receive(:action_sell).once.and_raise(ArgumentError)
+ expect { runner.converge }.not_to raise_error
+ end
- @runner.converge
+ it "should retry with the specified delay if retries are specified" do
+ first_resource.retries 3
+ provider = Chef::Provider::SnakeOil.new(run_context.resource_collection[0], run_context)
+ allow(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider)
+ allow(provider).to receive(:action_sell).and_raise(ArgumentError)
+ expect(first_resource).to receive(:sleep).with(2).exactly(3).times
+ expect { runner.converge }.to raise_error(ArgumentError)
+ end
- @first_resource.should be_updated
- end
+ it "should execute immediate actions on changed resources" do
+ notifying_resource = Chef::Resource::Cat.new("peanut", run_context)
+ notifying_resource.action = :purr # only action that will set updated on the resource
- it "should follow a chain of actions" do
- @first_resource.action = :nothing
+ run_context.resource_collection << notifying_resource
+ first_resource.action = :nothing # won't be updated unless notified by other resource
- middle_resource = Chef::Resource::Cat.new("peanut", @run_context)
- middle_resource.action = :nothing
- @run_context.resource_collection << middle_resource
- middle_resource.notifies(:purr, @first_resource, :immediately)
+ notifying_resource.notifies(:purr, first_resource, :immediately)
- last_resource = Chef::Resource::Cat.new("snuffles", @run_context)
- last_resource.action = :purr
- @run_context.resource_collection << last_resource
- last_resource.notifies(:purr, middle_resource, :immediately)
+ runner.converge
- @runner.converge
+ expect(first_resource).to be_updated
+ end
- last_resource.should be_updated # by action(:purr)
- middle_resource.should be_updated # by notification from last_resource
- @first_resource.should be_updated # by notification from middle_resource
- end
+ it "should follow a chain of actions" do
+ first_resource.action = :nothing
- it "should execute delayed actions on changed resources" do
- @first_resource.action = :nothing
- second_resource = Chef::Resource::Cat.new("peanut", @run_context)
- second_resource.action = :purr
+ middle_resource = Chef::Resource::Cat.new("peanut", run_context)
+ middle_resource.action = :nothing
+ run_context.resource_collection << middle_resource
+ middle_resource.notifies(:purr, first_resource, :immediately)
- @run_context.resource_collection << second_resource
- second_resource.notifies(:purr, @first_resource, :delayed)
+ last_resource = Chef::Resource::Cat.new("snuffles", run_context)
+ last_resource.action = :purr
+ run_context.resource_collection << last_resource
+ last_resource.notifies(:purr, middle_resource, :immediately)
- @runner.converge
+ runner.converge
- @first_resource.should be_updated
- end
+ expect(last_resource).to be_updated # by action(:purr)
+ expect(middle_resource).to be_updated # by notification from last_resource
+ expect(first_resource).to be_updated # by notification from middle_resource
+ end
- it "should execute delayed notifications when a failure occurs in the chef client run" do
- @first_resource.action = :nothing
- second_resource = Chef::Resource::Cat.new("peanut", @run_context)
- second_resource.action = :purr
+ it "should execute delayed actions on changed resources" do
+ first_resource.action = :nothing
+ second_resource = Chef::Resource::Cat.new("peanut", run_context)
+ second_resource.action = :purr
- @run_context.resource_collection << second_resource
- second_resource.notifies(:purr, @first_resource, :delayed)
+ run_context.resource_collection << second_resource
+ second_resource.notifies(:purr, first_resource, :delayed)
- third_resource = FailureResource.new("explode", @run_context)
- @run_context.resource_collection << third_resource
+ runner.converge
- lambda {@runner.converge}.should raise_error(FailureProvider::ChefClientFail)
+ expect(first_resource).to be_updated
+ end
- @first_resource.should be_updated
- end
+ it "should execute delayed notifications when a failure occurs in the chef client run" do
+ first_resource.action = :nothing
+ second_resource = Chef::Resource::Cat.new("peanut", run_context)
+ second_resource.action = :purr
- it "should execute delayed notifications when a failure occurs in a notification" do
- @first_resource.action = :nothing
- second_resource = Chef::Resource::Cat.new("peanut", @run_context)
- second_resource.action = :purr
+ run_context.resource_collection << second_resource
+ second_resource.notifies(:purr, first_resource, :delayed)
- @run_context.resource_collection << second_resource
+ third_resource = FailureResource.new("explode", run_context)
+ run_context.resource_collection << third_resource
- third_resource = FailureResource.new("explode", @run_context)
- third_resource.action = :nothing
- @run_context.resource_collection << third_resource
+ expect { runner.converge }.to raise_error(FailureProvider::ChefClientFail)
- second_resource.notifies(:fail, third_resource, :delayed)
- second_resource.notifies(:purr, @first_resource, :delayed)
+ expect(first_resource).to be_updated
+ end
- lambda {@runner.converge}.should raise_error(FailureProvider::ChefClientFail)
+ it "should execute delayed notifications when a failure occurs in a notification" do
+ first_resource.action = :nothing
+ second_resource = Chef::Resource::Cat.new("peanut", run_context)
+ second_resource.action = :purr
- @first_resource.should be_updated
- end
+ run_context.resource_collection << second_resource
- it "should execute delayed notifications when a failure occurs in multiple notifications" do
- @first_resource.action = :nothing
- second_resource = Chef::Resource::Cat.new("peanut", @run_context)
- second_resource.action = :purr
+ third_resource = FailureResource.new("explode", run_context)
+ third_resource.action = :nothing
+ run_context.resource_collection << third_resource
- @run_context.resource_collection << second_resource
+ second_resource.notifies(:fail, third_resource, :delayed)
+ second_resource.notifies(:purr, first_resource, :delayed)
- third_resource = FailureResource.new("explode", @run_context)
- third_resource.action = :nothing
- @run_context.resource_collection << third_resource
+ expect {runner.converge}.to raise_error(FailureProvider::ChefClientFail)
- fourth_resource = FailureResource.new("explode again", @run_context)
- fourth_resource.action = :nothing
- @run_context.resource_collection << fourth_resource
+ expect(first_resource).to be_updated
+ end
- second_resource.notifies(:fail, third_resource, :delayed)
- second_resource.notifies(:fail, fourth_resource, :delayed)
- second_resource.notifies(:purr, @first_resource, :delayed)
+ it "should execute delayed notifications when a failure occurs in multiple notifications" do
+ first_resource.action = :nothing
+ second_resource = Chef::Resource::Cat.new("peanut", run_context)
+ second_resource.action = :purr
- exception = nil
- begin
- @runner.converge
- rescue => e
- exception = e
- end
- exception.should be_a(Chef::Exceptions::MultipleFailures)
+ run_context.resource_collection << second_resource
+
+ third_resource = FailureResource.new("explode", run_context)
+ third_resource.action = :nothing
+ run_context.resource_collection << third_resource
+
+ fourth_resource = FailureResource.new("explode again", run_context)
+ fourth_resource.action = :nothing
+ run_context.resource_collection << fourth_resource
+
+ second_resource.notifies(:fail, third_resource, :delayed)
+ second_resource.notifies(:fail, fourth_resource, :delayed)
+ second_resource.notifies(:purr, first_resource, :delayed)
+
+ exception = nil
+ begin
+ runner.converge
+ rescue => e
+ exception = e
+ end
+ expect(exception).to be_a(Chef::Exceptions::MultipleFailures)
- expected_message =<<-E
+ expected_message =<<-E
Multiple failures occurred:
* FailureProvider::ChefClientFail occurred in delayed notification: [explode] (dynamically defined) had an error: FailureProvider::ChefClientFail: chef had an error of some sort
* FailureProvider::ChefClientFail occurred in delayed notification: [explode again] (dynamically defined) had an error: FailureProvider::ChefClientFail: chef had an error of some sort
-E
- exception.message.should == expected_message
+ E
+ expect(exception.message).to eq(expected_message)
- @first_resource.should be_updated
- end
-
- it "does not duplicate delayed notifications" do
- SnitchyProvider.clear_action_record
-
- Chef::Platform.set(
- :resource => :cat,
- :provider => SnitchyProvider
- )
+ expect(first_resource).to be_updated
+ end
- @first_resource.action = :nothing
+ it "does not duplicate delayed notifications" do
+ SnitchyProvider.clear_action_record
- second_resource = Chef::Resource::Cat.new("peanut", @run_context)
- second_resource.action = :first_action
- @run_context.resource_collection << second_resource
+ first_resource.action = :nothing
+ first_resource.provider = SnitchyProvider
- third_resource = Chef::Resource::Cat.new("snickers", @run_context)
- third_resource.action = :first_action
- @run_context.resource_collection << third_resource
+ second_resource = Chef::Resource::Cat.new("peanut", run_context)
+ second_resource.action = :first_action
+ second_resource.provider = SnitchyProvider
+ run_context.resource_collection << second_resource
- second_resource.notifies(:second_action, @first_resource, :delayed)
- second_resource.notifies(:third_action, @first_resource, :delayed)
+ third_resource = Chef::Resource::Cat.new("snickers", run_context)
+ third_resource.action = :first_action
+ third_resource.provider = SnitchyProvider
+ run_context.resource_collection << third_resource
- third_resource.notifies(:second_action, @first_resource, :delayed)
- third_resource.notifies(:third_action, @first_resource, :delayed)
+ second_resource.notifies(:second_action, first_resource, :delayed)
+ second_resource.notifies(:third_action, first_resource, :delayed)
- @runner.converge
- # resources 2 and 3 call :first_action in the course of normal resource
- # execution, and schedule delayed actions :second and :third on the first
- # resource. The duplicate actions should "collapse" to a single notification
- # and order should be preserved.
- SnitchyProvider.all_actions_called.should == [:first, :first, :second, :third]
- end
+ third_resource.notifies(:second_action, first_resource, :delayed)
+ third_resource.notifies(:third_action, first_resource, :delayed)
- it "executes delayed notifications in the order they were declared" do
- SnitchyProvider.clear_action_record
+ runner.converge
+ # resources 2 and 3 call :first_action in the course of normal resource
+ # execution, and schedule delayed actions :second and :third on the first
+ # resource. The duplicate actions should "collapse" to a single notification
+ # and order should be preserved.
+ expect(SnitchyProvider.all_actions_called).to eq([:first, :first, :second, :third])
+ end
- Chef::Platform.set(
- :resource => :cat,
- :provider => SnitchyProvider
- )
+ it "executes delayed notifications in the order they were declared" do
+ SnitchyProvider.clear_action_record
- @first_resource.action = :nothing
+ first_resource.action = :nothing
+ first_resource.provider = SnitchyProvider
- second_resource = Chef::Resource::Cat.new("peanut", @run_context)
- second_resource.action = :first_action
- @run_context.resource_collection << second_resource
+ second_resource = Chef::Resource::Cat.new("peanut", run_context)
+ second_resource.action = :first_action
+ second_resource.provider = SnitchyProvider
+ run_context.resource_collection << second_resource
- third_resource = Chef::Resource::Cat.new("snickers", @run_context)
- third_resource.action = :first_action
- @run_context.resource_collection << third_resource
+ third_resource = Chef::Resource::Cat.new("snickers", run_context)
+ third_resource.action = :first_action
+ third_resource.provider = SnitchyProvider
+ run_context.resource_collection << third_resource
- second_resource.notifies(:second_action, @first_resource, :delayed)
- second_resource.notifies(:second_action, @first_resource, :delayed)
+ second_resource.notifies(:second_action, first_resource, :delayed)
+ second_resource.notifies(:second_action, first_resource, :delayed)
- third_resource.notifies(:third_action, @first_resource, :delayed)
- third_resource.notifies(:third_action, @first_resource, :delayed)
+ third_resource.notifies(:third_action, first_resource, :delayed)
+ third_resource.notifies(:third_action, first_resource, :delayed)
- @runner.converge
- SnitchyProvider.all_actions_called.should == [:first, :first, :second, :third]
- end
+ runner.converge
+ expect(SnitchyProvider.all_actions_called).to eq([:first, :first, :second, :third])
+ end
- it "does not fire notifications if the resource was not updated by the last action executed" do
- # REGRESSION TEST FOR CHEF-1452
- SnitchyProvider.clear_action_record
+ it "does not fire notifications if the resource was not updated by the last action executed" do
+ # REGRESSION TEST FOR CHEF-1452
+ SnitchyProvider.clear_action_record
- Chef::Platform.set(
- :resource => :cat,
- :provider => SnitchyProvider
- )
+ first_resource.action = :first_action
+ first_resource.provider = SnitchyProvider
- @first_resource.action = :first_action
+ second_resource = Chef::Resource::Cat.new("peanut", run_context)
+ second_resource.action = :nothing
+ second_resource.provider = SnitchyProvider
+ run_context.resource_collection << second_resource
- second_resource = Chef::Resource::Cat.new("peanut", @run_context)
- second_resource.action = :nothing
- @run_context.resource_collection << second_resource
+ third_resource = Chef::Resource::Cat.new("snickers", run_context)
+ third_resource.action = :nothing
+ third_resource.provider = SnitchyProvider
+ run_context.resource_collection << third_resource
- third_resource = Chef::Resource::Cat.new("snickers", @run_context)
- third_resource.action = :nothing
- @run_context.resource_collection << third_resource
+ first_resource.notifies(:second_action, second_resource, :immediately)
+ second_resource.notifies(:third_action, third_resource, :immediately)
- @first_resource.notifies(:second_action, second_resource, :immediately)
- second_resource.notifies(:third_action, third_resource, :immediately)
+ runner.converge
- @runner.converge
+ # All of the resources should only fire once:
+ expect(SnitchyProvider.all_actions_called).to eq([:first, :second, :third])
- # All of the resources should only fire once:
- SnitchyProvider.all_actions_called.should == [:first, :second, :third]
+ # all of the resources should be marked as updated for reporting purposes
+ expect(first_resource).to be_updated
+ expect(second_resource).to be_updated
+ expect(third_resource).to be_updated
+ end
- # all of the resources should be marked as updated for reporting purposes
- @first_resource.should be_updated
- second_resource.should be_updated
- third_resource.should be_updated
- end
+ it "should check a resource's only_if and not_if if notified by another resource" do
+ first_resource.action = :buy
- it "should check a resource's only_if and not_if if notified by another resource" do
- @first_resource.action = :buy
+ only_if_called_times = 0
+ first_resource.only_if {only_if_called_times += 1; true}
- only_if_called_times = 0
- @first_resource.only_if {only_if_called_times += 1; true}
+ not_if_called_times = 0
+ first_resource.not_if {not_if_called_times += 1; false}
- not_if_called_times = 0
- @first_resource.not_if {not_if_called_times += 1; false}
+ second_resource = Chef::Resource::Cat.new("carmel", run_context)
+ run_context.resource_collection << second_resource
+ second_resource.notifies(:purr, first_resource, :delayed)
+ second_resource.action = :purr
- second_resource = Chef::Resource::Cat.new("carmel", @run_context)
- @run_context.resource_collection << second_resource
- second_resource.notifies(:purr, @first_resource, :delayed)
- second_resource.action = :purr
+ # hits only_if first time when the resource is run in order, second on notify
+ runner.converge
- # hits only_if first time when the resource is run in order, second on notify
- @runner.converge
+ expect(only_if_called_times).to eq(2)
+ expect(not_if_called_times).to eq(2)
+ end
- only_if_called_times.should == 2
- not_if_called_times.should == 2
- end
+ it "should resolve resource references in notifications when resources are defined lazily" do
+ first_resource.action = :nothing
- it "should resolve resource references in notifications when resources are defined lazily" do
- @first_resource.action = :nothing
+ lazy_resources = lambda {
+ last_resource = Chef::Resource::Cat.new("peanut", run_context)
+ run_context.resource_collection << last_resource
+ last_resource.notifies(:purr, first_resource.to_s, :delayed)
+ last_resource.action = :purr
+ }
+ second_resource = Chef::Resource::RubyBlock.new("myblock", run_context)
+ run_context.resource_collection << second_resource
+ second_resource.block { lazy_resources.call }
- lazy_resources = lambda {
- last_resource = Chef::Resource::Cat.new("peanut", @run_context)
- @run_context.resource_collection << last_resource
- last_resource.notifies(:purr, @first_resource.to_s, :delayed)
- last_resource.action = :purr
- }
- second_resource = Chef::Resource::RubyBlock.new("myblock", @run_context)
- @run_context.resource_collection << second_resource
- second_resource.block { lazy_resources.call }
+ runner.converge
- @runner.converge
+ expect(first_resource).to be_updated
+ end
- @first_resource.should be_updated
end
-
end
-
diff --git a/spec/unit/scan_access_control_spec.rb b/spec/unit/scan_access_control_spec.rb
index 48f820ff85..8cf681e994 100644
--- a/spec/unit/scan_access_control_spec.rb
+++ b/spec/unit/scan_access_control_spec.rb
@@ -39,9 +39,9 @@ describe Chef::ScanAccessControl do
end
it "does not set any fields on the current resource" do
- @current_resource.owner.should be_nil
- @current_resource.group.should be_nil
- @current_resource.mode.should be_nil
+ expect(@current_resource.owner).to be_nil
+ expect(@current_resource.group).to be_nil
+ expect(@current_resource.mode).to be_nil
end
end
@@ -50,9 +50,9 @@ describe Chef::ScanAccessControl do
before do
@stat = double("File::Stat for #{@new_resource.path}", :uid => 0, :gid => 0, :mode => 00100644)
- File.should_receive(:realpath).with(@new_resource.path).and_return(@real_file)
- File.should_receive(:stat).with(@real_file).and_return(@stat)
- File.should_receive(:exist?).with(@new_resource.path).and_return(true)
+ expect(File).to receive(:realpath).with(@new_resource.path).and_return(@real_file)
+ expect(File).to receive(:stat).with(@real_file).and_return(@stat)
+ expect(File).to receive(:exist?).with(@new_resource.path).and_return(true)
end
describe "when new_resource does not specify mode, user or group" do
@@ -62,26 +62,26 @@ describe Chef::ScanAccessControl do
end
it "sets the mode of the current resource to the current mode as a String" do
- @current_resource.mode.should == "0644"
+ expect(@current_resource.mode).to eq("0644")
end
context "on unix", :unix_only do
it "sets the group of the current resource to the current group as a String" do
- @current_resource.group.should == Etc.getgrgid(0).name
+ expect(@current_resource.group).to eq(Etc.getgrgid(0).name)
end
it "sets the owner of the current resource to the current owner as a String" do
- @current_resource.user.should == "root"
+ expect(@current_resource.user).to eq("root")
end
end
context "on windows", :windows_only do
it "sets the group of the current resource to the current group as a String" do
- @current_resource.group.should == 0
+ expect(@current_resource.group).to eq(0)
end
it "sets the owner of the current resource to the current owner as a String" do
- @current_resource.user.should == 0
+ expect(@current_resource.user).to eq(0)
end
end
end
@@ -93,7 +93,7 @@ describe Chef::ScanAccessControl do
end
it "sets the mode of the current resource to the file's current mode as a string" do
- @current_resource.mode.should == "0644"
+ expect(@current_resource.mode).to eq("0644")
end
end
@@ -104,7 +104,7 @@ describe Chef::ScanAccessControl do
end
it "sets the mode of the current resource to the current mode as a String" do
- @current_resource.mode.should == "0644"
+ expect(@current_resource.mode).to eq("0644")
end
end
@@ -117,7 +117,7 @@ describe Chef::ScanAccessControl do
end
it "sets the owner of current_resource to the UID of the current owner" do
- @current_resource.user.should == 0
+ expect(@current_resource.user).to eq(0)
end
end
@@ -129,17 +129,17 @@ describe Chef::ScanAccessControl do
it "sets the owner of current_resource to the username of the current owner" do
@root_passwd = double("Struct::Passwd for uid 0", :name => "root")
- Etc.should_receive(:getpwuid).with(0).and_return(@root_passwd)
+ expect(Etc).to receive(:getpwuid).with(0).and_return(@root_passwd)
@scanner.set_all!
- @current_resource.user.should == "root"
+ expect(@current_resource.user).to eq("root")
end
describe "and there is no passwd entry for the user" do
it "sets the owner of the current_resource to the UID" do
- Etc.should_receive(:getpwuid).with(0).and_raise(ArgumentError)
+ expect(Etc).to receive(:getpwuid).with(0).and_raise(ArgumentError)
@scanner.set_all!
- @current_resource.user.should == 0
+ expect(@current_resource.user).to eq(0)
end
end
end
@@ -152,7 +152,7 @@ describe Chef::ScanAccessControl do
end
it "sets the group of the current_resource to the gid of the current owner" do
- @current_resource.group.should == 0
+ expect(@current_resource.group).to eq(0)
end
end
@@ -164,17 +164,17 @@ describe Chef::ScanAccessControl do
it "sets the group of the current resource to the group name" do
@group_entry = double("Struct::Group for wheel", :name => "wheel")
- Etc.should_receive(:getgrgid).with(0).and_return(@group_entry)
+ expect(Etc).to receive(:getgrgid).with(0).and_return(@group_entry)
@scanner.set_all!
- @current_resource.group.should == "wheel"
+ expect(@current_resource.group).to eq("wheel")
end
describe "and there is no group entry for the group" do
it "sets the current_resource's group to the GID" do
- Etc.should_receive(:getgrgid).with(0).and_raise(ArgumentError)
+ expect(Etc).to receive(:getgrgid).with(0).and_raise(ArgumentError)
@scanner.set_all!
- @current_resource.group.should == 0
+ expect(@current_resource.group).to eq(0)
end
end
diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb
index c7388a6234..d4ff9e4367 100644
--- a/spec/unit/search/query_spec.rb
+++ b/spec/unit/search/query_spec.rb
@@ -68,8 +68,8 @@ describe Chef::Search::Query do
end
before(:each) do
- Chef::REST.stub(:new).and_return(rest)
- rest.stub(:get_rest).and_return(response)
+ allow(Chef::REST).to receive(:new).and_return(rest)
+ allow(rest).to receive(:get_rest).and_return(response)
end
describe "search" do
@@ -133,57 +133,57 @@ describe Chef::Search::Query do
} }
it "should accept a type as the first argument" do
- lambda { query.search("node") }.should_not raise_error
- lambda { query.search(:node) }.should_not raise_error
- lambda { query.search(Hash.new) }.should raise_error(Chef::Exceptions::InvalidSearchQuery, /(Hash)/)
+ expect { query.search("node") }.not_to raise_error
+ expect { query.search(:node) }.not_to raise_error
+ expect { query.search(Hash.new) }.to raise_error(Chef::Exceptions::InvalidSearchQuery, /(Hash)/)
end
it "should query for every object of a type by default" do
- rest.should_receive(:get_rest).with("search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000").and_return(response)
query.search(:node)
end
it "should allow a custom query" do
- rest.should_receive(:get_rest).with("search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000").and_return(response)
query.search(:node, "platform:rhel")
end
it "should let you set a sort order" do
- rest.should_receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=0&rows=1000").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=0&rows=1000").and_return(response)
query.search(:node, "platform:rhel", "id desc")
end
it "should let you set a starting object" do
- rest.should_receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=2&rows=1000").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=2&rows=1000").and_return(response)
query.search(:node, "platform:rhel", "id desc", 2)
end
it "should let you set how many rows to return" do
- rest.should_receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=2&rows=40").and_return(response)
+ expect(rest).to receive(:get_rest).with("search/node?q=platform:rhel&sort=id%20desc&start=2&rows=40").and_return(response)
query.search(:node, "platform:rhel", "id desc", 2, 40)
end
it "should throw an exception if you pass to many options" do
- lambda { query.search(:node, "platform:rhel", "id desc", 2, 40, "wrong") }
- .should raise_error(Chef::Exceptions::InvalidSearchQuery, "Too many arguments! (4 for <= 3)")
+ expect { query.search(:node, "platform:rhel", "id desc", 2, 40, "wrong") }
+ .to raise_error(Chef::Exceptions::InvalidSearchQuery, "Too many arguments! (4 for <= 3)")
end
it "should return the raw rows, start, and total if no block is passed" do
rows, start, total = query.search(:node)
- rows.should equal(response["rows"])
- start.should equal(response["start"])
- total.should equal(response["total"])
+ expect(rows).to equal(response["rows"])
+ expect(start).to equal(response["start"])
+ expect(total).to equal(response["total"])
end
it "should call a block for each object in the response" do
@call_me = double("blocky")
- response["rows"].each { |r| @call_me.should_receive(:do).with(r) }
+ response["rows"].each { |r| expect(@call_me).to receive(:do).with(r) }
query.search(:node) { |r| @call_me.do(r) }
end
it "should page through the responses" do
@call_me = double("blocky")
- response["rows"].each { |r| @call_me.should_receive(:do).with(r) }
+ response["rows"].each { |r| expect(@call_me).to receive(:do).with(r) }
query.search(:node, "*:*", nil, 0, 1) { |r| @call_me.do(r) }
end
@@ -192,17 +192,17 @@ describe Chef::Search::Query do
let(:filter_key) { :filter_result }
before(:each) do
- rest.should_receive(:post_rest).with(query_string, args[filter_key]).and_return(response)
+ expect(rest).to receive(:post_rest).with(query_string, args[filter_key]).and_return(response)
end
it "should return start" do
start = query.search(:node, "platform:rhel", args)[1]
- start.should == response['start']
+ expect(start).to eq(response['start'])
end
it "should return total" do
total = query.search(:node, "platform:rhel", args)[2]
- total.should == response['total']
+ expect(total).to eq(response['total'])
end
it "should return rows with the filter applied" do
@@ -211,13 +211,13 @@ describe Chef::Search::Query do
results.each_with_index do |result, idx|
expected = response["rows"][idx]
- result.should have_key("url")
- result["url"].should == expected["url"]
+ expect(result).to have_key("url")
+ expect(result["url"]).to eq(expected["url"])
- result.should have_key("data")
+ expect(result).to have_key("data")
filter_hash.keys.each do |filter_key|
- result["data"].should have_key(filter_key)
- result["data"][filter_key].should == expected["data"][filter_key]
+ expect(result["data"]).to have_key(filter_key)
+ expect(result["data"][filter_key]).to eq(expected["data"][filter_key])
end
end
end
@@ -232,21 +232,21 @@ describe Chef::Search::Query do
it "should emit a deprecation warning" do
# partial_search calls search, so we'll stub search to return empty
- query.stub(:search).and_return( [ [], 0, 0 ] )
- Chef::Log.should_receive(:warn).with("DEPRECATED: The 'partial_search' api is deprecated, please use the search api with 'filter_result'")
+ allow(query).to receive(:search).and_return( [ [], 0, 0 ] )
+ expect(Chef::Log).to receive(:warn).with("DEPRECATED: The 'partial_search' api is deprecated, please use the search api with 'filter_result'")
query.partial_search(:node, "platform:rhel", args)
end
it "should return an array of filtered hashes" do
- rest.should_receive(:post_rest).with(query_string, args[filter_key]).and_return(response)
+ expect(rest).to receive(:post_rest).with(query_string, args[filter_key]).and_return(response)
results = query.partial_search(:node, "platform:rhel", args)
results.each_with_index do |result, idx|
expected = response["rows"][idx]
filter_hash.keys.each do |filter_key|
- result.should have_key(filter_key)
- result[filter_key].should == expected["data"][filter_key]
+ expect(result).to have_key(filter_key)
+ expect(result[filter_key]).to eq(expected["data"][filter_key])
end
end
end
diff --git a/spec/unit/shell/model_wrapper_spec.rb b/spec/unit/shell/model_wrapper_spec.rb
index eae3b2b581..d6da2dcffc 100644
--- a/spec/unit/shell/model_wrapper_spec.rb
+++ b/spec/unit/shell/model_wrapper_spec.rb
@@ -32,12 +32,12 @@ describe Shell::ModelWrapper do
end
it "uses the explicit model symbol" do
- @wrapper.model_symbol.should == :client
+ expect(@wrapper.model_symbol).to eq(:client)
end
end
it "determines the model symbol from the class name" do
- @wrapper.model_symbol.should == :node
+ expect(@wrapper.model_symbol).to eq(:node)
end
describe "when listing objects" do
@@ -48,16 +48,16 @@ describe Shell::ModelWrapper do
@node_2.name("yummy")
@server_response = {:node_1 => @node_1, :node_2 => @node_2}
@wrapper = Shell::ModelWrapper.new(Chef::Node)
- Chef::Node.stub(:list).and_return(@server_response)
+ allow(Chef::Node).to receive(:list).and_return(@server_response)
end
it "lists fully inflated objects without the resource IDs" do
- @wrapper.all.should have(2).nodes
- @wrapper.all.should include(@node_1, @node_2)
+ expect(@wrapper.all.size).to eq(2)
+ expect(@wrapper.all).to include(@node_1, @node_2)
end
it "maps the listed nodes when given a block" do
- @wrapper.all {|n| n.name }.sort.reverse.should == %w{yummy sammich}
+ expect(@wrapper.all {|n| n.name }.sort.reverse).to eq(%w{yummy sammich})
end
end
@@ -72,23 +72,23 @@ describe Shell::ModelWrapper do
# Creating a Chef::Search::Query object tries to read the private key...
@searcher = double("Chef::Search::Query #{__FILE__}:#{__LINE__}")
- Chef::Search::Query.stub(:new).and_return(@searcher)
+ allow(Chef::Search::Query).to receive(:new).and_return(@searcher)
end
it "falls back to listing the objects when the 'query' is :all" do
- Chef::Node.stub(:list).and_return(@server_response)
- @wrapper.find(:all).should include(@node_1, @node_2)
+ allow(Chef::Node).to receive(:list).and_return(@server_response)
+ expect(@wrapper.find(:all)).to include(@node_1, @node_2)
end
it "searches for objects using the given query string" do
- @searcher.should_receive(:search).with(:node, 'name:app*').and_yield(@node_1).and_yield(@node_2)
- @wrapper.find("name:app*").should include(@node_1, @node_2)
+ expect(@searcher).to receive(:search).with(:node, 'name:app*').and_yield(@node_1).and_yield(@node_2)
+ expect(@wrapper.find("name:app*")).to include(@node_1, @node_2)
end
it "creates a 'AND'-joined query string from a HASH" do
# Hash order woes
- @searcher.should_receive(:search).with(:node, 'name:app* AND name:app*').and_yield(@node_1).and_yield(@node_2)
- @wrapper.find(:name=>"app*",'name'=>"app*").should include(@node_1, @node_2)
+ expect(@searcher).to receive(:search).with(:node, 'name:app* AND name:app*').and_yield(@node_1).and_yield(@node_2)
+ expect(@wrapper.find(:name=>"app*",'name'=>"app*")).to include(@node_1, @node_2)
end
end
diff --git a/spec/unit/shell/shell_ext_spec.rb b/spec/unit/shell/shell_ext_spec.rb
index c24acbca3e..9521ae646b 100644
--- a/spec/unit/shell/shell_ext_spec.rb
+++ b/spec/unit/shell/shell_ext_spec.rb
@@ -23,7 +23,7 @@ describe Shell::Extensions do
before do
@shell_client = TestableShellSession.instance
- Shell.stub(:session).and_return(@shell_client)
+ allow(Shell).to receive(:session).and_return(@shell_client)
@job_manager = TestJobManager.new
@root_context = Object.new
@root_context.instance_eval(&ObjectTestHarness)
@@ -37,98 +37,98 @@ describe Shell::Extensions do
irb_context = double("context", :main => target_context_obj)
irb_session = double("irb session", :context => irb_context)
@job_manager.jobs = [[:thread, irb_session]]
- @root_context.stub(:jobs).and_return(@job_manager)
+ allow(@root_context).to receive(:jobs).and_return(@job_manager)
@root_context.ensure_session_select_defined
- @root_context.jobs.select_shell_session(target_context_obj).should == irb_session
- @root_context.jobs.select_shell_session(:idontexist).should be_nil
+ expect(@root_context.jobs.select_shell_session(target_context_obj)).to eq(irb_session)
+ expect(@root_context.jobs.select_shell_session(:idontexist)).to be_nil
end
it "finds, then switches to a session" do
@job_manager.jobs = []
- @root_context.stub(:ensure_session_select_defined)
- @root_context.stub(:jobs).and_return(@job_manager)
- @job_manager.should_receive(:select_shell_session).and_return(:the_shell_session)
- @job_manager.should_receive(:switch).with(:the_shell_session)
+ allow(@root_context).to receive(:ensure_session_select_defined)
+ allow(@root_context).to receive(:jobs).and_return(@job_manager)
+ expect(@job_manager).to receive(:select_shell_session).and_return(:the_shell_session)
+ expect(@job_manager).to receive(:switch).with(:the_shell_session)
@root_context.find_or_create_session_for(:foo)
end
it "creates a new session if an existing one isn't found" do
@job_manager.jobs = []
- @root_context.stub(:jobs).and_return(@job_manager)
- @job_manager.stub(:select_shell_session).and_return(nil)
- @root_context.should_receive(:irb).with(:foo)
+ allow(@root_context).to receive(:jobs).and_return(@job_manager)
+ allow(@job_manager).to receive(:select_shell_session).and_return(nil)
+ expect(@root_context).to receive(:irb).with(:foo)
@root_context.find_or_create_session_for(:foo)
end
it "switches to recipe context" do
- @root_context.should respond_to(:recipe_mode)
+ expect(@root_context).to respond_to(:recipe_mode)
@shell_client.recipe = :monkeyTime
- @root_context.should_receive(:find_or_create_session_for).with(:monkeyTime)
+ expect(@root_context).to receive(:find_or_create_session_for).with(:monkeyTime)
@root_context.recipe_mode
end
it "switches to attribute context" do
- @root_context.should respond_to(:attributes_mode)
+ expect(@root_context).to respond_to(:attributes_mode)
@shell_client.node = "monkeyNodeTime"
- @root_context.should_receive(:find_or_create_session_for).with("monkeyNodeTime")
+ expect(@root_context).to receive(:find_or_create_session_for).with("monkeyNodeTime")
@root_context.attributes_mode
end
it "has a help command" do
- @root_context.should respond_to(:help)
+ expect(@root_context).to respond_to(:help)
end
it "turns irb tracing on and off" do
- @root_context.should respond_to(:trace)
- @root_context.conf.should_receive(:use_tracer=).with(true)
- @root_context.stub(:tracing?)
+ expect(@root_context).to respond_to(:trace)
+ expect(@root_context.conf).to receive(:use_tracer=).with(true)
+ allow(@root_context).to receive(:tracing?)
@root_context.tracing :on
end
it "says if tracing is on or off" do
- @root_context.conf.stub(:use_tracer).and_return(true)
- @root_context.should_receive(:puts).with("tracing is on")
+ allow(@root_context.conf).to receive(:use_tracer).and_return(true)
+ expect(@root_context).to receive(:puts).with("tracing is on")
@root_context.tracing?
end
it "prints node attributes" do
node = double("node", :attribute => {:foo => :bar})
@shell_client.node = node
- @root_context.should_receive(:pp).with({:foo => :bar})
+ expect(@root_context).to receive(:pp).with({:foo => :bar})
@root_context.ohai
- @root_context.should_receive(:pp).with(:bar)
+ expect(@root_context).to receive(:pp).with(:bar)
@root_context.ohai(:foo)
end
it "resets the recipe and reloads ohai data" do
- @shell_client.should_receive(:reset!)
+ expect(@shell_client).to receive(:reset!)
@root_context.reset
end
it "turns irb echo on and off" do
- @root_context.conf.should_receive(:echo=).with(true)
+ expect(@root_context.conf).to receive(:echo=).with(true)
@root_context.echo :on
end
it "says if echo is on or off" do
- @root_context.conf.stub(:echo).and_return(true)
- @root_context.should_receive(:puts).with("echo is on")
+ allow(@root_context.conf).to receive(:echo).and_return(true)
+ expect(@root_context).to receive(:puts).with("echo is on")
@root_context.echo?
end
it "gives access to the stepable iterator" do
- Shell::StandAloneSession.instance.stub(:reset!)
- Shell.session.stub(:rebuild_context)
+ allow(Shell::StandAloneSession.instance).to receive(:reset!)
+ allow(Shell.session).to receive(:rebuild_context)
events = Chef::EventDispatch::Dispatcher.new
run_context = Chef::RunContext.new(Chef::Node.new, {}, events)
- run_context.resource_collection.instance_variable_set(:@iterator, :the_iterator)
+ run_context.resource_collection.instance_variable_get(:@resource_list).instance_variable_set(:@iterator, :the_iterator)
Shell.session.run_context = run_context
- @root_context.chef_run.should == :the_iterator
+ expect(@root_context.chef_run).to eq(:the_iterator)
end
it "lists directory contents" do
entries = %w{. .. someFile}
- Dir.should_receive(:entries).with("/tmp").and_return(entries)
+ expect(Dir).to receive(:entries).with("/tmp").and_return(entries)
@root_context.ls "/tmp"
end
@@ -145,7 +145,7 @@ describe Shell::Extensions do
it "gives a list of the resources" do
resource = @recipe_object.file("foo")
- @recipe_object.should_receive(:pp).with(["file[foo]"])
+ expect(@recipe_object).to receive(:pp).with(["file[foo]"])
@recipe_object.resources
end
diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb
index f49c9fc805..d72e3fa1bb 100644
--- a/spec/unit/shell/shell_session_spec.rb
+++ b/spec/unit/shell/shell_session_spec.rb
@@ -42,7 +42,7 @@ end
describe Shell::ShellSession do
it "is a singleton object" do
- Shell::ShellSession.should include(Singleton)
+ expect(Shell::ShellSession).to include(Singleton)
end
end
@@ -66,13 +66,13 @@ describe Shell::ClientSession do
@session.instance_variable_set(:@client, @client)
@expansion = Chef::RunList::RunListExpansion.new(@node.chef_environment, [])
- @node.run_list.should_receive(:expand).with(@node.chef_environment).and_return(@expansion)
- Chef::REST.should_receive(:new).with(Chef::Config[:chef_server_url]).and_return(@chef_rest)
+ expect(@node.run_list).to receive(:expand).with(@node.chef_environment).and_return(@expansion)
+ expect(Chef::REST).to receive(:new).with(Chef::Config[:chef_server_url]).and_return(@chef_rest)
@session.rebuild_context
end
it "passes the shell CLI args to the client" do
- Chef::Client.should_receive(:new).with(nil, Chef::Config[:shell_config]).and_return(@client)
+ expect(Chef::Client).to receive(:new).with(nil, Chef::Config[:shell_config]).and_return(@client)
@session.send(:rebuild_node)
end
@@ -90,30 +90,30 @@ describe Shell::StandAloneSession do
end
it "has a run_context" do
- @session.run_context.should equal(@run_context)
+ expect(@session.run_context).to equal(@run_context)
end
it "returns a collection based on it's standalone recipe file" do
- @session.resource_collection.should == @recipe.run_context.resource_collection
+ expect(@session.resource_collection).to eq(@recipe.run_context.resource_collection)
end
it "gives nil for the definitions (for now)" do
- @session.definitions.should be_nil
+ expect(@session.definitions).to be_nil
end
it "gives nil for the cookbook_loader" do
- @session.cookbook_loader.should be_nil
+ expect(@session.cookbook_loader).to be_nil
end
it "runs chef with the standalone recipe" do
- @session.stub(:node_built?).and_return(true)
- Chef::Log.stub(:level)
+ allow(@session).to receive(:node_built?).and_return(true)
+ allow(Chef::Log).to receive(:level)
chef_runner = double("Chef::Runner.new", :converge => :converged)
# pre-heat resource collection cache
@session.resource_collection
- Chef::Runner.should_receive(:new).with(@session.recipe.run_context).and_return(chef_runner)
- @recipe.run_chef.should == :converged
+ expect(Chef::Runner).to receive(:new).with(@session.recipe.run_context).and_return(chef_runner)
+ expect(@recipe.run_chef).to eq(:converged)
end
it "passes the shell CLI args to the client" do
@@ -123,7 +123,7 @@ describe Shell::StandAloneSession do
:build_node => true,
:register => true,
:sync_cookbooks => {})
- Chef::Client.should_receive(:new).with(nil, Chef::Config[:shell_config]).and_return(@client)
+ expect(Chef::Client).to receive(:new).with(nil, Chef::Config[:shell_config]).and_return(@client)
@session.send(:rebuild_node)
end
@@ -147,39 +147,39 @@ describe Shell::SoloSession do
end
it "returns a collection based on it's compilation object and the extra recipe provided by chef-shell" do
- @session.stub(:node_built?).and_return(true)
+ allow(@session).to receive(:node_built?).and_return(true)
kitteh = Chef::Resource::Cat.new("keyboard")
@recipe.run_context.resource_collection << kitteh
- @session.resource_collection.should include(kitteh)
+ expect(@session.resource_collection).to include(kitteh)
end
it "returns definitions from its compilation object" do
- @session.definitions.should == @run_context.definitions
+ expect(@session.definitions).to eq(@run_context.definitions)
end
it "keeps json attribs and passes them to the node for consumption" do
@session.node_attributes = {"besnard_lakes" => "are_the_dark_horse"}
- @session.node.besnard_lakes.should == "are_the_dark_horse"
+ expect(@session.node.besnard_lakes).to eq("are_the_dark_horse")
#pending "1) keep attribs in an ivar 2) pass them to the node 3) feed them to the node on reset"
end
it "generates its resource collection from the compiled cookbooks and the ad hoc recipe" do
- @session.stub(:node_built?).and_return(true)
+ allow(@session).to receive(:node_built?).and_return(true)
kitteh_cat = Chef::Resource::Cat.new("kitteh")
@run_context.resource_collection << kitteh_cat
keyboard_cat = Chef::Resource::Cat.new("keyboard_cat")
@recipe.run_context.resource_collection << keyboard_cat
#@session.rebuild_collection
- @session.resource_collection.should include(kitteh_cat, keyboard_cat)
+ expect(@session.resource_collection).to include(kitteh_cat, keyboard_cat)
end
it "runs chef with a resource collection from the compiled cookbooks" do
- @session.stub(:node_built?).and_return(true)
- Chef::Log.stub(:level)
+ allow(@session).to receive(:node_built?).and_return(true)
+ allow(Chef::Log).to receive(:level)
chef_runner = double("Chef::Runner.new", :converge => :converged)
- Chef::Runner.should_receive(:new).with(an_instance_of(Chef::RunContext)).and_return(chef_runner)
+ expect(Chef::Runner).to receive(:new).with(an_instance_of(Chef::RunContext)).and_return(chef_runner)
- @recipe.run_chef.should == :converged
+ expect(@recipe.run_chef).to eq(:converged)
end
it "passes the shell CLI args to the client" do
@@ -189,7 +189,7 @@ describe Shell::SoloSession do
:build_node => true,
:register => true,
:sync_cookbooks => {})
- Chef::Client.should_receive(:new).with(nil, Chef::Config[:shell_config]).and_return(@client)
+ expect(Chef::Client).to receive(:new).with(nil, Chef::Config[:shell_config]).and_return(@client)
@session.send(:rebuild_node)
end
diff --git a/spec/unit/shell_out_spec.rb b/spec/unit/shell_out_spec.rb
index 1330dd16de..50b0b61cb7 100644
--- a/spec/unit/shell_out_spec.rb
+++ b/spec/unit/shell_out_spec.rb
@@ -2,8 +2,8 @@ require File.expand_path('../../spec_helper', __FILE__)
describe "Chef::ShellOut deprecation notices" do
it "logs a warning when initializing a new Chef::ShellOut object" do
- Chef::Log.should_receive(:warn).with("Chef::ShellOut is deprecated, please use Mixlib::ShellOut")
- Chef::Log.should_receive(:warn).with(/Called from\:/)
+ expect(Chef::Log).to receive(:warn).with("Chef::ShellOut is deprecated, please use Mixlib::ShellOut")
+ expect(Chef::Log).to receive(:warn).with(/Called from\:/)
Chef::ShellOut.new("pwd")
end
end
@@ -11,8 +11,8 @@ end
describe "Chef::Exceptions::ShellCommandFailed deprecation notices" do
it "logs a warning when referencing the constant Chef::Exceptions::ShellCommandFailed" do
- Chef::Log.should_receive(:warn).with("Chef::Exceptions::ShellCommandFailed is deprecated, use Mixlib::ShellOut::ShellCommandFailed")
- Chef::Log.should_receive(:warn).with(/Called from\:/)
+ expect(Chef::Log).to receive(:warn).with("Chef::Exceptions::ShellCommandFailed is deprecated, use Mixlib::ShellOut::ShellCommandFailed")
+ expect(Chef::Log).to receive(:warn).with(/Called from\:/)
Chef::Exceptions::ShellCommandFailed
end
end
diff --git a/spec/unit/shell_spec.rb b/spec/unit/shell_spec.rb
index bf638e1c3a..58dea4c988 100644
--- a/spec/unit/shell_spec.rb
+++ b/spec/unit/shell_spec.rb
@@ -42,13 +42,13 @@ describe Shell do
before do
Shell.irb_conf = {}
- Shell::ShellSession.instance.stub(:reset!)
+ allow(Shell::ShellSession.instance).to receive(:reset!)
end
describe "reporting its status" do
it "alway says it is running" do
- Shell.should be_running
+ expect(Shell).to be_running
end
end
@@ -56,8 +56,8 @@ describe Shell do
describe "configuring IRB" do
it "configures irb history" do
Shell.configure_irb
- Shell.irb_conf[:HISTORY_FILE].should == "~/.chef/chef_shell_history"
- Shell.irb_conf[:SAVE_HISTORY].should == 1000
+ expect(Shell.irb_conf[:HISTORY_FILE]).to eq("~/.chef/chef_shell_history")
+ expect(Shell.irb_conf[:SAVE_HISTORY]).to eq(1000)
end
it "has a prompt like ``chef > '' in the default context" do
@@ -67,12 +67,12 @@ describe Shell do
conf.main = Object.new
conf.main.instance_eval(&ObjectTestHarness)
Shell.irb_conf[:IRB_RC].call(conf)
- conf.prompt_c.should == "chef > "
- conf.return_format.should == " => %s \n"
- conf.prompt_i.should == "chef > "
- conf.prompt_n.should == "chef ?> "
- conf.prompt_s.should == "chef%l> "
- conf.use_tracer.should == false
+ expect(conf.prompt_c).to eq("chef > ")
+ expect(conf.return_format).to eq(" => %s \n")
+ expect(conf.prompt_i).to eq("chef > ")
+ expect(conf.prompt_n).to eq("chef ?> ")
+ expect(conf.prompt_s).to eq("chef%l> ")
+ expect(conf.use_tracer).to eq(false)
end
it "has a prompt like ``chef:recipe > '' in recipe context" do
@@ -82,10 +82,10 @@ describe Shell do
events = Chef::EventDispatch::Dispatcher.new
conf.main = Chef::Recipe.new(nil,nil,Chef::RunContext.new(Chef::Node.new, {}, events))
Shell.irb_conf[:IRB_RC].call(conf)
- conf.prompt_c.should == "chef:recipe > "
- conf.prompt_i.should == "chef:recipe > "
- conf.prompt_n.should == "chef:recipe ?> "
- conf.prompt_s.should == "chef:recipe%l> "
+ expect(conf.prompt_c).to eq("chef:recipe > ")
+ expect(conf.prompt_i).to eq("chef:recipe > ")
+ expect(conf.prompt_n).to eq("chef:recipe ?> ")
+ expect(conf.prompt_s).to eq("chef:recipe%l> ")
end
it "has a prompt like ``chef:attributes > '' in attributes/node context" do
@@ -94,10 +94,10 @@ describe Shell do
conf = OpenStruct.new
conf.main = Chef::Node.new
Shell.irb_conf[:IRB_RC].call(conf)
- conf.prompt_c.should == "chef:attributes > "
- conf.prompt_i.should == "chef:attributes > "
- conf.prompt_n.should == "chef:attributes ?> "
- conf.prompt_s.should == "chef:attributes%l> "
+ expect(conf.prompt_c).to eq("chef:attributes > ")
+ expect(conf.prompt_i).to eq("chef:attributes > ")
+ expect(conf.prompt_n).to eq("chef:attributes ?> ")
+ expect(conf.prompt_s).to eq("chef:attributes%l> ")
end
end
@@ -110,7 +110,7 @@ describe Shell do
end
it "creates help text for methods with descriptions" do
- @chef_object.help_descriptions.should == [Shell::Extensions::Help.new("rspec_method", "rspecin'", nil)]
+ expect(@chef_object.help_descriptions).to eq([Shell::Extensions::Help.new("rspec_method", "rspecin'", nil)])
end
it "adds help text when a new method is described then defined" do
@@ -120,8 +120,8 @@ describe Shell do
end
EVAL
@chef_object.instance_eval describe_define
- @chef_object.help_descriptions.should == [Shell::Extensions::Help.new("rspec_method", "rspecin'"),
- Shell::Extensions::Help.new("baz", "foo2the Bar")]
+ expect(@chef_object.help_descriptions).to eq([Shell::Extensions::Help.new("rspec_method", "rspecin'"),
+ Shell::Extensions::Help.new("baz", "foo2the Bar")])
end
it "adds help text for subcommands" do
@@ -133,7 +133,7 @@ describe Shell do
@chef_object.instance_eval describe_define
expected_help_text_fragments = [Shell::Extensions::Help.new("rspec_method", "rspecin'")]
expected_help_text_fragments << Shell::Extensions::Help.new("baz.baz_obj_command", "something you can do with baz.baz_obj_command")
- @chef_object.help_descriptions.should == expected_help_text_fragments
+ expect(@chef_object.help_descriptions).to eq(expected_help_text_fragments)
end
it "doesn't add previous subcommand help to commands defined afterward" do
@@ -147,13 +147,13 @@ describe Shell do
EVAL
@chef_object.instance_eval describe_define
- @chef_object.help_descriptions.should have(2).descriptions
- @chef_object.help_descriptions.select {|h| h.cmd == "super_monkey_time" }.should be_empty
+ expect(@chef_object.help_descriptions.size).to eq(2)
+ expect(@chef_object.help_descriptions.select {|h| h.cmd == "super_monkey_time" }).to be_empty
end
it "creates a help banner with the command descriptions" do
- @chef_object.help_banner.should match(/^\|\ Command[\s]+\|\ Description[\s]*$/)
- @chef_object.help_banner.should match(/^\|\ rspec_method[\s]+\|\ rspecin\'[\s]*$/)
+ expect(@chef_object.help_banner).to match(/^\|\ Command[\s]+\|\ Description[\s]*$/)
+ expect(@chef_object.help_banner).to match(/^\|\ rspec_method[\s]+\|\ rspecin\'[\s]*$/)
end
end
diff --git a/spec/unit/user_spec.rb b/spec/unit/user_spec.rb
index 2f2299c5bd..d451531b16 100644
--- a/spec/unit/user_spec.rb
+++ b/spec/unit/user_spec.rb
@@ -28,89 +28,89 @@ describe Chef::User do
describe "initialize" do
it "should be a Chef::User" do
- @user.should be_a_kind_of(Chef::User)
+ expect(@user).to be_a_kind_of(Chef::User)
end
end
describe "name" do
it "should let you set the name to a string" do
- @user.name("ops_master").should == "ops_master"
+ expect(@user.name("ops_master")).to eq("ops_master")
end
it "should return the current name" do
@user.name "ops_master"
- @user.name.should == "ops_master"
+ expect(@user.name).to eq("ops_master")
end
# It is not feasible to check all invalid characters. Here are a few
# that we probably care about.
it "should not accept invalid characters" do
# capital letters
- lambda { @user.name "Bar" }.should raise_error(ArgumentError)
+ expect { @user.name "Bar" }.to raise_error(ArgumentError)
# slashes
- lambda { @user.name "foo/bar" }.should raise_error(ArgumentError)
+ expect { @user.name "foo/bar" }.to raise_error(ArgumentError)
# ?
- lambda { @user.name "foo?" }.should raise_error(ArgumentError)
+ expect { @user.name "foo?" }.to raise_error(ArgumentError)
# &
- lambda { @user.name "foo&" }.should raise_error(ArgumentError)
+ expect { @user.name "foo&" }.to raise_error(ArgumentError)
end
it "should not accept spaces" do
- lambda { @user.name "ops master" }.should raise_error(ArgumentError)
+ expect { @user.name "ops master" }.to raise_error(ArgumentError)
end
it "should throw an ArgumentError if you feed it anything but a string" do
- lambda { @user.name Hash.new }.should raise_error(ArgumentError)
+ expect { @user.name Hash.new }.to raise_error(ArgumentError)
end
end
describe "admin" do
it "should let you set the admin bit" do
- @user.admin(true).should == true
+ expect(@user.admin(true)).to eq(true)
end
it "should return the current admin value" do
@user.admin true
- @user.admin.should == true
+ expect(@user.admin).to eq(true)
end
it "should default to false" do
- @user.admin.should == false
+ expect(@user.admin).to eq(false)
end
it "should throw an ArgumentError if you feed it anything but true or false" do
- lambda { @user.name Hash.new }.should raise_error(ArgumentError)
+ expect { @user.name Hash.new }.to raise_error(ArgumentError)
end
end
describe "public_key" do
it "should let you set the public key" do
- @user.public_key("super public").should == "super public"
+ expect(@user.public_key("super public")).to eq("super public")
end
it "should return the current public key" do
@user.public_key("super public")
- @user.public_key.should == "super public"
+ expect(@user.public_key).to eq("super public")
end
it "should throw an ArgumentError if you feed it something lame" do
- lambda { @user.public_key Hash.new }.should raise_error(ArgumentError)
+ expect { @user.public_key Hash.new }.to raise_error(ArgumentError)
end
end
describe "private_key" do
it "should let you set the private key" do
- @user.private_key("super private").should == "super private"
+ expect(@user.private_key("super private")).to eq("super private")
end
it "should return the private key" do
@user.private_key("super private")
- @user.private_key.should == "super private"
+ expect(@user.private_key).to eq("super private")
end
it "should throw an ArgumentError if you feed it something lame" do
- lambda { @user.private_key Hash.new }.should raise_error(ArgumentError)
+ expect { @user.private_key Hash.new }.to raise_error(ArgumentError)
end
end
@@ -122,37 +122,37 @@ describe Chef::User do
end
it "serializes as a JSON object" do
- @json.should match(/^\{.+\}$/)
+ expect(@json).to match(/^\{.+\}$/)
end
it "includes the name value" do
- @json.should include(%q{"name":"black"})
+ expect(@json).to include(%q{"name":"black"})
end
it "includes the public key value" do
- @json.should include(%{"public_key":"crowes"})
+ expect(@json).to include(%{"public_key":"crowes"})
end
it "includes the 'admin' flag" do
- @json.should include(%q{"admin":false})
+ expect(@json).to include(%q{"admin":false})
end
it "includes the private key when present" do
@user.private_key("monkeypants")
- @user.to_json.should include(%q{"private_key":"monkeypants"})
+ expect(@user.to_json).to include(%q{"private_key":"monkeypants"})
end
it "does not include the private key if not present" do
- @json.should_not include("private_key")
+ expect(@json).not_to include("private_key")
end
it "includes the password if present" do
@user.password "password"
- @user.to_json.should include(%q{"password":"password"})
+ expect(@user.to_json).to include(%q{"password":"password"})
end
it "does not include the password if not present" do
- @json.should_not include("password")
+ expect(@json).not_to include("password")
end
include_examples "to_json equalivent to Chef::JSONCompat.to_json" do
@@ -171,27 +171,27 @@ describe Chef::User do
end
it "should deserialize to a Chef::User object" do
- @user.should be_a_kind_of(Chef::User)
+ expect(@user).to be_a_kind_of(Chef::User)
end
it "preserves the name" do
- @user.name.should == "mr_spinks"
+ expect(@user.name).to eq("mr_spinks")
end
it "preserves the public key" do
- @user.public_key.should == "turtles"
+ expect(@user.public_key).to eq("turtles")
end
it "preserves the admin status" do
- @user.admin.should be_true
+ expect(@user.admin).to be_truthy
end
it "includes the private key if present" do
- @user.private_key.should == "pandas"
+ expect(@user.private_key).to eq("pandas")
end
it "includes the password if present" do
- @user.password.should == "password"
+ expect(@user.password).to eq("password")
end
end
@@ -201,7 +201,7 @@ describe Chef::User do
@user = Chef::User.new
@user.name "foobar"
@http_client = double("Chef::REST mock")
- Chef::REST.stub(:new).and_return(@http_client)
+ allow(Chef::REST).to receive(:new).and_return(@http_client)
end
describe "list" do
@@ -209,61 +209,61 @@ describe Chef::User do
Chef::Config[:chef_server_url] = "http://www.example.com"
@osc_response = { "admin" => "http://www.example.com/users/admin"}
@ohc_response = [ { "user" => { "username" => "admin" }} ]
- Chef::User.stub(:load).with("admin").and_return(@user)
+ allow(Chef::User).to receive(:load).with("admin").and_return(@user)
@osc_inflated_response = { "admin" => @user }
end
it "lists all clients on an OSC server" do
- @http_client.stub(:get_rest).with("users").and_return(@osc_response)
- Chef::User.list.should == @osc_response
+ allow(@http_client).to receive(:get_rest).with("users").and_return(@osc_response)
+ expect(Chef::User.list).to eq(@osc_response)
end
it "inflate all clients on an OSC server" do
- @http_client.stub(:get_rest).with("users").and_return(@osc_response)
- Chef::User.list(true).should == @osc_inflated_response
+ allow(@http_client).to receive(:get_rest).with("users").and_return(@osc_response)
+ expect(Chef::User.list(true)).to eq(@osc_inflated_response)
end
it "lists all clients on an OHC/OPC server" do
- @http_client.stub(:get_rest).with("users").and_return(@ohc_response)
+ allow(@http_client).to receive(:get_rest).with("users").and_return(@ohc_response)
# We expect that Chef::User.list will give a consistent response
# so OHC API responses should be transformed to OSC-style output.
- Chef::User.list.should == @osc_response
+ expect(Chef::User.list).to eq(@osc_response)
end
it "inflate all clients on an OHC/OPC server" do
- @http_client.stub(:get_rest).with("users").and_return(@ohc_response)
- Chef::User.list(true).should == @osc_inflated_response
+ allow(@http_client).to receive(:get_rest).with("users").and_return(@ohc_response)
+ expect(Chef::User.list(true)).to eq(@osc_inflated_response)
end
end
describe "create" do
it "creates a new user via the API" do
@user.password "password"
- @http_client.should_receive(:post_rest).with("users", {:name => "foobar", :admin => false, :password => "password"}).and_return({})
+ expect(@http_client).to receive(:post_rest).with("users", {:name => "foobar", :admin => false, :password => "password"}).and_return({})
@user.create
end
end
describe "read" do
it "loads a named user from the API" do
- @http_client.should_receive(:get_rest).with("users/foobar").and_return({"name" => "foobar", "admin" => true, "public_key" => "pubkey"})
+ expect(@http_client).to receive(:get_rest).with("users/foobar").and_return({"name" => "foobar", "admin" => true, "public_key" => "pubkey"})
user = Chef::User.load("foobar")
- user.name.should == "foobar"
- user.admin.should == true
- user.public_key.should == "pubkey"
+ expect(user.name).to eq("foobar")
+ expect(user.admin).to eq(true)
+ expect(user.public_key).to eq("pubkey")
end
end
describe "update" do
it "updates an existing user on via the API" do
- @http_client.should_receive(:put_rest).with("users/foobar", {:name => "foobar", :admin => false}).and_return({})
+ expect(@http_client).to receive(:put_rest).with("users/foobar", {:name => "foobar", :admin => false}).and_return({})
@user.update
end
end
describe "destroy" do
it "deletes the specified user via the API" do
- @http_client.should_receive(:delete_rest).with("users/foobar")
+ expect(@http_client).to receive(:delete_rest).with("users/foobar")
@user.destroy
end
end
diff --git a/spec/unit/util/backup_spec.rb b/spec/unit/util/backup_spec.rb
index 617886cede..f548e8241d 100644
--- a/spec/unit/util/backup_spec.rb
+++ b/spec/unit/util/backup_spec.rb
@@ -28,33 +28,33 @@ describe Chef::Util::Backup do
before(:each) do
@new_resource = double("new_resource")
- @new_resource.should_receive(:path).at_least(:once).and_return(tempfile.path)
+ expect(@new_resource).to receive(:path).at_least(:once).and_return(tempfile.path)
@backup = Chef::Util::Backup.new(@new_resource)
end
it "should store the resource passed to new as new_resource" do
- @backup.new_resource.should eql(@new_resource)
+ expect(@backup.new_resource).to eql(@new_resource)
end
describe "for cases when we don't want to back anything up" do
before(:each) do
- @backup.should_not_receive(:do_backup)
+ expect(@backup).not_to receive(:do_backup)
end
it "should not attempt to backup a file if :backup is false" do
- @new_resource.should_receive(:backup).at_least(:once).and_return(false)
+ expect(@new_resource).to receive(:backup).at_least(:once).and_return(false)
@backup.backup!
end
it "should not attempt to backup a file if :backup == 0" do
- @new_resource.should_receive(:backup).at_least(:once).and_return(0)
+ expect(@new_resource).to receive(:backup).at_least(:once).and_return(0)
@backup.backup!
end
it "should not attempt to backup a file if it does not exist" do
- @new_resource.should_receive(:backup).at_least(:once).and_return(1)
- File.should_receive(:exist?).with(tempfile.path).at_least(:once).and_return(false)
+ expect(@new_resource).to receive(:backup).at_least(:once).and_return(1)
+ expect(File).to receive(:exist?).with(tempfile.path).at_least(:once).and_return(false)
@backup.backup!
end
@@ -62,43 +62,43 @@ describe Chef::Util::Backup do
describe "for cases when we want to back things up" do
before(:each) do
- @backup.should_receive(:do_backup)
+ expect(@backup).to receive(:do_backup)
end
describe "when the number of backups is specified as 1" do
before(:each) do
- @new_resource.should_receive(:backup).at_least(:once).and_return(1)
+ expect(@new_resource).to receive(:backup).at_least(:once).and_return(1)
end
it "should not delete anything if this is the only backup" do
- @backup.should_receive(:sorted_backup_files).and_return(['a'])
- @backup.should_not_receive(:delete_backup)
+ expect(@backup).to receive(:sorted_backup_files).and_return(['a'])
+ expect(@backup).not_to receive(:delete_backup)
@backup.backup!
end
it "should keep only 1 backup copy" do
- @backup.should_receive(:sorted_backup_files).and_return(['a', 'b', 'c'])
- @backup.should_receive(:delete_backup).with('b')
- @backup.should_receive(:delete_backup).with('c')
+ expect(@backup).to receive(:sorted_backup_files).and_return(['a', 'b', 'c'])
+ expect(@backup).to receive(:delete_backup).with('b')
+ expect(@backup).to receive(:delete_backup).with('c')
@backup.backup!
end
end
describe "when the number of backups is specified as 2" do
before(:each) do
- @new_resource.should_receive(:backup).at_least(:once).and_return(2)
+ expect(@new_resource).to receive(:backup).at_least(:once).and_return(2)
end
it "should not delete anything if we only have one other backup" do
- @backup.should_receive(:sorted_backup_files).and_return(['a', 'b'])
- @backup.should_not_receive(:delete_backup)
+ expect(@backup).to receive(:sorted_backup_files).and_return(['a', 'b'])
+ expect(@backup).not_to receive(:delete_backup)
@backup.backup!
end
it "should keep only 2 backup copies" do
- @backup.should_receive(:sorted_backup_files).and_return(['a', 'b', 'c', 'd'])
- @backup.should_receive(:delete_backup).with('c')
- @backup.should_receive(:delete_backup).with('d')
+ expect(@backup).to receive(:sorted_backup_files).and_return(['a', 'b', 'c', 'd'])
+ expect(@backup).to receive(:delete_backup).with('c')
+ expect(@backup).to receive(:delete_backup).with('d')
@backup.backup!
end
end
@@ -106,36 +106,36 @@ describe Chef::Util::Backup do
describe "backup_filename" do
it "should return a timestamped path" do
- @backup.should_receive(:path).and_return('/a/b/c.txt')
- @backup.send(:backup_filename).should =~ %r|^/a/b/c.txt.chef-\d{14}.\d{6}$|
+ expect(@backup).to receive(:path).and_return('/a/b/c.txt')
+ expect(@backup.send(:backup_filename)).to match(%r|^/a/b/c.txt.chef-\d{14}.\d{6}$|)
end
it "should strip the drive letter off for windows" do
- @backup.should_receive(:path).and_return('c:\a\b\c.txt')
- @backup.send(:backup_filename).should =~ %r|^\\a\\b\\c.txt.chef-\d{14}.\d{6}$|
+ expect(@backup).to receive(:path).and_return('c:\a\b\c.txt')
+ expect(@backup.send(:backup_filename)).to match(%r|^\\a\\b\\c.txt.chef-\d{14}.\d{6}$|)
end
it "should strip the drive letter off for windows (with forwardslashes)" do
- @backup.should_receive(:path).and_return('c:/a/b/c.txt')
- @backup.send(:backup_filename).should =~ %r|^/a/b/c.txt.chef-\d{14}.\d{6}$|
+ expect(@backup).to receive(:path).and_return('c:/a/b/c.txt')
+ expect(@backup.send(:backup_filename)).to match(%r|^/a/b/c.txt.chef-\d{14}.\d{6}$|)
end
end
describe "backup_path" do
it "uses the file's directory when Chef::Config[:file_backup_path] is nil" do
- @backup.should_receive(:path).and_return('/a/b/c.txt')
+ expect(@backup).to receive(:path).and_return('/a/b/c.txt')
Chef::Config[:file_backup_path] = nil
- @backup.send(:backup_path).should =~ %r|^/a/b/c.txt.chef-\d{14}.\d{6}$|
+ expect(@backup.send(:backup_path)).to match(%r|^/a/b/c.txt.chef-\d{14}.\d{6}$|)
end
it "uses the configured Chef::Config[:file_backup_path]" do
- @backup.should_receive(:path).and_return('/a/b/c.txt')
+ expect(@backup).to receive(:path).and_return('/a/b/c.txt')
Chef::Config[:file_backup_path] = '/backupdir'
- @backup.send(:backup_path).should =~ %r|^/backupdir[\\/]+a/b/c.txt.chef-\d{14}.\d{6}$|
+ expect(@backup.send(:backup_path)).to match(%r|^/backupdir[\\/]+a/b/c.txt.chef-\d{14}.\d{6}$|)
end
it "uses the configured Chef::Config[:file_backup_path] and strips the drive on windows" do
- @backup.should_receive(:path).and_return('c:\\a\\b\\c.txt')
+ expect(@backup).to receive(:path).and_return('c:\\a\\b\\c.txt')
Chef::Config[:file_backup_path] = 'c:\backupdir'
- @backup.send(:backup_path).should =~ %r|^c:\\backupdir[\\/]+a\\b\\c.txt.chef-\d{14}.\d{6}$|
+ expect(@backup.send(:backup_path)).to match(%r|^c:\\backupdir[\\/]+a\\b\\c.txt.chef-\d{14}.\d{6}$|)
end
end
diff --git a/spec/unit/util/diff_spec.rb b/spec/unit/util/diff_spec.rb
index 947ce1d5aa..ea226f1c04 100644
--- a/spec/unit/util/diff_spec.rb
+++ b/spec/unit/util/diff_spec.rb
@@ -122,7 +122,7 @@ shared_examples_for "a diff util" do
new_tempfile.close
end
it "calling for_output should return a valid diff" do
- differ.for_output.join("\\n").should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_output.join("\\n")).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
it "calling for_reporting should return a utf-8 string" do
expect(differ.for_reporting.encoding).to equal(Encoding::UTF_8)
@@ -135,7 +135,7 @@ shared_examples_for "a diff util" do
new_tempfile.close
end
it "calling for_output should return a valid diff" do
- differ.for_output.join("\\n").should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_output.join("\\n")).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
it "calling for_reporting should return a utf-8 string" do
expect(differ.for_reporting.encoding).to equal(Encoding::UTF_8)
@@ -187,7 +187,7 @@ shared_examples_for "a diff util" do
new_tempfile.close
end
it "calling for_output should return a valid diff" do
- differ.for_output.join("\\n").should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_output.join("\\n")).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
it "calling for_reporting should return a utf-8 string" do
expect(differ.for_reporting.encoding).to equal(Encoding::UTF_8)
@@ -213,7 +213,7 @@ shared_examples_for "a diff util" do
new_tempfile.close
end
it "calling for_output should return a valid diff" do
- differ.for_output.join("\\n").should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_output.join("\\n")).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
it "calling for_reporting should return a utf-8 string" do
expect(differ.for_reporting.encoding).to equal(Encoding::UTF_8)
@@ -251,7 +251,7 @@ shared_examples_for "a diff util" do
new_tempfile.close
end
it "calling for_output should return a valid diff" do
- differ.for_output.join("\\n").should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_output.join("\\n")).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
it "calling for_reporting should return a utf-8 string" do
expect(differ.for_reporting.encoding).to equal(Encoding::UTF_8)
@@ -290,7 +290,7 @@ shared_examples_for "a diff util" do
new_tempfile.close
end
it "calling for_output should return a valid diff" do
- differ.for_output.join("\\n").should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_output.join("\\n")).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
it "calling for_reporting should return a utf-8 string" do
expect(differ.for_reporting.encoding).to equal(Encoding::UTF_8)
@@ -349,12 +349,12 @@ shared_examples_for "a diff util" do
end
it "calling for_output should return a unified diff" do
- differ.for_output.size.should eql(5)
- differ.for_output.join("\\n").should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_output.size).to eql(5)
+ expect(differ.for_output.join("\\n")).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
it "calling for_reporting should return a unified diff" do
- differ.for_reporting.should match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
+ expect(differ.for_reporting).to match(/\A--- .*\\n\+\+\+ .*\\n@@/m)
end
describe "when the diff output is too long" do
@@ -383,7 +383,7 @@ shared_examples_for "a diff util" do
it "should identify zero-length files as text" do
Tempfile.open("chef-util-diff-spec") do |file|
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
@@ -391,7 +391,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(plain_ascii)
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
@@ -399,7 +399,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write("This is a binary file.\0")
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
@@ -407,7 +407,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write("This is a binary file.\nNo Really\nit is\0")
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
@@ -426,7 +426,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(plain_ascii)
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
@@ -434,7 +434,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(utf_8)
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
@@ -442,7 +442,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(latin_1)
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
@@ -450,7 +450,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(shift_jis)
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
@@ -471,7 +471,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(plain_ascii)
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
@@ -479,7 +479,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(utf_8)
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
@@ -487,7 +487,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(latin_1)
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
@@ -495,7 +495,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(shift_jis)
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
end
@@ -515,14 +515,14 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(plain_ascii)
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
it "should identify UTF-8 that is invalid Shift-JIS as binary" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(utf_8)
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
@@ -530,7 +530,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(latin_1)
file.close
- differ.send(:is_binary?, file.path).should be_true
+ expect(differ.send(:is_binary?, file.path)).to be_truthy
end
end
@@ -538,7 +538,7 @@ shared_examples_for "a diff util" do
Tempfile.open("chef-util-diff-spec") do |file|
file.write(shift_jis)
file.close
- differ.send(:is_binary?, file.path).should be_false
+ expect(differ.send(:is_binary?, file.path)).to be_falsey
end
end
diff --git a/spec/unit/util/dsc/configuration_generator_spec.rb b/spec/unit/util/dsc/configuration_generator_spec.rb
index 03f3ffe25c..c39c949991 100644
--- a/spec/unit/util/dsc/configuration_generator_spec.rb
+++ b/spec/unit/util/dsc/configuration_generator_spec.rb
@@ -51,9 +51,9 @@ describe Chef::Util::DSC::ConfigurationGenerator do
context 'when strings are used as switches' do
it 'should merge the hash if there are no restricted switches' do
merged = conf_man.send(:get_merged_configuration_flags!, {'flag' => 'a'}, 'hello')
- merged.should include(:flag)
- merged[:flag].should eql('a')
- merged.should include(:outputpath)
+ expect(merged).to include(:flag)
+ expect(merged[:flag]).to eql('a')
+ expect(merged).to include(:outputpath)
end
it 'should raise an ArgumentError if you try to override outputpath' do
@@ -70,16 +70,16 @@ describe Chef::Util::DSC::ConfigurationGenerator do
it 'should be case insensitive to switches that are allowed' do
merged = conf_man.send(:get_merged_configuration_flags!, {'FLAG' => 'a'}, 'hello')
- merged.should include(:flag)
+ expect(merged).to include(:flag)
end
end
context 'when symbols are used as switches' do
it 'should merge the hash if there are no restricted switches' do
merged = conf_man.send(:get_merged_configuration_flags!, {:flag => 'a'}, 'hello')
- merged.should include(:flag)
- merged[:flag].should eql('a')
- merged.should include(:outputpath)
+ expect(merged).to include(:flag)
+ expect(merged[:flag]).to eql('a')
+ expect(merged).to include(:outputpath)
end
it 'should raise an ArgumentError if you try to override outputpath' do
@@ -96,21 +96,21 @@ describe Chef::Util::DSC::ConfigurationGenerator do
it 'should be case insensitive to switches that are allowed' do
merged = conf_man.send(:get_merged_configuration_flags!, {:FLAG => 'a'}, 'hello')
- merged.should include(:flag)
+ expect(merged).to include(:flag)
end
end
context 'when there are no flags' do
it 'should supply an output path if configuration_flags is an empty hash' do
merged = conf_man.send(:get_merged_configuration_flags!, {}, 'hello')
- merged.should include(:outputpath)
- merged.length.should eql(1)
+ expect(merged).to include(:outputpath)
+ expect(merged.length).to eql(1)
end
it 'should supply an output path if configuration_flags is an empty hash' do
merged = conf_man.send(:get_merged_configuration_flags!, nil, 'hello')
- merged.should include(:outputpath)
- merged.length.should eql(1)
+ expect(merged).to include(:outputpath)
+ expect(merged.length).to eql(1)
end
end
@@ -165,7 +165,7 @@ describe Chef::Util::DSC::ConfigurationGenerator do
found_configuration = true
end
end
- expect(found_configuration).to be_true
+ expect(found_configuration).to be_truthy
end
end
end
diff --git a/spec/unit/util/dsc/lcm_output_parser_spec.rb b/spec/unit/util/dsc/lcm_output_parser_spec.rb
index 23a3dbd3ec..ba4f40c4f7 100644
--- a/spec/unit/util/dsc/lcm_output_parser_spec.rb
+++ b/spec/unit/util/dsc/lcm_output_parser_spec.rb
@@ -21,11 +21,11 @@ require 'chef/util/dsc/lcm_output_parser'
describe Chef::Util::DSC::LocalConfigurationManager::Parser do
context 'empty input parameter' do
it 'returns an empty array for a 0 length string' do
- Chef::Util::DSC::LocalConfigurationManager::Parser::parse('').should be_empty
+ expect(Chef::Util::DSC::LocalConfigurationManager::Parser::parse('')).to be_empty
end
it 'returns an empty array for a nil input' do
- Chef::Util::DSC::LocalConfigurationManager::Parser::parse('').should be_empty
+ expect(Chef::Util::DSC::LocalConfigurationManager::Parser::parse('')).to be_empty
end
end
@@ -35,7 +35,7 @@ describe Chef::Util::DSC::LocalConfigurationManager::Parser do
logtype: [machinename]: LCM: [ Start Set ]
logtype: [machinename]: LCM: [ End Set ]
EOF
- Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str).should be_empty
+ expect(Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)).to be_empty
end
it 'returns a single resource when only 1 logged with the correct name' do
@@ -46,8 +46,8 @@ logtype: [machinename]: LCM: [ End Resource ] [name]
logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources.length.should eq(1)
- resources[0].name.should eq('[name]')
+ expect(resources.length).to eq(1)
+ expect(resources[0].name).to eq('[name]')
end
it 'identifies when a resource changes the state of the system' do
@@ -60,7 +60,7 @@ logtype: [machinename]: LCM: [ End Resource ] [name]
logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources[0].changes_state?.should be_true
+ expect(resources[0].changes_state?).to be_truthy
end
it 'preserves the log provided for how the system changed the state' do
@@ -74,7 +74,7 @@ logtype: [machinename]: LCM: [ End Resource ] [name]
logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources[0].change_log.should match_array(["[name]","[message]","[name]"])
+ expect(resources[0].change_log).to match_array(["[name]","[message]","[name]"])
end
it 'should return false for changes_state?' do
@@ -86,7 +86,7 @@ logtype: [machinename]: LCM: [ End Resource ] [name]
logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources[0].changes_state?.should be_false
+ expect(resources[0].changes_state?).to be_falsey
end
it 'should return an empty array for change_log if changes_state? is false' do
@@ -98,7 +98,7 @@ logtype: [machinename]: LCM: [ End Resource ] [name]
logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources[0].change_log.should be_empty
+ expect(resources[0].change_log).to be_empty
end
end
@@ -120,8 +120,8 @@ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources[0].changes_state?.should be_false
- resources[1].changes_state?.should be_true
+ expect(resources[0].changes_state?).to be_falsey
+ expect(resources[1].changes_state?).to be_truthy
end
it 'should allow missing a [End Resource] when its the first one and still find all the resource' do
@@ -141,8 +141,8 @@ logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources[0].changes_state?.should be_false
- resources[1].changes_state?.should be_true
+ expect(resources[0].changes_state?).to be_falsey
+ expect(resources[1].changes_state?).to be_truthy
end
it 'should allow missing set and end resource and assume an unconverged resource in this case' do
@@ -160,10 +160,10 @@ logtype: [machinename]: LCM: [ End Resource ]
logtype: [machinename]: LCM: [ End Set ]
EOF
resources = Chef::Util::DSC::LocalConfigurationManager::Parser::parse(str)
- resources[0].changes_state?.should be_true
- resources[0].name.should eql('[name]')
- resources[1].changes_state?.should be_true
- resources[1].name.should eql('[name2]')
+ expect(resources[0].changes_state?).to be_truthy
+ expect(resources[0].name).to eql('[name]')
+ expect(resources[1].changes_state?).to be_truthy
+ expect(resources[1].name).to eql('[name2]')
end
end
end
diff --git a/spec/unit/util/dsc/local_configuration_manager_spec.rb b/spec/unit/util/dsc/local_configuration_manager_spec.rb
index c9a63bf816..009c667c87 100644
--- a/spec/unit/util/dsc/local_configuration_manager_spec.rb
+++ b/spec/unit/util/dsc/local_configuration_manager_spec.rb
@@ -32,7 +32,7 @@ EOH
}
let(:no_whatif_lcm_output) { <<-EOH
-Start-DscConfiguration : A parameter cannot be found that matches parameter name 'whatif'.
+Start-DscConfiguration : A parameter cannot be found\r\n that matches parameter name 'whatif'.
At line:1 char:123
+ run-somecommand -whatif
+ ~~~~~~~~
@@ -77,8 +77,13 @@ EOH
let(:lcm_standard_error) { no_whatif_lcm_output }
let(:lcm_cmdlet_success) { false }
+ it 'returns true when passed to #whatif_not_supported?' do
+ expect(lcm.send(:whatif_not_supported?, no_whatif_lcm_output)).to be_truthy
+ end
+
it 'should should return a (possibly empty) array of ResourceInfo instances' do
expect(Chef::Log).to receive(:warn)
+ expect(lcm).to receive(:whatif_not_supported?).and_call_original
test_configuration_result = nil
expect {test_configuration_result = lcm.test_configuration('config')}.not_to raise_error
expect(test_configuration_result.class).to be(Array)
@@ -92,7 +97,7 @@ EOH
it 'should log a warning if the message is formatted as expected when a resource import failure occurs' do
expect(Chef::Log).to receive(:warn)
- expect(lcm).to receive(:output_has_dsc_module_failure?).and_call_original
+ expect(lcm).to receive(:dsc_module_import_failure?).and_call_original
test_configuration_result = nil
expect {test_configuration_result = lcm.test_configuration('config')}.not_to raise_error
end
@@ -112,22 +117,22 @@ EOH
it 'should log a warning' do
expect(Chef::Log).to receive(:warn)
- expect(lcm).to receive(:output_has_dsc_module_failure?).and_call_original
+ expect(lcm).to receive(:dsc_module_import_failure?).and_call_original
expect {lcm.test_configuration('config')}.not_to raise_error
end
end
end
it 'should identify a correctly formatted error message as a resource import failure' do
- expect(lcm.send(:output_has_dsc_module_failure?, dsc_resource_import_failure_output)).to be(true)
+ expect(lcm.send(:dsc_module_import_failure?, dsc_resource_import_failure_output)).to be(true)
end
it 'should not identify an incorrectly formatted error message as a resource import failure' do
- expect(lcm.send(:output_has_dsc_module_failure?, dsc_resource_import_failure_output.gsub('module', 'gibberish'))).to be(false)
+ expect(lcm.send(:dsc_module_import_failure?, dsc_resource_import_failure_output.gsub('module', 'gibberish'))).to be(false)
end
it 'should not identify a message without a CimException reference as a resource import failure' do
- expect(lcm.send(:output_has_dsc_module_failure?, dsc_resource_import_failure_output.gsub('CimException', 'ArgumentException'))).to be(false)
+ expect(lcm.send(:dsc_module_import_failure?, dsc_resource_import_failure_output.gsub('CimException', 'ArgumentException'))).to be(false)
end
end
end
diff --git a/spec/unit/util/editor_spec.rb b/spec/unit/util/editor_spec.rb
index 06370f7de0..968302df17 100644
--- a/spec/unit/util/editor_spec.rb
+++ b/spec/unit/util/editor_spec.rb
@@ -22,7 +22,7 @@ describe Chef::Util::Editor do
context 'when there is no match' do
subject(:execute) { editor.append_line_after('missing', 'new') }
- it('returns the number of added lines') { should be == 0 }
+ it('returns the number of added lines') { is_expected.to eq(0) }
it 'does not add any lines' do
expect { execute }.to_not change { editor.lines }
end
@@ -31,7 +31,7 @@ describe Chef::Util::Editor do
context 'when there is a match' do
subject(:execute) { editor.append_line_after('two', 'new') }
- it('returns the number of added lines') { should be == 2 }
+ it('returns the number of added lines') { is_expected.to eq(2) }
it 'adds a line after each match' do
execute
expect(editor.lines).to be == ['one', 'two', 'new', 'two', 'new', 'three']
@@ -48,7 +48,7 @@ describe Chef::Util::Editor do
context 'when there is no match' do
subject(:execute) { editor.append_line_if_missing('missing', 'new') }
- it('returns the number of added lines') { should be == 1 }
+ it('returns the number of added lines') { is_expected.to eq(1) }
it 'adds a line to the end' do
execute
expect(editor.lines).to be == ['one', 'two', 'two', 'three', 'new']
@@ -58,7 +58,7 @@ describe Chef::Util::Editor do
context 'when there is a match' do
subject(:execute) { editor.append_line_if_missing('one', 'new') }
- it('returns the number of added lines') { should be == 0 }
+ it('returns the number of added lines') { is_expected.to eq(0) }
it 'does not add any lines' do
expect { execute }.to_not change { editor.lines }
end
@@ -74,7 +74,7 @@ describe Chef::Util::Editor do
context 'when there is no match' do
subject(:execute) { editor.remove_lines('missing') }
- it('returns the number of removed lines') { should be == 0 }
+ it('returns the number of removed lines') { is_expected.to eq(0) }
it 'does not remove any lines' do
expect { execute }.to_not change { editor.lines }
end
@@ -83,7 +83,7 @@ describe Chef::Util::Editor do
context 'when there is a match' do
subject(:execute) { editor.remove_lines('two') }
- it('returns the number of removed lines') { should be == 2 }
+ it('returns the number of removed lines') { is_expected.to eq(2) }
it 'removes the matching lines' do
execute
expect(editor.lines).to be == ['one', 'three']
@@ -100,7 +100,7 @@ describe Chef::Util::Editor do
context 'when there is no match' do
subject(:execute) { editor.replace('missing', 'new') }
- it('returns the number of changed lines') { should be == 0 }
+ it('returns the number of changed lines') { is_expected.to eq(0) }
it 'does not change any lines' do
expect { execute }.to_not change { editor.lines }
end
@@ -109,7 +109,7 @@ describe Chef::Util::Editor do
context 'when there is a match' do
subject(:execute) { editor.replace('two', 'new') }
- it('returns the number of changed lines') { should be == 2 }
+ it('returns the number of changed lines') { is_expected.to eq(2) }
it 'replaces the matching portions' do
execute
expect(editor.lines).to be == ['one', 'new', 'new', 'three']
@@ -127,7 +127,7 @@ describe Chef::Util::Editor do
context 'when there is no match' do
subject(:execute) { editor.replace_lines('missing', 'new') }
- it('returns the number of changed lines') { should be == 0 }
+ it('returns the number of changed lines') { is_expected.to eq(0) }
it 'does not change any lines' do
expect { execute }.to_not change { editor.lines }
end
@@ -136,7 +136,7 @@ describe Chef::Util::Editor do
context 'when there is a match' do
subject(:execute) { editor.replace_lines('two', 'new') }
- it('returns the number of replaced lines') { should be == 2 }
+ it('returns the number of replaced lines') { is_expected.to eq(2) }
it 'replaces the matching line' do
execute
expect(editor.lines).to be == ['one', 'new', 'new', 'three']
diff --git a/spec/unit/util/file_edit_spec.rb b/spec/unit/util/file_edit_spec.rb
index 139b29d9ce..b99cf2f426 100644
--- a/spec/unit/util/file_edit_spec.rb
+++ b/spec/unit/util/file_edit_spec.rb
@@ -135,21 +135,21 @@ twice
describe "search_file_replace" do
it "should accept regex passed in as a string (not Regexp object) and replace the match if there is one" do
fedit.search_file_replace("localhost", "replacement")
- fedit.unwritten_changes?.should be_true
+ expect(fedit.unwritten_changes?).to be_truthy
fedit.write_file
expect(edited_file_contents).to eq(localhost_replaced)
end
it "should accept regex passed in as a Regexp object and replace the match if there is one" do
fedit.search_file_replace(/localhost/, "replacement")
- fedit.unwritten_changes?.should be_true
+ expect(fedit.unwritten_changes?).to be_truthy
fedit.write_file
expect(edited_file_contents).to eq(localhost_replaced)
end
it "should do nothing if there isn't a match" do
fedit.search_file_replace(/pattern/, "replacement")
- fedit.unwritten_changes?.should be_false
+ expect(fedit.unwritten_changes?).to be_falsey
fedit.write_file
expect(edited_file_contents).to eq(starting_content)
end
@@ -158,7 +158,7 @@ twice
describe "search_file_replace_line" do
it "should search for match and replace the whole line" do
fedit.search_file_replace_line(/localhost/, "replacement line")
- fedit.unwritten_changes?.should be_true
+ expect(fedit.unwritten_changes?).to be_truthy
fedit.write_file
expect(edited_file_contents).to eq(localhost_line_replaced)
end
@@ -167,7 +167,7 @@ twice
describe "search_file_delete" do
it "should search for match and delete the match" do
fedit.search_file_delete(/localhost/)
- fedit.unwritten_changes?.should be_true
+ expect(fedit.unwritten_changes?).to be_truthy
fedit.write_file
expect(edited_file_contents).to eq(localhost_deleted)
end
@@ -176,7 +176,7 @@ twice
describe "search_file_delete_line" do
it "should search for match and delete the matching line" do
fedit.search_file_delete_line(/localhost/)
- fedit.unwritten_changes?.should be_true
+ expect(fedit.unwritten_changes?).to be_truthy
fedit.write_file
expect(edited_file_contents).to eq(localhost_line_deleted)
end
@@ -185,7 +185,7 @@ twice
describe "insert_line_after_match" do
it "should search for match and insert the given line after the matching line" do
fedit.insert_line_after_match(/localhost/, "new line inserted")
- fedit.unwritten_changes?.should be_true
+ expect(fedit.unwritten_changes?).to be_truthy
fedit.write_file
expect(edited_file_contents).to eq(append_after_all_localhost)
end
@@ -194,14 +194,14 @@ twice
describe "insert_line_if_no_match" do
it "should search for match and insert the given line if no line match" do
fedit.insert_line_if_no_match(/pattern/, "new line inserted")
- fedit.unwritten_changes?.should be_true
+ expect(fedit.unwritten_changes?).to be_truthy
fedit.write_file
expect(edited_file_contents).to eq(append_after_content)
end
it "should do nothing if there is a match" do
fedit.insert_line_if_no_match(/localhost/, "replacement")
- fedit.unwritten_changes?.should be_false
+ expect(fedit.unwritten_changes?).to be_falsey
fedit.write_file
expect(edited_file_contents).to eq(starting_content)
end
@@ -218,7 +218,7 @@ twice
it "should return true if a file got edited" do
fedit.insert_line_if_no_match(/pattern/, "new line inserted")
fedit.write_file
- expect(fedit.file_edited?).to be_true
+ expect(fedit.file_edited?).to be_truthy
end
end
end
diff --git a/spec/unit/util/path_helper_spec.rb b/spec/unit/util/path_helper_spec.rb
index 1d97efc607..4df4b9b1ff 100644
--- a/spec/unit/util/path_helper_spec.rb
+++ b/spec/unit/util/path_helper_spec.rb
@@ -25,81 +25,81 @@ describe Chef::Util::PathHelper do
[ false, true ].each do |is_windows|
context "on #{is_windows ? "windows" : "unix"}" do
before(:each) do
- Chef::Platform.stub(:windows?).and_return(is_windows)
+ allow(Chef::Platform).to receive(:windows?).and_return(is_windows)
end
describe "join" do
it "joins components when some end with separators" do
expected = PathHelper.cleanpath("/foo/bar/baz")
expected = "C:#{expected}" if is_windows
- PathHelper.join(is_windows ? 'C:\\foo\\' : "/foo/", "bar", "baz").should == expected
+ expect(PathHelper.join(is_windows ? 'C:\\foo\\' : "/foo/", "bar", "baz")).to eq(expected)
end
it "joins components when some end and start with separators" do
expected = PathHelper.cleanpath("/foo/bar/baz")
expected = "C:#{expected}" if is_windows
- PathHelper.join(is_windows ? 'C:\\foo\\' : "/foo/", "bar/", "/baz").should == expected
+ expect(PathHelper.join(is_windows ? 'C:\\foo\\' : "/foo/", "bar/", "/baz")).to eq(expected)
end
it "joins components that don't end in separators" do
expected = PathHelper.cleanpath("/foo/bar/baz")
expected = "C:#{expected}" if is_windows
- PathHelper.join(is_windows ? 'C:\\foo' : "/foo", "bar", "baz").should == expected
+ expect(PathHelper.join(is_windows ? 'C:\\foo' : "/foo", "bar", "baz")).to eq(expected)
end
it "joins starting with '' resolve to absolute paths" do
- PathHelper.join('', 'a', 'b').should == "#{PathHelper.path_separator}a#{PathHelper.path_separator}b"
+ expect(PathHelper.join('', 'a', 'b')).to eq("#{PathHelper.path_separator}a#{PathHelper.path_separator}b")
end
it "joins ending with '' add a / to the end" do
- PathHelper.join('a', 'b', '').should == "a#{PathHelper.path_separator}b#{PathHelper.path_separator}"
+ expect(PathHelper.join('a', 'b', '')).to eq("a#{PathHelper.path_separator}b#{PathHelper.path_separator}")
end
if is_windows
it "joins components on Windows when some end with unix separators" do
- PathHelper.join('C:\\foo/', "bar", "baz").should == 'C:\\foo\\bar\\baz'
+ expect(PathHelper.join('C:\\foo/', "bar", "baz")).to eq('C:\\foo\\bar\\baz')
end
end
end
if is_windows
it "path_separator is \\" do
- PathHelper.path_separator.should == '\\'
+ expect(PathHelper.path_separator).to eq('\\')
end
else
it "path_separator is /" do
- PathHelper.path_separator.should == '/'
+ expect(PathHelper.path_separator).to eq('/')
end
end
if is_windows
it "cleanpath changes slashes into backslashes and leaves backslashes alone" do
- PathHelper.cleanpath('/a/b\\c/d/').should == '\\a\\b\\c\\d'
+ expect(PathHelper.cleanpath('/a/b\\c/d/')).to eq('\\a\\b\\c\\d')
end
it "cleanpath does not remove leading double backslash" do
- PathHelper.cleanpath('\\\\a/b\\c/d/').should == '\\\\a\\b\\c\\d'
+ expect(PathHelper.cleanpath('\\\\a/b\\c/d/')).to eq('\\\\a\\b\\c\\d')
end
else
it "cleanpath removes extra slashes alone" do
- PathHelper.cleanpath('/a///b/c/d/').should == '/a/b/c/d'
+ expect(PathHelper.cleanpath('/a///b/c/d/')).to eq('/a/b/c/d')
end
end
describe "dirname" do
it "dirname('abc') is '.'" do
- PathHelper.dirname('abc').should == '.'
+ expect(PathHelper.dirname('abc')).to eq('.')
end
it "dirname('/') is '/'" do
- PathHelper.dirname(PathHelper.path_separator).should == PathHelper.path_separator
+ expect(PathHelper.dirname(PathHelper.path_separator)).to eq(PathHelper.path_separator)
end
it "dirname('a/b/c') is 'a/b'" do
- PathHelper.dirname(PathHelper.join('a', 'b', 'c')).should == PathHelper.join('a', 'b')
+ expect(PathHelper.dirname(PathHelper.join('a', 'b', 'c'))).to eq(PathHelper.join('a', 'b'))
end
it "dirname('a/b/c/') is 'a/b'" do
- PathHelper.dirname(PathHelper.join('a', 'b', 'c', '')).should == PathHelper.join('a', 'b')
+ expect(PathHelper.dirname(PathHelper.join('a', 'b', 'c', ''))).to eq(PathHelper.join('a', 'b'))
end
it "dirname('/a/b/c') is '/a/b'" do
- PathHelper.dirname(PathHelper.join('', 'a', 'b', 'c')).should == PathHelper.join('', 'a', 'b')
+ expect(PathHelper.dirname(PathHelper.join('', 'a', 'b', 'c'))).to eq(PathHelper.join('', 'a', 'b'))
end
end
end
@@ -109,9 +109,9 @@ describe Chef::Util::PathHelper do
context "on windows" do
before(:each) do
# pass by default
- Chef::Platform.stub(:windows?).and_return(true)
- PathHelper.stub(:printable?).and_return(true)
- PathHelper.stub(:windows_max_length_exceeded?).and_return(false)
+ allow(Chef::Platform).to receive(:windows?).and_return(true)
+ allow(PathHelper).to receive(:printable?).and_return(true)
+ allow(PathHelper).to receive(:windows_max_length_exceeded?).and_return(false)
end
it "returns the path if the path passes the tests" do
@@ -123,14 +123,14 @@ describe Chef::Util::PathHelper do
end
it "raises an error if the path has invalid characters" do
- PathHelper.stub(:printable?).and_return(false)
+ allow(PathHelper).to receive(:printable?).and_return(false)
expect { PathHelper.validate_path("Newline!\n") }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "Adds the \\\\?\\ prefix if the path exceeds MAX_LENGTH and does not have it" do
long_path = "C:\\" + "a" * 250 + "\\" + "b" * 250
prefixed_long_path = "\\\\?\\" + long_path
- PathHelper.stub(:windows_max_length_exceeded?).and_return(true)
+ allow(PathHelper).to receive(:windows_max_length_exceeded?).and_return(true)
expect(PathHelper.validate_path(long_path)).to eql(prefixed_long_path)
end
end
@@ -138,38 +138,38 @@ describe Chef::Util::PathHelper do
describe "windows_max_length_exceeded?" do
it "returns true if the path is too long (259 + NUL) for the API" do
- expect(PathHelper.windows_max_length_exceeded?("C:\\" + "a" * 250 + "\\" + "b" * 6)).to be_true
+ expect(PathHelper.windows_max_length_exceeded?("C:\\" + "a" * 250 + "\\" + "b" * 6)).to be_truthy
end
it "returns false if the path is not too long (259 + NUL) for the standard API" do
- expect(PathHelper.windows_max_length_exceeded?("C:\\" + "a" * 250 + "\\" + "b" * 5)).to be_false
+ expect(PathHelper.windows_max_length_exceeded?("C:\\" + "a" * 250 + "\\" + "b" * 5)).to be_falsey
end
it "returns false if the path is over 259 characters but uses the \\\\?\\ prefix" do
- expect(PathHelper.windows_max_length_exceeded?("\\\\?\\C:\\" + "a" * 250 + "\\" + "b" * 250)).to be_false
+ expect(PathHelper.windows_max_length_exceeded?("\\\\?\\C:\\" + "a" * 250 + "\\" + "b" * 250)).to be_falsey
end
end
describe "printable?" do
it "returns true if the string contains no non-printable characters" do
- expect(PathHelper.printable?("C:\\Program Files (x86)\\Microsoft Office\\Files.lst")).to be_true
+ expect(PathHelper.printable?("C:\\Program Files (x86)\\Microsoft Office\\Files.lst")).to be_truthy
end
it "returns true when given 'abc' in unicode" do
- expect(PathHelper.printable?("\u0061\u0062\u0063")).to be_true
+ expect(PathHelper.printable?("\u0061\u0062\u0063")).to be_truthy
end
it "returns true when given japanese unicode" do
- expect(PathHelper.printable?("\uff86\uff87\uff88")).to be_true
+ expect(PathHelper.printable?("\uff86\uff87\uff88")).to be_truthy
end
it "returns false if the string contains a non-printable character" do
- expect(PathHelper.printable?("\my files\work\notes.txt")).to be_false
+ expect(PathHelper.printable?("\my files\work\notes.txt")).to be_falsey
end
# This isn't necessarily a requirement, but here to be explicit about functionality.
it "returns false if the string contains a newline or tab" do
- expect(PathHelper.printable?("\tThere's no way,\n\t *no* way,\n\t that you came from my loins.\n")).to be_false
+ expect(PathHelper.printable?("\tThere's no way,\n\t *no* way,\n\t that you came from my loins.\n")).to be_falsey
end
end
@@ -205,15 +205,15 @@ describe Chef::Util::PathHelper do
describe "paths_eql?" do
it "returns true if the paths are the same" do
- PathHelper.stub(:canonical_path).with("bandit").and_return("c:/bandit/bandit")
- PathHelper.stub(:canonical_path).with("../bandit/bandit").and_return("c:/bandit/bandit")
- expect(PathHelper.paths_eql?("bandit", "../bandit/bandit")).to be_true
+ allow(PathHelper).to receive(:canonical_path).with("bandit").and_return("c:/bandit/bandit")
+ allow(PathHelper).to receive(:canonical_path).with("../bandit/bandit").and_return("c:/bandit/bandit")
+ expect(PathHelper.paths_eql?("bandit", "../bandit/bandit")).to be_truthy
end
it "returns false if the paths are different" do
- PathHelper.stub(:canonical_path).with("bandit").and_return("c:/Bo/Bandit")
- PathHelper.stub(:canonical_path).with("../bandit/bandit").and_return("c:/bandit/bandit")
- expect(PathHelper.paths_eql?("bandit", "../bandit/bandit")).to be_false
+ allow(PathHelper).to receive(:canonical_path).with("bandit").and_return("c:/Bo/Bandit")
+ allow(PathHelper).to receive(:canonical_path).with("../bandit/bandit").and_return("c:/bandit/bandit")
+ expect(PathHelper.paths_eql?("bandit", "../bandit/bandit")).to be_falsey
end
end
diff --git a/spec/unit/util/powershell/cmdlet_spec.rb b/spec/unit/util/powershell/cmdlet_spec.rb
index a964f607c8..5ddf9282c4 100644
--- a/spec/unit/util/powershell/cmdlet_spec.rb
+++ b/spec/unit/util/powershell/cmdlet_spec.rb
@@ -51,18 +51,18 @@ describe Chef::Util::Powershell::Cmdlet do
# Is this list really complete?
%w{` " # '}.each do |c|
it "escapse #{c}" do
- @cmdlet.send(:escape_parameter_value, "stuff #{c}").should eql("stuff `#{c}")
+ expect(@cmdlet.send(:escape_parameter_value, "stuff #{c}")).to eql("stuff `#{c}")
end
end
it 'does not do anything to a string without special characters' do
- @cmdlet.send(:escape_parameter_value, 'stuff').should eql('stuff')
+ expect(@cmdlet.send(:escape_parameter_value, 'stuff')).to eql('stuff')
end
end
describe '#escape_string_parameter_value' do
it "surrounds a string with ''" do
- @cmdlet.send(:escape_string_parameter_value, 'stuff').should eql("'stuff'")
+ expect(@cmdlet.send(:escape_string_parameter_value, 'stuff')).to eql("'stuff'")
end
end
@@ -80,27 +80,27 @@ describe Chef::Util::Powershell::Cmdlet do
end
it 'ignores switches with a false value' do
- @cmdlet.send(:command_switches_string, {foo: false}).should eql('')
+ expect(@cmdlet.send(:command_switches_string, {foo: false})).to eql('')
end
it 'should correctly handle a value type of string' do
- @cmdlet.send(:command_switches_string, {foo: 'bar'}).should eql("-foo 'bar'")
+ expect(@cmdlet.send(:command_switches_string, {foo: 'bar'})).to eql("-foo 'bar'")
end
it 'should correctly handle a value type of string even when it is 0 length' do
- @cmdlet.send(:command_switches_string, {foo: ''}).should eql("-foo ''")
+ expect(@cmdlet.send(:command_switches_string, {foo: ''})).to eql("-foo ''")
end
it 'should not quote integers' do
- @cmdlet.send(:command_switches_string, {foo: 1}).should eql("-foo 1")
+ expect(@cmdlet.send(:command_switches_string, {foo: 1})).to eql("-foo 1")
end
it 'should not quote floats' do
- @cmdlet.send(:command_switches_string, {foo: 1.0}).should eql("-foo 1.0")
+ expect(@cmdlet.send(:command_switches_string, {foo: 1.0})).to eql("-foo 1.0")
end
it 'has just the switch when the value is true' do
- @cmdlet.send(:command_switches_string, {foo: true}).should eql("-foo")
+ expect(@cmdlet.send(:command_switches_string, {foo: true})).to eql("-foo")
end
end
end
diff --git a/spec/unit/util/selinux_spec.rb b/spec/unit/util/selinux_spec.rb
index 53faba3db3..0ed138c7bc 100644
--- a/spec/unit/util/selinux_spec.rb
+++ b/spec/unit/util/selinux_spec.rb
@@ -44,17 +44,17 @@ describe Chef::Util::Selinux do
expected_paths.each do |bin_path|
selinux_path = File.join(bin_path, "selinuxenabled")
- File.should_receive(:executable?).with(selinux_path).and_return(false)
+ expect(File).to receive(:executable?).with(selinux_path).and_return(false)
end
- @test_instance.selinux_enabled?.should be_false
+ expect(@test_instance.selinux_enabled?).to be_falsey
end
describe "when selinuxenabled binary exists" do
before do
@selinux_enabled_path = File.join("/sbin", "selinuxenabled")
- File.stub(:executable?) do |file_path|
- file_path.end_with?("selinuxenabled").should be_true
+ allow(File).to receive(:executable?) do |file_path|
+ expect(file_path.end_with?("selinuxenabled")).to be_truthy
file_path == @selinux_enabled_path
end
end
@@ -62,54 +62,54 @@ describe Chef::Util::Selinux do
describe "when selinux is enabled" do
before do
cmd_result = double("Cmd Result", :exitstatus => 0)
- @test_instance.should_receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result)
+ expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result)
end
it "should report selinux is enabled" do
- @test_instance.selinux_enabled?.should be_true
+ expect(@test_instance.selinux_enabled?).to be_truthy
# should check the file system only once for multiple calls
- @test_instance.selinux_enabled?.should be_true
+ expect(@test_instance.selinux_enabled?).to be_truthy
end
end
describe "when selinux is disabled" do
before do
cmd_result = double("Cmd Result", :exitstatus => 1)
- @test_instance.should_receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result)
+ expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result)
end
it "should report selinux is disabled" do
- @test_instance.selinux_enabled?.should be_false
+ expect(@test_instance.selinux_enabled?).to be_falsey
# should check the file system only once for multiple calls
- @test_instance.selinux_enabled?.should be_false
+ expect(@test_instance.selinux_enabled?).to be_falsey
end
end
describe "when selinux gives an unexpected status" do
before do
cmd_result = double("Cmd Result", :exitstatus => 101)
- @test_instance.should_receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result)
+ expect(@test_instance).to receive(:shell_out!).once.with(@selinux_enabled_path, {:returns=>[0, 1]}).and_return(cmd_result)
end
it "should throw an error" do
- lambda {@test_instance.selinux_enabled?}.should raise_error(RuntimeError)
+ expect {@test_instance.selinux_enabled?}.to raise_error(RuntimeError)
end
end
end
describe "when selinuxenabled binary doesn't exist" do
before do
- File.stub(:executable?) do |file_path|
- file_path.end_with?("selinuxenabled").should be_true
+ allow(File).to receive(:executable?) do |file_path|
+ expect(file_path.end_with?("selinuxenabled")).to be_truthy
false
end
end
it "should report selinux is disabled" do
- @test_instance.selinux_enabled?.should be_false
+ expect(@test_instance.selinux_enabled?).to be_falsey
# should check the file system only once for multiple calls
- File.should_not_receive(:executable?)
- @test_instance.selinux_enabled?.should be_false
+ expect(File).not_to receive(:executable?)
+ expect(@test_instance.selinux_enabled?).to be_falsey
end
end
@@ -118,53 +118,53 @@ describe Chef::Util::Selinux do
before do
@restorecon_enabled_path = File.join("/sbin", "restorecon")
- File.stub(:executable?) do |file_path|
- file_path.end_with?("restorecon").should be_true
+ allow(File).to receive(:executable?) do |file_path|
+ expect(file_path.end_with?("restorecon")).to be_truthy
file_path == @restorecon_enabled_path
end
end
it "should call restorecon non-recursive by default" do
restorecon_command = "#{@restorecon_enabled_path} -R \"#{path}\""
- @test_instance.should_receive(:shell_out!).twice.with(restorecon_command)
+ expect(@test_instance).to receive(:shell_out!).twice.with(restorecon_command)
@test_instance.restore_security_context(path)
- File.should_not_receive(:executable?)
+ expect(File).not_to receive(:executable?)
@test_instance.restore_security_context(path)
end
it "should call restorecon recursive when recursive is set" do
restorecon_command = "#{@restorecon_enabled_path} -R -r \"#{path}\""
- @test_instance.should_receive(:shell_out!).twice.with(restorecon_command)
+ expect(@test_instance).to receive(:shell_out!).twice.with(restorecon_command)
@test_instance.restore_security_context(path, true)
- File.should_not_receive(:executable?)
+ expect(File).not_to receive(:executable?)
@test_instance.restore_security_context(path, true)
end
it "should call restorecon non-recursive when recursive is not set" do
restorecon_command = "#{@restorecon_enabled_path} -R \"#{path}\""
- @test_instance.should_receive(:shell_out!).twice.with(restorecon_command)
+ expect(@test_instance).to receive(:shell_out!).twice.with(restorecon_command)
@test_instance.restore_security_context(path)
- File.should_not_receive(:executable?)
+ expect(File).not_to receive(:executable?)
@test_instance.restore_security_context(path)
end
describe "when restorecon doesn't exist on the system" do
before do
- File.stub(:executable?) do |file_path|
- file_path.end_with?("restorecon").should be_true
+ allow(File).to receive(:executable?) do |file_path|
+ expect(file_path.end_with?("restorecon")).to be_truthy
false
end
end
it "should log a warning message" do
log = [ ]
- Chef::Log.stub(:warn) do |message|
+ allow(Chef::Log).to receive(:warn) do |message|
log << message
end
@test_instance.restore_security_context(path)
- log.should_not be_empty
- File.should_not_receive(:executable?)
+ expect(log).not_to be_empty
+ expect(File).not_to receive(:executable?)
@test_instance.restore_security_context(path)
end
end
diff --git a/spec/unit/util/threaded_job_queue_spec.rb b/spec/unit/util/threaded_job_queue_spec.rb
index a199937639..22626328be 100644
--- a/spec/unit/util/threaded_job_queue_spec.rb
+++ b/spec/unit/util/threaded_job_queue_spec.rb
@@ -23,8 +23,8 @@ describe Chef::Util::ThreadedJobQueue do
it "should pass mutex to jobs with an arity of 1" do
job = double()
- job.should_receive(:arity).at_least(:once).and_return(1)
- job.should_receive(:call).exactly(5).times.with(an_instance_of(Mutex))
+ expect(job).to receive(:arity).at_least(:once).and_return(1)
+ expect(job).to receive(:call).exactly(5).times.with(an_instance_of(Mutex))
5.times { queue << job }
queue.process
@@ -32,20 +32,20 @@ describe Chef::Util::ThreadedJobQueue do
it "should pass nothing to jobs with an arity of 0" do
job = double()
- job.should_receive(:arity).at_least(:once).and_return(0)
- job.should_receive(:call).exactly(5).times.with(no_args)
+ expect(job).to receive(:arity).at_least(:once).and_return(0)
+ expect(job).to receive(:call).exactly(5).times.with(no_args)
5.times { queue << job }
queue.process
end
it "should use specified number of threads" do
- Thread.should_receive(:new).exactly(7).times.and_call_original
+ expect(Thread).to receive(:new).exactly(7).times.and_call_original
queue.process(7)
end
it "should propagate exceptions to the main thread" do
queue << lambda { raise WorkerThreadError }
- lambda { queue.process }.should raise_error(WorkerThreadError)
+ expect { queue.process }.to raise_error(WorkerThreadError)
end
end
diff --git a/spec/unit/version/platform_spec.rb b/spec/unit/version/platform_spec.rb
index 69f42e58b2..dd425b32a5 100644
--- a/spec/unit/version/platform_spec.rb
+++ b/spec/unit/version/platform_spec.rb
@@ -21,12 +21,12 @@ describe Chef::Version::Platform do
it "is a subclass of Chef::Version" do
v = Chef::Version::Platform.new('1.1')
- v.should be_an_instance_of(Chef::Version::Platform)
- v.should be_a_kind_of(Chef::Version)
+ expect(v).to be_an_instance_of(Chef::Version::Platform)
+ expect(v).to be_a_kind_of(Chef::Version)
end
it "should transform 1 to 1.0.0" do
- Chef::Version::Platform.new("1").to_s.should == "1.0.0"
+ expect(Chef::Version::Platform.new("1").to_s).to eq("1.0.0")
end
describe "when creating valid Versions" do
@@ -44,7 +44,7 @@ describe Chef::Version::Platform do
the_error = Chef::Exceptions::InvalidPlatformVersion
bad_versions.each do |v|
it "should raise #{the_error} when given '#{v}'" do
- lambda { Chef::Version::Platform.new v }.should raise_error(the_error)
+ expect { Chef::Version::Platform.new v }.to raise_error(the_error)
end
end
end
@@ -52,7 +52,7 @@ describe Chef::Version::Platform do
describe "<=>" do
it "should equate versions 1 and 1.0.0" do
- Chef::Version::Platform.new("1").should == Chef::Version::Platform.new("1.0.0")
+ expect(Chef::Version::Platform.new("1")).to eq(Chef::Version::Platform.new("1.0.0"))
end
end
diff --git a/spec/unit/version_class_spec.rb b/spec/unit/version_class_spec.rb
index b0fcfbb3fb..fe1488550b 100644
--- a/spec/unit/version_class_spec.rb
+++ b/spec/unit/version_class_spec.rb
@@ -25,22 +25,22 @@ describe Chef::Version do
end
it "should turn itself into a string" do
- @v0.to_s.should == "0.0.0"
- @v123.to_s.should == "1.2.3"
+ expect(@v0.to_s).to eq("0.0.0")
+ expect(@v123.to_s).to eq("1.2.3")
end
it "should make a round trip with its string representation" do
a = Chef::Version.new(@v123.to_s)
- a.should == @v123
+ expect(a).to eq(@v123)
end
it "should transform 1.2 to 1.2.0" do
- Chef::Version.new("1.2").to_s.should == "1.2.0"
+ expect(Chef::Version.new("1.2").to_s).to eq("1.2.0")
end
it "should transform 01.002.0003 to 1.2.3" do
a = Chef::Version.new "01.002.0003"
- a.should == @v123
+ expect(a).to eq(@v123)
end
describe "when creating valid Versions" do
@@ -58,7 +58,7 @@ describe Chef::Version do
the_error = Chef::Exceptions::InvalidCookbookVersion
bad_versions.each do |v|
it "should raise #{the_error} when given '#{v}'" do
- lambda { Chef::Version.new v }.should raise_error(the_error)
+ expect { Chef::Version.new v }.to raise_error(the_error)
end
end
end
@@ -66,15 +66,15 @@ describe Chef::Version do
describe "<=>" do
it "should equate versions 1.2 and 1.2.0" do
- Chef::Version.new("1.2").should == Chef::Version.new("1.2.0")
+ expect(Chef::Version.new("1.2")).to eq(Chef::Version.new("1.2.0"))
end
it "should equate version 1.04 and 1.4" do
- Chef::Version.new("1.04").should == Chef::Version.new("1.4")
+ expect(Chef::Version.new("1.04")).to eq(Chef::Version.new("1.4"))
end
it "should treat versions as numbers in the right way" do
- Chef::Version.new("2.0").should be < Chef::Version.new("11.0")
+ expect(Chef::Version.new("2.0")).to be < Chef::Version.new("11.0")
end
it "should sort based on the version number" do
@@ -95,9 +95,9 @@ describe Chef::Version do
examples.each do |smaller, larger|
sm = Chef::Version.new(smaller)
lg = Chef::Version.new(larger)
- sm.should be < lg
- lg.should be > sm
- sm.should_not == lg
+ expect(sm).to be < lg
+ expect(lg).to be > sm
+ expect(sm).not_to eq(lg)
end
end
@@ -106,7 +106,7 @@ describe Chef::Version do
Chef::Version.new(s)
end
got = a.sort.map {|v| v.to_s }
- got.should == %w{0.0.0 0.0.1 0.1.0 0.1.1 1.0.0 1.1.0 1.1.1}
+ expect(got).to eq(%w{0.0.0 0.0.1 0.1.0 0.1.1 1.0.0 1.1.0 1.1.1})
end
it "should sort an array of versions, part 2" do
@@ -114,7 +114,7 @@ describe Chef::Version do
Chef::Version.new(s)
end
got = a.sort.map { |v| v.to_s }
- got.should == %w{0.8.6 1.0.0 1.2.3 3.5.7 4.4.6 4.5.5 4.5.6 5.9.8 9.8.7}
+ expect(got).to eq(%w{0.8.6 1.0.0 1.2.3 3.5.7 4.4.6 4.5.5 4.5.6 5.9.8 9.8.7})
end
describe "comparison examples" do
@@ -163,7 +163,7 @@ describe Chef::Version do
it "(#{spec.first(3).join(' ')}) should be #{spec[3]}" do
got = Chef::Version.new(spec[0]).send(spec[1],
Chef::Version.new(spec[2]))
- got.should == spec[3]
+ expect(got).to eq(spec[3])
end
end
end
diff --git a/spec/unit/version_constraint/platform_spec.rb b/spec/unit/version_constraint/platform_spec.rb
index a3599aeb96..f38eb49689 100644
--- a/spec/unit/version_constraint/platform_spec.rb
+++ b/spec/unit/version_constraint/platform_spec.rb
@@ -21,24 +21,24 @@ describe Chef::VersionConstraint::Platform do
it "is a subclass of Chef::VersionConstraint" do
v = Chef::VersionConstraint::Platform.new
- v.should be_an_instance_of(Chef::VersionConstraint::Platform)
- v.should be_a_kind_of(Chef::VersionConstraint)
+ expect(v).to be_an_instance_of(Chef::VersionConstraint::Platform)
+ expect(v).to be_a_kind_of(Chef::VersionConstraint)
end
it "should work with Chef::Version::Platform classes" do
vc = Chef::VersionConstraint::Platform.new("1.0")
- vc.version.should be_an_instance_of(Chef::Version::Platform)
+ expect(vc.version).to be_an_instance_of(Chef::Version::Platform)
end
describe "include?" do
it "pessimistic ~> x" do
vc = Chef::VersionConstraint::Platform.new "~> 1"
- vc.should include "1.3.3"
- vc.should include "1.4"
+ expect(vc).to include "1.3.3"
+ expect(vc).to include "1.4"
- vc.should_not include "2.2"
- vc.should_not include "0.3.0"
+ expect(vc).not_to include "2.2"
+ expect(vc).not_to include "0.3.0"
end
end
diff --git a/spec/unit/version_constraint_spec.rb b/spec/unit/version_constraint_spec.rb
index dfa4740d51..0ae502f66d 100644
--- a/spec/unit/version_constraint_spec.rb
+++ b/spec/unit/version_constraint_spec.rb
@@ -26,18 +26,18 @@ describe Chef::VersionConstraint do
v_error = Chef::Exceptions::InvalidCookbookVersion
bad_version.each do |s|
it "should raise #{v_error} when given #{s}" do
- lambda { Chef::VersionConstraint.new s }.should raise_error(v_error)
+ expect { Chef::VersionConstraint.new s }.to raise_error(v_error)
end
end
bad_op.each do |s|
it "should raise #{o_error} when given #{s}" do
- lambda { Chef::VersionConstraint.new s }.should raise_error(o_error)
+ expect { Chef::VersionConstraint.new s }.to raise_error(o_error)
end
end
it "should interpret a lone version number as implicit = OP" do
vc = Chef::VersionConstraint.new("1.2.3")
- vc.to_s.should == "= 1.2.3"
+ expect(vc.to_s).to eq("= 1.2.3")
end
it "should allow initialization with [] for back compatibility" do
@@ -52,28 +52,28 @@ describe Chef::VersionConstraint do
it "should default to >= 0.0.0" do
vc = Chef::VersionConstraint.new
- vc.to_s.should == ">= 0.0.0"
+ expect(vc.to_s).to eq(">= 0.0.0")
end
it "should default to >= 0.0.0 when initialized with nil" do
- Chef::VersionConstraint.new(nil).to_s.should == ">= 0.0.0"
+ expect(Chef::VersionConstraint.new(nil).to_s).to eq(">= 0.0.0")
end
it "should work with Chef::Version classes" do
vc = Chef::VersionConstraint.new("1.0")
- vc.version.should be_an_instance_of(Chef::Version)
+ expect(vc.version).to be_an_instance_of(Chef::Version)
end
it "should allow ops without space separator" do
- Chef::VersionConstraint.new("=1.2.3").should eql(Chef::VersionConstraint.new("= 1.2.3"))
- Chef::VersionConstraint.new(">1.2.3").should eql(Chef::VersionConstraint.new("> 1.2.3"))
- Chef::VersionConstraint.new("<1.2.3").should eql(Chef::VersionConstraint.new("< 1.2.3"))
- Chef::VersionConstraint.new(">=1.2.3").should eql(Chef::VersionConstraint.new(">= 1.2.3"))
- Chef::VersionConstraint.new("<=1.2.3").should eql(Chef::VersionConstraint.new("<= 1.2.3"))
+ expect(Chef::VersionConstraint.new("=1.2.3")).to eql(Chef::VersionConstraint.new("= 1.2.3"))
+ expect(Chef::VersionConstraint.new(">1.2.3")).to eql(Chef::VersionConstraint.new("> 1.2.3"))
+ expect(Chef::VersionConstraint.new("<1.2.3")).to eql(Chef::VersionConstraint.new("< 1.2.3"))
+ expect(Chef::VersionConstraint.new(">=1.2.3")).to eql(Chef::VersionConstraint.new(">= 1.2.3"))
+ expect(Chef::VersionConstraint.new("<=1.2.3")).to eql(Chef::VersionConstraint.new("<= 1.2.3"))
end
it "should allow ops with multiple spaces" do
- Chef::VersionConstraint.new("= 1.2.3").should eql(Chef::VersionConstraint.new("= 1.2.3"))
+ expect(Chef::VersionConstraint.new("= 1.2.3")).to eql(Chef::VersionConstraint.new("= 1.2.3"))
end
describe "include?" do
@@ -82,70 +82,70 @@ describe Chef::VersionConstraint do
@vc = Chef::VersionConstraint.new "> 1.2.3"
end
it "String" do
- @vc.should include "1.4"
+ expect(@vc).to include "1.4"
end
it "Chef::Version" do
- @vc.should include Chef::Version.new("1.4")
+ expect(@vc).to include Chef::Version.new("1.4")
end
it "Chef::CookbookVersion" do
cv = Chef::CookbookVersion.new("alice", '/tmp/blah.txt')
cv.version = "1.4"
- @vc.should include cv
+ expect(@vc).to include cv
end
end
it "strictly less than" do
vc = Chef::VersionConstraint.new "< 1.2.3"
- vc.should_not include "1.3.0"
- vc.should_not include "1.2.3"
- vc.should include "1.2.2"
+ expect(vc).not_to include "1.3.0"
+ expect(vc).not_to include "1.2.3"
+ expect(vc).to include "1.2.2"
end
it "strictly greater than" do
vc = Chef::VersionConstraint.new "> 1.2.3"
- vc.should include "1.3.0"
- vc.should_not include "1.2.3"
- vc.should_not include "1.2.2"
+ expect(vc).to include "1.3.0"
+ expect(vc).not_to include "1.2.3"
+ expect(vc).not_to include "1.2.2"
end
it "less than or equal to" do
vc = Chef::VersionConstraint.new "<= 1.2.3"
- vc.should_not include "1.3.0"
- vc.should include "1.2.3"
- vc.should include "1.2.2"
+ expect(vc).not_to include "1.3.0"
+ expect(vc).to include "1.2.3"
+ expect(vc).to include "1.2.2"
end
it "greater than or equal to" do
vc = Chef::VersionConstraint.new ">= 1.2.3"
- vc.should include "1.3.0"
- vc.should include "1.2.3"
- vc.should_not include "1.2.2"
+ expect(vc).to include "1.3.0"
+ expect(vc).to include "1.2.3"
+ expect(vc).not_to include "1.2.2"
end
it "equal to" do
vc = Chef::VersionConstraint.new "= 1.2.3"
- vc.should_not include "1.3.0"
- vc.should include "1.2.3"
- vc.should_not include "0.3.0"
+ expect(vc).not_to include "1.3.0"
+ expect(vc).to include "1.2.3"
+ expect(vc).not_to include "0.3.0"
end
it "pessimistic ~> x.y.z" do
vc = Chef::VersionConstraint.new "~> 1.2.3"
- vc.should include "1.2.3"
- vc.should include "1.2.4"
+ expect(vc).to include "1.2.3"
+ expect(vc).to include "1.2.4"
- vc.should_not include "1.2.2"
- vc.should_not include "1.3.0"
- vc.should_not include "2.0.0"
+ expect(vc).not_to include "1.2.2"
+ expect(vc).not_to include "1.3.0"
+ expect(vc).not_to include "2.0.0"
end
it "pessimistic ~> x.y" do
vc = Chef::VersionConstraint.new "~> 1.2"
- vc.should include "1.3.3"
- vc.should include "1.4"
+ expect(vc).to include "1.3.3"
+ expect(vc).to include "1.4"
- vc.should_not include "2.2"
- vc.should_not include "0.3.0"
+ expect(vc).not_to include "2.2"
+ expect(vc).not_to include "0.3.0"
end
end
@@ -153,13 +153,13 @@ describe Chef::VersionConstraint do
it 'shows a patch-level if one is given' do
vc = Chef::VersionConstraint.new '~> 1.2.0'
- vc.to_s.should == '~> 1.2.0'
+ expect(vc.to_s).to eq('~> 1.2.0')
end
it 'shows no patch-level if one is not given' do
vc = Chef::VersionConstraint.new '~> 1.2'
- vc.to_s.should == '~> 1.2'
+ expect(vc.to_s).to eq('~> 1.2')
end
end
@@ -167,13 +167,13 @@ describe Chef::VersionConstraint do
it 'shows a patch-level if one is given' do
vc = Chef::VersionConstraint.new '~> 1.2.0'
- vc.inspect.should == '(~> 1.2.0)'
+ expect(vc.inspect).to eq('(~> 1.2.0)')
end
it 'shows no patch-level if one is not given' do
vc = Chef::VersionConstraint.new '~> 1.2'
- vc.inspect.should == '(~> 1.2)'
+ expect(vc.inspect).to eq('(~> 1.2)')
end
end
end
diff --git a/spec/unit/windows_service_spec.rb b/spec/unit/windows_service_spec.rb
index ba3d2980df..cf933a9ab2 100644
--- a/spec/unit/windows_service_spec.rb
+++ b/spec/unit/windows_service_spec.rb
@@ -25,29 +25,29 @@ describe "Chef::Application::WindowsService", :windows_only do
let (:shell_out_result) {Object.new}
let (:tempfile) {Tempfile.new "log_file"}
before do
- instance.stub(:parse_options)
- shell_out_result.stub(:stdout)
- shell_out_result.stub(:stderr)
+ allow(instance).to receive(:parse_options)
+ allow(shell_out_result).to receive(:stdout)
+ allow(shell_out_result).to receive(:stderr)
end
it "runs chef-client in new process" do
- instance.should_receive(:configure_chef).twice
+ expect(instance).to receive(:configure_chef).twice
instance.service_init
- instance.should_receive(:run_chef_client).and_call_original
- instance.should_receive(:shell_out).and_return(shell_out_result)
- instance.stub(:running?).and_return(true, false)
- instance.instance_variable_get(:@service_signal).stub(:wait)
- instance.stub(:state).and_return(4)
+ expect(instance).to receive(:run_chef_client).and_call_original
+ expect(instance).to receive(:shell_out).and_return(shell_out_result)
+ allow(instance).to receive(:running?).and_return(true, false)
+ allow(instance.instance_variable_get(:@service_signal)).to receive(:wait)
+ allow(instance).to receive(:state).and_return(4)
instance.service_main
end
it "passes config params to new process" do
Chef::Config.merge!({:log_location => tempfile.path, :config_file => "test_config_file", :log_level => :info})
- instance.should_receive(:configure_chef).twice
+ expect(instance).to receive(:configure_chef).twice
instance.service_init
- instance.stub(:running?).and_return(true, false)
- instance.instance_variable_get(:@service_signal).stub(:wait)
- instance.stub(:state).and_return(4)
- instance.should_receive(:run_chef_client).and_call_original
- instance.should_receive(:shell_out).with("chef-client --no-fork -c test_config_file -L #{tempfile.path}").and_return(shell_out_result)
+ allow(instance).to receive(:running?).and_return(true, false)
+ allow(instance.instance_variable_get(:@service_signal)).to receive(:wait)
+ allow(instance).to receive(:state).and_return(4)
+ expect(instance).to receive(:run_chef_client).and_call_original
+ expect(instance).to receive(:shell_out).with("chef-client --no-fork -c test_config_file -L #{tempfile.path}").and_return(shell_out_result)
instance.service_main
tempfile.unlink
end
diff --git a/spec/unit/workstation_config_loader_spec.rb b/spec/unit/workstation_config_loader_spec.rb
index de108ff6d7..0f60e3ec38 100644
--- a/spec/unit/workstation_config_loader_spec.rb
+++ b/spec/unit/workstation_config_loader_spec.rb
@@ -177,7 +177,7 @@ describe Chef::WorkstationConfigLoader do
env["CD"] = "/home/someuser/prod/chef-repo" # windows
env["PWD"] = "/home/someuser/prod/chef-repo" # unix
- Dir.stub(:pwd).and_return("/home/someuser/codes/chef-repo")
+ allow(Dir).to receive(:pwd).and_return("/home/someuser/codes/chef-repo")
end
it "loads the config from the non-dereferenced directory path" do
diff --git a/tasks/rspec.rb b/tasks/rspec.rb
index 95ae274955..a6fc5a9180 100644
--- a/tasks/rspec.rb
+++ b/tasks/rspec.rb
@@ -27,28 +27,16 @@ begin
task :default => :spec
- desc "Run all specs in spec directory"
+ desc "Run standard specs (minus long running specs)"
RSpec::Core::RakeTask.new(:spec) do |t|
- t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/.rspec\""]
- t.pattern = FileList['spec/**/*_spec.rb']
- end
-
- desc "Run all functional specs (in functional/ directory)"
- RSpec::Core::RakeTask.new(:functional) do |t|
- t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/spec/spec.opts\""]
- t.pattern = FileList['spec/functional/**/*_spec.rb']
- end
-
- desc "Run the rspec tests with activesupport loaded"
- RSpec::Core::RakeTask.new(:spec_activesupport) do |t|
- t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/.rspec\"", "--require active_support/core_ext"]
- t.pattern = FileList['spec/unit/**/*_spec.rb']
+ # right now this just limits to functional + unit, but could also remove
+ # individual tests marked long-running
+ t.pattern = FileList['spec/{functional,unit}/**/*_spec.rb']
end
namespace :spec do
desc "Run all specs in spec directory with RCov"
RSpec::Core::RakeTask.new(:rcov) do |t|
- t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/spec/spec.opts\""]
t.pattern = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_opts = lambda do
@@ -56,16 +44,26 @@ begin
end
end
+ desc "Run all specs in spec directory"
+ RSpec::Core::RakeTask.new(:all) do |t|
+ t.pattern = FileList['spec/**/*_spec.rb']
+ end
+
desc "Print Specdoc for all specs"
RSpec::Core::RakeTask.new(:doc) do |t|
t.rspec_opts = ["--format", "specdoc", "--dry-run"]
t.pattern = FileList['spec/**/*_spec.rb']
end
- [:unit].each do |sub|
+ desc "Run the specs under spec/unit with activesupport loaded"
+ RSpec::Core::RakeTask.new(:activesupport) do |t|
+ t.rspec_opts = ["--require active_support/core_ext"]
+ t.pattern = FileList['spec/unit/**/*_spec.rb']
+ end
+
+ [:unit, :functional, :integration, :stress].each do |sub|
desc "Run the specs under spec/#{sub}"
RSpec::Core::RakeTask.new(sub) do |t|
- t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/spec/spec.opts\""]
t.pattern = FileList["spec/#{sub}/**/*_spec.rb"]
end
end