chefspec 5.4.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -2
  3. data/CHANGELOG.md +12 -1
  4. data/README.md +17 -3
  5. data/chefspec.gemspec +2 -3
  6. data/examples/apt_package/spec/install_spec.rb +1 -1
  7. data/examples/apt_package/spec/purge_spec.rb +1 -1
  8. data/examples/apt_package/spec/reconfig_spec.rb +1 -1
  9. data/examples/apt_package/spec/remove_spec.rb +1 -1
  10. data/examples/apt_package/spec/upgrade_spec.rb +1 -1
  11. data/examples/apt_repository/spec/add_spec.rb +1 -1
  12. data/examples/apt_repository/spec/remove_spec.rb +1 -1
  13. data/examples/apt_update/spec/periodic_spec.rb +1 -1
  14. data/examples/apt_update/spec/update_spec.rb +1 -1
  15. data/examples/batch/spec/run_spec.rb +1 -1
  16. data/examples/cab_package/recipes/install.rb +13 -0
  17. data/examples/cab_package/recipes/remove.rb +13 -0
  18. data/examples/cab_package/spec/install_spec.rb +26 -0
  19. data/examples/cab_package/spec/remove_spec.rb +22 -0
  20. data/examples/chocolatey_package/spec/install_spec.rb +1 -1
  21. data/examples/chocolatey_package/spec/remove_spec.rb +1 -1
  22. data/examples/chocolatey_package/spec/upgrade_spec.rb +1 -1
  23. data/examples/dnf_package/recipes/install.rb +13 -0
  24. data/examples/dnf_package/recipes/purge.rb +13 -0
  25. data/examples/dnf_package/recipes/remove.rb +13 -0
  26. data/examples/dnf_package/recipes/upgrade.rb +13 -0
  27. data/examples/dnf_package/spec/install_spec.rb +26 -0
  28. data/examples/dnf_package/spec/purge_spec.rb +22 -0
  29. data/examples/dnf_package/spec/remove_spec.rb +22 -0
  30. data/examples/dnf_package/spec/upgrade_spec.rb +22 -0
  31. data/examples/dpkg_package/spec/install_spec.rb +1 -1
  32. data/examples/dpkg_package/spec/purge_spec.rb +1 -1
  33. data/examples/dpkg_package/spec/remove_spec.rb +1 -1
  34. data/examples/dsc_resource/spec/run_spec.rb +4 -4
  35. data/examples/dsc_script/spec/run_spec.rb +1 -1
  36. data/examples/env/spec/create_spec.rb +1 -1
  37. data/examples/env/spec/delete_spec.rb +1 -1
  38. data/examples/env/spec/modify_spec.rb +1 -1
  39. data/examples/freebsd_package/spec/install_spec.rb +1 -1
  40. data/examples/freebsd_package/spec/remove_spec.rb +1 -1
  41. data/examples/ips_package/spec/install_spec.rb +1 -1
  42. data/examples/ips_package/spec/remove_spec.rb +1 -1
  43. data/examples/ips_package/spec/upgrade_spec.rb +1 -1
  44. data/examples/msu_package/recipes/install.rb +13 -0
  45. data/examples/msu_package/recipes/remove.rb +13 -0
  46. data/examples/msu_package/spec/install_spec.rb +26 -0
  47. data/examples/msu_package/spec/remove_spec.rb +22 -0
  48. data/examples/pacman_package/spec/install_spec.rb +1 -1
  49. data/examples/pacman_package/spec/purge_spec.rb +1 -1
  50. data/examples/pacman_package/spec/remove_spec.rb +1 -1
  51. data/examples/pacman_package/spec/upgrade_spec.rb +1 -1
  52. data/examples/portage_package/spec/install_spec.rb +1 -1
  53. data/examples/portage_package/spec/purge_spec.rb +1 -1
  54. data/examples/portage_package/spec/remove_spec.rb +1 -1
  55. data/examples/portage_package/spec/upgrade_spec.rb +1 -1
  56. data/examples/powershell_script/spec/run_spec.rb +1 -1
  57. data/examples/registry_key/spec/create_if_missing_spec.rb +1 -1
  58. data/examples/registry_key/spec/create_spec.rb +1 -1
  59. data/examples/registry_key/spec/delete_key_spec.rb +1 -1
  60. data/examples/registry_key/spec/delete_spec.rb +1 -1
  61. data/examples/roles/roles/role.rb +2 -2
  62. data/examples/rpm_package/spec/install_spec.rb +1 -1
  63. data/examples/rpm_package/spec/remove_spec.rb +1 -1
  64. data/examples/rpm_package/spec/upgrade_spec.rb +1 -1
  65. data/examples/server/spec/data_bag_spec.rb +9 -11
  66. data/examples/smartos_package/spec/install_spec.rb +1 -1
  67. data/examples/smartos_package/spec/remove_spec.rb +1 -1
  68. data/examples/smartos_package/spec/upgrade_spec.rb +1 -1
  69. data/examples/solaris_package/spec/install_spec.rb +1 -1
  70. data/examples/solaris_package/spec/remove_spec.rb +1 -1
  71. data/examples/step_into/spec/default_spec.rb +2 -2
  72. data/examples/use_inline_resources/spec/default_spec.rb +1 -1
  73. data/examples/windows_package/spec/install_spec.rb +1 -1
  74. data/examples/windows_package/spec/remove_spec.rb +1 -1
  75. data/examples/windows_service/spec/configure_startup_spec.rb +1 -1
  76. data/examples/windows_service/spec/disable_spec.rb +1 -1
  77. data/examples/windows_service/spec/enable_spec.rb +1 -1
  78. data/examples/windows_service/spec/reload_spec.rb +1 -1
  79. data/examples/windows_service/spec/restart_spec.rb +1 -1
  80. data/examples/windows_service/spec/start_spec.rb +1 -1
  81. data/examples/windows_service/spec/stop_spec.rb +1 -1
  82. data/examples/yum_package/spec/install_spec.rb +1 -1
  83. data/examples/yum_package/spec/purge_spec.rb +1 -1
  84. data/examples/yum_package/spec/remove_spec.rb +1 -1
  85. data/examples/yum_package/spec/upgrade_spec.rb +1 -1
  86. data/examples/yum_repository/spec/add_spec.rb +1 -1
  87. data/examples/yum_repository/spec/create_spec.rb +1 -1
  88. data/examples/yum_repository/spec/delete_spec.rb +1 -1
  89. data/examples/yum_repository/spec/makecache_spec.rb +1 -1
  90. data/examples/yum_repository/spec/remove_spec.rb +1 -1
  91. data/features/cab_package.feature +21 -0
  92. data/features/dnf_package.feature +26 -0
  93. data/features/msu_package.feature +23 -0
  94. data/features/support/env.rb +8 -0
  95. data/lib/chefspec.rb +0 -1
  96. data/lib/chefspec/api.rb +3 -0
  97. data/lib/chefspec/api/cab_package.rb +80 -0
  98. data/lib/chefspec/api/dnf_package.rb +154 -0
  99. data/lib/chefspec/api/msu_package.rb +81 -0
  100. data/lib/chefspec/rspec.rb +1 -0
  101. data/lib/chefspec/server_methods.rb +4 -35
  102. data/lib/chefspec/server_runner.rb +2 -42
  103. data/lib/chefspec/version.rb +1 -1
  104. data/lib/chefspec/zero_server.rb +139 -0
  105. metadata +31 -6
  106. data/lib/chefspec/chef_backwards_compat.rb +0 -79
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chefspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Crump
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-10 00:00:00.000000000 Z
12
+ date: 2017-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '12.0'
62
+ version: '13.0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "<"
68
68
  - !ruby/object:Gem::Version
