serverspec 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serverspec/backend/exec.rb +2 -2
- data/lib/serverspec/version.rb +1 -1
- data/spec/backend/exec/build_command_spec.rb +32 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a3700953c925debcbea16eab1e7d9a91119f8d0
|
4
|
+
data.tar.gz: 3917363452032c05e21025078ff2b1da086aaf74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59d589134f92052fe138aea40c6b152c3f2736ea01f4948919d03095071cdcb9c80cd19934fb7fbcce0853bc8206f4bf6644872f73bed7d967ac3ddc46a327c5
|
7
|
+
data.tar.gz: 4deab1fbd20b41beb3d5001afe5874d1f14ed44f6ae8e922bba0812f93cfa8193d4f1b00d1496bac637385edd385a1c7e6200d50a7da397da8412914e874f5be
|
@@ -37,8 +37,8 @@ module Serverspec
|
|
37
37
|
path = Serverspec.configuration.path || RSpec.configuration.path
|
38
38
|
if path
|
39
39
|
cmd = "env PATH=#{path}:$PATH #{cmd}"
|
40
|
-
cmd.gsub!(/(\&\&\s
|
41
|
-
cmd.gsub!(/(\|\|\s
|
40
|
+
cmd.gsub!(/(\&\&\s*!?\(?\s*)/, "\\1env PATH=#{path}:$PATH ")
|
41
|
+
cmd.gsub!(/(\|\|\s*!?\(?\s*)/, "\\1env PATH=#{path}:$PATH ")
|
42
42
|
end
|
43
43
|
cmd
|
44
44
|
end
|
data/lib/serverspec/version.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include Serverspec::Helper::Exec
|
4
|
+
|
5
|
+
describe 'build command with path' do
|
6
|
+
before :each do
|
7
|
+
RSpec.configure do |c|
|
8
|
+
c.path = '/sbin:/usr/sbin'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'command pattern 1' do
|
13
|
+
subject { backend.build_command('test -f /etc/passwd') }
|
14
|
+
it { should eq 'env PATH=/sbin:/usr/sbin:$PATH test -f /etc/passwd' }
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'command pattern 2' do
|
18
|
+
subject { backend.build_command('test ! -f /etc/selinux/config || (getenforce | grep -i -- disabled && grep -i -- ^SELINUX=disabled$ /etc/selinux/config)') }
|
19
|
+
it { should eq 'env PATH=/sbin:/usr/sbin:$PATH test ! -f /etc/selinux/config || (env PATH=/sbin:/usr/sbin:$PATH getenforce | grep -i -- disabled && env PATH=/sbin:/usr/sbin:$PATH grep -i -- ^SELINUX=disabled$ /etc/selinux/config)' }
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'command pattern 3' do
|
23
|
+
subject { backend.build_command("dpkg -s apache2 && ! dpkg -s apache2 | grep -E '^Status: .+ not-installed$'") }
|
24
|
+
it { should eq "env PATH=/sbin:/usr/sbin:$PATH dpkg -s apache2 && ! env PATH=/sbin:/usr/sbin:$PATH dpkg -s apache2 | grep -E '^Status: .+ not-installed$'" }
|
25
|
+
end
|
26
|
+
|
27
|
+
after :each do
|
28
|
+
RSpec.configure do |c|
|
29
|
+
c.path = nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
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.4
|
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-
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/serverspec/type/zfs.rb
|
204
204
|
- lib/serverspec/version.rb
|
205
205
|
- serverspec.gemspec
|
206
|
+
- spec/backend/exec/build_command_spec.rb
|
206
207
|
- spec/backend/exec/configuration_spec.rb
|
207
208
|
- spec/backend/ssh/build_command_spec.rb
|
208
209
|
- spec/backend/ssh/configuration_spec.rb
|
@@ -333,6 +334,7 @@ signing_key:
|
|
333
334
|
specification_version: 4
|
334
335
|
summary: RSpec tests for your servers configured by Puppet, Chef or anything else
|
335
336
|
test_files:
|
337
|
+
- spec/backend/exec/build_command_spec.rb
|
336
338
|
- spec/backend/exec/configuration_spec.rb
|
337
339
|
- spec/backend/ssh/build_command_spec.rb
|
338
340
|
- spec/backend/ssh/configuration_spec.rb
|