specinfra 2.50.4 → 2.51.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: c4a4576e3f89ab971501259a5b2f0d4ff81375da
4
- data.tar.gz: a44bb834b6ba489e631de9f6e64c4918ed14a58a
3
+ metadata.gz: 52e2b0c52dbef5e2bd95f8ca26db95c6b2f9f189
4
+ data.tar.gz: f0edda0089b55411b7ba841837af2987482676df
5
5
  SHA512:
6
- metadata.gz: cd67c47f4d521832d1edbcf6bfa8db9bb8f2829cb0118a1f01a8bd83ff04c76b0e5548a035c2c4250e8dcaf47c3acdf5dd8093509132b88d0fb909a44db8bdcc
7
- data.tar.gz: 98b9e396f696b18688f1833d0da3bb1a334ce4f6049ab202c13b4799af405c9fb05d4ef0e65c9bff5e6ccaecceda45f4a7d309820f7030fb4f1da31e28460c6a
6
+ metadata.gz: 5434491e5f9f713a7e9f2416bdffb6f685454c69fe331e7423bf0cda0de758d080571a43763f1f7d909aa989d60a54d58030f4446990015cb1ac58195a6fc87b
7
+ data.tar.gz: ffa28b948c261dbaf4d9e239c5b710c74e62c407869e5580f93bbd8aa4fdd4c22a1e10e318f111d3e97039c7f6defdcf026058cbd16630beecfc5a991ba22e7b
@@ -32,7 +32,13 @@ module Specinfra
32
32
  def build_command(cmd)
33
33
  shell = get_config(:shell) || '/bin/sh'
34
34
  cmd = cmd.shelljoin if cmd.is_a?(Array)
35
- cmd = "#{shell.shellescape} -c #{cmd.to_s.shellescape}"
35
+ shell = shell.shellescape
36
+
37
+ if get_config(:interactive_shell)
38
+ shell << " -i"
39
+ end
40
+
41
+ cmd = "#{shell} -c #{cmd.to_s.shellescape}"
36
42
 
37
43
  path = get_config(:path)
38
44
  if path
@@ -6,6 +6,7 @@ module Specinfra
6
6
  :env,
7
7
  :path,
8
8
  :shell,
9
+ :interactive_shell,
9
10
  :pre_command,
10
11
  :stdout,
11
12
  :stderr,
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.50.4"
2
+ VERSION = "2.51.0"
3
3
  end
@@ -46,6 +46,20 @@ describe Specinfra::Backend::Exec do
46
46
  end
47
47
  end
48
48
 
49
+ context 'with an interactive shell' do
50
+ before do
51
+ RSpec.configure {|c| c.interactive_shell = true }
52
+ end
53
+
54
+ after do
55
+ RSpec.configure {|c| c.interactive_shell = nil }
56
+ end
57
+
58
+ it 'should emulate an interactive shell' do
59
+ expect(Specinfra.backend.build_command('test -f /etc/passwd')).to eq '/bin/sh -i -c test\ -f\ /etc/passwd'
60
+ end
61
+ end
62
+
49
63
  context 'with custom path' do
50
64
  before do
51
65
  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.50.4
4
+ version: 2.51.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-01 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp