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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57528c35adf6105e153b7dbe26c0a1db093a7b6a
4
- data.tar.gz: d3ede874674a3ca5a4abb4d830aa7c64f90014ea
3
+ metadata.gz: 34bfc818daa6085b0fa154fe2228c9b5cd51b7ce
4
+ data.tar.gz: dbf6210c50fd26d4d9131114eb3784952c2f4cbf
5
5
  SHA512:
6
- metadata.gz: d8546b8a206c0fb3d516f77dc9b73a29e0ede2b532b40bdb544820776d8fbe17439192a02628a95b78b3b626658e53bc2c3e16b9d7c2203bb194aee55289bf07
7
- data.tar.gz: b8ead4874e92c031eab156534eb309a301ac4e9b999d35b2e7062d01c650c7e8e0c5408693367edfdb6599fb34f2fb9e66a758d8923b192fcbac8bcb0bd2bbc7
6
+ metadata.gz: 7a30443127f10a9c7c340380ea636be0c6faff0ed8d67e230292c6f64ce85ca84c633dbaa3a2f833792900929c278b177415abb8618aa780fd6c9b7b81910e01
7
+ data.tar.gz: 149c7b4759356c918a0abcc9943f3af70c743e25e370b63072ed988fc60e5c515255f87736df15ae787cd3fd163b1ad0d7d84832e07679b5759b9256ed7296c0
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.0.0.beta18"
2
+ VERSION = "2.0.0.beta19"
3
3
  end
@@ -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
- it { should return_stdout("nameserver 127.0.0.1") }
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
- it { should_not return_stdout('content-should-be-included') }
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
- it { should return_stdout(/127\.0\.0\.1/) }
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
- it { should return_stderr("No such file or directory") }
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
- it { should_not return_stderr('file') }
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
- it { should return_stderr(/file/) }
39
+ its(:stderr) { should match /file/ }
40
40
  end
41
41
  end
42
42
 
43
43
  describe command('cat /etc/resolv.conf') do
44
- it { should return_exit_status 0 }
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
- it { should return_stdout("test output 1.2.3") }
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
- it { should_not return_stdout('content-should-be-included') }
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
- it { should return_stdout(/1\.2\.3/) }
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
- it { should return_stderr("No such file or directory") }
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
- it { should_not return_stderr('file') }
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
- it { should return_stderr(/file/) }
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
- it { should return_exit_status 0 }
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.beta18
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
@@ -1,5 +0,0 @@
1
- RSpec::Matchers.define :return_exit_status do |status|
2
- match do |command|
3
- command.return_exit_status?(status)
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- RSpec::Matchers.define :return_stderr do |content|
2
- match do |command|
3
- command.return_stderr?(content)
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- RSpec::Matchers.define :return_stdout do |content|
2
- match do |command|
3
- command.return_stdout?(content)
4
- end
5
- end