serverspec 2.0.0.beta18 → 2.0.0.beta19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serverspec/matcher.rb +0 -4
- data/lib/serverspec/type/command.rb +0 -20
- data/lib/serverspec/version.rb +1 -1
- data/spec/type/base/command_spec.rb +7 -7
- data/spec/type/windows/command_spec.rb +7 -7
- metadata +1 -4
- data/lib/serverspec/matcher/return_exit_status.rb +0 -5
- data/lib/serverspec/matcher/return_stderr.rb +0 -5
- data/lib/serverspec/matcher/return_stdout.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34bfc818daa6085b0fa154fe2228c9b5cd51b7ce
|
4
|
+
data.tar.gz: dbf6210c50fd26d4d9131114eb3784952c2f4cbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a30443127f10a9c7c340380ea636be0c6faff0ed8d67e230292c6f64ce85ca84c633dbaa3a2f833792900929c278b177415abb8618aa780fd6c9b7b81910e01
|
7
|
+
data.tar.gz: 149c7b4759356c918a0abcc9943f3af70c743e25e370b63072ed988fc60e5c515255f87736df15ae787cd3fd163b1ad0d7d84832e07679b5759b9256ed7296c0
|
data/lib/serverspec/matcher.rb
CHANGED
@@ -23,10 +23,6 @@ require 'serverspec/matcher/be_running'
|
|
23
23
|
require 'serverspec/matcher/belong_to_group'
|
24
24
|
require 'serverspec/matcher/belong_to_primary_group'
|
25
25
|
|
26
|
-
require 'serverspec/matcher/return_exit_status'
|
27
|
-
require 'serverspec/matcher/return_stdout'
|
28
|
-
require 'serverspec/matcher/return_stderr'
|
29
|
-
|
30
26
|
# ipfiter, ipnat, iptables
|
31
27
|
require 'serverspec/matcher/have_rule'
|
32
28
|
|
@@ -1,26 +1,6 @@
|
|
1
1
|
module Serverspec
|
2
2
|
module Type
|
3
3
|
class Command < Base
|
4
|
-
def return_stdout?(content)
|
5
|
-
if content.instance_of?(Regexp)
|
6
|
-
stdout =~ content
|
7
|
-
else
|
8
|
-
stdout.strip == content
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def return_stderr?(content)
|
13
|
-
if content.instance_of?(Regexp)
|
14
|
-
stderr =~ content
|
15
|
-
else
|
16
|
-
stderr.strip == content
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def return_exit_status?(status)
|
21
|
-
exit_status == status
|
22
|
-
end
|
23
|
-
|
24
4
|
def stdout
|
25
5
|
command_result.stdout
|
26
6
|
end
|
data/lib/serverspec/version.rb
CHANGED
@@ -4,44 +4,44 @@ set :os, :family => 'base'
|
|
4
4
|
|
5
5
|
describe command('cat /etc/resolv.conf') do
|
6
6
|
let(:stdout) { "nameserver 127.0.0.1\r\n" }
|
7
|
-
|
7
|
+
its(:stdout) { should match /nameserver 127.0.0.1/ }
|
8
8
|
end
|
9
9
|
|
10
10
|
describe 'complete matching of stdout' do
|
11
11
|
context command('cat /etc/resolv.conf') do
|
12
12
|
let(:stdout) { "foocontent-should-be-includedbar\r\n" }
|
13
|
-
|
13
|
+
its(:stdout) { should_not eq 'content-should-be-included' }
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'regexp matching of stdout' do
|
18
18
|
context command('cat /etc/resolv.conf') do
|
19
19
|
let(:stdout) { "nameserver 127.0.0.1\r\n" }
|
20
|
-
|
20
|
+
its(:stdout) { should match /127\.0\.0\.1/ }
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
describe command('cat /etc/resolv.conf') do
|
25
25
|
let(:stderr) { "No such file or directory\r\n" }
|
26
|
-
|
26
|
+
its(:stderr) { should match /No such file or directory/ }
|
27
27
|
end
|
28
28
|
|
29
29
|
describe 'complete matching of stderr' do
|
30
30
|
context command('cat /etc/resolv.conf') do
|
31
31
|
let(:stderr) { "No such file or directory\r\n" }
|
32
|
-
|
32
|
+
its(:stdout) { should_not eq 'file' }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
describe 'regexp matching of stderr' do
|
37
37
|
context command('cat /etc/resolv.conf') do
|
38
38
|
let(:stderr) { "No such file or directory\r\n" }
|
39
|
-
|
39
|
+
its(:stderr) { should match /file/ }
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
describe command('cat /etc/resolv.conf') do
|
44
|
-
|
44
|
+
its(:exit_status) { should eq 0 }
|
45
45
|
end
|
46
46
|
|
47
47
|
describe command('ls -al /') do
|
@@ -5,44 +5,44 @@ set :os, :family => 'windows'
|
|
5
5
|
|
6
6
|
describe command('test_cmd /test/path/file') do
|
7
7
|
let(:stdout) { "test output 1.2.3\r\n" }
|
8
|
-
|
8
|
+
its(:stdout) { should match /test output 1.2.3/ }
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'complete matching of stdout' do
|
12
12
|
context command('test_cmd /test/path/file') do
|
13
13
|
let(:stdout) { "foocontent-should-be-includedbar\r\n" }
|
14
|
-
|
14
|
+
its(:stdout) { should_not eq 'content-should-be-included' }
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
describe 'regexp matching of stdout' do
|
19
19
|
context command('test_cmd /test/path/file') do
|
20
20
|
let(:stdout) { "test output 1.2.3\r\n" }
|
21
|
-
|
21
|
+
its(:stdout) { should match /1\.2\.3/ }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe command('test_cmd /test/path/file') do
|
26
26
|
let(:stderr) { "No such file or directory\r\n" }
|
27
|
-
|
27
|
+
its(:stderr) { should match /No such file or directory/ }
|
28
28
|
end
|
29
29
|
|
30
30
|
describe 'complete matching of stderr' do
|
31
31
|
context command('test_cmd /test/path/file') do
|
32
32
|
let(:stderr) { "No such file or directory\r\n" }
|
33
|
-
|
33
|
+
its(:stderr) { should_not eq 'file' }
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
describe 'regexp matching of stderr' do
|
38
38
|
context command('test_cmd /test/path/file') do
|
39
39
|
let(:stderr) { "No such file or directory\r\n" }
|
40
|
-
|
40
|
+
its(:stderr) { should match /file/ }
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
describe command('test_cmd /test/path/file') do
|
45
|
-
|
45
|
+
its(:exit_status) { should eq 0 }
|
46
46
|
end
|
47
47
|
|
48
48
|
describe command('dir "c:\"') do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
@@ -122,9 +122,6 @@ files:
|
|
122
122
|
- lib/serverspec/matcher/have_site_application.rb
|
123
123
|
- lib/serverspec/matcher/have_site_bindings.rb
|
124
124
|
- lib/serverspec/matcher/have_virtual_dir.rb
|
125
|
-
- lib/serverspec/matcher/return_exit_status.rb
|
126
|
-
- lib/serverspec/matcher/return_stderr.rb
|
127
|
-
- lib/serverspec/matcher/return_stdout.rb
|
128
125
|
- lib/serverspec/setup.rb
|
129
126
|
- lib/serverspec/subject.rb
|
130
127
|
- lib/serverspec/type/base.rb
|