69
- version: '12.0'
69
+ version: '13.0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: redcarpet
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -160,6 +160,10 @@ files:
160
160
  - examples/bff_package/spec/purge_spec.rb
161
161
  - examples/bff_package/spec/remove_spec.rb
162
162
  - examples/bff_package/spec/upgrade_spec.rb
163
+ - examples/cab_package/recipes/install.rb
164
+ - examples/cab_package/recipes/remove.rb
165
+ - examples/cab_package/spec/install_spec.rb
166
+ - examples/cab_package/spec/remove_spec.rb
163
167
  - examples/cached/recipes/default.rb
164
168
  - examples/cached/spec/default_spec.rb
165
169
  - examples/chef_gem/recipes/install.rb
@@ -209,6 +213,14 @@ files:
209
213
  - examples/directory/recipes/delete.rb
210
214
  - examples/directory/spec/create_spec.rb
211
215
  - examples/directory/spec/delete_spec.rb
216
+ - examples/dnf_package/recipes/install.rb
217
+ - examples/dnf_package/recipes/purge.rb
218
+ - examples/dnf_package/recipes/remove.rb
219
+ - examples/dnf_package/recipes/upgrade.rb
220
+ - examples/dnf_package/spec/install_spec.rb
221
+ - examples/dnf_package/spec/purge_spec.rb
222
+ - examples/dnf_package/spec/remove_spec.rb
223
+ - examples/dnf_package/spec/upgrade_spec.rb
212
224
  - examples/do_nothing/recipes/default.rb
