serverspec 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serverspec/commands/base.rb +3 -3
- data/lib/serverspec/commands/debian.rb +5 -1
- data/lib/serverspec/commands/redhat.rb +1 -1
- data/lib/serverspec/version.rb +1 -1
- data/serverspec.gemspec +1 -1
- data/spec/debian/package_spec.rb +9 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 474f5248cc40037fdd84c1bf78442a634deec8c7
|
4
|
+
data.tar.gz: 0cfa035a3b82be9b37ce21cc88582cec8c4c817c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09319d6728e2139736dc24bdc2f34b7d3de39e726b04c93c039d35869e5705fdba04cb719b85e4f8eb7eb76235a3c3616c2cca37f0c0dfdf998979eb355ba52c
|
7
|
+
data.tar.gz: 077f9ccbe971a224726156d74ae2b0253946944e3f72b7a536c6a49e4324996f55a6656cb83012b3c0192e6d5f4f9ed90ed2983720bd9455a265371b1d0417f6
|
@@ -165,20 +165,20 @@ module Serverspec
|
|
165
165
|
def check_installed_by_gem(name, version=nil)
|
166
166
|
regexp = "^#{name}"
|
167
167
|
cmd = "gem list --local | grep -w -- #{escape(regexp)}"
|
168
|
-
cmd = "#{cmd} | grep -w -- #{escape(version)}"
|
168
|
+
cmd = "#{cmd} | grep -w -- #{escape(version)}" if version
|
169
169
|
cmd
|
170
170
|
end
|
171
171
|
|
172
172
|
def check_installed_by_npm(name, version=nil)
|
173
173
|
cmd = "npm ls #{escape(name)} -g"
|
174
|
-
cmd = "#{cmd} | grep -w -- #{escape(version)}"
|
174
|
+
cmd = "#{cmd} | grep -w -- #{escape(version)}" if version
|
175
175
|
cmd
|
176
176
|
end
|
177
177
|
|
178
178
|
def check_installed_by_pecl(name, version=nil)
|
179
179
|
regexp = "^#{name}"
|
180
180
|
cmd = "pecl list | grep -w -- #{escape(regexp)}"
|
181
|
-
cmd = "#{cmd} | grep -w -- #{escape(version)}"
|
181
|
+
cmd = "#{cmd} | grep -w -- #{escape(version)}" if version
|
182
182
|
cmd
|
183
183
|
end
|
184
184
|
|
@@ -8,7 +8,11 @@ module Serverspec
|
|
8
8
|
|
9
9
|
def check_installed(package, version=nil)
|
10
10
|
escaped_package = escape(package)
|
11
|
-
"dpkg -s #{escaped_package} && ! dpkg -s #{escaped_package} | grep -E '^Status: .+ not-installed$'"
|
11
|
+
cmd = "dpkg -s #{escaped_package} && ! dpkg -s #{escaped_package} | grep -E '^Status: .+ not-installed$'"
|
12
|
+
if version
|
13
|
+
cmd = "#{cmd} && dpkg -s #{escaped_package} | grep -E '^Version: #{escape(version)}$'"
|
14
|
+
end
|
15
|
+
cmd
|
12
16
|
end
|
13
17
|
|
14
18
|
def check_running(service)
|
data/lib/serverspec/version.rb
CHANGED
data/serverspec.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "net-ssh"
|
22
|
-
spec.add_runtime_dependency "rspec", "
|
22
|
+
spec.add_runtime_dependency "rspec", ">= 2.13.0"
|
23
23
|
spec.add_runtime_dependency "highline"
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
25
|
spec.add_development_dependency "rake"
|
data/spec/debian/package_spec.rb
CHANGED
@@ -11,6 +11,15 @@ describe package('invalid-package') do
|
|
11
11
|
it { should_not be_installed }
|
12
12
|
end
|
13
13
|
|
14
|
+
describe package('apache2') do
|
15
|
+
it { should be_installed.with_version('1.1.1') }
|
16
|
+
its(:command) { should eq "dpkg -s apache2 && ! dpkg -s apache2 | grep -E '^Status: .+ not-installed$' && dpkg -s apache2 | grep -E '^Version: 1.1.1$'" }
|
17
|
+
end
|
18
|
+
|
19
|
+
describe package('invalid-package') do
|
20
|
+
it { should_not be_installed.with_version('invalid-version') }
|
21
|
+
end
|
22
|
+
|
14
23
|
describe package('jekyll') do
|
15
24
|
it { should be_installed.by('gem') }
|
16
25
|
its(:command) { should eq "gem list --local | grep -w -- \\^jekyll" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.13.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.13.0
|
41
41
|
- !ruby/object:Gem::Dependency
|