chefspec 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chefspec/coverage.rb +12 -3
- data/lib/chefspec/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed014e65ab7679c297ff2c9ba74f55ba32c0f073
|
4
|
+
data.tar.gz: 26e8d01c3cf74991bfaaa9bc78f473a143ee5fee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 487d73acc66883931474cc2ed0614b84b892b6e22cb1ad340d118aae007744c519962d6661a4086aa6761eec88f282e31adb2bb8a5ef7d82b2bf329b8ad2ae92
|
7
|
+
data.tar.gz: 951cd1b4af13bf3732c624f403771abeb909f0f89b7974db975149c23e5d861f2ddb6a0740b83ea2b4b40a084250a64dc2531c810eab6087590ead8349a3c0f4
|
data/lib/chefspec/coverage.rb
CHANGED
@@ -19,12 +19,16 @@ module ChefSpec
|
|
19
19
|
end
|
20
20
|
|
21
21
|
#
|
22
|
-
# Add a resource to the resource collection.
|
22
|
+
# Add a resource to the resource collection. Only new resources are added
|
23
|
+
# and only resources that match the given filter are covered (which is *
|
24
|
+
# by default).
|
23
25
|
#
|
24
26
|
# @param [Chef::Resource] resource
|
25
27
|
#
|
26
28
|
def add(resource)
|
27
|
-
|
29
|
+
if !exists?(resource) && filtered?(resource)
|
30
|
+
@collection[resource.to_s] = ResourceWrapper.new(resource)
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
#
|
@@ -39,7 +43,8 @@ module ChefSpec
|
|
39
43
|
end
|
40
44
|
|
41
45
|
#
|
42
|
-
# Called to check if a resource belongs to a cookbook from the specified
|
46
|
+
# Called to check if a resource belongs to a cookbook from the specified
|
47
|
+
# directories.
|
43
48
|
#
|
44
49
|
# @param [Chef::Resource] resource
|
45
50
|
#
|
@@ -117,6 +122,10 @@ module ChefSpec
|
|
117
122
|
@collection[resource.to_s]
|
118
123
|
end
|
119
124
|
|
125
|
+
def exists?(resource)
|
126
|
+
!find(resource).nil?
|
127
|
+
end
|
128
|
+
|
120
129
|
class ResourceWrapper
|
121
130
|
attr_reader :resource
|
122
131
|
|
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: 3.1.
|
4
|
+
version: 3.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: 2013-12-
|
12
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -255,6 +255,6 @@ rubyforge_project:
|
|
255
255
|
rubygems_version: 2.2.0
|
256
256
|
signing_key:
|
257
257
|
specification_version: 4
|
258
|
-
summary: chefspec-3.1.
|
258
|
+
summary: chefspec-3.1.1
|
259
259
|
test_files: []
|
260
260
|
has_rdoc:
|