chefspec 8.0.1 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +16 -9
  3. data/Rakefile +60 -52
  4. data/chefspec.gemspec +20 -20
  5. data/lib/chefspec.rb +29 -29
  6. data/lib/chefspec/api.rb +15 -13
  7. data/lib/chefspec/api/core.rb +3 -3
  8. data/lib/chefspec/api/described.rb +3 -5
  9. data/lib/chefspec/api/include_any_recipe.rb +24 -0
  10. data/lib/chefspec/api/stubs.rb +2 -2
  11. data/lib/chefspec/api/stubs_for.rb +23 -20
  12. data/lib/chefspec/berkshelf.rb +4 -4
  13. data/lib/chefspec/cacher.rb +2 -2
  14. data/lib/chefspec/coverage.rb +35 -40
  15. data/lib/chefspec/coverage/filters.rb +18 -15
  16. data/lib/chefspec/deprecations.rb +3 -3
  17. data/lib/chefspec/errors.rb +7 -7
  18. data/lib/chefspec/expect_exception.rb +2 -1
  19. data/lib/chefspec/extensions.rb +14 -13
  20. data/lib/chefspec/extensions/chef/client.rb +3 -3
  21. data/lib/chefspec/extensions/chef/conditional.rb +2 -1
  22. data/lib/chefspec/extensions/chef/cookbook/gem_installer.rb +5 -4
  23. data/lib/chefspec/extensions/chef/cookbook_loader.rb +1 -0
  24. data/lib/chefspec/extensions/chef/cookbook_uploader.rb +1 -1
  25. data/lib/chefspec/extensions/chef/data_query.rb +3 -3
  26. data/lib/chefspec/extensions/chef/lwrp_base.rb +1 -0
  27. data/lib/chefspec/extensions/chef/provider.rb +8 -5
  28. data/lib/chefspec/extensions/chef/resource.rb +18 -12
  29. data/lib/chefspec/extensions/chef/resource/freebsd_package.rb +2 -1
  30. data/lib/chefspec/extensions/chef/run_context/cookbook_compiler.rb +21 -1
  31. data/lib/chefspec/extensions/chef/securable.rb +1 -1
  32. data/lib/chefspec/extensions/ohai/system.rb +11 -0
  33. data/lib/chefspec/file_cache_path_proxy.rb +3 -3
  34. data/lib/chefspec/formatter.rb +15 -3
  35. data/lib/chefspec/librarian.rb +7 -6
  36. data/lib/chefspec/matchers.rb +9 -8
  37. data/lib/chefspec/matchers/do_nothing_matcher.rb +15 -15
  38. data/lib/chefspec/matchers/include_any_recipe_matcher.rb +51 -0
  39. data/lib/chefspec/matchers/include_recipe_matcher.rb +1 -1
  40. data/lib/chefspec/matchers/link_to_matcher.rb +2 -2
  41. data/lib/chefspec/matchers/notifications_matcher.rb +5 -4
  42. data/lib/chefspec/matchers/render_file_matcher.rb +3 -3
  43. data/lib/chefspec/matchers/resource_matcher.rb +18 -16
  44. data/lib/chefspec/mixins/normalize.rb +1 -1
  45. data/lib/chefspec/policyfile.rb +6 -6
  46. data/lib/chefspec/renderer.rb +4 -4
  47. data/lib/chefspec/rspec.rb +1 -1
  48. data/lib/chefspec/runner.rb +1 -1
  49. data/lib/chefspec/server.rb +1 -1
  50. data/lib/chefspec/server_methods.rb +8 -8
  51. data/lib/chefspec/server_runner.rb +10 -10
  52. data/lib/chefspec/solo_runner.rb +26 -24
  53. data/lib/chefspec/stubs/command_registry.rb +1 -1
  54. data/lib/chefspec/stubs/command_stub.rb +1 -1
  55. data/lib/chefspec/stubs/data_bag_item_registry.rb +1 -1
  56. data/lib/chefspec/stubs/data_bag_item_stub.rb +1 -1
  57. data/lib/chefspec/stubs/data_bag_registry.rb +1 -1
  58. data/lib/chefspec/stubs/data_bag_stub.rb +1 -1
  59. data/lib/chefspec/stubs/registry.rb +1 -1
  60. data/lib/chefspec/stubs/search_registry.rb +2 -2
  61. data/lib/chefspec/stubs/search_stub.rb +2 -2
  62. data/lib/chefspec/util.rb +7 -7
  63. data/lib/chefspec/version.rb +1 -1
  64. data/lib/chefspec/zero_server.rb +4 -4
  65. data/spec/spec_helper.rb +3 -4
  66. data/spec/support/hash.rb +3 -3
  67. data/spec/unit/cacher_spec.rb +17 -17
  68. data/spec/unit/coverage/filters_spec.rb +16 -16
  69. data/spec/unit/deprecations_spec.rb +8 -9
  70. data/spec/unit/errors_spec.rb +15 -15
  71. data/spec/unit/expect_exception_spec.rb +9 -9
  72. data/spec/unit/macros_spec.rb +50 -50
  73. data/spec/unit/matchers/do_nothing_matcher.rb +1 -1
  74. data/spec/unit/matchers/include_any_recipe_matcher_spec.rb +52 -0
  75. data/spec/unit/matchers/include_recipe_matcher_spec.rb +15 -15
  76. data/spec/unit/matchers/link_to_matcher_spec.rb +18 -18
  77. data/spec/unit/matchers/notifications_matcher_spec.rb +15 -16
  78. data/spec/unit/matchers/render_file_matcher_spec.rb +26 -26
  79. data/spec/unit/matchers/resource_matcher_spec.rb +1 -1
  80. data/spec/unit/matchers/state_attrs_matcher_spec.rb +24 -24
  81. data/spec/unit/matchers/subscribes_matcher_spec.rb +27 -29
  82. data/spec/unit/renderer_spec.rb +36 -36
  83. data/spec/unit/server_runner_spec.rb +6 -6
  84. data/spec/unit/solo_runner_spec.rb +69 -69
  85. data/spec/unit/stubs/command_registry_spec.rb +11 -11
  86. data/spec/unit/stubs/command_stub_spec.rb +26 -26
  87. data/spec/unit/stubs/data_bag_item_registry_spec.rb +17 -17
  88. data/spec/unit/stubs/data_bag_item_stub_spec.rb +14 -14
  89. data/spec/unit/stubs/data_bag_registry_spec.rb +16 -16
  90. data/spec/unit/stubs/data_bag_stub_spec.rb +13 -13
  91. data/spec/unit/stubs/registry_spec.rb +9 -9
  92. data/spec/unit/stubs/search_registry_spec.rb +17 -17
  93. data/spec/unit/stubs/search_stub_spec.rb +14 -14
  94. data/spec/unit/stubs/stub_spec.rb +22 -22
  95. metadata +16 -12
