serverspec 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -138,6 +138,14 @@ module Serverspec
138
138
  cmd
139
139
  end
140
140
 
141
+ def check_installed_by_pecl name, version=nil
142
+ cmd = "pecl list | grep -w -- ^#{escape(name)}"
143
+ if ! version.nil?
144
+ cmd = "#{cmd} | grep -w -- #{escape(version)}"
145
+ end
146
+ cmd
147
+ end
148
+
141
149
  def check_belonging_group user, group
142
150
  "id #{escape(user)} | awk '{print $3}' | grep -- #{escape(group)}"
143
151
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  end
@@ -10,6 +10,9 @@ describe 'Serverspec commands of Darwin family' do
10
10
  it_behaves_like 'support command check_installed_by_gem', 'jekyll'
11
11
  it_behaves_like 'support command check_installed_by_gem with_version', 'jekyll', '1.0.2'
12
12
 
13
+ it_behaves_like 'support command check_installed_by_pecl', 'mongo'
14
+ it_behaves_like 'support command check_installed_by_pecl with_version', 'mongo', '1.4.1'
15
+
13
16
  it_behaves_like 'support command check_mounted', '/'
14
17
 
15
18
  it_behaves_like 'support command check_routing_table', '192.168.100.1/24'
@@ -7,4 +7,6 @@ describe 'Serverspec package matchers of Darwin family' do
7
7
  it_behaves_like 'support package installed by gem with version matcher', 'jekyll', '1.1.1'
8
8
  it_behaves_like 'support package installed by npm matcher', 'bower'
9
9
  it_behaves_like 'support package installed by npm with version matcher', 'bower', '0.9.2'
10
+ it_behaves_like 'support package installed by pecl matcher', 'mongo'
11
+ it_behaves_like 'support package installed by pecl with version matcher', 'mongo', '1.4.1'
10
12
  end
@@ -10,6 +10,9 @@ describe 'Serverspec commands of Debian family' do
10
10
  it_behaves_like 'support command check_installed_by_gem', 'jekyll'
11
11
  it_behaves_like 'support command check_installed_by_gem with_version', 'jekyll', '1.0.2'
12
12
 
13
+ it_behaves_like 'support command check_installed_by_pecl', 'mongo'
14
+ it_behaves_like 'support command check_installed_by_pecl with_version', 'mongo', '1.4.1'
15
+
13
16
  it_behaves_like 'support command check_mounted', '/'
14
17
 
15
18
  it_behaves_like 'support command check_routing_table', '192.168.100.1/24'
@@ -8,4 +8,6 @@ describe 'Serverspec package matchers of Debian family' do
8
8
  it_behaves_like 'support package installed by gem with version matcher', 'jekyll', '1.1.1'
9
9
  it_behaves_like 'support package installed by npm matcher', 'bower'
10
10
  it_behaves_like 'support package installed by npm with version matcher', 'bower', '0.9.2'
11
+ it_behaves_like 'support package installed by pecl matcher', 'mongo'
12
+ it_behaves_like 'support package installed by pecl with version matcher', 'mongo', '1.4.1'
11
13
  end
@@ -10,6 +10,9 @@ describe 'Serverspec commands of Gentoo family' do
10
10
  it_behaves_like 'support command check_installed_by_gem', 'jekyll'
11
11
  it_behaves_like 'support command check_installed_by_gem with_version', 'jekyll', '1.0.2'
12
12
 
13
+ it_behaves_like 'support command check_installed_by_pecl', 'mongo'
14
+ it_behaves_like 'support command check_installed_by_pecl with_version', 'mongo', '1.4.1'
15
+
13
16
  it_behaves_like 'support command check_mounted', '/'
14
17
 
15
18
  it_behaves_like 'support command check_routing_table', '192.168.100.1/24'
@@ -8,4 +8,6 @@ describe 'Serverspec package matchers of Gentoo family' do
8
8
  it_behaves_like 'support package installed by gem with version matcher', 'jekyll', '1.1.1'
9
9
  it_behaves_like 'support package installed by npm matcher', 'bower'
10
10
  it_behaves_like 'support package installed by npm with version matcher', 'bower', '0.9.2'
11
+ it_behaves_like 'support package installed by pecl matcher', 'mongo'
12
+ it_behaves_like 'support package installed by pecl with version matcher', 'mongo', '1.4.1'
11
13
  end
@@ -10,6 +10,9 @@ describe 'Serverspec commands of Red Hat' do
10
10
  it_behaves_like 'support command check_installed_by_gem', 'jekyll'
