chefspec 6.2.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +17 -23
  3. data/CHANGELOG.md +10 -0
  4. data/Gemfile +9 -0
  5. data/README.md +1 -1
  6. data/chefspec.gemspec +2 -2
  7. data/examples/custom_resource/libraries/matchers.rb +5 -0
  8. data/examples/custom_resource/recipes/default.rb +1 -0
  9. data/examples/custom_resource/resources/custom_resource.rb +9 -0
  10. data/examples/custom_resource/spec/default_spec.rb +18 -0
  11. data/examples/multiple_actions/recipes/reversed.rb +9 -0
  12. data/examples/multiple_actions/recipes/sequential.rb +5 -3
  13. data/examples/multiple_actions/spec/reversed_spec.rb +17 -0
  14. data/examples/multiple_actions/spec/sequential_spec.rb +3 -2
  15. data/features/custom_resource.feature +7 -0
  16. data/features/multiple_actions.feature +1 -0
  17. data/lib/chefspec/extensions/chef/lwrp_base.rb +21 -35
  18. data/lib/chefspec/matchers/resource_matcher.rb +20 -27
  19. data/lib/chefspec/server_methods.rb +4 -1
  20. data/lib/chefspec/solo_runner.rb +8 -8
  21. data/lib/chefspec/version.rb +1 -1
  22. metadata +16 -19
  23. data/examples/easy_install_package/recipes/install.rb +0 -13
  24. data/examples/easy_install_package/recipes/purge.rb +0 -13
  25. data/examples/easy_install_package/recipes/remove.rb +0 -13
  26. data/examples/easy_install_package/recipes/upgrade.rb +0 -13
  27. data/examples/easy_install_package/spec/install_spec.rb +0 -23
  28. data/examples/easy_install_package/spec/purge_spec.rb +0 -19
  29. data/examples/easy_install_package/spec/remove_spec.rb +0 -19
  30. data/examples/easy_install_package/spec/upgrade_spec.rb +0 -19
  31. data/features/easy_install_package.feature +0 -13
  32. data/gemfiles/chefspec.gemfile +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11a70e63e41d70878f57327c5ed4008b49901a78
4
- data.tar.gz: 7cfbd1b0ed9431a5c0ecba7d2445679863d61afd
3
+ metadata.gz: c5200ce7871519ab0cc3ec4991be81a879de497e
4
+ data.tar.gz: 06e54036feed75509905d6d0fa216fca5ad21e70
5
5
  SHA512:
6
- metadata.gz: 28874630542168cc116ab2a951a0254dc3eb7c23406c7dcffaf920a903948c09a32604d7c695254ee0065fc2ce3c345802cab5e78bb508206098069c490ab39d
7
- data.tar.gz: 82d8a732f2d4a24b2c6350a0455a8d2bff1205d27f86ad65fed549f861460bf679152b650f6b50d5078eea42c3e40dc7b1d249193e9d6a9734d92f87cbbecc30
6
+ metadata.gz: c01f41111509834f0edfd555ccb1f6cd5b46286834884309ac1045b792404fe7110ad15669e9307f7b85f620eee3cdaf1e5a87c884ab4c41c06d5198b19223bc
7
+ data.tar.gz: 90a5eba4f6aaa993733d2880f9fa591fc8504dad190ab855821be27d1d98712644bc2057e16d683e352f49144a1f6f2664d93db4da820349e0d6182801068e86
@@ -4,9 +4,9 @@ sudo: false
4
4
 
5
5
  before_install:
6
6
  - gem install bundler
7
-
8
- rvm:
9
- - 2.2.6
7
+ - bundle --version
8
+ - gem update --system
9
+ - gem --version
10
10
 
11
11
  branches:
12
12
  only:
@@ -14,25 +14,19 @@ branches:
14
14
 
15
15
  bundler_args: --jobs 7 --retry 3
16
16
 
17
- gemfile: gemfiles/chefspec.gemfile
18
-
19
- env:
20
- - CHEF_VERSION=master
21
- - CHEF_VERSION=12.18.31
22
- - CHEF_VERSION=12.17.44
23
- - CHEF_VERSION=12.16.42
24
- - CHEF_VERSION=12.15.19
25
- - CHEF_VERSION=12.14.89
26
- - CHEF_VERSION=12.13.37
27
- - CHEF_VERSION=12.12.15
28
- - CHEF_VERSION=12.11.18
29
- - CHEF_VERSION=12.10.24
30
- - CHEF_VERSION=12.9.41
31
- - CHEF_VERSION=12.8.1
32
- - CHEF_VERSION=12.7.2
33
- - CHEF_VERSION=12.6.0
34
-
35
17
  matrix:
36
- fast_finish: true
37
- allow_failures:
18
+ include:
38
19
  - env: CHEF_VERSION=master
20
+ rvm: 2.4.1
21
+ - env: CHEF_VERSION=13.0.118
22
+ rvm: 2.4.1
23
+ - env: CHEF_VERSION=12.18.31
24
+ rvm: 2.3.1
25
+ - env: CHEF_VERSION=12.17.44
26
+ rvm: 2.3.1
27
+ - env: CHEF_VERSION=12.16.42
28
+ rvm: 2.3.1
29
+ - env: CHEF_VERSION=12.15.19
30
+ rvm: 2.3.1
31
+ - env: CHEF_VERSION=12.14.89
32
+ rvm: 2.3.1
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG for ChefSpec
2
2
 
3
+ ## 7.0.0 (April, 18, 2017)
4
+
5
+ - Increased the chef gem dependency from 12.6+ to 12.14+. Since ChefSpec is consumed within ChefDK this actually has a minor impact on end users who generally consume Chefspec via ChefDK, which will bundle both compatible chef and chefspec releases.
6
+ - Fixed incompatibilities with Chef 13.
7
+ - Loosened the Fauxhai dependency to allow for the upcoming Fauxhai 5.0 release.
8
+ - Removed easy_install_package testing and examples as easy_install_package was removed in Chef 13\. The actual matcher is still present for users with existing specs against Chef 12 cookbooks.
9
+ - Added additional testing and an example for LWRPs with use_inline_resources defined.
10
+ - Added testing against Chef 13 and Ruby 2.4.
11
+ - Removed code that supported Chef < 12.5.
12
+
3
13
  ## 6.2.0 (March 27, 2017)
4
14
 
5
15
  - Correctly handle the block form of search() when using stubs
data/Gemfile CHANGED
@@ -1,3 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ # env var for travis
4
+ if ENV['CHEF_VERSION']
5
+ if ENV['CHEF_VERSION'] == "master"
6
+ gem 'chef', git: "https://github.com/chef/chef"
7
+ else
8
+ gem 'chef', ENV['CHEF_VERSION']
9
+ end
10
+ end
11
+
3
12
  gemspec
data/README.md CHANGED
@@ -19,7 +19,7 @@ ChefSpec runs your cookbook(s) locally with Chef Solo without actually convergin
19
19
 
20
20
  ## Important Notes
21
21
 
22
- - **ChefSpec requires Ruby 2.2 or later and Chef 12.6 or later!**
22
+ - **ChefSpec requires Ruby 2.2 or later and Chef 12.14.89 or later!**
23
23
  - **This documentation corresponds to the master branch, which may be unreleased. Please check the README of the latest git tag or the gem's source for your version's documentation!**
24
24
  - **Each resource matcher is self-documented using [Yard](http://rubydoc.info/github/sethvargo/chefspec) and has a corresponding aruba test from the [examples directory](https://github.com/sethvargo/chefspec/tree/master/examples).**
25
25
  - **ChefSpec aims to maintain compatibility with the two most recent minor versions of Chef.** If you are running an older version of Chef it may work, or you will need to run an older version of ChefSpec.
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
25
25
 
26
26
  s.required_ruby_version = '>= 2.2'
27
27
 
28
- s.add_dependency 'chef', '>= 12.0'
29
- s.add_dependency 'fauxhai', '>= 3.6', '< 5'
28
+ s.add_dependency 'chef', '>= 12.14.89'
29
+ s.add_dependency 'fauxhai', '>= 4', '< 6'
30
30
  s.add_dependency 'rspec', '~> 3.0'
31
31
 
32
32
  # Development Dependencies
@@ -0,0 +1,5 @@
1
+ if defined?(ChefSpec)
2
+ def run_custom_resource(resource_name)
3
+ ChefSpec::Matchers::ResourceMatcher.new(:custom_resource, :run, resource_name)
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ custom_resource 'resource'
@@ -0,0 +1,9 @@
1
+ provides :custom_resource
2
+
3
+ property :name, name_property: true
4
+
5
+ action :run do
6
+ package('package') { action :install }
7
+ service('service') { action :start }
8
+ template('template') { action :create }
9
+ end
@@ -0,0 +1,18 @@
1
+ require 'chefspec'
2
+
3
+ describe 'custom_resource::default' do
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04', step_into: ['custom_resource'])
6
+ .converge(described_recipe)
7
+ end
8
+
9
+ it 'uses the LWRP' do
10
+ expect(chef_run).to run_custom_resource('resource')
11
+ end
12
+
13
+ it 'steps into the LWRP' do
14
+ expect(chef_run).to install_package('package')
15
+ expect(chef_run).to start_service('service')
16
+ expect(chef_run).to create_template('template')
17
+ end
18
+ end
@@ -0,0 +1,9 @@
1
+ service 'foo' do
2
+ stop_command 'bar'
3
+ action :stop
4
+ end
5
+
6
+ service 'foo' do
7
+ start_command 'baz'
8
+ action :start
9
+ end
@@ -1,7 +1,9 @@
1
- service 'resource' do
1
+ service 'foo' do
2
+ start_command 'baz'
2
3
  action :start
3
4
  end
4
5
 
5
- service 'resource' do
6
- action :nothing
6
+ service 'foo' do
7
+ stop_command 'bar'
8
+ action :stop
7
9
  end
@@ -0,0 +1,17 @@
1
+ require 'chefspec'
2
+
3
+ describe 'multiple_actions::reversed' do
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04', log_level: :fatal)
6
+ .converge(described_recipe)
7
+ end
8
+
9
+ it 'executes both actions' do
10
+ expect(chef_run).to stop_service('foo').with(stop_command: 'bar')
11
+ expect(chef_run).to start_service('foo').with(start_command: 'baz')
12
+ end
13
+
14
+ it 'does not match other actions' do
15
+ expect(chef_run).to_not disable_service('foo')
16
+ end
17
+ end
@@ -7,10 +7,11 @@ describe 'multiple_actions::sequential' do
7
7
  end
8
8
 
9
9
  it 'executes both actions' do
10
- expect(chef_run).to start_service('resource')
10
+ expect(chef_run).to stop_service('foo').with(stop_command: 'bar')
11
+ expect(chef_run).to start_service('foo').with(start_command: 'baz')
11
12
  end
12
13
 
13
14
  it 'does not match other actions' do
14
- expect(chef_run).to_not disable_service('resource')
15
+ expect(chef_run).to_not disable_service('foo')
15
16
  end
16
17
  end
@@ -0,0 +1,7 @@
1
+ Feature: Testing an LWRP with inline resources
2
+ Background:
3
+ * I am using the "custom_resource" cookbook
4
+
5
+ Scenario: Running the specs
6
+ * I successfully run `rspec spec/default_spec.rb`
7
+ * the output should contain "0 failures"
@@ -9,3 +9,4 @@ Feature: The multiple_actions matcher
9
9
  | Matcher |
10
10
  | default |
11
11
  | sequential |
12
+ | reversed |
@@ -1,45 +1,31 @@
1
- # Override Chef LWRP creation to remove existing class to avoid redefinition warnings.
2
- class Chef
3
- class Provider
4
- class LWRPBase < Provider
5
- # 12.4 version of inline resources
6
- module InlineResources
1
+ # XXX: This monkeypatch is somewhat terrible and dumps all of the
2
+ # resources in the sub-resource collection into the main resource
3
+ # collection. Chefspec needs to be taught how to deal with
4
+ # sub-resource collections.
5
+
6
+ if defined?(Chef::Provider::InlineResources)
7
+ class Chef
8
+ class Provider
9
+ module InlineResources # ~> 12.5
10
+ def initialize(resource, run_context)
11
+ super
12
+ @run_context = run_context
13
+ @resource_collection = run_context.resource_collection
14
+ end
15
+
7
16
  module ClassMethods
8
- #
9
- # For LWRPs that call +use_inline_resources+, do not create another
10
- # +resource_collection+ so that everything is added to the parent
11
- # +resource_collection+.
12
- #
13
- # @param [String] name
14
- #
15
- # @override Chef::Provider::LWRPBase::InlineResources::ClassMethods#action
16
- #
17
17
  def action(name, &block)
18
18
  define_method("action_#{name}", &block)
19
19
  end
20
20
  end
21
21
  end
22
22
  end
23
-
24
- # 12.5 version of inline resources
25
- module InlineResources
26
- #
27
- # For LWRPs that call +use_inline_resources+, do not create another
28
- # +resource_collection+ so that everything is added to the parent
29
- # +resource_collection+.
30
- #
31
- # @param [String] name
32
- #
33
- def initialize(resource, run_context)
34
- super
35
- @run_context = run_context
36
- @resource_collection = run_context.resource_collection
37
- end
38
-
39
- module ClassMethods
40
- def action(name, &block)
41
- define_method("action_#{name}", &block)
42
- end
23
+ end
24
+ else # >= 13.0
25
+ class Chef
26
+ class Provider
27
+ def self.action(name, &block)
28
+ define_method("action_#{name}", &block)
43
29
  end
44
30
  end
45
31
  end
@@ -39,7 +39,7 @@ module ChefSpec::Matchers
39
39
  end
40
40
 
41
41
  def description
42
- %Q{#{@expected_action} #{@resource_name} "#{@expected_identity}"}
42
+ %Q{#{@expected_actioe} #{@resource_name} "#{@expected_identity}"}
43
43
  end
44
44
 
45
45
  def matches?(runner)
@@ -47,42 +47,35 @@ module ChefSpec::Matchers
47
47
 
48
48
  if resource
49
49
  ChefSpec::Coverage.cover!(resource)
50
- resource.performed_action?(@expected_action) && unmatched_parameters.empty? && correct_phase?
51
- else
52
- false
50
+ unmatched_parameters.empty? && correct_phase?
53
51
  end
54
52
  end
55
53
 
56
54
  def failure_message
57
55
  if resource
58
- if resource.performed_action?(@expected_action)
59
- if unmatched_parameters.empty?
60
- if @compile_time
61
- %Q{expected "#{resource.to_s}" to be run at compile time}
62
- else
63
- %Q{expected "#{resource.to_s}" to be run at converge time}
64
- end
56
+ if unmatched_parameters.empty?
57
+ if @compile_time
58
+ %Q{expected "#{resource.to_s}" to be run at compile time}
65
59
  else
66
- message = %Q{expected "#{resource.to_s}" to have parameters:} \
67
- "\n\n" \
68
- " " + unmatched_parameters.collect { |parameter, h|
69
- msg = "#{parameter} #{h[:expected].inspect}, was #{h[:actual].inspect}"
70
- diff = ::RSpec::Matchers::ExpectedsForMultipleDiffs.from(h[:expected]) \
71
- .message_with_diff(message, ::RSpec::Expectations::differ, h[:actual])
72
- msg += diff if diff
73
- msg
74
- }.join("\n ")
60
+ %Q{expected "#{resource.to_s}" to be run at converge time}
75
61
  end
76
62
  else
77
- %Q{expected "#{resource.to_s}" actions #{resource.performed_actions.inspect}} \
78
- " to include :#{@expected_action}"
63
+ message = %Q{expected "#{resource.to_s}" to have parameters:} \
64
+ "\n\n" \
65
+ " " + unmatched_parameters.collect { |parameter, h|
66
+ msg = "#{parameter} #{h[:expected].inspect}, was #{h[:actual].inspect}"
67
+ diff = ::RSpec::Matchers::ExpectedsForMultipleDiffs.from(h[:expected]) \
68
+ .message_with_diff(message, ::RSpec::Expectations::differ, h[:actual])
69
+ msg += diff if diff
70
+ msg
71
+ }.join("\n ")
79
72
  end
80
73
  else
81
74
  %Q{expected "#{@resource_name}[#{@expected_identity}]"} \
82
- " with action :#{@expected_action} to be in Chef run." \
83
- " Other #{@resource_name} resources:" \
84
- "\n\n" \
85
- " " + similar_resources.map(&:to_s).join("\n ") + "\n "
75
+ " with action :#{@expected_action} to be in Chef run." \
76
+ " Other #{@resource_name} resources:" \
77
+ "\n\n" \
78
+ " " + similar_resources.map(&:to_s).join("\n ") + "\n "
86
79
  end
87
80
  end
88
81
 
@@ -165,7 +158,7 @@ module ChefSpec::Matchers
165
158
  # @return [Chef::Resource, nil]
166
159
  #
167
160
  def resource
168
- @_resource ||= @runner.find_resource(@resource_name, @expected_identity)
161
+ @_resource ||= @runner.find_resource(@resource_name, @expected_identity, @expected_action)
169
162
  end
170
163
 
171
164
  #
@@ -64,8 +64,11 @@ module ChefSpec
64
64
  data = get('#{key}', name)
65
65
  json = JSON.parse(data)
66
66
 
67
- if #{klass}.respond_to?(:json_create)
67
+ case
68
+ when #{klass}.respond_to?(:json_create)
68
69
  #{klass}.json_create(json)
70
+ when #{klass}.respond_to?(:from_hash)
71
+ #{klass}.from_hash(json)
69
72
  else
70
73
  #{klass}.new(json)
71
74
  end
@@ -156,7 +156,9 @@ module ChefSpec
156
156
  end
157
157
 
158
158
  #
159
- # Find the resource with the declared type and resource name.
159
+ # Find the resource with the declared type and resource name, and optionally match a performed action.
160
+ #
161
+ # If multiples match it returns the last (which more or less matches the chef last-inserter-wins semantics)
160
162
  #
161
163
  # @example Find a template at `/etc/foo`
162
164
  # chef_run.find_resource(:template, '/etc/foo') #=> #<Chef::Resource::Template>
@@ -167,17 +169,15 @@ module ChefSpec
167
169
  # or `directory`.
168
170
  # @param [String, Regexp] name
169
171
  # The value of the name attribute or identity attribute for the resource.
172
+ # @param [Symbol] action
173
+ # (optional) match only resources that performed the action.
170
174
  #
171
175
  # @return [Chef::Resource, nil]
172
176
  # The matching resource, or nil if one is not found
173
177
  #
174
- def find_resource(type, name)
175
- begin
176
- return resource_collection.lookup("#{type}[#{name}]")
177
- rescue Chef::Exceptions::ResourceNotFound; end
178
-
179
- resource_collection.all_resources.find do |resource|
180
- resource_name(resource) == type && (name === resource.identity || name === resource.name)
178
+ def find_resource(type, name, action = nil)
179
+ resource_collection.all_resources.reverse_each.find do |resource|
180
+ resource.declared_type == type.to_sym && (name === resource.identity || name === resource.name) && (action.nil? || resource.performed_action?(action))
181
181
  end
182
182
  end
183
183
 
@@ -1,3 +1,3 @@
1
1
  module ChefSpec
2
- VERSION = '6.2.0'
2
+ VERSION = '7.0.0'
3
3
  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: 6.2.0
4
+ version: 7.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: 2017-03-27 00:00:00.000000000 Z
12
+ date: 2017-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -17,34 +17,34 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '12.0'
20
+ version: 12.14.89
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: '12.0'
27
+ version: 12.14.89
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: fauxhai
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '3.6'
34
+ version: '4'
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: '5'
37
+ version: '6'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: '3.6'
44
+ version: '4'
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '5'
47
+ version: '6'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -209,6 +209,10 @@ files:
209
209
  - examples/custom_matcher/resources/thing.rb
210
210
  - examples/custom_matcher/spec/install_spec.rb
211
211
  - examples/custom_matcher/spec/remove_spec.rb
212
+ - examples/custom_resource/libraries/matchers.rb
213
+ - examples/custom_resource/recipes/default.rb
214
+ - examples/custom_resource/resources/custom_resource.rb
215
+ - examples/custom_resource/spec/default_spec.rb
212
216
  - examples/deploy/recipes/deploy.rb
213
217
  - examples/deploy/recipes/force_deploy.rb
214
218
  - examples/deploy/recipes/rollback.rb
@@ -239,14 +243,6 @@ files:
239
243
  - examples/dsc_resource/spec/run_spec.rb
240
244
  - examples/dsc_script/recipes/run.rb
241
245
  - examples/dsc_script/spec/run_spec.rb
242
- - examples/easy_install_package/recipes/install.rb
243
- - examples/easy_install_package/recipes/purge.rb
244
- - examples/easy_install_package/recipes/remove.rb
245
- - examples/easy_install_package/recipes/upgrade.rb
246
- - examples/easy_install_package/spec/install_spec.rb
247
- - examples/easy_install_package/spec/purge_spec.rb
248
- - examples/easy_install_package/spec/remove_spec.rb
249
- - examples/easy_install_package/spec/upgrade_spec.rb
250
246
  - examples/env/recipes/create.rb
251
247
  - examples/env/recipes/delete.rb
252
248
  - examples/env/recipes/modify.rb
@@ -390,8 +386,10 @@ files:
390
386
  - examples/msu_package/spec/install_spec.rb
391
387
  - examples/msu_package/spec/remove_spec.rb
392
388
  - examples/multiple_actions/recipes/default.rb
389
+ - examples/multiple_actions/recipes/reversed.rb
393
390
  - examples/multiple_actions/recipes/sequential.rb
394
391
  - examples/multiple_actions/spec/default_spec.rb
392
+ - examples/multiple_actions/spec/reversed_spec.rb
395
393
  - examples/multiple_actions/spec/sequential_spec.rb
396
394
  - examples/multiple_run_action/recipes/default.rb
397
395
  - examples/multiple_run_action/spec/default_spec.rb
@@ -711,6 +709,7 @@ files:
711
709
  - features/cookbook_file.feature
712
710
  - features/cron.feature
713
711
  - features/custom_matcher.feature
712
+ - features/custom_resource.feature
714
713
  - features/deploy.feature
715
714
  - features/directory.feature
716
715
  - features/dnf_package.feature
@@ -718,7 +717,6 @@ files:
718
717
  - features/dpkg_package.feature
719
718
  - features/dsc_resource.feature
720
719
  - features/dsc_script.feature
721
- - features/easy_install_package.feature
722
720
  - features/env.feature
723
721
  - features/erl_call.feature
724
722
  - features/execute.feature
@@ -792,7 +790,6 @@ files:
792
790
  - features/yum_package.feature
793
791
  - features/yum_repository.feature
794
792
  - features/zypper_package.feature
795
- - gemfiles/chefspec.gemfile
796
793
  - lib/chefspec.rb
797
794
  - lib/chefspec/api.rb
798
795
  - lib/chefspec/api/apt_package.rb
@@ -994,6 +991,7 @@ test_files:
994
991
  - features/cookbook_file.feature
995
992
  - features/cron.feature
996
993
  - features/custom_matcher.feature
994
+ - features/custom_resource.feature
997
995
  - features/deploy.feature
998
996
  - features/directory.feature
999
997
  - features/dnf_package.feature
@@ -1001,7 +999,6 @@ test_files:
1001
999
  - features/dpkg_package.feature
1002
1000
  - features/dsc_resource.feature
1003
1001
  - features/dsc_script.feature
1004
- - features/easy_install_package.feature
1005
1002
  - features/env.feature
1006
1003
  - features/erl_call.feature
1007
1004
  - features/execute.feature
@@ -1,13 +0,0 @@
1
- easy_install_package 'default_action'
2
-
3
- easy_install_package 'explicit_action' do
4
- action :install
5
- end
6
-
7
- easy_install_package 'with_attributes' do
8
- version '1.0.0'
9
- end
10
-
11
- easy_install_package 'specifying the identity attribute' do
12
- package_name 'identity_attribute'
13
- end
@@ -1,13 +0,0 @@
1
- easy_install_package 'explicit_action' do
2
- action :purge
3
- end
4
-
5
- easy_install_package 'with_attributes' do
6
- version '1.0.0'
7
- action :purge
8
- end
9
-
10
- easy_install_package 'specifying the identity attribute' do
11
- package_name 'identity_attribute'
12
- action :purge
13
- end
@@ -1,13 +0,0 @@
1
- easy_install_package 'explicit_action' do
2
- action :remove
3
- end
4
-
5
- easy_install_package 'with_attributes' do
6
- version '1.0.0'
7
- action :remove
8
- end
9
-
10
- easy_install_package 'specifying the identity attribute' do
11
- package_name 'identity_attribute'
12
- action :remove
13
- end
@@ -1,13 +0,0 @@
1
- easy_install_package 'explicit_action' do
2
- action :upgrade
3
- end
4
-
5
- easy_install_package 'with_attributes' do
6
- version '1.0.0'
7
- action :upgrade
8
- end
9
-
10
- easy_install_package 'specifying the identity attribute' do
11
- package_name 'identity_attribute'
12
- action :upgrade
13
- end
@@ -1,23 +0,0 @@
1
- require 'chefspec'
2
-
3
- describe 'easy_install_package::install' do
4
- let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
-
6
- it 'installs a easy_install_package with the default action' do
7
- expect(chef_run).to install_easy_install_package('default_action')
8
- expect(chef_run).to_not install_easy_install_package('not_default_action')
9
- end
10
-
11
- it 'installs a easy_install_package with an explicit action' do
12
- expect(chef_run).to install_easy_install_package('explicit_action')
13
- end
14
-
15
- it 'installs a easy_install_package with attributes' do
16
- expect(chef_run).to install_easy_install_package('with_attributes').with(version: '1.0.0')
17
- expect(chef_run).to_not install_easy_install_package('with_attributes').with(version: '1.2.3')
18
- end
19
-
20
- it 'installs a easy_install_package when specifying the identity attribute' do
21
- expect(chef_run).to install_easy_install_package('identity_attribute')
22
- end
23
- end
@@ -1,19 +0,0 @@
1
- require 'chefspec'
2
-
3
- describe 'easy_install_package::purge' do
4
- let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
-
6
- it 'purges a easy_install_package with an explicit action' do
7
- expect(chef_run).to purge_easy_install_package('explicit_action')
8
- expect(chef_run).to_not purge_easy_install_package('not_explicit_action')
9
- end
10
-
11
- it 'purges a easy_install_package with attributes' do
12
- expect(chef_run).to purge_easy_install_package('with_attributes').with(version: '1.0.0')
13
- expect(chef_run).to_not purge_easy_install_package('with_attributes').with(version: '1.2.3')
14
- end
15
-
16
- it 'purges a easy_install_package when specifying the identity attribute' do
17
- expect(chef_run).to purge_easy_install_package('identity_attribute')
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- require 'chefspec'
2
-
3
- describe 'easy_install_package::remove' do
4
- let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
-
6
- it 'removes a easy_install_package with an explicit action' do
7
- expect(chef_run).to remove_easy_install_package('explicit_action')
8
- expect(chef_run).to_not remove_easy_install_package('not_explicit_action')
9
- end
10
-
11
- it 'removes a easy_install_package with attributes' do
12
- expect(chef_run).to remove_easy_install_package('with_attributes').with(version: '1.0.0')
13
- expect(chef_run).to_not remove_easy_install_package('with_attributes').with(version: '1.2.3')
14
- end
15
-
16
- it 'removes a easy_install_package when specifying the identity attribute' do
17
- expect(chef_run).to remove_easy_install_package('identity_attribute')
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- require 'chefspec'
2
-
3
- describe 'easy_install_package::upgrade' do
4
- let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
-
6
- it 'upgrades a easy_install_package with an explicit action' do
7
- expect(chef_run).to upgrade_easy_install_package('explicit_action')
8
- expect(chef_run).to_not upgrade_easy_install_package('not_explicit_action')
9
- end
10
-
11
- it 'upgrades a easy_install_package with attributes' do
12
- expect(chef_run).to upgrade_easy_install_package('with_attributes').with(version: '1.0.0')
13
- expect(chef_run).to_not upgrade_easy_install_package('with_attributes').with(version: '1.2.3')
14
- end
15
-
16
- it 'upgrades a easy_install_package when specifying the identity attribute' do
17
- expect(chef_run).to upgrade_easy_install_package('identity_attribute')
18
- end
19
- end
@@ -1,13 +0,0 @@
1
- Feature: The easy_install_package matcher
2
- Background:
3
- * I am using the "easy_install_package" cookbook
4
-
5
- Scenario Outline: Running specs
6
- * I successfully run `rspec spec/<Matcher>_spec.rb`
7
- * the output should contain "0 failures"
8
- Examples:
9
- | Matcher |
10
- | install |
11
- | purge |
12
- | remove |
13
- | upgrade |
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- if ENV['CHEF_VERSION'] == 'master'
4
- gem 'chef', github: 'chef/chef'
5
- else
6
- gem 'chef', ENV['CHEF_VERSION']
7
- end
8
-
9
- gemspec path: '..'