213
225
  - examples/do_nothing/spec/default_spec.rb
214
226
  - examples/dpkg_package/recipes/install.rb
@@ -367,6 +379,10 @@ files:
367
379
  - examples/mount/spec/mount_spec.rb
368
380
  - examples/mount/spec/remount_spec.rb
369
381
  - examples/mount/spec/umount_spec.rb
382
+ - examples/msu_package/recipes/install.rb
383
+ - examples/msu_package/recipes/remove.rb
384
+ - examples/msu_package/spec/install_spec.rb
385
+ - examples/msu_package/spec/remove_spec.rb
370
386
  - examples/multiple_actions/recipes/default.rb
371
387
  - examples/multiple_actions/recipes/sequential.rb
372
388
  - examples/multiple_actions/spec/default_spec.rb
@@ -678,6 +694,7 @@ files:
678
694
  - features/attributes.feature
679
695
  - features/batch.feature
680
696
  - features/bff_package.feature
697
+ - features/cab_package.feature
681
698
  - features/cached.feature
682
699
  - features/chef_gem.feature
683
700
  - features/chocolatey_package.feature
@@ -687,6 +704,7 @@ files:
687
704
  - features/custom_matcher.feature
688
705
  - features/deploy.feature
689
706
  - features/directory.feature
707
+ - features/dnf_package.feature
690
708
  - features/do_nothing.feature
691
709
  - features/dpkg_package.feature
692
710
  - features/dsc_resource.feature
@@ -714,6 +732,7 @@ files:
714
732
  - features/macports_package.feature
715
733
  - features/mdadm.feature
716
734
  - features/mount.feature
735
+ - features/msu_package.feature
717
736
  - features/multiple_actions.feature
718
737
  - features/multiple_run_action.feature
719
738
  - features/notifications.feature
@@ -770,12 +789,14 @@ files:
770
789
  - lib/chefspec/api/apt_update.rb
771
790
  - lib/chefspec/api/batch.rb
772
791
  - lib/chefspec/api/bff_package.rb
792
+ - lib/chefspec/api/cab_package.rb
773
793
  - lib/chefspec/api/chef_gem.rb
774
794
  - lib/chefspec/api/chocolatey_package.rb
775
795
  - lib/chefspec/api/cookbook_file.rb
776
796
  - lib/chefspec/api/cron.rb
777
797
  - lib/chefspec/api/deploy.rb
778
798
  - lib/chefspec/api/directory.rb
799
+ - lib/chefspec/api/dnf_package.rb
779
800
  - lib/chefspec/api/do_nothing.rb
780
801
  - lib/chefspec/api/dpkg_package.rb
781
802
  - lib/chefspec/api/dsc_resource.rb
@@ -800,6 +821,7 @@ files:
800
821
  - lib/chefspec/api/macports_package.rb
801
822
  - lib/chefspec/api/mdadm.rb
802
823
  - lib/chefspec/api/mount.rb
824
+ - lib/chefspec/api/msu_package.rb
803
825
  - lib/chefspec/api/notifications.rb
804
826
  - lib/chefspec/api/ohai.rb
805
827
  - lib/chefspec/api/openbsd_package.rb
@@ -834,7 +856,6 @@ files:
834
856
  - lib/chefspec/api/zypper_package.rb
835
857
  - lib/chefspec/berkshelf.rb
836
858
  - lib/chefspec/cacher.rb
837
- - lib/chefspec/chef_backwards_compat.rb
838
859
  - lib/chefspec/coverage.rb
839
860
  - lib/chefspec/coverage/filters.rb
840
861
  - lib/chefspec/deprecations.rb
@@ -881,6 +902,7 @@ files:
881
902
  - lib/chefspec/stubs/stub.rb
882
903
  - lib/chefspec/util.rb
883
904
  - lib/chefspec/version.rb
905
+ - lib/chefspec/zero_server.rb
884
906
  - spec/spec_helper.rb
885
907
  - spec/support/hash.rb