@@ -1,62 +1,62 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe ChefSpec::Stubs::Stub do
4
- describe '#and_return' do
5
- subject { described_class.new.and_return('value') }
4
+ describe "#and_return" do
5
+ subject { described_class.new.and_return("value") }
6
6
 
7
- it 'sets the value' do
8
- expect(subject.value).to eq('value')
7
+ it "sets the value" do
8
+ expect(subject.value).to eq("value")
9
9
  end
10
10
 
11
- it 'returns an instance of the stub' do
12
- expect(subject.and_return('value')).to be(subject)
11
+ it "returns an instance of the stub" do
12
+ expect(subject.and_return("value")).to be(subject)
13
13
  end
14
14
  end
15
15
 
16
- describe '#and_raise' do
16
+ describe "#and_raise" do
17
17
  subject { described_class.new.and_raise(ArgumentError) }
18
18
 
19
- it 'sets the block' do
19
+ it "sets the block" do
20
20
  expect(subject.instance_variable_get(:@block)).to be_a(Proc)
21
21
  end
22
22
 
23
- it 'returns an instance of the stub' do
23
+ it "returns an instance of the stub" do
24
24
  expect(subject.and_raise(ArgumentError)).to be(subject)
25
25
  end
26
26
  end
27
27
 
28
- describe '#result' do
29
- context 'when a value is given' do
30
- subject { described_class.new.and_return('value') }
28
+ describe "#result" do
29
+ context "when a value is given" do
30
+ subject { described_class.new.and_return("value") }
31
31
 
32
- it 'returns the value' do
33
- expect(subject.result).to eq('value')
32
+ it "returns the value" do
33
+ expect(subject.result).to eq("value")
34
34
  end
35
35
  end
36
36
 
37
- context 'when a block is given' do
37
+ context "when a block is given" do
38
38
  subject { described_class.new }
39
39
 
