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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f7f37a530acbb9dff67aed530b585d77fdd0775
4
- data.tar.gz: 33079e8115211a7bb28392ea9aa26a584f2b8e43
3
+ metadata.gz: 2b27856f904afc7828e2ebd18d3b0d6cf445df4c
4
+ data.tar.gz: c044c2653ce2dd4edea1a9af3be1a279bd10464b
5
5
  SHA512:
6
- metadata.gz: 62f881a2f5ca9f7438399dfba1925ea5226c742c6e3d7da85facf1df9be28a8444d799c18428af6e0d9e12288a259a64fe3af47905733ca83572b28b33c92ac2
7
- data.tar.gz: 4ee3f4f55710eca0bc4bf036ec683306a1d9312583ebe9edbfd3dfef892d5224813586c6109be50e0af4b89d0a393095b8e263d1fc46ab5e108319989f6c445b
6
+ metadata.gz: b990fc3a58d92ab8a308ae89fe1f4c354f513d3af9054dc2e328df7fb88313c7a539117ab58ece8775d39f3aff296de8c4c20a6b36e94f6a6a1ad6d4f9832dec
7
+ data.tar.gz: b4fa0c0393da51a776b26b7c2da7b55cedda9d6c5f27747475feb229797c3d6eaaaf1abf79d70991ff7f6f00256761b91cdb9eff17ef5626db9e2440b29c5670
@@ -27,4 +27,5 @@ gemfile:
27
27
  matrix:
28
28
  fast_finish: true
29
29
  allow_failures:
30
+ - gemfile: gemfiles/chef-12.0.0.alpha.gemfile
30
31
  - gemfile: gemfiles/chef-master.gemfile
@@ -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
@@ -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.define_runner_method' instead."
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::SoloRuner.new(*args, &block)
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
@@ -0,0 +1,11 @@
1
+ require 'chef/cookbook_uploader'
2
+
3
+ class Chef::CookbookUploader
4
+ #
5
+ # Don't validate uploaded cookbooks. Validating a cookbook takes *forever*
6
+ # to complete. It's just not worth it...
7
+ #
8
+ def validate_cookbooks
9
+ # noop
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module ChefSpec
2
- VERSION = '4.1.0'
2
+ VERSION = '4.1.1'
3
3
  end
@@ -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.0
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 00:00:00.000000000 Z
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