specinfra 2.51.2 → 2.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0968dfc6a41a511a8b4451da5696646de90b26ee
4
- data.tar.gz: 57c45b5e2ef4967fd080745c386a3fab2524412b
3
+ metadata.gz: f646ff170ce099769c7f7d017c64f9539f8e2b26
4
+ data.tar.gz: 12363501f793feb74be015aca6d9b544ecaae1a7
5
5
  SHA512:
6
- metadata.gz: 9c3cb60e46fb76d0792843e891a34c26221668f9f90cdccf65992792e6e2b42f1a0d0186d9ac4be02d86dfe7948d3a900fa89bc0fb80e6f403c5b2a596f44b3b
7
- data.tar.gz: b0426d21fab638069fc7f6883d2e90234e0c96feb9280f0aff02d9aedaf208cf0f5b53040e6774a31d81152e06241f7c3d4145ea79f3d6d657592bf698156370
6
+ metadata.gz: dae91ce7ac68a39d01832a207f6fb3a6e57b1bfb7b9e53c6936be485c432d2cf67e6e7a0058839b8ccfc8f516a94a5af2ae55b0abb5b2bd458107ded52a44b38
7
+ data.tar.gz: c6ad4d292a0b14c6f66e206605163167d166798dcb66dfde82a10c4a5627cce6670befed1511cfbda185fe3c1b07b712b49473d29ba6999c46affd4a14cd2054
@@ -38,6 +38,10 @@ module Specinfra
38
38
  shell << " -i"
39
39
  end
40
40
 
41
+ if get_config(:login_shell)
42
+ shell << " -l"
43
+ end
44
+
41
45
  cmd = "#{shell} -c #{cmd.to_s.shellescape}"
42
46
 
43
47
  path = get_config(:path)
@@ -32,7 +32,7 @@ class Specinfra::Command::Windows::Base::Service < Specinfra::Command::Windows::
32
32
  command = []
33
33
  property.keys.each do |key|
34
34
  value= property[key]
35
- command <<"(FindService -name '#{service}').#{key} -eq '#{value}'"
35
+ command << "(FindService -name '#{service}').#{key} -eq '#{value}'"
36
36
  end
37
37
  executable = command.join(' -and ')
38
38
  Backend::PowerShell::Command.new do
@@ -48,4 +48,4 @@ class Specinfra::Command::Windows::Base::Service < Specinfra::Command::Windows::
48
48
  end
49
49
  end
50
50
  end
51
- end
51
+ end
@@ -7,6 +7,7 @@ module Specinfra
7
7
  :path,
8
8
  :shell,
9
9
  :interactive_shell,
10
+ :login_shell,
10
11
  :pre_command,
11
12
  :stdout,
12
13
  :stderr,
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.51.2"
2
+ VERSION = "2.52.0"
3
3
  end
@@ -60,6 +60,20 @@ describe Specinfra::Backend::Exec do
60
60
  end
61
61
  end
62
62
 
63
+ context 'with an login shell' do
64
+ before do
65
+ RSpec.configure {|c| c.login_shell = true }
66
+ end
67
+
68
+ after do
69
+ RSpec.configure {|c| c.login_shell = nil }
70
+ end
71
+
72
+ it 'should emulate an login shell' do
73
+ expect(Specinfra.backend.build_command('test -f /etc/passwd')).to eq '/bin/sh -l -c test\ -f\ /etc/passwd'
74
+ end
75
+ end
76
+
63
77
  context 'with custom path' do
64
78
  before do
65
79
  RSpec.configure {|c| c.path = '/opt/bin:/opt/foo/bin:$PATH' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.51.2
4
+ version: 2.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-27 00:00:00.000000000 Z
11
+ date: 2016-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp