chefspec 4.6.0 → 4.6.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.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/CHANGELOG.md +84 -77
- data/chefspec.gemspec +2 -2
- data/lib/chefspec/file_cache_path_proxy.rb +15 -0
- data/lib/chefspec/rspec.rb +1 -0
- data/lib/chefspec/server_runner.rb +8 -0
- data/lib/chefspec/version.rb +1 -1
- data/spec/unit/macros_spec.rb +1 -1
- data/spec/unit/server_runner_spec.rb +28 -0
- metadata +11 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f410d780fe92a5920a74f64838cf10de403ed2e8
|
|
4
|
+
data.tar.gz: 5a3f7521450d65a824d1eca60b1ef5212508c509
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fce0162abe4b2dc222b0f78fa45fe8739e314a0ca5835f461811244c4a8939c585423766a5103b9404b77f04d33a5ac78dd7c55f9f5acd7da37a9f9664ff5491
|
|
7
|
+
data.tar.gz: 853c4db0453f16f55311c4fa1595aad07de144a0e2568bc39bbf0905232c68fa5196f46be7b31a25cd940e040cfa118a2653715a76ef1c0b2fcc098931a0f4b3
|
data/.travis.yml
CHANGED
|
@@ -2,6 +2,9 @@ language: ruby
|
|
|
2
2
|
cache: bundler
|
|
3
3
|
sudo: false
|
|
4
4
|
|
|
5
|
+
before_install:
|
|
6
|
+
- gem install bundler
|
|
7
|
+
|
|
5
8
|
rvm:
|
|
6
9
|
- 2.0.0
|
|
7
10
|
- 2.1
|
|
@@ -17,6 +20,7 @@ gemfile: gemfiles/chefspec.gemfile
|
|
|
17
20
|
|
|
18
21
|
env:
|
|
19
22
|
- CHEF_VERSION=master
|
|
23
|
+
- CHEF_VERSION=12.8.1
|
|
20
24
|
- CHEF_VERSION=12.7.2
|
|
21
25
|
- CHEF_VERSION=12.6.0
|
|
22
26
|
- CHEF_VERSION=12.5.1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
CHANGELOG for ChefSpec
|
|
2
|
-
|
|
1
|
+
# CHANGELOG for ChefSpec
|
|
2
|
+
|
|
3
|
+
## 4.6.1 (March 29, 2016)
|
|
4
|
+
|
|
5
|
+
BUG FIXES
|
|
6
|
+
|
|
7
|
+
- Use the same Chef :file_cache_path in every ChefSpec converge to prevent large numbers of LWRP deprecation warnings
|
|
8
|
+
- Require Fauxhai ~3.2 to prevent ChefSpec spec failures
|
|
9
|
+
- Require Rake < 11.0 to prevent failures
|
|
3
10
|
|
|
4
11
|
## 4.6.0 (March 7, 2016)
|
|
5
12
|
|
|
6
|
-
|
|
13
|
+
IMPROVEMENTS
|
|
7
14
|
|
|
8
15
|
- Add support for adding `berkshelf_options` to the RSpec config
|
|
9
16
|
- Add `chocolately_package` matches
|
|
10
17
|
- Support `do..end` style syntax in block expectations
|
|
11
18
|
- Output a diff when multi-line resource parameters are unmatched
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
BUG FIXES
|
|
14
21
|
|
|
15
22
|
- Update tests to include better descriptions and feature names
|
|
16
23
|
- Add support for Policyfile workflow
|
|
17
24
|
|
|
18
25
|
## 4.5.0 (December 4, 2015)
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
IMPROVEMENTS
|
|
21
28
|
- Update Fauxhai dependency to 3.0 to bring in newly generated mocked Ohai data
|
|
22
29
|
|
|
23
30
|
## 4.4.0 (September 18, 2015)
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
BUG FIXES
|
|
26
33
|
- Documentation improvements (using regex in stubbed commands, chef 12+ custom matcher gotchas)
|
|
27
34
|
- Spec suite improvements (dsc resource specs, platform specific configurations)
|
|
28
35
|
- Chef 12+ platform specific resource loading related error
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
IMPROVEMENTS
|
|
31
38
|
- Support for policy files
|
|
32
39
|
|
|
33
40
|
## 4.3.0 (July 16, 2015)
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
BUG FIXES:
|
|
36
43
|
- Improved documentation
|
|
37
44
|
- Use TemplateContext's `_extend_modules` for passing on template helper
|
|
38
45
|
modules to nested partial templates
|
|
@@ -44,7 +51,7 @@ Bugfixes:
|
|
|
44
51
|
- Update Librarian `Cheffile` site URL to supermarket.chef.io
|
|
45
52
|
- Filter Windows and Unix paths for test coverage report with Berkshelf
|
|
46
53
|
|
|
47
|
-
|
|
54
|
+
IMPROVEMENTS:
|
|
48
55
|
- Added possibility to specify file_cache_path globally
|
|
49
56
|
- Added new capabilities for reboot resource
|
|
50
57
|
- Use `Chef::Resource#declared_type` first if available (Chef >= 12),
|
|
@@ -53,12 +60,12 @@ Improvements:
|
|
|
53
60
|
- Add windows_service resource
|
|
54
61
|
|
|
55
62
|
## 4.2.0 (December 25, 2014)
|
|
56
|
-
|
|
63
|
+
BUG FIXES:
|
|
57
64
|
- Updated README grep examples
|
|
58
65
|
- Fix various typographical errors
|
|
59
66
|
- Improved error message when using a deprecated resource matcher
|
|
60
67
|
|
|
61
|
-
|
|
68
|
+
IMPROVEMENTS:
|
|
62
69
|
- Add support for Chef 12
|
|
63
70
|
- Added support for environments in Chef Solo
|
|
64
71
|
- Fix location definition for caching
|
|
@@ -66,16 +73,16 @@ Improvements:
|
|
|
66
73
|
- Update support for Chef 12
|
|
67
74
|
|
|
68
75
|
## 4.1.1 (October 13, 2014)
|
|
69
|
-
|
|
76
|
+
BUG FIXES:
|
|
70
77
|
- Fix total fail on my part with deprecations and add test coverage
|
|
71
78
|
- Do not validate cookbooks on upload (speed)
|
|
72
79
|
|
|
73
80
|
## 4.1.0 (October 12, 2014)
|
|
74
|
-
|
|
81
|
+
BUG FIXES:
|
|
75
82
|
- Bump the minimum required version of Chef to 11.14
|
|
76
83
|
- Filter resources that have no source line in the coverage report - this is related to a bug in Chef where, when cloning a resource, both the clone and the original resource lose their metadata
|
|
77
84
|
|
|
78
|
-
|
|
85
|
+
IMPROVEMENTS:
|
|
79
86
|
- Allow multiple instances of a Chef Server instance
|
|
80
87
|
- Separate ChefSpec::Runner into `ChefSpec::SoloRunner` and `ChefSpec::ServerRunner`
|
|
81
88
|
- Preliminary support for Chef 12 alpha (not 100% complete)
|
|
@@ -85,19 +92,19 @@ Improvements:
|
|
|
85
92
|
- Deprecate `ChefSpec::Runner.new` - you should specify if you want a `SoloRunner` or `ServerRunner`
|
|
86
93
|
- Updated documentation
|
|
87
94
|
|
|
88
|
-
|
|
95
|
+
BREAKING CHANGES:
|
|
89
96
|
- Due to the new `ServerRunner`, the `ChefSpec::Server` singleton object has been deprecated. As much as I would like to provide a backwards-compatible interface, there is no way to do so (as the code now supports multiple Chef Server instances). Sorry :(.
|
|
90
97
|
- Remove old deprecations - this is not really a breaking change, but the v2.0.0 deprecations have been removed in favor of new ones
|
|
91
98
|
|
|
92
99
|
## 4.0.2 (August 13, 2014)
|
|
93
|
-
|
|
100
|
+
BUG FIXES:
|
|
94
101
|
- Fix a regression caused by a new version of Chef Zero in single_org mode
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
IMPROVEMENTS:
|
|
97
104
|
- Test against Chef 11.14.0 in the Travis matrix
|
|
98
105
|
|
|
99
106
|
## 4.0.1 (June 27, 2014)
|
|
100
|
-
|
|
107
|
+
BUG FIXES:
|
|
101
108
|
- Fix class comparisons
|
|
102
109
|
- Update ChefZero API to work again
|
|
103
110
|
- Use proper cookbook in the template_finder
|
|
@@ -105,11 +112,11 @@ Bugfixes:
|
|
|
105
112
|
- Various documentation updates
|
|
106
113
|
|
|
107
114
|
## 4.0.0 (June 2, 2014)
|
|
108
|
-
|
|
115
|
+
BREAKING CHANGES:
|
|
109
116
|
- **Upgraded to RSpec 3!** RSpec 3 brings many new API changes and syntaxes
|
|
110
117
|
- **Bump minimum required Chef version to 11.12!** Without this change, Chef Zero will blow up
|
|
111
118
|
|
|
112
|
-
|
|
119
|
+
BUG FIXES:
|
|
113
120
|
- Gracefully fail if a resource does not report it's source line in the reporter
|
|
114
121
|
- Pull the correct cookbook folder from the stack on Windows (88bfc6)
|
|
115
122
|
- Cover resources in render_file matchers for reporting
|
|
@@ -122,12 +129,12 @@ Bugfixes:
|
|
|
122
129
|
- Fix a bug that will happen in later Chef versions because FreeBSD is evil (13ff143)
|
|
123
130
|
- Do not pass local file paths to `preferred_filename_on_disk_location`
|
|
124
131
|
|
|
125
|
-
|
|
132
|
+
FEATURES:
|
|
126
133
|
- Add runner methods for all the bash, csh, perl, etc resources
|
|
127
134
|
- Upgraded fauxhai dependency and specs
|
|
128
135
|
- Upgrade Chef Zero for multi-org support
|
|
129
136
|
|
|
130
|
-
|
|
137
|
+
IMPROVEMENTS:
|
|
131
138
|
- Improved documentation around the `define_runner_method` method
|
|
132
139
|
- Update badges to be all SVG
|
|
133
140
|
- Test on Ruby 2.1
|
|
@@ -136,46 +143,46 @@ Improvements:
|
|
|
136
143
|
|
|
137
144
|
|
|
138
145
|
## 3.4.0 (March 16, 2014)
|
|
139
|
-
|
|
146
|
+
BUG FIXES:
|
|
140
147
|
- Restore Berkshelf 2 support (missing edge case)
|
|
141
148
|
- Add negative failure message for subscribes/notifies matchers
|
|
142
149
|
|
|
143
|
-
|
|
150
|
+
FEATURES:
|
|
144
151
|
- Added `do_nothing` matcher for asserting a resource performed no actions
|
|
145
152
|
|
|
146
|
-
|
|
153
|
+
IMPROVEMENTS:
|
|
147
154
|
- Increased spec coverage for matchers
|
|
148
155
|
- Support RSpec matchers in `with_content`
|
|
149
156
|
|
|
150
157
|
## 3.3.1 (March 11, 2014)
|
|
151
|
-
|
|
158
|
+
BUG FIXES:
|
|
152
159
|
- Various typographical fixes in the README
|
|
153
160
|
- Remove unused JSON report
|
|
154
161
|
- Restore coverage reporting for Berkshelf 2 users
|
|
155
162
|
- Minor formatting changes for errors
|
|
156
163
|
|
|
157
|
-
|
|
164
|
+
IMPROVEMENTS:
|
|
158
165
|
- Remove dependency on i18n and use native ERB instead
|
|
159
166
|
- Vendor Berkshelf/Librarian in a "cookbooks" directory so we can shorten the pathname during coverage reporting
|
|
160
167
|
|
|
161
168
|
## 3.3.0 (March 9, 2014)
|
|
162
|
-
|
|
169
|
+
BUG FIXES:
|
|
163
170
|
- Update documentation for setting `automatic` attributes
|
|
164
171
|
- Update documentation for stubbing data_bags
|
|
165
172
|
- Use a non-internal RSpec variable name for expecting exceptions
|
|
166
173
|
- Fix the airity of the `stub_node` method
|
|
167
174
|
|
|
168
|
-
|
|
175
|
+
IMPROVEMENTS:
|
|
169
176
|
- Better filtering protocols for resource coverage
|
|
170
177
|
|
|
171
178
|
## 3.2.0 (January 31, 2014)
|
|
172
|
-
|
|
179
|
+
BUG FIXES:
|
|
173
180
|
- Fix coverage calculation when there are no resources in the collection
|
|
174
181
|
- Fix misplaced quote in matcher output
|
|
175
182
|
- Include all files in generated gem
|
|
176
183
|
- Ensure compatibility with Chef HEAD
|
|
177
184
|
|
|
178
|
-
|
|
185
|
+
IMPROVEMENTS:
|
|
179
186
|
- Test Ruby 2.1 on Travis
|
|
180
187
|
- Miscellaneous README typos
|
|
181
188
|
- Add `subscribe_to` matchers
|
|
@@ -183,45 +190,45 @@ Improvements:
|
|
|
183
190
|
- Add support for passing a `node` object directly to the server `create_node` method
|
|
184
191
|
|
|
185
192
|
## 3.1.4 (January 3, 2014)
|
|
186
|
-
|
|
193
|
+
BUG FIXES:
|
|
187
194
|
- Correctly expand the node's run_list in server mode
|
|
188
195
|
- Actually package i18n translations with the cookbook
|
|
189
196
|
|
|
190
|
-
|
|
197
|
+
IMPROVEMENTS:
|
|
191
198
|
- Document setting a node's role
|
|
192
199
|
- Add examples and features for `stub_node`
|
|
193
200
|
|
|
194
201
|
## 3.1.3 (January 2, 2014)
|
|
195
|
-
|
|
202
|
+
BUG FIXES:
|
|
196
203
|
- Fix broken deprecations module
|
|
197
204
|
- Update a broken test ([@bknowles][])
|
|
198
205
|
|
|
199
|
-
|
|
206
|
+
IMPROVEMENTS:
|
|
200
207
|
- Better gem description on GitHub and Rubygems
|
|
201
208
|
- Helper support for template rendering (Chef 11.4+) ([@geraud][])
|
|
202
209
|
|
|
203
210
|
## 3.1.2 (December 30, 2013)
|
|
204
|
-
|
|
211
|
+
BUG FIXES:
|
|
205
212
|
- Require i18n 0.6.9 or higher (but less than 1.0.0) ([#289](https://github.com/sethvargo/chefspec/issues/245))
|
|
206
213
|
|
|
207
214
|
## 3.1.1 (December 29, 2013)
|
|
208
|
-
|
|
215
|
+
BUG FIXES:
|
|
209
216
|
- Handle duplicate resources in the coverage reporter
|
|
210
217
|
|
|
211
218
|
## 3.1.0 (December 29, 2013)
|
|
212
|
-
|
|
219
|
+
BUG FIXES:
|
|
213
220
|
- Only remove existing LWRP resources and providers when a new one is encountered ([@student][])
|
|
214
221
|
- Attempt to coerce dashes to underscores in LWRPs
|
|
215
222
|
- Various documentation fixes and typos
|
|
216
223
|
|
|
217
|
-
|
|
224
|
+
IMPROVEMENTS:
|
|
218
225
|
- Don't include `deprecations` module by default
|
|
219
226
|
- Add examples for stubbing commands across recipes
|
|
220
227
|
- Yield a block after cookbooks are compiled but before they are converged ([@rteabeault][])
|
|
221
228
|
- Add IRC Channel #chefspec
|
|
222
229
|
- Raise a nice error when `cookbook_path` cannot be determined ([@ryotarai][])
|
|
223
230
|
|
|
224
|
-
|
|
231
|
+
FEATURES:
|
|
225
232
|
- Add support for Librarian ([@mlafeldt][])
|
|
226
233
|
- Add Cacher module for caching runner results ([@sethvargo][] & [@DracoAter][])
|
|
227
234
|
- Add Chef Zero (server) mode ([@sethvargo][])
|
|
@@ -229,13 +236,13 @@ Features:
|
|
|
229
236
|
- Use i18n (internationalization) ([@sethvargo][])
|
|
230
237
|
|
|
231
238
|
## 3.0.2 (November 6, 2013)
|
|
232
|
-
|
|
239
|
+
BUG FIXES:
|
|
233
240
|
- Update links to point at new repository location
|
|
234
241
|
- Deleted relish docs to remove confusion
|
|
235
242
|
- Bump fauxhai dependency to 2.0 (removing the HTTParty transitive dependency)
|
|
236
243
|
- Convert resource names with dashes to underscores when stepping into them
|
|
237
244
|
|
|
238
|
-
|
|
245
|
+
IMPROVEMENTS:
|
|
239
246
|
- Added a "what people are saying" section to the README - if you have something cool to say about ChefSpec, let me know!
|
|
240
247
|
- Add a link to [`knife-spec`](https://github.com/sethvargo/knife-spec)
|
|
241
248
|
- Test against Chef 11.8
|
|
@@ -244,11 +251,11 @@ Improvements:
|
|
|
244
251
|
|
|
245
252
|
|
|
246
253
|
## 3.0.1 (October 22, 2013)
|
|
247
|
-
|
|
254
|
+
BUG FIXES:
|
|
248
255
|
- Fix an issue where LWRPs were not properly stepped into when `use_inline_resources` was specified ([#244](https://github.com/sethvargo/chefspec/issues/244))
|
|
249
256
|
- Coerce `render_file` `@expected_content` to a string before asserting if content is included ([#243](https://github.com/sethvargo/chefspec/issues/243))
|
|
250
257
|
|
|
251
|
-
|
|
258
|
+
IMPROVEMENTS:
|
|
252
259
|
- Miscellaneous documentation fixes and additions ([#245](https://github.com/sethvargo/chefspec/issues/245), [#241](https://github.com/sethvargo/chefspec/issues/241), [#238](https://github.com/sethvargo/chefspec/issues/238))
|
|
253
260
|
|
|
254
261
|
|
|
@@ -281,7 +288,7 @@ Breaking:
|
|
|
281
288
|
- `Runner#resources` converted from an Array to a Hash. This is to ensure that all resource actions are added (when multiple calls to run_action exist (#201)). This also drastically improves resource lookup times.
|
|
282
289
|
- `Resource#actions` is no longer maniuplated. Instead, a new method `Resource#performed_actions` now keeps track of the actions taken on a resource (as well as the phase in which they were taken), preserving the original state of the resource.
|
|
283
290
|
|
|
284
|
-
|
|
291
|
+
FEATURES:
|
|
285
292
|
- Added a new `render_file` action to replace `create_file_with_content`. This matcher will render the contents of any file to a string and then optionally compare the result if given a `with` chainable.
|
|
286
293
|
- All resources now accept a `with` chainable for matching specific resource attributes.
|
|
287
294
|
- Windows attributes are now testable on non-Windows systems (like `inherits`)
|
|
@@ -313,7 +320,7 @@ Features:
|
|
|
313
320
|
- Add `chefspec/berkshelf` for easily integrating specs with Berkshelf (2 & 3)
|
|
314
321
|
- Add `.at_compile_time` and `.at_converge_time` matchers for asserting which phase of the Chef run a resource should be run
|
|
315
322
|
|
|
316
|
-
|
|
323
|
+
IMPROVEMENTS:
|
|
317
324
|
- Move to inline documentation (Yard)
|
|
318
325
|
- Implement InProcess Aruba testing for ultra-fast tests
|
|
319
326
|
- Create "examples" directory for testing and demonstration
|
|
@@ -327,11 +334,11 @@ Improvements:
|
|
|
327
334
|
|
|
328
335
|
## 2.0.1 (August 28, 2013)
|
|
329
336
|
|
|
330
|
-
|
|
337
|
+
BUG FIXES:
|
|
331
338
|
|
|
332
339
|
- Add missing second optional parameter to `Hash#respond_to?` monkey patch
|
|
333
340
|
|
|
334
|
-
|
|
341
|
+
FEATURES
|
|
335
342
|
|
|
336
343
|
- Improve error message when using a regular express
|
|
337
344
|
- Improve documentation for Python packages
|
|
@@ -342,7 +349,7 @@ Breaking:
|
|
|
342
349
|
|
|
343
350
|
- Remove support for REE ([@andrewgross][] for the CI)
|
|
344
351
|
|
|
345
|
-
|
|
352
|
+
BUG FIXES:
|
|
346
353
|
|
|
347
354
|
- Better failure message for `create_remote_file` ([@tmatilai][])
|
|
348
355
|
- Add `cookbook_file` as an accepted type to the `create_file` matchers ([@dafyddcrosby][])
|
|
@@ -353,7 +360,7 @@ Bugfixes:
|
|
|
353
360
|
- Fix CI ([@sethvargo][])
|
|
354
361
|
- Match File actions as an array ([@sethvargo][])
|
|
355
362
|
|
|
356
|
-
|
|
363
|
+
FEATURES:
|
|
357
364
|
|
|
358
365
|
- Extend `ruby_block` matcher to accept regular expressions ([@ssimeonov][])
|
|
359
366
|
- Add `create_remote_file_if_missing` matcher ([@jimhopp][])
|
|
@@ -364,47 +371,47 @@ Features:
|
|
|
364
371
|
|
|
365
372
|
## 1.3.1 (June 10, 2013)
|
|
366
373
|
|
|
367
|
-
|
|
374
|
+
BUG FIXES:
|
|
368
375
|
|
|
369
376
|
- Allow the user to override `cookbook_path` again
|
|
370
377
|
|
|
371
378
|
## 1.3.0 (June 6, 2013)
|
|
372
379
|
|
|
373
|
-
|
|
380
|
+
FEATURES:
|
|
374
381
|
|
|
375
382
|
- Added the ability to evaluate `only_if` and `not_if` conditional guards and
|
|
376
383
|
support for stubbing shell guards (#142, #144).
|
|
377
384
|
- New `described_recipe` and `described_cookbook` helpers to keep your specs
|
|
378
385
|
DRY (#140). Thanks Andrey Chernih.
|
|
379
386
|
|
|
380
|
-
|
|
387
|
+
BUG FIXES:
|
|
381
388
|
|
|
382
389
|
- Ensure that Ohai plugin reloader works with ChefSpec (#141). Thanks Andrey
|
|
383
390
|
Chernih.
|
|
384
391
|
|
|
385
392
|
## 1.2.0 (May 16, 2013)
|
|
386
393
|
|
|
387
|
-
|
|
394
|
+
FEATURES:
|
|
388
395
|
|
|
389
396
|
- Add support for partial files (@RanjibDey)
|
|
390
397
|
- Automatically check certain directories for cookbooks (@sethvargo)
|
|
391
398
|
|
|
392
399
|
## 1.1.0 (May 10, 2013)
|
|
393
400
|
|
|
394
|
-
|
|
401
|
+
FEATURES:
|
|
395
402
|
|
|
396
403
|
- Upgrade to newest version of fauxhai (@tmatilai)
|
|
397
404
|
- Make `find_resource` a public method (@adamhjk)
|
|
398
405
|
- Add path support (from fauxhai) (@RanjibDey)
|
|
399
406
|
- Custom Chef formatter for ChefSpec (removes pesky output) (@sethvargo)
|
|
400
407
|
|
|
401
|
-
|
|
408
|
+
BUG FIXES:
|
|
402
409
|
|
|
403
410
|
- Remove pesky output from Chef 11
|
|
404
411
|
|
|
405
412
|
## 1.0.0 (April 22, 2013)
|
|
406
413
|
|
|
407
|
-
|
|
414
|
+
FEATURES:
|
|
408
415
|
|
|
409
416
|
- Add support for matching file content using Regular Expressions (@ketan)
|
|
410
417
|
- Add support for `ruby_block` matcher (Andrey Vorobiev)
|
|
@@ -422,7 +429,7 @@ Features:
|
|
|
422
429
|
- Relax gemspec constraints (@juliandunn)
|
|
423
430
|
- Improve documentation and examples
|
|
424
431
|
|
|
425
|
-
|
|
432
|
+
BUG FIXES:
|
|
426
433
|
|
|
427
434
|
- Fix Rubygems/Bundler 2.0 compatibility issues
|
|
428
435
|
- Upgrade to newest RSpec
|
|
@@ -431,7 +438,7 @@ Bugfixes:
|
|
|
431
438
|
|
|
432
439
|
## 0.9.0 (November 10, 2012)
|
|
433
440
|
|
|
434
|
-
|
|
441
|
+
FEATURES:
|
|
435
442
|
|
|
436
443
|
- Support added for the `user` resource (#6). Thanks Ranjib Dey.
|
|
437
444
|
- Support for making assertions about notifications added (#49). Thanks to
|
|
@@ -448,7 +455,7 @@ Features:
|
|
|
448
455
|
to Ketan Padegaonkar.
|
|
449
456
|
- Support added for the `chef_gem` resource (#74). Thanks to Jim Hopp.
|
|
450
457
|
|
|
451
|
-
|
|
458
|
+
BUG FIXES:
|
|
452
459
|
|
|
453
460
|
- Avoid failure if template path is not writable (#48). Thanks to Augusto
|
|
454
461
|
Becciu and Jim Hopp.
|
|
@@ -464,7 +471,7 @@ Bugfixes:
|
|
|
464
471
|
|
|
465
472
|
## 0.8.0 (September 14, 2012)
|
|
466
473
|
|
|
467
|
-
|
|
474
|
+
FEATURES:
|
|
468
475
|
|
|
469
476
|
- LWRP support added (#40). You can now make assertions about the resources
|
|
470
477
|
created by a provider by telling chefspec to [step into a provider
|
|
@@ -472,14 +479,14 @@ Features:
|
|
|
472
479
|
Thanks to Augusto Becciu for implementing this feature.
|
|
473
480
|
- Updated for compatibility with Chef 10.14. Thanks Augusto Becciu.
|
|
474
481
|
|
|
475
|
-
|
|
482
|
+
BUG FIXES:
|
|
476
483
|
|
|
477
484
|
- Template paths are no longer hard-coded to live under `default` (#32).
|
|
478
485
|
Thanks Augusto Becciu.
|
|
479
486
|
|
|
480
487
|
## 0.7.0 (August 27, 2012)
|
|
481
488
|
|
|
482
|
-
|
|
489
|
+
FEATURES:
|
|
483
490
|
|
|
484
491
|
- Cron resource support added (#33). Thanks Alexander Tamoykin.
|
|
485
492
|
- RSpec dependency
|
|
@@ -488,14 +495,14 @@ Features:
|
|
|
488
495
|
[named subject](http://blog.davidchelimsky.net/2012/05/13/spec-smell-explicit-use-of-subject/)
|
|
489
496
|
support (#37). Thanks Doug Ireton.
|
|
490
497
|
|
|
491
|
-
|
|
498
|
+
BUG FIXES:
|
|
492
499
|
|
|
493
500
|
- Correctly infer the default `cookbook_path` on Windows (#38). Thanks Torben
|
|
494
501
|
Knerr.
|
|
495
502
|
|
|
496
503
|
## 0.6.1 (June 21, 2012)
|
|
497
504
|
|
|
498
|
-
|
|
505
|
+
FEATURES:
|
|
499
506
|
|
|
500
507
|
- With the
|
|
501
508
|
[release of Chef 10.12.0](http://www.opscode.com/blog/2012/06/19/chef-10-12-0-released/)
|
|
@@ -505,7 +512,7 @@ Features:
|
|
|
505
512
|
|
|
506
513
|
## 0.6.0 (May 31, 2012)
|
|
507
514
|
|
|
508
|
-
|
|
515
|
+
FEATURES:
|
|
509
516
|
|
|
510
517
|
- Service matchers extended to add support for the `:nothing` and `:enabled`
|
|
511
518
|
actions. Thanks to Steve Lum (#20).
|
|
@@ -517,53 +524,53 @@ Features:
|
|
|
517
524
|
|
|
518
525
|
## 0.5.0 (February 20, 2012)
|
|
519
526
|
|
|
520
|
-
|
|
527
|
+
FEATURES:
|
|
521
528
|
|
|
522
529
|
- Thanks to Chris Griego and Morgan Nelson for these improvements:
|
|
523
530
|
- Support both arrays and raw symbols for actions in the file content matcher (#14).
|
|
524
531
|
- Add support for cookbook_file resources (#14).
|
|
525
532
|
- Support added for `gem_package` resources. Thanks to Jim Hopp from Lookout (#16).
|
|
526
533
|
|
|
527
|
-
|
|
534
|
+
BUG FIXES:
|
|
528
535
|
|
|
529
536
|
- Set the client_key to nil so that Chef::Search::Query.new doesn't raise (#14). Thanks Chris Griego and Morgan Nelson.
|
|
530
537
|
|
|
531
538
|
## 0.4.0 (November 14, 2011)
|
|
532
539
|
|
|
533
|
-
|
|
540
|
+
FEATURES:
|
|
534
541
|
|
|
535
542
|
- Ruby 1.9.3 is now supported.
|
|
536
543
|
- The `create_file_with_content` matcher now matches on partial content (#13). This is an API behaviour change but
|
|
537
544
|
sufficiently minor and unlikely to break existing specs that I'm not bumping the major version. Thanks Chris Griego
|
|
538
545
|
and Morgan Nelson from getaroom.
|
|
539
546
|
|
|
540
|
-
|
|
547
|
+
BUG FIXES:
|
|
541
548
|
|
|
542
549
|
- Fixed a bug in the `install_package_at_version` matcher where it would error if the package action was not
|
|
543
550
|
explicitly specified (#13). Thanks Chris Griego and Morgan Nelson from getaroom.
|
|
544
551
|
|
|
545
552
|
## 0.3.0 (October 2, 2011)
|
|
546
553
|
|
|
547
|
-
|
|
554
|
+
FEATURES:
|
|
548
555
|
|
|
549
556
|
- [Added new matcher](https://www.relishapp.com/sethvargo/chefspec/docs/write-examples-for-templates) `create_file_with_content` for verifying Chef `template` resource generated content.
|
|
550
557
|
- [Knife plugin](https://www.relishapp.com/sethvargo/chefspec/docs/generate-placeholder-examples) added to generate placeholder examples.
|
|
551
558
|
|
|
552
559
|
## 0.2.1 (September 21, 2011)
|
|
553
|
-
|
|
560
|
+
BUG FIXES:
|
|
554
561
|
|
|
555
562
|
- Fixed typo in 0.2.0 botched release. Pro-tip: run your tests.
|
|
556
563
|
|
|
557
564
|
## 0.2.0 (September 21, 2011)
|
|
558
565
|
|
|
559
|
-
|
|
566
|
+
FEATURES:
|
|
560
567
|
|
|
561
568
|
- Significantly improved performance by not invoking OHAI.
|
|
562
569
|
- ChefRunner constructor now accepts a block to set node attributes.
|
|
563
570
|
- ChefRunner constructor now takes an options hash.
|
|
564
571
|
- Converge now returns a reference to the ChefRunner to support calling converge in a let block.
|
|
565
572
|
|
|
566
|
-
|
|
573
|
+
BUG FIXES:
|
|
567
574
|
|
|
568
575
|
- Removed LWRP redefinition warnings.
|
|
569
576
|
- Reset run_list between calls to converge.
|
|
@@ -571,18 +578,18 @@ Bugfixes:
|
|
|
571
578
|
|
|
572
579
|
## 0.1.0 (August 9, 2011)
|
|
573
580
|
|
|
574
|
-
|
|
581
|
+
FEATURES:
|
|
575
582
|
|
|
576
583
|
- Support for Chef 0.1.x (#2)
|
|
577
584
|
- Support MRI 1.9.2 (#3)
|
|
578
585
|
|
|
579
|
-
|
|
586
|
+
BUG FIXES:
|
|
580
587
|
|
|
581
588
|
- Added specs.
|
|
582
589
|
|
|
583
590
|
## 0.0.2 (July 31, 2011)
|
|
584
591
|
|
|
585
|
-
|
|
592
|
+
BUG FIXES:
|
|
586
593
|
|
|
587
594
|
- Corrected gem dependencies.
|
|
588
595
|
|
data/chefspec.gemspec
CHANGED
|
@@ -27,11 +27,11 @@ Gem::Specification.new do |s|
|
|
|
27
27
|
s.required_ruby_version = '>= 1.9'
|
|
28
28
|
|
|
29
29
|
s.add_dependency 'chef', '>= 11.14'
|
|
30
|
-
s.add_dependency 'fauxhai', '~> 3.
|
|
30
|
+
s.add_dependency 'fauxhai', '~> 3.2'
|
|
31
31
|
s.add_dependency 'rspec', '~> 3.0'
|
|
32
32
|
|
|
33
33
|
# Development Dependencies
|
|
34
|
-
s.add_development_dependency 'rake'
|
|
34
|
+
s.add_development_dependency 'rake', '< 11.0'
|
|
35
35
|
s.add_development_dependency 'redcarpet', '~> 3.3'
|
|
36
36
|
s.add_development_dependency 'yard', '~> 0.8'
|
|
37
37
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
require 'singleton'
|
|
3
|
+
|
|
4
|
+
module ChefSpec
|
|
5
|
+
class FileCachePathProxy
|
|
6
|
+
include Singleton
|
|
7
|
+
|
|
8
|
+
attr_reader :file_cache_path
|
|
9
|
+
|
|
10
|
+
def initialize
|
|
11
|
+
@file_cache_path = Dir.mktmpdir(["chefspec", "file_cache_path"])
|
|
12
|
+
at_exit { FileUtils.rm_rf(@file_cache_path) }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/chefspec/rspec.rb
CHANGED
|
@@ -2,6 +2,7 @@ require 'chef_zero/server'
|
|
|
2
2
|
require 'chef/cookbook_loader'
|
|
3
3
|
require 'chef/cookbook_uploader'
|
|
4
4
|
|
|
5
|
+
require_relative 'file_cache_path_proxy'
|
|
5
6
|
require_relative 'server_methods'
|
|
6
7
|
require_relative 'solo_runner'
|
|
7
8
|
|
|
@@ -11,6 +12,13 @@ module ChefSpec
|
|
|
11
12
|
|
|
12
13
|
# @see (SoloRunner#initialize)
|
|
13
14
|
def initialize(options = {})
|
|
15
|
+
# Unlike the SoloRunner, the file_cache_path needs to remain consistent
|
|
16
|
+
# for every Chef run or else the Chef client tries to loads the same
|
|
17
|
+
# cookbook multiple times and will encounter deprecated logic when
|
|
18
|
+
# creating LWRPs. It also slows down the entire process.
|
|
19
|
+
options[:file_cache_path] ||= RSpec.configuration.file_cache_path ||
|
|
20
|
+
ChefSpec::FileCachePathProxy.instance.file_cache_path
|
|
21
|
+
|
|
14
22
|
# Call super, but do not pass in the block because we want to customize
|
|
15
23
|
# our yielding.
|
|
16
24
|
super(options, &nil)
|
data/lib/chefspec/version.rb
CHANGED
data/spec/unit/macros_spec.rb
CHANGED
|
@@ -76,7 +76,7 @@ describe ChefSpec::Macros do
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
it 'sets the automatic attributes from a JSON data path' do
|
|
79
|
-
allow(File).to receive(:
|
|
79
|
+
allow(File).to receive(:exist?).with('/path/to/json').and_return(true)
|
|
80
80
|
allow(File).to receive(:read).with('/path/to/json').and_return('{ "ipaddress": "1.2.3.4" }')
|
|
81
81
|
node = described_class.stub_node('node.example', path: '/path/to/json')
|
|
82
82
|
expect(node['ipaddress']).to eq('1.2.3.4')
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe ChefSpec::ServerRunner do
|
|
4
|
+
context 'when the RSpec config is set' do
|
|
5
|
+
it 'does not create a tmpdir' do
|
|
6
|
+
allow(RSpec.configuration).to receive(:file_cache_path)
|
|
7
|
+
.and_return("/foo/bar")
|
|
8
|
+
expect(ChefSpec::FileCachePathProxy).to_not receive(:instance)
|
|
9
|
+
described_class.new
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
context 'when the RSpec config is not set' do
|
|
14
|
+
it 'creates and returns a tmpdir' do
|
|
15
|
+
expect(ChefSpec::FileCachePathProxy).to receive(:instance)
|
|
16
|
+
.and_call_original
|
|
17
|
+
described_class.new
|
|
18
|
+
expect(Chef::Config[:file_cache_path]).to match(/chefspec/)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'uses the same path' do
|
|
22
|
+
val = ChefSpec::FileCachePathProxy.instance.file_cache_path
|
|
23
|
+
expect(described_class.new.options[:file_cache_path]).to eq(val)
|
|
24
|
+
expect(described_class.new.options[:file_cache_path]).to eq(val)
|
|
25
|
+
expect(described_class.new.options[:file_cache_path]).to eq(val)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
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: 4.6.
|
|
4
|
+
version: 4.6.1
|
|
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: 2016-03-
|
|
12
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: chef
|
|
@@ -31,20 +31,14 @@ dependencies:
|
|
|
31
31
|
requirements:
|
|
32
32
|
- - "~>"
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '3.
|
|
35
|
-
- - ">="
|
|
36
|
-
- !ruby/object:Gem::Version
|
|
37
|
-
version: 3.0.1
|
|
34
|
+
version: '3.2'
|
|
38
35
|
type: :runtime
|
|
39
36
|
prerelease: false
|
|
40
37
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
38
|
requirements:
|
|
42
39
|
- - "~>"
|
|
43
40
|
- !ruby/object:Gem::Version
|
|
44
|
-
version: '3.
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: 3.0.1
|
|
41
|
+
version: '3.2'
|
|
48
42
|
- !ruby/object:Gem::Dependency
|
|
49
43
|
name: rspec
|
|
50
44
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -63,16 +57,16 @@ dependencies:
|
|
|
63
57
|
name: rake
|
|
64
58
|
requirement: !ruby/object:Gem::Requirement
|
|
65
59
|
requirements:
|
|
66
|
-
- - "
|
|
60
|
+
- - "<"
|
|
67
61
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
62
|
+
version: '11.0'
|
|
69
63
|
type: :development
|
|
70
64
|
prerelease: false
|
|
71
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
72
66
|
requirements:
|
|
73
|
-
- - "
|
|
67
|
+
- - "<"
|
|
74
68
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
69
|
+
version: '11.0'
|
|
76
70
|
- !ruby/object:Gem::Dependency
|
|
77
71
|
name: redcarpet
|
|
78
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -720,6 +714,7 @@ files:
|
|
|
720
714
|
- lib/chefspec/extensions/chef/resource.rb
|
|
721
715
|
- lib/chefspec/extensions/chef/resource/freebsd_package.rb
|
|
722
716
|
- lib/chefspec/extensions/chef/securable.rb
|
|
717
|
+
- lib/chefspec/file_cache_path_proxy.rb
|
|
723
718
|
- lib/chefspec/formatter.rb
|
|
724
719
|
- lib/chefspec/librarian.rb
|
|
725
720
|
- lib/chefspec/macros.rb
|
|
@@ -771,6 +766,7 @@ files:
|
|
|
771
766
|
- spec/unit/matchers/state_attrs_matcher_spec.rb
|
|
772
767
|
- spec/unit/matchers/subscribes_matcher_spec.rb
|
|
773
768
|
- spec/unit/renderer_spec.rb
|
|
769
|
+
- spec/unit/server_runner_spec.rb
|
|
774
770
|
- spec/unit/solo_runner_spec.rb
|
|
775
771
|
- spec/unit/stubs/command_registry_spec.rb
|
|
776
772
|
- spec/unit/stubs/command_stub_spec.rb
|
|
@@ -909,6 +905,7 @@ test_files:
|
|
|
909
905
|
- spec/unit/matchers/state_attrs_matcher_spec.rb
|
|
910
906
|
- spec/unit/matchers/subscribes_matcher_spec.rb
|
|
911
907
|
- spec/unit/renderer_spec.rb
|
|
908
|
+
- spec/unit/server_runner_spec.rb
|
|
912
909
|
- spec/unit/solo_runner_spec.rb
|
|
913
910
|
- spec/unit/stubs/command_registry_spec.rb
|
|
914
911
|
- spec/unit/stubs/command_stub_spec.rb
|