serverspec 0.15.5 → 0.16.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: 9bfa1196daebf86961d9664e6a500ad33b16c1e1
4
- data.tar.gz: 7133f65128990b40cf58e1397f0a6c95e04e9f38
3
+ metadata.gz: 5f9e60dffbf889e149689ae2ea4756c01481327c
4
+ data.tar.gz: edb2f01c08ea0b3dac4756db8d3a3e3d5e335946
5
5
  SHA512:
6
- metadata.gz: a67a4626bbc5d6b17c6ae1ae6a3f888a65704d6e0d3a4987a8dc3ca1b71d3068e5be3039c18b18426d5b97c82d34fb8e7d4067111c03ac3bf8e225c2193dbdfb
7
- data.tar.gz: 96f233411903341b59b8af59d92d8d2b02e42077f22f0ee2ce782dd6ea30f0af958c8d011c1e25889e514b9c0ae5dfebe57181b30ae80a0298ad29f96745f798
6
+ metadata.gz: e4824f8eb7bec9311ba75c841fcab072ba5fc798ba1d6549d9a1b36c55ed6b73fd280050a360c2330b35275166365a4040d99a8002f11d1fbeb96d5084586e00
7
+ data.tar.gz: 4f7dcf8119978f055aa659c65f998db32ec3d4cf0b270f76b2dbdd7b433485b369ace1873d18c7061ba8e0a0d2b1b22389f1c6b82a9b58f6e7e720db6da1e0f2
@@ -14,13 +14,10 @@ module Serverspec
14
14
 
15
15
  def return_stderr?(content)
16
16
  ret = backend.run_command(@name)
17
- # In ssh access with pty, stderr is merged to stdout
18
- # See http://stackoverflow.com/questions/7937651/receiving-extended-data-with-ssh-using-twisted-conch-as-client
19
- # So I use stdout instead of stderr
20
17
  if content.instance_of?(Regexp)
21
- ret.stdout =~ content
18
+ ret.stderr =~ content
22
19
  else
23
- ret.stdout.strip == content
20
+ ret.stderr.strip == content
24
21
  end
25
22
  end
26
23
 
@@ -36,10 +33,12 @@ module Serverspec
36
33
  @result
37
34
  end
38
35
 
39
- # In ssh access with pty, stderr is merged to stdout
40
- # See http://stackoverflow.com/questions/7937651/receiving-extended-data-with-ssh-using-twisted-conch-as-client
41
- # So I use stdout instead of stderr
42
- alias :stderr :stdout
36
+ def stderr
37
+ if @result.nil?
38
+ @result = backend.run_command(@name).stderr
39
+ end
40
+ @result
41
+ end
43
42
  end
44
43
  end
45
44
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.15.5"
2
+ VERSION = "0.16.0"
3
3
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -24,21 +24,21 @@ describe 'regexp matching of stdout' do
24
24
  end
25
25
 
26
26
  describe command('cat /etc/resolv.conf') do
27
- let(:stdout) { "No such file or directory\r\n" }
27
+ let(:stderr) { "No such file or directory\r\n" }
28
28
  it { should return_stderr("No such file or directory") }
29
29
  its(:command) { should eq 'cat /etc/resolv.conf' }
30
30
  end
31
31
 
32
32
  describe 'complete matching of stderr' do
33
33
  context command('cat /etc/resolv.conf') do
34
- let(:stdout) { "No such file or directory\r\n" }
35
- it { should_not return_stdout('file') }
34
+ let(:stderr) { "No such file or directory\r\n" }
35
+ it { should_not return_stderr('file') }
36
36
  end
37
37
  end
38
38
 
39
39
  describe 'regexp matching of stderr' do
40
40
  context command('cat /etc/resolv.conf') do
41
- let(:stdout) { "No such file or directory\r\n" }
41
+ let(:stderr) { "No such file or directory\r\n" }
42
42
  it { should return_stderr(/file/) }
43
43
  end
44
44
  end
@@ -63,7 +63,5 @@ EOF
63
63
  }
64
64
 
65
65
  its(:stdout) { should match /bin/ }
66
- its(:stderr) { should match /bin/ }
67
-
68
66
  its(:stdout) { should eq stdout }
69
67
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -23,21 +23,21 @@ describe 'regexp matching of stdout' do
23
23
  end
24
24
 
25
25
  describe command('cat /etc/resolv.conf') do
26
- let(:stdout) { "No such file or directory\r\n" }
26
+ let(:stderr) { "No such file or directory\r\n" }
27
27
  it { should return_stderr("No such file or directory") }
28
28
  its(:command) { should eq 'cat /etc/resolv.conf' }
29
29
  end
30
30
 
31
31
  describe 'complete matching of stderr' do
32
32
  context command('cat /etc/resolv.conf') do
33
- let(:stdout) { "No such file or directory\r\n" }
34
- it { should_not return_stdout('file') }
33
+ let(:stderr) { "No such file or directory\r\n" }
34
+ it { should_not return_stderr('file') }
35
35
  end
36
36
  end
37
37
 
38
38
  describe 'regexp matching of stderr' do
39
39
  context command('cat /etc/resolv.conf') do
40
- let(:stdout) { "No such file or directory\r\n" }
40
+ let(:stderr) { "No such file or directory\r\n" }
41
41
  it { should return_stderr(/file/) }
42
42
  end
43
43
  end
@@ -61,7 +61,5 @@ EOF
61
61
  }
62
62
 
63
63
  its(:stdout) { should match /bin/ }
64
- its(:stderr) { should match /bin/ }
65
-
66
64
  its(:stdout) { should eq stdout }
67
65
  end
@@ -24,21 +24,21 @@ describe 'regexp matching of stdout' do
24
24
  end
25
25
 
26
26
  describe command('test_cmd /test/path/file') do
27
- let(:stdout) { "No such file or directory\r\n" }
27
+ let(:stderr) { "No such file or directory\r\n" }
28
28
  it { should return_stderr("No such file or directory") }
29
29
  its(:command) { should eq 'test_cmd /test/path/file' }
30
30
  end
31
31
 
32
32
  describe 'complete matching of stderr' do
33
33
  context command('test_cmd /test/path/file') do
34
- let(:stdout) { "No such file or directory\r\n" }
35
- it { should_not return_stdout('file') }
34
+ let(:stderr) { "No such file or directory\r\n" }
35
+ it { should_not return_stderr('file') }
36
36
  end
37
37
  end
38
38
 
39
39
  describe 'regexp matching of stderr' do
40
40
  context command('test_cmd /test/path/file') do
41
- let(:stdout) { "No such file or directory\r\n" }
41
+ let(:stderr) { "No such file or directory\r\n" }
42
42
  it { should return_stderr(/file/) }
43
43
  end
44
44
  end
@@ -63,7 +63,5 @@ EOF
63
63
  }
64
64
 
65
65
  its(:stdout) { should match /Program Files/ }
66
- its(:stderr) { should match /Program Files/ }
67
-
68
66
  its(:stdout) { should eq stdout }
69
67
  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.15.5
4
+ version: 0.16.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: 2014-03-17 00:00:00.000000000 Z
11
+ date: 2014-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh