chefspec 9.1.0 → 9.3.1

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/api/core.rb +3 -3
  6. data/lib/chefspec/api/described.rb +3 -5
  7. data/lib/chefspec/api/stubs.rb +2 -2
  8. data/lib/chefspec/api/stubs_for.rb +22 -19
  9. data/lib/chefspec/api.rb +14 -14
  10. data/lib/chefspec/berkshelf.rb +4 -4
  11. data/lib/chefspec/cacher.rb +2 -2
  12. data/lib/chefspec/coverage/filters.rb +18 -15
  13. data/lib/chefspec/coverage.rb +35 -40
  14. data/lib/chefspec/deprecations.rb +3 -3
  15. data/lib/chefspec/errors.rb +7 -7
  16. data/lib/chefspec/expect_exception.rb +2 -1
  17. data/lib/chefspec/extensions/chef/client.rb +3 -3
  18. data/lib/chefspec/extensions/chef/conditional.rb +2 -1
  19. data/lib/chefspec/extensions/chef/cookbook/gem_installer.rb +5 -4
  20. data/lib/chefspec/extensions/chef/cookbook_loader.rb +1 -0
  21. data/lib/chefspec/extensions/chef/cookbook_uploader.rb +1 -1
  22. data/lib/chefspec/extensions/chef/data_query.rb +3 -3
  23. data/lib/chefspec/extensions/chef/lwrp_base.rb +1 -0
  24. data/lib/chefspec/extensions/chef/provider.rb +8 -5
  25. data/lib/chefspec/extensions/chef/resource/freebsd_package.rb +2 -1
  26. data/lib/chefspec/extensions/chef/resource.rb +18 -12
  27. data/lib/chefspec/extensions/chef/run_context/cookbook_compiler.rb +21 -1
  28. data/lib/chefspec/extensions/chef/securable.rb +1 -1
  29. data/lib/chefspec/extensions/ohai/system.rb +11 -0
  30. data/lib/chefspec/extensions.rb +14 -13
  31. data/lib/chefspec/file_cache_path_proxy.rb +3 -3
  32. data/lib/chefspec/formatter.rb +15 -3
  33. data/lib/chefspec/librarian.rb +7 -6
  34. data/lib/chefspec/matchers/do_nothing_matcher.rb +15 -15
  35. data/lib/chefspec/matchers/include_any_recipe_matcher.rb +4 -4
  36. data/lib/chefspec/matchers/include_recipe_matcher.rb +1 -1
  37. data/lib/chefspec/matchers/link_to_matcher.rb +2 -2
  38. data/lib/chefspec/matchers/notifications_matcher.rb +5 -4
  39. data/lib/chefspec/matchers/render_file_matcher.rb +3 -3
  40. data/lib/chefspec/matchers/resource_matcher.rb +18 -16
  41. data/lib/chefspec/matchers.rb +9 -9
  42. data/lib/chefspec/mixins/normalize.rb +1 -1
  43. data/lib/chefspec/policyfile.rb +6 -6
  44. data/lib/chefspec/renderer.rb +4 -4
  45. data/lib/chefspec/rspec.rb +1 -1
  46. data/lib/chefspec/server.rb +1 -1
  47. data/lib/chefspec/server_methods.rb +8 -8
  48. data/lib/chefspec/server_runner.rb +10 -10
  49. data/lib/chefspec/solo_runner.rb +27 -25
  50. data/lib/chefspec/stubs/command_registry.rb +1 -1
  51. data/lib/chefspec/stubs/command_stub.rb +1 -1
  52. data/lib/chefspec/stubs/data_bag_item_registry.rb +1 -1
  53. data/lib/chefspec/stubs/data_bag_item_stub.rb +1 -1
  54. data/lib/chefspec/stubs/data_bag_registry.rb +1 -1
  55. data/lib/chefspec/stubs/data_bag_stub.rb +1 -1
  56. data/lib/chefspec/stubs/registry.rb +1 -1
  57. data/lib/chefspec/stubs/search_registry.rb +2 -2
  58. data/lib/chefspec/stubs/search_stub.rb +2 -2
  59. data/lib/chefspec/util.rb +7 -7
  60. data/lib/chefspec/version.rb +1 -1
  61. data/lib/chefspec/zero_server.rb +4 -4
  62. data/lib/chefspec.rb +29 -29
  63. data/spec/spec_helper.rb +3 -4
  64. data/spec/support/hash.rb +3 -3
  65. data/spec/unit/cacher_spec.rb +17 -17
  66. data/spec/unit/coverage/filters_spec.rb +16 -16
  67. data/spec/unit/deprecations_spec.rb +8 -9
  68. data/spec/unit/errors_spec.rb +15 -15
  69. data/spec/unit/expect_exception_spec.rb +9 -9
  70. data/spec/unit/macros_spec.rb +50 -50
  71. data/spec/unit/matchers/do_nothing_matcher.rb +1 -1
  72. data/spec/unit/matchers/include_any_recipe_matcher_spec.rb +23 -23
  73. data/spec/unit/matchers/include_recipe_matcher_spec.rb +15 -15
  74. data/spec/unit/matchers/link_to_matcher_spec.rb +18 -18
  75. data/spec/unit/matchers/notifications_matcher_spec.rb +15 -16
  76. data/spec/unit/matchers/render_file_matcher_spec.rb +26 -26
  77. data/spec/unit/matchers/resource_matcher_spec.rb +1 -1
  78. data/spec/unit/matchers/state_attrs_matcher_spec.rb +24 -24
  79. data/spec/unit/matchers/subscribes_matcher_spec.rb +27 -29
  80. data/spec/unit/renderer_spec.rb +36 -36
  81. data/spec/unit/server_runner_spec.rb +6 -6
  82. data/spec/unit/solo_runner_spec.rb +69 -69
  83. data/spec/unit/stubs/command_registry_spec.rb +11 -11
  84. data/spec/unit/stubs/command_stub_spec.rb +26 -26
  85. data/spec/unit/stubs/data_bag_item_registry_spec.rb +17 -17
  86. data/spec/unit/stubs/data_bag_item_stub_spec.rb +14 -14
  87. data/spec/unit/stubs/data_bag_registry_spec.rb +16 -16
  88. data/spec/unit/stubs/data_bag_stub_spec.rb +13 -13
  89. data/spec/unit/stubs/registry_spec.rb +9 -9
  90. data/spec/unit/stubs/search_registry_spec.rb +17 -17
  91. data/spec/unit/stubs/search_stub_spec.rb +14 -14
  92. data/spec/unit/stubs/stub_spec.rb +22 -22
  93. metadata +10 -11
  94. data/lib/chefspec/extensions/.DS_Store +0 -0
  95. data/lib/chefspec/extensions/chef/.DS_Store +0 -0
@@ -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: 9.1.0
4
+ version: 9.3.1
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: 2020-02-12 00:00:00.000000000 Z
12
+ date: 2021-08-23 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
@@ -105,8 +105,6 @@ files:
105
105
  - lib/chefspec/errors.rb
106
106
  - lib/chefspec/expect_exception.rb
107
107
  - lib/chefspec/extensions.rb
108
- - lib/chefspec/extensions/.DS_Store
109
- - lib/chefspec/extensions/chef/.DS_Store
110
108
  - lib/chefspec/extensions/chef/client.rb
111
109
  - lib/chefspec/extensions/chef/conditional.rb
112
110
  - lib/chefspec/extensions/chef/cookbook/gem_installer.rb
@@ -119,6 +117,7 @@ files:
119
117
  - lib/chefspec/extensions/chef/resource/freebsd_package.rb
120
118
  - lib/chefspec/extensions/chef/run_context/cookbook_compiler.rb
121
119
  - lib/chefspec/extensions/chef/securable.rb
120
+ - lib/chefspec/extensions/ohai/system.rb
122
121
  - lib/chefspec/file_cache_path_proxy.rb
123
122
  - lib/chefspec/formatter.rb
124
123
  - lib/chefspec/librarian.rb
@@ -200,7 +199,7 @@ homepage: https://github.com/chefspec/chefspec
200
199
  licenses:
201
200
  - MIT
202
201
  metadata: {}
203
- post_install_message:
202
+ post_install_message:
204
203
  rdoc_options: []
205
204
  require_paths:
206
205
  - lib
@@ -208,15 +207,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
207
  requirements:
209
208
  - - ">="
210
209
  - !ruby/object:Gem::Version
211
- version: '2.4'
210
+ version: '2.5'
212
211
  required_rubygems_version: !ruby/object:Gem::Requirement
213
212
  requirements:
214
213
  - - ">="
215
214
  - !ruby/object:Gem::Version
216
215
  version: '0'
217
216
  requirements: []
218
- rubygems_version: 3.0.3
219
- signing_key:
217
+ rubygems_version: 3.2.22
218
+ signing_key:
220
219
  specification_version: 4
221
220
  summary: Write RSpec examples and generate coverage reports for Chef recipes!
222
221
  test_files: []
Binary file
Binary file