chefspec 5.1.1 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/examples/attributes/spec/default_spec.rb +1 -1
  4. data/examples/cached/spec/default_spec.rb +1 -1
  5. data/examples/chef_gem/spec/install_spec.rb +1 -1
  6. data/examples/chef_gem/spec/purge_spec.rb +1 -1
  7. data/examples/chef_gem/spec/reconfig_spec.rb +1 -1
  8. data/examples/chef_gem/spec/remove_spec.rb +1 -1
  9. data/examples/chef_gem/spec/upgrade_spec.rb +1 -1
  10. data/examples/compile_time/spec/default_spec.rb +1 -1
  11. data/examples/cookbook_file/spec/create_if_missing_spec.rb +1 -1
  12. data/examples/cookbook_file/spec/create_spec.rb +1 -1
  13. data/examples/cookbook_file/spec/delete_spec.rb +1 -1
  14. data/examples/cookbook_file/spec/touch_spec.rb +1 -1
  15. data/examples/cron/spec/create_spec.rb +1 -1
  16. data/examples/cron/spec/delete_spec.rb +1 -1
  17. data/examples/custom_matcher/spec/install_spec.rb +1 -1
  18. data/examples/custom_matcher/spec/remove_spec.rb +1 -1
  19. data/examples/deploy/spec/deploy_spec.rb +1 -1
  20. data/examples/deploy/spec/force_deploy_spec.rb +1 -1
  21. data/examples/deploy/spec/rollback_spec.rb +1 -1
  22. data/examples/directory/spec/create_spec.rb +1 -1
  23. data/examples/directory/spec/delete_spec.rb +1 -1
  24. data/examples/do_nothing/spec/default_spec.rb +1 -1
  25. data/examples/easy_install_package/spec/install_spec.rb +1 -1
  26. data/examples/easy_install_package/spec/purge_spec.rb +1 -1
  27. data/examples/easy_install_package/spec/remove_spec.rb +1 -1
  28. data/examples/easy_install_package/spec/upgrade_spec.rb +1 -1
  29. data/examples/erl_call/spec/run_spec.rb +1 -1
  30. data/examples/execute/spec/run_spec.rb +1 -1
  31. data/examples/expect_exception/spec/compile_error_spec.rb +1 -1
  32. data/examples/expect_exception/spec/converge_error_spec.rb +1 -1
  33. data/examples/expect_exception/spec/no_error_spec.rb +1 -1
  34. data/examples/file/spec/create_if_missing_spec.rb +1 -1
  35. data/examples/file/spec/create_spec.rb +1 -1
  36. data/examples/file/spec/delete_spec.rb +1 -1
  37. data/examples/file/spec/touch_spec.rb +1 -1
  38. data/examples/gem_package/spec/install_spec.rb +1 -1
  39. data/examples/gem_package/spec/purge_spec.rb +1 -1
  40. data/examples/gem_package/spec/reconfig_spec.rb +1 -1
  41. data/examples/gem_package/spec/remove_spec.rb +1 -1
  42. data/examples/gem_package/spec/upgrade_spec.rb +1 -1
  43. data/examples/git/spec/checkout_spec.rb +1 -1
  44. data/examples/git/spec/export_spec.rb +1 -1
  45. data/examples/git/spec/sync_spec.rb +1 -1
  46. data/examples/group/spec/create_spec.rb +1 -1
  47. data/examples/group/spec/manage_spec.rb +1 -1
  48. data/examples/group/spec/modify_spec.rb +1 -1
  49. data/examples/group/spec/remove_spec.rb +1 -1
  50. data/examples/guards/spec/default_spec.rb +1 -1
  51. data/examples/heavy_provider_light_resource/spec/provider_service_spec.rb +1 -1
  52. data/examples/http_request/spec/delete_spec.rb +1 -1
  53. data/examples/http_request/spec/get_spec.rb +1 -1
  54. data/examples/http_request/spec/head_spec.rb +1 -1
  55. data/examples/http_request/spec/options_spec.rb +1 -1
  56. data/examples/http_request/spec/post_spec.rb +1 -1
  57. data/examples/http_request/spec/put_spec.rb +1 -1
  58. data/examples/ifconfig/spec/add_spec.rb +1 -1
  59. data/examples/ifconfig/spec/delete_spec.rb +1 -1
  60. data/examples/ifconfig/spec/disable_spec.rb +1 -1
  61. data/examples/ifconfig/spec/enable_spec.rb +1 -1
  62. data/examples/include_recipe/spec/default_spec.rb +1 -1
  63. data/examples/link/spec/create_spec.rb +1 -1
  64. data/examples/link/spec/delete_spec.rb +1 -1
  65. data/examples/link/spec/link_to_spec.rb +1 -1
  66. data/examples/log/spec/write_spec.rb +1 -1
  67. data/examples/macports_package/spec/install_spec.rb +1 -1
  68. data/examples/macports_package/spec/purge_spec.rb +1 -1
  69. data/examples/macports_package/spec/remove_spec.rb +1 -1
  70. data/examples/macports_package/spec/upgrade_spec.rb +1 -1
  71. data/examples/mdadm/spec/assemble_spec.rb +1 -1
  72. data/examples/mdadm/spec/create_spec.rb +1 -1
  73. data/examples/mdadm/spec/stop_spec.rb +1 -1
  74. data/examples/mount/spec/disable_spec.rb +1 -1
  75. data/examples/mount/spec/enable_spec.rb +1 -1
  76. data/examples/mount/spec/mount_spec.rb +1 -1
  77. data/examples/mount/spec/remount_spec.rb +1 -1
  78. data/examples/mount/spec/umount_spec.rb +1 -1
  79. data/examples/multiple_actions/spec/default_spec.rb +1 -1
  80. data/examples/multiple_actions/spec/sequential_spec.rb +2 -2
  81. data/examples/multiple_run_action/spec/default_spec.rb +1 -1
  82. data/examples/notifications/spec/before_spec.rb +1 -1
  83. data/examples/notifications/spec/chained_spec.rb +1 -1
  84. data/examples/notifications/spec/default_spec.rb +1 -1
  85. data/examples/notifications/spec/delayed_spec.rb +1 -1
  86. data/examples/notifications/spec/immediately_spec.rb +1 -1
  87. data/examples/ohai/spec/reload_spec.rb +1 -1
  88. data/examples/package/spec/install_spec.rb +1 -1
  89. data/examples/package/spec/purge_spec.rb +1 -1
  90. data/examples/package/spec/reconfig_spec.rb +1 -1
  91. data/examples/package/spec/remove_spec.rb +1 -1
  92. data/examples/package/spec/upgrade_spec.rb +1 -1
  93. data/examples/reboot/spec/cancel_spec.rb +1 -1
  94. data/examples/reboot/spec/now_spec.rb +1 -1
  95. data/examples/reboot/spec/request_spec.rb +1 -1
  96. data/examples/remote_directory/spec/create_if_missing_spec.rb +1 -1
  97. data/examples/remote_directory/spec/create_spec.rb +1 -1
  98. data/examples/remote_directory/spec/delete_spec.rb +1 -1
  99. data/examples/remote_file/spec/create_if_missing_spec.rb +1 -1
  100. data/examples/remote_file/spec/create_spec.rb +1 -1
  101. data/examples/remote_file/spec/delete_spec.rb +1 -1
  102. data/examples/remote_file/spec/touch_spec.rb +1 -1
  103. data/examples/render_file/spec/default_spec.rb +1 -1
  104. data/examples/render_file/spec/template_helpers_spec.rb +1 -1
  105. data/examples/route/spec/add_spec.rb +1 -1
  106. data/examples/route/spec/delete_spec.rb +1 -1
  107. data/examples/ruby_block/spec/run_spec.rb +1 -1
  108. data/examples/script/spec/run_bash_spec.rb +1 -1
  109. data/examples/script/spec/run_csh_spec.rb +1 -1
  110. data/examples/script/spec/run_perl_spec.rb +1 -1
  111. data/examples/script/spec/run_python_spec.rb +1 -1
  112. data/examples/script/spec/run_ruby_spec.rb +1 -1
  113. data/examples/script/spec/run_script_spec.rb +1 -1
  114. data/examples/server/spec/client_spec.rb +1 -1
  115. data/examples/server/spec/data_bag_spec.rb +1 -1
  116. data/examples/server/spec/environment_spec.rb +1 -1
  117. data/examples/server/spec/node_spec.rb +4 -4
  118. data/examples/server/spec/render_with_cached_spec.rb +1 -1
  119. data/examples/server/spec/role_spec.rb +1 -1
  120. data/examples/server/spec/search_spec.rb +2 -2
  121. data/examples/service/spec/disable_spec.rb +1 -1
  122. data/examples/service/spec/enable_spec.rb +1 -1
  123. data/examples/service/spec/reload_spec.rb +1 -1
  124. data/examples/service/spec/restart_spec.rb +1 -1
  125. data/examples/service/spec/start_spec.rb +1 -1
  126. data/examples/service/spec/stop_spec.rb +1 -1
  127. data/examples/state_attrs/spec/default_spec.rb +1 -1
  128. data/examples/step_into/spec/default_spec.rb +1 -1
  129. data/examples/stub_command/spec/default_spec.rb +1 -1
  130. data/examples/subscribes/spec/before_spec.rb +1 -1
  131. data/examples/subscribes/spec/chained_spec.rb +1 -1
  132. data/examples/subscribes/spec/default_spec.rb +1 -1
  133. data/examples/subscribes/spec/delayed_spec.rb +1 -1
  134. data/examples/subscribes/spec/immediately_spec.rb +1 -1
  135. data/examples/subversion/spec/checkout_spec.rb +1 -1
  136. data/examples/subversion/spec/export_spec.rb +1 -1
  137. data/examples/subversion/spec/force_export_spec.rb +1 -1
  138. data/examples/subversion/spec/sync_spec.rb +1 -1
  139. data/examples/template/spec/create_if_missing_spec.rb +1 -1
  140. data/examples/template/spec/create_spec.rb +1 -1
  141. data/examples/template/spec/delete_spec.rb +1 -1
  142. data/examples/template/spec/touch_spec.rb +1 -1
  143. data/examples/use_inline_resources/spec/default_spec.rb +1 -1
  144. data/examples/user/spec/create_spec.rb +2 -2
  145. data/examples/user/spec/lock_spec.rb +2 -2
  146. data/examples/user/spec/manage_spec.rb +2 -2
  147. data/examples/user/spec/modify_spec.rb +2 -2
  148. data/examples/user/spec/remove_spec.rb +2 -2
  149. data/examples/user/spec/unlock_spec.rb +2 -2
  150. data/examples/yum_repository/recipes/makecache.rb +3 -0
  151. data/examples/yum_repository/spec/{make_cache_spec.rb → makecache_spec.rb} +2 -2
  152. data/features/yum_repository.feature +1 -1
  153. data/lib/chefspec/api/yum_repository.rb +5 -5
  154. data/lib/chefspec/solo_runner.rb +1 -1
  155. data/lib/chefspec/version.rb +1 -1
  156. data/templates/errors/may_need_to_specify_platform.erb +1 -1
  157. metadata +4 -4
  158. data/examples/yum_repository/recipes/make_cache.rb +0 -3
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'package::remove' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'removes a package with an explicit action' do
7
7
  expect(chef_run).to remove_package('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'package::upgrade' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'upgrades a package with an explicit action' do
7
7
  expect(chef_run).to upgrade_package('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'reboot::cancel' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a cancel_reboot' do
7
7
  expect(chef_run).to cancel_reboot('explicit cancel')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'reboot::now' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a reboot_now when specifying action' do
7
7
  expect(chef_run).to now_reboot('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'reboot::request' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a request_reboot' do
7
7
  expect(chef_run).to request_reboot('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'remote_directory::create_if_missing' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'creates a remote_directory with an explicit action' do
7
7
  expect(chef_run).to create_remote_directory_if_missing('/tmp/explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'remote_directory::create' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'creates a remote_directory with the default action' do
7
7
  expect(chef_run).to create_remote_directory('/tmp/default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'remote_directory::delete' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'deletes a remote_directory with an explicit action' do
7
7
  expect(chef_run).to delete_remote_directory('/tmp/explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'remote_file::create_if_missing' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'creates a remote_file with an explicit action' do
7
7
  expect(chef_run).to create_remote_file_if_missing('/tmp/explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'remote_file::create' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'creates a remote_file with the default action' do
7
7
  expect(chef_run).to create_remote_file('/tmp/default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'remote_file::delete' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'deletes a remote_file with an explicit action' do
7
7
  expect(chef_run).to delete_remote_file('/tmp/explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'remote_file::touch' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'touchs a remote_file with an explicit action' do
7
7
  expect(chef_run).to touch_remote_file('/tmp/explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'render_file::default' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  context 'file' do
7
7
  it 'renders the file' do
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'render_file::template_helpers' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'renders the file using a helper' do
7
7
  expect(chef_run).to render_file('/tmp/template_with_helper')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'route::add' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'adds a route with the default action' do
7
7
  expect(chef_run).to add_route('10.0.0.1')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'route::delete' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'deletes a route with an explicit action' do
7
7
  expect(chef_run).to delete_route('10.0.0.2')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'ruby_block::run' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a ruby_block with the default action' do
7
7
  expect(chef_run).to run_ruby_block('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'script::run_bash' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a bash script with the default action' do
7
7
  expect(chef_run).to run_bash('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'script::run_csh' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a csh script with the default action' do
7
7
  expect(chef_run).to run_csh('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'script::run_perl' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a perl script with the default action' do
7
7
  expect(chef_run).to run_perl('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'script::run_python' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a python script with the default action' do
7
7
  expect(chef_run).to run_python('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'script::run_ruby' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a ruby script with the default action' do
7
7
  expect(chef_run).to run_ruby('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'script::run_script' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'runs a script with the default action' do
7
7
  expect(chef_run).to run_script('default_action')
@@ -2,7 +2,7 @@ require 'chefspec'
2
2
 
3
3
  describe 'server::client' do
4
4
  let(:chef_run) do
5
- ChefSpec::ServerRunner.new do |_node, server|
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |_node, server|
6
6
  server.create_client('bacon', name: 'bacon')
7
7
  end.converge(described_recipe)
8
8
  end
@@ -2,7 +2,7 @@ require 'chefspec'
2
2
 
3
3
  describe 'server::data_bag' do
4
4
  let(:chef_run) do
5
- ChefSpec::ServerRunner.new do |node, server|
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node, server|
6
6
  server.create_data_bag('accounts', {
7
7
  'github' => {
8
8
  'username' => 'sethvargo',
@@ -2,7 +2,7 @@ require 'chefspec'
2
2
 
3
3
  describe 'server::environment' do
4
4
  let(:chef_run) do
5
- ChefSpec::ServerRunner.new do |_node, server|
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |_node, server|
6
6
  server.create_environment('production')
7
7
  end.converge(described_recipe)
8
8
  end
@@ -2,7 +2,7 @@ require 'chefspec'
2
2
 
3
3
  describe 'server::node' do
4
4
  let(:chef_run) do
5
- ChefSpec::ServerRunner.new do |_node, server|
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |_node, server|
6
6
  server.create_node('bacon', name: 'bacon')
7
7
  end.converge(described_recipe)
8
8
  end
@@ -18,7 +18,7 @@ describe 'server::node' do
18
18
 
19
19
  context 'with custom Ohai data' do
20
20
  let(:chef_run) do
21
- ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '14.04')
21
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
22
22
  .converge(described_recipe)
23
23
  end
24
24
 
@@ -27,14 +27,14 @@ describe 'server::node' do
27
27
 
28
28
  node = chef_run.get_node('chefspec')
29
29
  expect(node['kernel']['name']).to eq('Linux')
30
- expect(node['kernel']['release']).to eq('3.13.0-66-generic')
30
+ expect(node['kernel']['release']).to eq('4.4.0-21-generic')
31
31
  expect(node['kernel']['machine']).to eq('x86_64')
32
32
  end
33
33
  end
34
34
 
35
35
  context 'with overridden node data' do
36
36
  let(:chef_run) do
37
- ChefSpec::ServerRunner.new do |node, _server|
37
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node, _server|
38
38
  node.normal['breakfast']['bacon'] = true
39
39
  end.converge(described_recipe)
40
40
  end
@@ -6,7 +6,7 @@ RSpec.configure do |config|
6
6
  end
7
7
 
8
8
  describe 'server::render_with_cached' do
9
- cached(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
9
+ cached(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
10
10
 
11
11
  it 'does not cache file requests' do
12
12
  expect(chef_run).to render_file('/tmp/file')
@@ -2,7 +2,7 @@ require 'chefspec'
2
2
 
3
3
  describe 'server::role' do
4
4
  let(:chef_run) do
5
- ChefSpec::ServerRunner.new do |_node, server|
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |_node, server|
6
6
  server.create_role('webserver')
7
7
  end.converge(described_recipe)
8
8
  end
@@ -33,7 +33,7 @@ describe 'server::search' do
33
33
  end
34
34
 
35
35
  let(:chef_run) do
36
- ChefSpec::ServerRunner.new do |node, server|
36
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node, server|
37
37
  node.normal['bar'] = true
38
38
  server.update_node(node)
39
39
 
@@ -47,7 +47,7 @@ describe 'server::search' do
47
47
  it 'finds all nodes with the bar attribute' do
48
48
  expect(chef_run).to write_log('nodes with an attribute')
49
49
  .with_message(<<-EOH.gsub(/^ {8}/, '').strip)
50
- chefspec, FQDN: chefspec.local, hostname: chefspec
50
+ chefspec, FQDN: fauxhai.local, hostname: Fauxhai
51
51
  node_1, FQDN: node_1.example.com, hostname: node_1
52
52
  node_2, FQDN: node_2.example.com, hostname: node_2
53
53
  node_3, FQDN: node_3.example.com, hostname: node_3
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'service::disable' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'disables a service with an explicit action' do
7
7
  expect(chef_run).to disable_service('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'service::enable' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'enables a service with an explicit action' do
7
7
  expect(chef_run).to enable_service('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'service::reload' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'reloads a service with an explicit action' do
7
7
  expect(chef_run).to reload_service('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'service::restart' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'restarts a service with an explicit action' do
7
7
  expect(chef_run).to restart_service('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'service::start' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'starts a service with an explicit action' do
7
7
  expect(chef_run).to start_service('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'service::stop' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'stops a service with an explicit action' do
7
7
  expect(chef_run).to stop_service('explicit_action')
@@ -3,7 +3,7 @@ require 'chefspec'
3
3
  ChefSpec.define_matcher(:state_attrs_lwrp)
4
4
 
5
5
  describe 'state_attrs::default' do
6
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
6
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
7
7
  let(:lwrp) { chef_run.state_attrs_lwrp('name') }
8
8
 
9
9
  it 'has the correct state attributes' do
@@ -2,7 +2,7 @@ require 'chefspec'
2
2
 
3
3
  describe 'step_into::default' do
4
4
  context 'without :step_into' do
5
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
5
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
6
6
 
7
7
  it 'does not execute the LWRPs action' do
8
8
  expect(chef_run).to_not write_log('message')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'stub_command::default' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  context 'when the command is not stubbed' do
7
7
  it 'raises an exception' do
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'subscribes::before' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
  let(:service) { chef_run.service('receiving_resource') }
6
6
 
7
7
  it 'subscribes to the template creation' do
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'subscribes::chained' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
  let(:service) { chef_run.service('service') }
6
6
  let(:log) { chef_run.log('log') }
7
7
 
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'subscribes::default' do
4
- let(:chef_run) { ChefSpec::ServerRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
  let(:service) { chef_run.service('receiving_resource') }
6
6
 
7
7
  it 'subscribes to the template creation' do