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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81dfca1b27052f6fde88b707a39a88b9aa6b2f2d
4
- data.tar.gz: 89eb5ad29b3113ef22451c013a5160797551f74b
3
+ metadata.gz: 474f5248cc40037fdd84c1bf78442a634deec8c7
4
+ data.tar.gz: 0cfa035a3b82be9b37ce21cc88582cec8c4c817c
5
5
  SHA512:
6
- metadata.gz: 44674d6f99cacae928100c6abcb4101107721eb33ba53eea3b27c05d3d2889ed4cf37c3ceb383c4af163599b35f2e1bb4254b36a09fdc62d178e3a072100dce8
7
- data.tar.gz: bd01d518d19c6f06a32c454aac243e9a70b562526e0da8102a992f3dbb95bae4119d00dc7659cf9b6e179c922f9dc8f1aaf6f862c8ec666d068b70a0439a85ab
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)}" unless version.nil?
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)}" unless version.nil?
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)}" unless version.nil?
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)
@@ -20,7 +20,7 @@ module Serverspec
20
20
 
21
21
  def check_installed(package,version=nil)
22
22
  cmd = "rpm -q #{escape(package)}"
23
- if ! version.nil?
23
+ if version
24
24
  cmd = "#{cmd} | grep -w -- #{escape(version)}"
25
25
  end
26
26
  cmd
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.7.8"
2
+ VERSION = "0.7.9"
3
3
  end
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", "~> 2.13.0"
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"
@@ -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.8
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-12 00:00:00.000000000 Z
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