chefspec 1.0.0.rc1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chefspec/matchers/script.rb +21 -4
- data/lib/chefspec/monkey_patches/lwrp_base.rb +1 -1
- data/lib/chefspec/version.rb +1 -1
- metadata +18 -31
@@ -5,12 +5,29 @@ module ChefSpec
|
|
5
5
|
%w(bash csh perl python ruby).each do |interpreter|
|
6
6
|
RSpec::Matchers.define "execute_#{interpreter}_script".to_sym do |name|
|
7
7
|
match do |chef_run|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
if @attributes
|
9
|
+
chef_run.resources.any? do |resource|
|
10
|
+
(resource_type(resource) == interpreter ||
|
11
|
+
(resource_type(resource) == 'script' && resource.interpreter == interpreter)) &&
|
12
|
+
resource.name == name &&
|
13
|
+
expected_attributes?(resource)
|
14
|
+
end
|
15
|
+
else
|
16
|
+
chef_run.resources.any? do |resource|
|
17
|
+
(resource_type(resource) == interpreter ||
|
18
|
+
(resource_type(resource) == 'script' && resource.interpreter == interpreter)) &&
|
19
|
+
resource.name == name
|
20
|
+
end
|
12
21
|
end
|
13
22
|
end
|
23
|
+
|
24
|
+
chain :with do |attributes|
|
25
|
+
@attributes = attributes
|
26
|
+
end
|
27
|
+
|
28
|
+
def expected_attributes?(resource)
|
29
|
+
@attributes.all? { |k,v| v === resource.send(k) }
|
30
|
+
end
|
14
31
|
end
|
15
32
|
end
|
16
33
|
end
|
@@ -24,7 +24,7 @@ if Chef::VERSION >= '11.0.0'
|
|
24
24
|
#
|
25
25
|
# @param [String] class_name The class name. Must be a valid constant name.
|
26
26
|
def remove_existing_lwrp(class_name)
|
27
|
-
[Chef::Resource::LWRPBase, Chef::Provider::LWRPBase].each do |resource_holder|
|
27
|
+
[Chef::Resource::LWRPBase, Chef::Provider::LWRPBase, Chef::Resource, Chef::Provider].each do |resource_holder|
|
28
28
|
if RUBY_VERSION < '1.9'
|
29
29
|
if resource_holder.const_defined? class_name
|
30
30
|
resource_holder.send(:remove_const, class_name)
|
data/lib/chefspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chefspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrew Crump
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -64,7 +64,7 @@ dependencies:
|
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 0.6.0
|
70
70
|
type: :runtime
|
@@ -72,25 +72,9 @@ dependencies:
|
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: 0.6.0
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: moneta
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - <
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 0.7.0
|
86
|
-
type: :runtime
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - <
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 0.7.0
|
94
78
|
- !ruby/object:Gem::Dependency
|
95
79
|
name: rspec
|
96
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +82,7 @@ dependencies:
|
|
98
82
|
requirements:
|
99
83
|
- - ~>
|
100
84
|
- !ruby/object:Gem::Version
|
101
|
-
version: 2.
|
85
|
+
version: '2.0'
|
102
86
|
type: :runtime
|
103
87
|
prerelease: false
|
104
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,23 +90,23 @@ dependencies:
|
|
106
90
|
requirements:
|
107
91
|
- - ~>
|
108
92
|
- !ruby/object:Gem::Version
|
109
|
-
version: 2.
|
93
|
+
version: '2.0'
|
110
94
|
- !ruby/object:Gem::Dependency
|
111
95
|
name: rake
|
112
96
|
requirement: !ruby/object:Gem::Requirement
|
113
97
|
none: false
|
114
98
|
requirements:
|
115
|
-
- -
|
99
|
+
- - ! '>='
|
116
100
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0
|
101
|
+
version: '0'
|
118
102
|
type: :development
|
119
103
|
prerelease: false
|
120
104
|
version_requirements: !ruby/object:Gem::Requirement
|
121
105
|
none: false
|
122
106
|
requirements:
|
123
|
-
- -
|
107
|
+
- - ! '>='
|
124
108
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0
|
109
|
+
version: '0'
|
126
110
|
- !ruby/object:Gem::Dependency
|
127
111
|
name: yard
|
128
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,18 +232,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
248
232
|
version: '0'
|
249
233
|
segments:
|
250
234
|
- 0
|
251
|
-
hash:
|
235
|
+
hash: -3276455735612635198
|
252
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
253
237
|
none: false
|
254
238
|
requirements:
|
255
|
-
- - ! '
|
239
|
+
- - ! '>='
|
256
240
|
- !ruby/object:Gem::Version
|
257
|
-
version:
|
241
|
+
version: '0'
|
242
|
+
segments:
|
243
|
+
- 0
|
244
|
+
hash: -3276455735612635198
|
258
245
|
requirements: []
|
259
246
|
rubyforge_project:
|
260
247
|
rubygems_version: 1.8.23
|
261
248
|
signing_key:
|
262
249
|
specification_version: 3
|
263
|
-
summary: chefspec-1.0.0
|
250
|
+
summary: chefspec-1.0.0
|
264
251
|
test_files: []
|
265
252
|
has_rdoc:
|