chefspec 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chefspec.rb +1 -0
- data/lib/chefspec/chef_runner.rb +9 -1
- data/lib/chefspec/matchers/file.rb +2 -1
- data/lib/chefspec/matchers/link.rb +14 -0
- data/lib/chefspec/matchers/service.rb +1 -1
- data/lib/chefspec/version.rb +1 -1
- metadata +68 -78
data/lib/chefspec.rb
CHANGED
@@ -4,6 +4,7 @@ require 'chefspec/chef_runner'
|
|
4
4
|
require 'chefspec/version'
|
5
5
|
require 'chefspec/matchers/execute'
|
6
6
|
require 'chefspec/matchers/file'
|
7
|
+
require 'chefspec/matchers/link'
|
7
8
|
require 'chefspec/matchers/log'
|
8
9
|
require 'chefspec/matchers/package'
|
9
10
|
require 'chefspec/matchers/service'
|
data/lib/chefspec/chef_runner.rb
CHANGED
@@ -126,6 +126,14 @@ module ChefSpec
|
|
126
126
|
find_resource('template', path)
|
127
127
|
end
|
128
128
|
|
129
|
+
# Find any link declared with the given target_file
|
130
|
+
#
|
131
|
+
# @param [String] target_file The link's target_file
|
132
|
+
# @return [Chef::Resource::Directory] The matching link, or Nil
|
133
|
+
def link(target_file)
|
134
|
+
find_resource('link', target_file)
|
135
|
+
end
|
136
|
+
|
129
137
|
# This runner as a string.
|
130
138
|
#
|
131
139
|
# @return [String] Currently includes the run_list. Format of the string may change between versions of this gem.
|
@@ -143,7 +151,7 @@ module ChefSpec
|
|
143
151
|
# @param [Ohai::System] ohai The ohai instance to set fake attributes on
|
144
152
|
def fake_ohai(ohai)
|
145
153
|
{:os => 'chefspec', :os_version => ChefSpec::VERSION, :fqdn => 'chefspec.local', :domain => 'local',
|
146
|
-
:ipaddress => '127.0.0.1', :hostname => 'chefspec',
|
154
|
+
:ipaddress => '127.0.0.1', :hostname => 'chefspec', :languages => Mash.new({"ruby" => "/usr/somewhere"}),
|
147
155
|
:kernel => Mash.new({:machine => 'i386'})}.each_pair do |attribute,value|
|
148
156
|
ohai[attribute] = value
|
149
157
|
end
|
@@ -4,6 +4,7 @@ module ChefSpec
|
|
4
4
|
module Matchers
|
5
5
|
|
6
6
|
define_resource_matchers([:create, :delete], [:file, :directory, :cookbook_file], :path)
|
7
|
+
define_resource_matchers([:create], [:remote_file], :path)
|
7
8
|
|
8
9
|
RSpec::Matchers.define :be_owned_by do |user, group|
|
9
10
|
match do |file|
|
@@ -11,4 +12,4 @@ module ChefSpec
|
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
14
|
-
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'chefspec/matchers/shared'
|
2
|
+
|
3
|
+
module ChefSpec
|
4
|
+
module Matchers
|
5
|
+
|
6
|
+
define_resource_matchers([:create, :delete], [:link], :target_file)
|
7
|
+
|
8
|
+
RSpec::Matchers.define :link_to do |path|
|
9
|
+
match do |link|
|
10
|
+
link.nil? ? false : link.to == path
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -3,7 +3,7 @@ require 'chefspec/matchers/shared'
|
|
3
3
|
module ChefSpec
|
4
4
|
module Matchers
|
5
5
|
|
6
|
-
define_resource_matchers([:start, :stop, :restart, :reload], [:service], :service_name)
|
6
|
+
define_resource_matchers([:start, :stop, :restart, :reload, :nothing, :enable], [:service], :service_name)
|
7
7
|
|
8
8
|
RSpec::Matchers.define :set_service_to_start_on_boot do |service|
|
9
9
|
match do |chef_run|
|
data/lib/chefspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,89 +1,82 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: chefspec
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 0
|
10
|
-
version: 0.5.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Andrew Crump
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
date: 2012-05-30 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: chef
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
22
17
|
none: false
|
23
|
-
requirements:
|
24
|
-
- -
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 35
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
- 9
|
30
|
-
- 12
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
31
21
|
version: 0.9.12
|
32
22
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
|
35
|
-
segments:
|
36
|
-
- 0
|
37
|
-
- 10
|
38
|
-
version: "0.10"
|
39
|
-
requirement: *id001
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '0.10'
|
40
25
|
type: :runtime
|
41
26
|
prerelease: false
|
42
|
-
|
43
|
-
|
44
|
-
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.9.12
|
33
|
+
- - ~>
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0.10'
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: erubis
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
45
39
|
none: false
|
46
|
-
requirements:
|
47
|
-
- -
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
|
50
|
-
segments:
|
51
|
-
- 0
|
52
|
-
version: "0"
|
53
|
-
requirement: *id002
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
54
44
|
type: :runtime
|
55
45
|
prerelease: false
|
56
|
-
|
57
|
-
|
58
|
-
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: rspec
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
59
55
|
none: false
|
60
|
-
requirements:
|
56
|
+
requirements:
|
61
57
|
- - ~>
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
|
64
|
-
segments:
|
65
|
-
- 2
|
66
|
-
- 8
|
67
|
-
- 0
|
68
|
-
version: 2.8.0
|
69
|
-
requirement: *id003
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 2.10.0
|
70
60
|
type: :runtime
|
71
61
|
prerelease: false
|
72
|
-
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 2.10.0
|
73
68
|
description: Write RSpec examples for Opscode Chef recipes
|
74
69
|
email:
|
75
70
|
executables: []
|
76
|
-
|
77
71
|
extensions: []
|
78
|
-
|
79
72
|
extra_rdoc_files: []
|
80
|
-
|
81
|
-
files:
|
73
|
+
files:
|
82
74
|
- lib/chef/knife/cookbook_create_specs.rb
|
83
75
|
- lib/chefspec/chef_runner.rb
|
84
76
|
- lib/chefspec/matchers/execute.rb
|
85
77
|
- lib/chefspec/matchers/file.rb
|
86
78
|
- lib/chefspec/matchers/file_content.rb
|
79
|
+
- lib/chefspec/matchers/link.rb
|
87
80
|
- lib/chefspec/matchers/log.rb
|
88
81
|
- lib/chefspec/matchers/package.rb
|
89
82
|
- lib/chefspec/matchers/service.rb
|
@@ -93,38 +86,35 @@ files:
|
|
93
86
|
- lib/chefspec/version.rb
|
94
87
|
- lib/chefspec.rb
|
95
88
|
homepage: http://acrmp.github.com/chefspec
|
96
|
-
licenses:
|
89
|
+
licenses:
|
97
90
|
- MIT
|
98
91
|
post_install_message:
|
99
92
|
rdoc_options: []
|
100
|
-
|
101
|
-
require_paths:
|
93
|
+
require_paths:
|
102
94
|
- lib
|
103
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
96
|
none: false
|
105
|
-
requirements:
|
106
|
-
- -
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
|
109
|
-
segments:
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
segments:
|
110
102
|
- 0
|
111
|
-
|
112
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
hash: 2386870567278883429
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
105
|
none: false
|
114
|
-
requirements:
|
115
|
-
- -
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
118
|
-
segments:
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
segments:
|
119
111
|
- 0
|
120
|
-
|
112
|
+
hash: 2386870567278883429
|
121
113
|
requirements: []
|
122
|
-
|
123
114
|
rubyforge_project:
|
124
|
-
rubygems_version: 1.8.
|
115
|
+
rubygems_version: 1.8.19
|
125
116
|
signing_key:
|
126
117
|
specification_version: 3
|
127
|
-
summary: chefspec-0.
|
118
|
+
summary: chefspec-0.6.0
|
128
119
|
test_files: []
|
129
|
-
|
130
120
|
has_rdoc:
|