886
908
  - spec/unit/api_spec.rb
@@ -934,7 +956,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
934
956
  requirements:
935
957
  - - ">="
936
958
  - !ruby/object:Gem::Version
937
- version: '2.1'
959
+ version: '2.2'
938
960
  required_rubygems_version: !ruby/object:Gem::Requirement
939
961
  requirements:
940
962
  - - ">="
@@ -953,6 +975,7 @@ test_files:
953
975
  - features/attributes.feature
954
976
  - features/batch.feature
955
977
  - features/bff_package.feature
978
+ - features/cab_package.feature
956
979
  - features/cached.feature
957
980
  - features/chef_gem.feature
958
981
  - features/chocolatey_package.feature
@@ -962,6 +985,7 @@ test_files:
962
985
  - features/custom_matcher.feature
963
986
  - features/deploy.feature
964
987
  - features/directory.feature
988
+ - features/dnf_package.feature
965
989
  - features/do_nothing.feature
966
990
  - features/dpkg_package.feature
967
991
  - features/dsc_resource.feature
@@ -989,6 +1013,7 @@ test_files:
989
1013
  - features/macports_package.feature
990
1014
  - features/mdadm.feature
991
1015
  - features/mount.feature
1016
+ - features/msu_package.feature
992
1017
  - features/multiple_actions.feature
993
1018
  - features/multiple_run_action.feature
994
1019
  - features/notifications.feature
@@ -1,79 +0,0 @@
1
- #
2
- # This file contains the backwards compatible hacks required to make ChefSpec
3
- # work with the previous version of Chef. ChefSpec only promises to be backwards
4
- # compatible with the last major release of Chef, but it may work with earlier
5
- # versions.
6
- #
7
- # The hacks are kept in this file so as to avoid a bunch of branching logic
8
- # throughout the codebase. It also makes dropping backwards compatability much
9
- # easier without the risk of breaking things.
10
- #
11
- # This file must be loaded AFTER the rest of ChefSpec has been initialized!
12
- #
13
-
14
- module ChefSpec
15
- class ServerRunner
16
- #
17
- # The method airty for the Chef::CookbookUploader used to accept a list of
18
- # cookbook paths. This restores that behavior.
19
- #
20
- def cookbook_uploader_for(loader)
21
- Chef::CookbookUploader.new(loader.cookbooks, loader.cookbook_paths)
22
- end
23
- end
24
-
25
- module RemoveExistingLWRP
26
- def self.extended(klass)
27
- class << klass
28
- alias_method :build_from_file_without_removal, :build_from_file
29
- alias_method :build_from_file, :build_from_file_with_removal
30
- end
31
- end
32
-
33
- #
34
- # Override Chef provider to remove any existing LWRPs to suppress constant
35
- # re-definition warnings.
36
- #
37
- # @param [String] cookbook_name
38
- # the name of the cookbook
39
- # @param [String] filename
40
- # file to load as a LWRP
41
- # @param [Chef::RunContext] run_context
42
- # context of a Chef Run
43
- #
44
- # @return [Chef::Provider]
45
- #
46
- def build_from_file_with_removal(cookbook_name, filename, run_context)
47
- provider_name = filename_to_qualified_string(cookbook_name, filename)
48
- class_name = convert_to_class_name(provider_name)
49
-
50
- remove_existing_lwrp(class_name)
51
- build_from_file_without_removal(cookbook_name, filename, run_context)
52
- end
53
-
54
- #
55
- # Remove any existing Chef provider or resource with the specified name.
56
- #
57
- # @param [String] class_name
58
- # The class name. Must be a valid constant name.
59
- #
60
- def remove_existing_lwrp(class_name)
61
- [self, superclass].each do |resource_holder|
62
- look_in_parents = false
63
- if resource_holder.const_defined?(class_name, look_in_parents)
64
- old_class = resource_holder.send(:remove_const, class_name)
65
-
66
- if resource_holder.respond_to?(:resource_classes)
67
- resource_holder.resource_classes.delete(old_class)
68
- end
69
- end
70
- end
71
- end
72
- end
73
- end
74
-
75
-
76
- # Only remove existing LWRPs for older versions of Chef. Newer versions of
77
- # Chef do not break things as much...
78
- Chef::Provider::LWRPBase.extend(ChefSpec::RemoveExistingLWRP)
79
- Chef::Resource::LWRPBase.extend(ChefSpec::RemoveExistingLWRP)