chefspec 7.4.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 811f21e393d16be39c8162bbe17c1157d214ce0eb378e8d19e686683fad4160b
4
- data.tar.gz: 764db71993cd015961d195d39dc1c99a74bda29311a3fc69210961e4482d6ba9
3
+ metadata.gz: 888dff160c4e09262e47271fc25e19e24dfa5415f9c17566d5fab2c3b07d3f38
4
+ data.tar.gz: a79eacde94a5abdad1ab8e4530ed95d46255323927fbfe9706873aa7d6d99545
5
5
  SHA512:
6
- metadata.gz: b7b68c00204307439f31270eb1ae14360d1750aabc7e7f87c2128337331fb29b6041858132f218fee76fd65c8d2903739816c1be4a8f268646c66fd10449b5a9
7
- data.tar.gz: d25a404af72648245718dc0ee6519023754c0c6f111f87746edb611e6c17856571bc183e17fd1284b33709ddebd8a0ba36c91a0f4245403db49bbd0d7e2a09b3
6
+ metadata.gz: 76b576b0e8fd51f067bda1eaca73ebb3bd5f49f0ce366ac4c59d84942b2d1437cead58afc7fd1b0c96e7051e656342e2b2ac9e1d2d3c183953ed8fefba15b79f
7
+ data.tar.gz: f5ba63555cde2fb189c53ceedfffd46491744605ea50f8927f85502c8ba480455a69ba397cdc27d1ace387509e95b8c5442b10b411ea50b3d18aaf075c0a5b3d
@@ -21,9 +21,10 @@ Gem::Specification.new do |s|
21
21
  s.files = %w{LICENSE Rakefile Gemfile chefspec.gemspec} + Dir.glob("{lib,templates,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
22
22
  s.require_paths = ['lib']
23
23
 
24
- s.required_ruby_version = '>= 2.3'
24
+ s.required_ruby_version = '>= 2.4'
25
25
 
26
- s.add_dependency 'chef', '>= 13'
26
+ s.add_dependency 'chef', '>= 14'
27
+ s.add_dependency 'chef-cli'
27
28
  s.add_dependency 'fauxhai', '>= 6.11'
28
29
  s.add_dependency 'rspec', '~> 3.0'
29
30
  end
@@ -90,26 +90,6 @@ module ChefSpec
90
90
  @outputs << block
91
91
  end
92
92
 
93
- #
94
- # Change the template for reporting of converage analysis.
95
- #
96
- # @param [string] path
97
- # The template file to use for the output of the report
98
- #
99
- # @return [true]
100
- #
101
- def set_template(file = 'human.erb')
102
- [
103
- ChefSpec.root.join('templates', 'coverage', file),
104
- File.expand_path(file, Dir.pwd)
105
- ].each do |temp|
106
- if File.exist?(temp)
107
- @template = temp
108
- return
109
- end
110
- end
111
- raise Error::TemplateNotFound.new(path: file)
112
- end
113
93
  #
114
94
  # Add a resource to the resource collection. Only new resources are added
115
95
  # and only resources that match the given filter are covered (which is *
@@ -25,7 +25,7 @@ Chef::Cookbook::GemInstaller.prepend(Module.new do
25
25
  gem_cmd = "gem install #{gem_name} --version '#{gem_requirements.join(', ')}'"
26
26
  gemfile_line = "gem '#{[gem_name, *gem_requirements].join('\', \'')}'"
27
27
  warn "No matching version found for '#{gem_name}' in your gem environment.\n" \
28
- " - if you are using ChefDK, run the following command: \"chef #{gem_cmd}\"\n" \
28
+ " - if you are using Chef Workstation, run the following command: \"chef #{gem_cmd}\"\n" \
29
29
  " - if you are using bundler, append \"#{gemfile_line}\" to your Gemfile and run \"bundle install\"\n" \
30
30
  " - otherwise run: \"#{gem_cmd}\""
31
31
  end
@@ -1,8 +1,8 @@
1
1
  begin
2
- require 'chef-dk/policyfile_services/export_repo'
3
- require 'chef-dk/policyfile_services/install'
2
+ require 'chef-cli/policyfile_services/export_repo'
3
+ require 'chef-cli/policyfile_services/install'
4
4
  rescue LoadError
5
- raise ChefSpec::Error::GemLoadError.new(gem: 'chef-dk', name: 'ChefDK')
5
+ raise ChefSpec::Error::GemLoadError.new(gem: 'chef-cli', name: 'ChefCLI')
6
6
  end
7
7
 
8
8
  module ChefSpec
@@ -27,14 +27,14 @@ module ChefSpec
27
27
  policyfile_path = File.join(Dir.pwd, 'Policyfile.rb')
28
28
  end
29
29
 
30
- installer = ChefDK::PolicyfileServices::Install.new(
30
+ installer = ChefCLI::PolicyfileServices::Install.new(
31
31
  policyfile: policyfile_path,
32
- ui: ChefDK::UI.null
32
+ ui: ChefCLI::UI.null
33
33
  )
34
34
 
35
35
  installer.run
36
36
 
37
- exporter = ChefDK::PolicyfileServices::ExportRepo.new(
37
+ exporter = ChefCLI::PolicyfileServices::ExportRepo.new(
38
38
  policyfile: policyfile_path,
39
39
  export_dir: @tmpdir
40
40
  )
@@ -1,3 +1,3 @@
1
1
  module ChefSpec
2
- VERSION = '7.4.0'
2
+ VERSION = '8.0.0'
3
3
  end
@@ -1,11 +1,6 @@
1
1
  require 'chefspec'
2
2
  require 'support/hash'
3
3
 
4
-
5
- ChefSpec::Coverage.start! do
6
- set_template 'table.erb'
7
- end
8
-
9
4
  RSpec.configure do |config|
10
5
  config.expect_with(:rspec) { |c| c.syntax = :expect }
11
6
  config.filter_run(focus: true)
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: 7.4.0
4
+ version: 8.0.0
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: 2019-06-27 00:00:00.000000000 Z
12
+ date: 2019-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -17,14 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '13'
20
+ version: '14'
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: '13'
27
+ version: '14'
28
+ - !ruby/object:Gem::Dependency
29
+ name: chef-cli
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: fauxhai
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -167,9 +181,6 @@ files:
167
181
  - spec/unit/stubs/search_registry_spec.rb
168
182
  - spec/unit/stubs/search_stub_spec.rb
169
183
  - spec/unit/stubs/stub_spec.rb
170
- - templates/coverage/human.erb
171
- - templates/coverage/json.erb
172
- - templates/coverage/table.erb
173
184
  - templates/errors/cookbook_path_not_found.erb
174
185
  - templates/errors/erb_template_parse_error.erb
175
186
  - templates/errors/gem_load_error.erb
@@ -191,7 +202,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
202
  requirements:
192
203
  - - ">="
193
204
  - !ruby/object:Gem::Version
194
- version: '2.3'
205
+ version: '2.4'
195
206
  required_rubygems_version: !ruby/object:Gem::Requirement
196
207
  requirements:
197
208
  - - ">="
@@ -1,22 +0,0 @@
1
-
2
- <% if @total == 0 %>
3
- No Chef resources found, skipping coverage calculation...
4
- <% else %>
5
- ChefSpec Coverage report generated...
6
-
7
- Total Resources: <%= @total %>
8
- Touched Resources: <%= @touched %>
9
- Touch Coverage: <%= @coverage %>%
10
-
11
- <% if @untouched_resources.empty? %>
12
- You are awesome and so is your test coverage! Have a fantastic day!
13
-
14
- <% else %>
15
- Untouched Resources:
16
-
17
- <% @untouched_resources.each do |resource| %>
18
- <%= resource.to_s.ljust(32) %> <%= resource.source_file %>:<%= resource.source_line %>
19
- <% end %>
20
-
21
- <% end %>
22
- <% end %>
@@ -1,8 +0,0 @@
1
- { "resources":[
2
- <%= @all_resources.map { |resource| resource.to_json }.join(",\n") %>
3
- ],
4
- "resource_count": <%= @total %>,
5
- "resources_touched": <%= @touched %>,
6
- "resource_coverage": <%= @coverage %>
7
-
8
- }
@@ -1,14 +0,0 @@
1
- <%='Touched'.to_s.ljust(8) %> <%='Resource'.to_s.ljust(48) %> File:Line
2
- <% @all_resources.each do |resource| %>
3
- <%=resource.touched?.to_s.ljust(8) %> <%= resource.to_s.ljust(48) %> <%= resource.source_file %>:<%= resource.source_line %>
4
- <% end %>
5
-
6
- <% if @total == 0 %>
7
- No Chef resources found, skipping coverage calculation...
8
- <% else %>
9
- ChefSpec Coverage report generated...
10
-
11
- Total Resources: <%= @total %>
12
- Touched Resources: <%= @touched %>
13
- Touch Coverage: <%= @coverage %>%
14
- <% end %>