40
- it 'calls the block' do
40
+ it "calls the block" do
41
41
  subject.instance_variable_set(:@block, Proc.new { 1 == 2 })
42
42
  expect(subject.result).to eq(false)
43
43
  end
44
44
  end
45
45
 
46
- context 'when an exception block is given' do
46
+ context "when an exception block is given" do
47
47
  subject { described_class.new.and_raise(ArgumentError) }
48
48
 
49
- it 'raises the exception' do
49
+ it "raises the exception" do
50
50
  expect {
51
51
  subject.result
52
52
  }.to raise_error(ArgumentError)
53
53
  end
54
54
  end
55
55
 
56
- context 'when the value is a Hash' do
57
- subject { described_class.new.and_return([ { name: 'a' } ]) }
56
+ context "when the value is a Hash" do
57
+ subject { described_class.new.and_return([ { name: "a" } ]) }
58
58
 
59
- it 'recursively mashifies the value' do
59
+ it "recursively mashifies the value" do
60
60
  expect(subject.result.first).to be_a(Mash)
61
61
  end
62
62
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chefspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.1
4
+ version: 9.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Crump
8
8
  - Seth Vargo
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-30 00:00:00.000000000 Z
12
+ date: 2021-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '14'
20
+ version: '15'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '14'
27
+ version: '15'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: chef-cli
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -40,19 +40,19 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: fauxhai
43
+ name: fauxhai-ng
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '6.11'
48
+ version: '7.5'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '6.11'
55
+ version: '7.5'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -86,6 +86,7 @@ files:
86
86
  - lib/chefspec/api/core.rb
87
87
  - lib/chefspec/api/described.rb
88
88
  - lib/chefspec/api/do_nothing.rb
89
+ - lib/chefspec/api/include_any_recipe.rb
89
90
  - lib/chefspec/api/include_recipe.rb
90
91
  - lib/chefspec/api/link.rb
91
92
  - lib/chefspec/api/notifications.rb
@@ -118,11 +119,13 @@ files:
118
119
  - lib/chefspec/extensions/chef/resource/freebsd_package.rb
119
120
  - lib/chefspec/extensions/chef/run_context/cookbook_compiler.rb
120
121
  - lib/chefspec/extensions/chef/securable.rb
122
+ - lib/chefspec/extensions/ohai/system.rb
121
123
  - lib/chefspec/file_cache_path_proxy.rb
122
124
  - lib/chefspec/formatter.rb
123
125
  - lib/chefspec/librarian.rb
124
126
  - lib/chefspec/matchers.rb
125
127
  - lib/chefspec/matchers/do_nothing_matcher.rb
128
+ - lib/chefspec/matchers/include_any_recipe_matcher.rb
126
129
  - lib/chefspec/matchers/include_recipe_matcher.rb
127
130
  - lib/chefspec/matchers/link_to_matcher.rb
128
131
  - lib/chefspec/matchers/notifications_matcher.rb
@@ -161,6 +164,7 @@ files:
161
164
  - spec/unit/expect_exception_spec.rb
162
165
  - spec/unit/macros_spec.rb
163
166
  - spec/unit/matchers/do_nothing_matcher.rb
167
+ - spec/unit/matchers/include_any_recipe_matcher_spec.rb
164
168
  - spec/unit/matchers/include_recipe_matcher_spec.rb
165
169
  - spec/unit/matchers/link_to_matcher_spec.rb
166
170
  - spec/unit/matchers/notifications_matcher_spec.rb
@@ -197,7 +201,7 @@ homepage: https://github.com/chefspec/chefspec
197
201
  licenses:
198
202
  - MIT
199
203
  metadata: {}
200
- post_install_message:
204
+ post_install_message:
201
205
  rdoc_options: []
202
206
  require_paths:
203
207
  - lib
@@ -205,15 +209,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
209
  requirements:
206
210
  - - ">="
207
211
  - !ruby/object:Gem::Version
208
- version: '2.4'
212
+ version: '2.5'
209
213
  required_rubygems_version: !ruby/object:Gem::Requirement
210
214
  requirements:
211
215
  - - ">="
212
216
  - !ruby/object:Gem::Version
213
217
  version: '0'
214
218
  requirements: []
215
- rubygems_version: 3.0.3
216
- signing_key:
219
+ rubygems_version: 3.2.15
220
+ signing_key:
217
221
  specification_version: 4
218
222
  summary: Write RSpec examples and generate coverage reports for Chef recipes!
219
223
  test_files: []