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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e36c6ee6a2dcb7bfd4581b1c2d9c4a0929261ee6
4
- data.tar.gz: cd368bdfd8855ef11cc2153bee23d44452eca881
3
+ metadata.gz: 2a3700953c925debcbea16eab1e7d9a91119f8d0
4
+ data.tar.gz: 3917363452032c05e21025078ff2b1da086aaf74
5
5
  SHA512:
6
- metadata.gz: 37b9973d685f6aae3ebecb9f4445983629074b78cad169fd65ee862ee22a3b4cdc7a98812b3e0a92d950f117e99f617bae7af0769f7a703997d73f3de502a98e
7
- data.tar.gz: 961ea420b33ef1311317c9eda56a21e71a158f32caae641923535395daef5f715c6fce5565f5fbef18428461513ced6c6b40c0ffecf0b85493f6c2ffa6bf6b35
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*\(?)/, "\\1env PATH=#{path}:$PATH ")
41
- cmd.gsub!(/(\|\|\s*\(?)/, "\\1env PATH=#{path}:$PATH ")
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
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
@@ -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.3
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-07-31 00:00:00.000000000 Z
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