chefspec 5.1.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/examples/yum_repository/recipes/add.rb +8 -0
- data/examples/yum_repository/recipes/delete.rb +3 -0
- data/examples/yum_repository/recipes/remove.rb +4 -0
- data/examples/yum_repository/spec/add_spec.rb +12 -0
- data/examples/yum_repository/spec/create_spec.rb +1 -1
- data/examples/yum_repository/spec/delete_spec.rb +12 -0
- data/examples/yum_repository/spec/remove_spec.rb +1 -1
- data/features/yum_repository.feature +2 -0
- data/lib/chefspec/api/yum_repository.rb +51 -1
- data/lib/chefspec/version.rb +1 -1
- 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: ee4f05ff2e8da02d4e67edcd08e3cb308bf275f0
|
4
|
+
data.tar.gz: 8261a3465db6774d5b5d3c5b114e3517811f4047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 019fc9c25a49e7e890446119b3aed4856699be9d78138dcafadee05a85703037f884d078a9f3b00d60ce64683e48f23423f7fb4eecdd9236fce2b918e16a1aba
|
7
|
+
data.tar.gz: 98c4a810505d55a203c59b055ec3e81883abe8925e0d98a87d3df4be326d1ce4b6ce340fe76832a6d063945e1a3b985674fe8f57aafce77c0baf2ea985394362
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'chefspec'
|
2
|
+
|
3
|
+
describe 'yum_repository::add' do
|
4
|
+
let(:chef_run) do
|
5
|
+
ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
|
6
|
+
.converge(described_recipe)
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'creates a yum_repository with add action' do
|
10
|
+
expect(chef_run).to add_yum_repository('explicit_add_action')
|
11
|
+
end
|
12
|
+
end
|
@@ -11,7 +11,7 @@ describe 'yum_repository::create' do
|
|
11
11
|
expect(chef_run).to_not create_yum_repository('not_default_action')
|
12
12
|
end
|
13
13
|
|
14
|
-
it 'creates a yum_repository with
|
14
|
+
it 'creates a yum_repository with create action' do
|
15
15
|
expect(chef_run).to create_yum_repository('explicit_action')
|
16
16
|
end
|
17
17
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'chefspec'
|
2
|
+
|
3
|
+
describe 'yum_repository::delete' do
|
4
|
+
let(:chef_run) do
|
5
|
+
ChefSpec::ServerRunner.new(platform: 'centos', version: '7.2.1511')
|
6
|
+
.converge(described_recipe)
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'removes a yum_repository with delete action' do
|
10
|
+
expect(chef_run).to delete_yum_repository('explicit_delete_action')
|
11
|
+
end
|
12
|
+
end
|
@@ -6,7 +6,7 @@ describe 'yum_repository::remove' do
|
|
6
6
|
.converge(described_recipe)
|
7
7
|
end
|
8
8
|
|
9
|
-
it 'removes a yum_repository with
|
9
|
+
it 'removes a yum_repository with remove action' do
|
10
10
|
expect(chef_run).to remove_yum_repository('explicit_remove_action')
|
11
11
|
end
|
12
12
|
end
|
@@ -5,7 +5,7 @@ module ChefSpec::API
|
|
5
5
|
|
6
6
|
#
|
7
7
|
# Assert that a +yum_repository+ resource exists in the Chef run with the
|
8
|
-
# action +:create+. Given a Chef Recipe that
|
8
|
+
# action +:create+. Given a Chef Recipe that creates "epel" as an
|
9
9
|
# +yum_repository+:
|
10
10
|
#
|
11
11
|
# yum_repository 'epel' do
|
@@ -29,6 +29,56 @@ module ChefSpec::API
|
|
29
29
|
resource_name)
|
30
30
|
end
|
31
31
|
|
32
|
+
#
|
33
|
+
# Assert that a +yum_repository+ resource exists in the Chef run with the
|
34
|
+
# action +:add+. Given a Chef Recipe that adds "epel" as an
|
35
|
+
# +yum_repository+:
|
36
|
+
#
|
37
|
+
# yum_repository 'epel' do
|
38
|
+
# baseurl "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-#{node['platform_version'].to_i}&arch=$basearch"
|
39
|
+
# description 'Extra Packages for $releasever - $basearch'
|
40
|
+
# action :add
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# The Examples section demonstrates the different ways to test an
|
44
|
+
# +yum_repository+ resource with ChefSpec.
|
45
|
+
#
|
46
|
+
# @example Assert that an +yum_repository+ was added
|
47
|
+
# expect(chef_run).to add_yum_repository('epel')
|
48
|
+
# @param [String, Regex] resource_name
|
49
|
+
# the name of the resource to match
|
50
|
+
#
|
51
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
52
|
+
|
53
|
+
def add_yum_repository(resource_name)
|
54
|
+
ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :add,
|
55
|
+
resource_name)
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Assert that a +yum_repository+ resource exists in the Chef run with the
|
60
|
+
# action +:delete+. Given a Chef Recipe that deletes "epel" as an
|
61
|
+
# +yum_repository+:
|
62
|
+
#
|
63
|
+
# yum_repository 'epel' do
|
64
|
+
# action :delete
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# The Examples section demonstrates the different ways to test an
|
68
|
+
# +yum_repository+ resource with ChefSpec.
|
69
|
+
#
|
70
|
+
# @example Assert that an +yum_repository+ was deleted
|
71
|
+
# expect(chef_run).to delete_yum_repository('epel')
|
72
|
+
# @param [String, Regex] resource_name
|
73
|
+
# the name of the resource to match
|
74
|
+
#
|
75
|
+
# @return [ChefSpec::Matchers::ResourceMatcher]
|
76
|
+
|
77
|
+
def delete_yum_repository(resource_name)
|
78
|
+
ChefSpec::Matchers::ResourceMatcher.new(:yum_repository, :delete,
|
79
|
+
resource_name)
|
80
|
+
end
|
81
|
+
|
32
82
|
#
|
33
83
|
# Assert that a +yum_repository+ resource exists in the Chef run with the
|
34
84
|
# action +:remove+. Given a Chef Recipe that removes "epel" as an
|
data/lib/chefspec/version.rb
CHANGED
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: 5.1.
|
4
|
+
version: 5.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: 2016-09-
|
12
|
+
date: 2016-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -578,10 +578,14 @@ files:
|
|
578
578
|
- examples/yum_package/spec/purge_spec.rb
|
579
579
|
- examples/yum_package/spec/remove_spec.rb
|
580
580
|
- examples/yum_package/spec/upgrade_spec.rb
|
581
|
+
- examples/yum_repository/recipes/add.rb
|
581
582
|
- examples/yum_repository/recipes/create.rb
|
583
|
+
- examples/yum_repository/recipes/delete.rb
|
582
584
|
- examples/yum_repository/recipes/make_cache.rb
|
583
585
|
- examples/yum_repository/recipes/remove.rb
|
586
|
+
- examples/yum_repository/spec/add_spec.rb
|
584
587
|
- examples/yum_repository/spec/create_spec.rb
|
588
|
+
- examples/yum_repository/spec/delete_spec.rb
|
585
589
|
- examples/yum_repository/spec/make_cache_spec.rb
|
586
590
|
- examples/yum_repository/spec/remove_spec.rb
|
587
591
|
- features/apt_package.feature
|