11
11
  it_behaves_like 'support command check_installed_by_gem with_version', 'jekyll', '1.0.2'
12
12
 
13
+ it_behaves_like 'support command check_installed_by_pecl', 'mongo'
14
+ it_behaves_like 'support command check_installed_by_pecl with_version', 'mongo', '1.4.1'
15
+
13
16
  it_behaves_like 'support command check_mounted', '/'
14
17
 
15
18
  it_behaves_like 'support command check_routing_table', '192.168.100.1/24'
@@ -8,4 +8,6 @@ describe 'Serverspec package matchers of Red Hat family' do
8
8
  it_behaves_like 'support package installed by gem with version matcher', 'jekyll', '1.1.1'
9
9
  it_behaves_like 'support package installed by npm matcher', 'bower'
10
10
  it_behaves_like 'support package installed by npm with version matcher', 'bower', '0.9.2'
11
+ it_behaves_like 'support package installed by pecl matcher', 'mongo'
12
+ it_behaves_like 'support package installed by pecl with version matcher', 'mongo', '1.4.1'
11
13
  end
@@ -10,6 +10,9 @@ describe 'Serverspec commands of Solaris family' do
10
10
  it_behaves_like 'support command check_installed_by_gem', 'jekyll'
11
11
  it_behaves_like 'support command check_installed_by_gem with_version', 'jekyll', '1.0.2'
12
12
 
13
+ it_behaves_like 'support command check_installed_by_pecl', 'mongo'
14
+ it_behaves_like 'support command check_installed_by_pecl with_version', 'mongo', '1.4.1'
15
+
13
16
  it_behaves_like 'support command check_mounted', '/'
14
17
 
15
18
  it_behaves_like 'support command check_routing_table', '192.168.100.1/24'
@@ -8,4 +8,6 @@ describe 'Serverspec package matchers of Solaris family' do
8
8
  it_behaves_like 'support package installed by gem with version matcher', 'jekyll', '1.1.1'
9
9
  it_behaves_like 'support package installed by npm matcher', 'bower'
10
10
  it_behaves_like 'support package installed by npm with version matcher', 'bower', '0.9.2'
11
+ it_behaves_like 'support package installed by pecl matcher', 'mongo'
12
+ it_behaves_like 'support package installed by pecl with version matcher', 'mongo', '1.4.1'
11
13
  end
@@ -18,6 +18,16 @@ shared_examples_for 'support command check_installed_by_npm with_version' do |pa
18
18
  it { should eq "npm ls #{package} -g | grep -w -- #{version}" }
19
19
  end
20
20
 
21
+ shared_examples_for 'support command check_installed_by_pecl' do |package|
22
+ subject { commands.check_installed_by_pecl(package) }
23
+ it { should eq "pecl list | grep -w -- ^#{package}" }
24
+ end
25
+
26
+ shared_examples_for 'support command check_installed_by_pecl with_version' do |package, version|
27
+ subject { commands.check_installed_by_pecl(package, version) }
28
+ it { should eq "pecl list | grep -w -- ^#{package} | grep -w -- #{version}" }
29
+ end
30
+
21
31
  shared_examples_for 'support command check_file' do |file|
22
32
  subject { commands.check_file(file) }
23
33
  it { should eq "test -f #{file}" }
@@ -52,8 +52,32 @@ shared_examples_for 'support package installed by npm with version matcher' do |
52
52
  it { should be_installed.by('npm').with_version(version) }
53
53
  end
54
54
 
55
- describe package(name) do
55
+ describe package('invalid-npm-package') do
56
56
  it { should_not be_installed.by('npm').with_version('invalid-version') }
57
57
  end
58
58
  end
59
59
  end
60
+
61
+ shared_examples_for 'support package installed by pecl matcher' do |name|
62
+ describe 'installed by pecl' do
63
+ describe package(name) do
64
+ it { should be_installed.by('pecl') }
65
+ end
66
+
67
+ describe package('invalid-pecl') do
68
+ it { should_not be_installed.by('pecl') }
69
+ end
70
+ end
71
+ end
72
+
73
+ shared_examples_for 'support package installed by pecl with version matcher' do |name, version|
74
+ describe 'installed by pecl with version' do
75
+ describe package(name) do
76
+ it { should be_installed.by('pecl').with_version(version) }
77
+ end
78
+
79
+ describe package('invalid-pecl-package') do
80
+ it { should_not be_installed.by('pecl').with_version('invalid-version') }
81
+ end
82
+ end
83
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-19 00:00:00.000000000 Z
12
+ date: 2013-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh