chefspec 4.1.0 → 4.1.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 +1 -0
- data/CHANGELOG.md +5 -0
- data/lib/chefspec.rb +1 -0
- data/lib/chefspec/deprecations.rb +4 -4
- data/lib/chefspec/extensions/chef/cookbook_uploader.rb +11 -0
- data/lib/chefspec/version.rb +1 -1
- data/spec/unit/deprecations_spec.rb +75 -0
- data/templates/errors/no_conversion_error.erb +1 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b27856f904afc7828e2ebd18d3b0d6cf445df4c
|
4
|
+
data.tar.gz: c044c2653ce2dd4edea1a9af3be1a279bd10464b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b990fc3a58d92ab8a308ae89fe1f4c354f513d3af9054dc2e328df7fb88313c7a539117ab58ece8775d39f3aff296de8c4c20a6b36e94f6a6a1ad6d4f9832dec
|
7
|
+
data.tar.gz: b4fa0c0393da51a776b26b7c2da7b55cedda9d6c5f27747475feb229797c3d6eaaaf1abf79d70991ff7f6f00256761b91cdb9eff17ef5626db9e2440b29c5670
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
CHANGELOG for ChefSpec
|
2
2
|
======================
|
3
3
|
|
4
|
+
## 4.1.1 (October 13, 2014)
|
5
|
+
Bugfixes:
|
6
|
+
- Fix total fail on my part with deprecations and add test coverage
|
7
|
+
- Do not validate cookbooks on upload (speed)
|
8
|
+
|
4
9
|
## 4.1.0 (October 12, 2014)
|
5
10
|
Bugfixes:
|
6
11
|
- Bump the minimum required version of Chef to 11.14
|
data/lib/chefspec.rb
CHANGED
@@ -44,6 +44,7 @@ end
|
|
44
44
|
|
45
45
|
require_relative 'chefspec/extensions/chef/client'
|
46
46
|
require_relative 'chefspec/extensions/chef/conditional'
|
47
|
+
require_relative 'chefspec/extensions/chef/cookbook_uploader'
|
47
48
|
require_relative 'chefspec/extensions/chef/data_query'
|
48
49
|
require_relative 'chefspec/extensions/chef/lwrp_base'
|
49
50
|
require_relative 'chefspec/extensions/chef/resource'
|
@@ -19,8 +19,8 @@ module ChefSpec
|
|
19
19
|
# @deprecated {ChefSpec.define_runner_method} is deprecated. Please
|
20
20
|
# use {ChefSpec.define_runner_method} instead.
|
21
21
|
def self.define_runner_method(resource_name)
|
22
|
-
deprecated "`ChefSpec.define_runner_method' is deprecated. " \
|
23
|
-
"Please use `ChefSpec.
|
22
|
+
deprecated "`ChefSpec::Runner.define_runner_method' is deprecated. " \
|
23
|
+
"Please use `ChefSpec.define_matcher' instead."
|
24
24
|
|
25
25
|
ChefSpec.define_matcher(resource_name)
|
26
26
|
end
|
@@ -31,7 +31,7 @@ module ChefSpec
|
|
31
31
|
deprecated "`ChefSpec::Runner' is deprecated. Please use" \
|
32
32
|
" `ChefSpec::SoloRunner' or `ChefSpec::ServerRunner' instead."
|
33
33
|
|
34
|
-
ChefSpec::
|
34
|
+
ChefSpec::SoloRunner.new(*args, &block)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -40,7 +40,7 @@ module ChefSpec
|
|
40
40
|
deprecated "`ChefSpec::Server.#{m}' is deprecated. There is no longer" \
|
41
41
|
" a global Chef Server instance. Please use a ChefSpec::ServerRunner" \
|
42
42
|
" instead. More documentation can be found in the ChefSpec README."
|
43
|
-
raise NoConversionError
|
43
|
+
raise ChefSpec::Error::NoConversionError
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/lib/chefspec/version.rb
CHANGED
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ChefSpec::Runner do
|
4
|
+
before do
|
5
|
+
allow_any_instance_of(ChefSpec::SoloRunner)
|
6
|
+
.to receive(:dry_run?)
|
7
|
+
.and_return(true)
|
8
|
+
allow(ChefSpec::Runner).to receive(:deprecated)
|
9
|
+
end
|
10
|
+
|
11
|
+
describe '#define_runner_method' do
|
12
|
+
before do
|
13
|
+
allow(ChefSpec).to receive(:define_matcher)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'prints a deprecation' do
|
17
|
+
expect(ChefSpec::Runner).to receive(:deprecated)
|
18
|
+
.with("`ChefSpec::Runner.define_runner_method' is deprecated. "\
|
19
|
+
"Please use `ChefSpec.define_matcher' instead.")
|
20
|
+
ChefSpec::Runner.define_runner_method(:my_custom_resource)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'calls ChefSpec#define_matcher' do
|
24
|
+
expect(ChefSpec).to receive(:define_matcher).with(:my_custom_resource).once
|
25
|
+
ChefSpec::Runner.define_runner_method(:my_custom_resource)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#new' do
|
31
|
+
before do
|
32
|
+
allow(ChefSpec::SoloRunner).to receive(:new)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'prints a deprecation' do
|
36
|
+
expect(ChefSpec::Runner).to receive(:deprecated)
|
37
|
+
.with("`ChefSpec::Runner' is deprecated. Please use" \
|
38
|
+
" `ChefSpec::SoloRunner' or `ChefSpec::ServerRunner' instead.")
|
39
|
+
ChefSpec::Runner.new
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'calls SoloRunner#new with no args' do
|
43
|
+
expect(ChefSpec::SoloRunner).to receive(:new).with(no_args()).once
|
44
|
+
ChefSpec::Runner.new
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'calls SoloRunner#new with args' do
|
48
|
+
args = [ 'args' ]
|
49
|
+
expect(ChefSpec::SoloRunner).to receive(:new).with(*args).once
|
50
|
+
ChefSpec::Runner.new(*args)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe ChefSpec::Server do
|
57
|
+
before do
|
58
|
+
allow(ChefSpec::Server).to receive(:deprecated)
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'prints a deprecation for any method called' do
|
62
|
+
expect(ChefSpec::Server).to receive(:deprecated)
|
63
|
+
.with("`ChefSpec::Server.any_method' is deprecated. There is no longer" \
|
64
|
+
" a global Chef Server instance. Please use a ChefSpec::ServerRunner" \
|
65
|
+
" instead. More documentation can be found in the ChefSpec README."
|
66
|
+
)
|
67
|
+
expect{ChefSpec::Server.any_method}.to raise_error
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'raises non-conversion error for any method called' do
|
71
|
+
expect{ChefSpec::Server.any_method}
|
72
|
+
.to raise_error(ChefSpec::Error::NoConversionError)
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
You called a deprecated method without a backwards compatible replacement.
|
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.1.
|
4
|
+
version: 4.1.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: 2014-10-
|
12
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -669,6 +669,7 @@ files:
|
|
669
669
|
- lib/chefspec/expect_exception.rb
|
670
670
|
- lib/chefspec/extensions/chef/client.rb
|
671
671
|
- lib/chefspec/extensions/chef/conditional.rb
|
672
|
+
- lib/chefspec/extensions/chef/cookbook_uploader.rb
|
672
673
|
- lib/chefspec/extensions/chef/data_query.rb
|
673
674
|
- lib/chefspec/extensions/chef/lwrp_base.rb
|
674
675
|
- lib/chefspec/extensions/chef/resource.rb
|
@@ -709,6 +710,7 @@ files:
|
|
709
710
|
- spec/support/hash.rb
|
710
711
|
- spec/unit/api_spec.rb
|
711
712
|
- spec/unit/cacher_spec.rb
|
713
|
+
- spec/unit/deprecations_spec.rb
|
712
714
|
- spec/unit/errors_spec.rb
|
713
715
|
- spec/unit/expect_exception_spec.rb
|
714
716
|
- spec/unit/extensions/lwrp_base_spec.rb
|
@@ -736,6 +738,7 @@ files:
|
|
736
738
|
- templates/coverage/human.erb
|
737
739
|
- templates/errors/cookbook_path_not_found.erb
|
738
740
|
- templates/errors/gem_load_error.erb
|
741
|
+
- templates/errors/no_conversion_error.erb
|
739
742
|
- templates/errors/not_stubbed.erb
|
740
743
|
homepage: http://code.sethvargo.com/chefspec
|
741
744
|
licenses:
|
@@ -838,6 +841,7 @@ test_files:
|
|
838
841
|
- spec/support/hash.rb
|
839
842
|
- spec/unit/api_spec.rb
|
840
843
|
- spec/unit/cacher_spec.rb
|
844
|
+
- spec/unit/deprecations_spec.rb
|
841
845
|
- spec/unit/errors_spec.rb
|
842
846
|
- spec/unit/expect_exception_spec.rb
|
843
847
|
- spec/unit/extensions/lwrp_base_spec.rb
|