serverspec 2.29.2 → 2.30.0

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: 3ed47abd0163d425439cda72a1f516b7089ece17
4
- data.tar.gz: 0101db4c86239636a97353473f70341d3cbd86c8
3
+ metadata.gz: 805aa103f31a41ff32676fa36c1f6e54801ee299
4
+ data.tar.gz: 7feea0c4b60f88ed26264b530db7e194807f1806
5
5
  SHA512:
6
- metadata.gz: 1e98f71979be7f14e858c00ad7c8ce240178dfb30d5a64390d9ea074120688c2f055d9dc8570bd83c77e1c8ab4c74cd5829992528375e2d7f26645b4cb753c5a
7
- data.tar.gz: 6545a00487106a805620819380cfeaed53103a1902354707aca3afa88a270e146ebdda0c0f87b1f72a99ba559052ed7306e59d05057c748cf1879ff561b5195b
6
+ metadata.gz: bc4cc36245e7a9d9ba25ebc82ec428ffa4b9086595b3db43374b81056d37ef91c652ab24305baee7f7bf6d25f45fd751f5ab4d2763b5ac7ea1d10685f2ddc8cf
7
+ data.tar.gz: e74039e4443f224733b816790d7b9521ea8e0cbab9dbdfe7b4707e7c2b232d2f54ab504f9be0152958503ca89d3d13cf29e840db90c2d369d86163bffa547adf
@@ -14,10 +14,6 @@ environment:
14
14
  - ruby_version: "21"
15
15
  - ruby_version: "22"
16
16
 
17
- matrix:
18
- allow_failures:
19
- - ruby_version: "22" # waiting for net-ssh update
20
-
21
17
  clone_depth: 5
22
18
 
23
19
  cache:
@@ -22,6 +22,7 @@ require 'serverspec/matcher/be_permissive'
22
22
  # service
23
23
  require 'serverspec/matcher/be_enabled'
24
24
  require 'serverspec/matcher/be_running'
25
+ require 'serverspec/matcher/be_monitored_by'
25
26
 
26
27
  # user
27
28
  require 'serverspec/matcher/belong_to_group'
@@ -7,6 +7,12 @@ RSpec::Matchers.define :be_enabled do
7
7
  end
8
8
  end
9
9
 
10
+ description do
11
+ message = 'be enabled'
12
+ message << " with level #{@level}" if @level
13
+ message
14
+ end
15
+
10
16
  chain :with_level do |level|
11
17
  @level = level
12
18
  end
@@ -3,6 +3,13 @@ RSpec::Matchers.define :be_listening do
3
3
  port.listening? @with, @local_address
4
4
  end
5
5
 
6
+ description do
7
+ message = 'be listening'
8
+ message << " on #{@local_address}" if @local_address
9
+ message << " with #{@with}" if @with
10
+ message
11
+ end
12
+
6
13
  chain :with do |with|
7
14
  @with = with
8
15
  end
@@ -0,0 +1,17 @@
1
+ RSpec::Matchers.define :be_monitored_by do |monitor|
2
+ match do |service|
3
+ service.monitored_by?(monitor, @monitor_name)
4
+ end
5
+ description do
6
+ if @monitor_name
7
+ "be monitored by #{monitor} with name #{@monitor_name}"
8
+ else
9
+ "be monitored by #{monitor}"
10
+ end
11
+ end
12
+
13
+ chain :with_name do |name|
14
+ @monitor_name = (name ? name : nil)
15
+ end
16
+
17
+ end
@@ -7,6 +7,12 @@ RSpec::Matchers.define :be_running do
7
7
  end
8
8
  end
9
9
 
10
+ description do
11
+ message = 'be running'
12
+ message << " under #{@under}" if @under
13
+ message
14
+ end
15
+
10
16
  chain :under do |under|
11
17
  @under = under
12
18
  end
@@ -7,6 +7,14 @@ RSpec::Matchers.define :have_rule do |rule|
7
7
  end
8
8
  end
9
9
 
10
+ description do
11
+ message = %Q{have rule "#{rule}"}
12
+ message << " with table #{@table}" if @table
13
+ message << ' and' if @table && @chain
14
+ message << " with chain #{@chain}" if @chain
15
+ message
16
+ end
17
+
10
18
  chain :with_table do |table|
11
19
  @table = table
12
20
  end
@@ -25,9 +25,11 @@ module Serverspec::Type
25
25
  end
26
26
  end
27
27
 
28
- def monitored_by?(monitor)
28
+ def monitored_by?(monitor, monitor_name)
29
29
  check_method = "check_service_is_monitored_by_#{monitor}".to_sym
30
- res = @runner.send(check_method, @name)
30
+ # use the with_name value if set instead of the service name
31
+ monitor_name = (monitor_name ? monitor_name : @name)
32
+ res = @runner.send(check_method, monitor_name)
31
33
  end
32
34
 
33
35
  def has_property?(property)
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.29.2"
2
+ VERSION = "2.30.0"
3
3
  end
@@ -36,6 +36,11 @@ describe service('sshd') do
36
36
  it { should be_monitored_by(:monit) }
37
37
  end
38
38
 
39
+ describe service('tinc') do
40
+ let(:stdout) { "Process 'tinc-myvpn'\r\n status running\r\n monitoring status monitored" }
41
+ it { should be_monitored_by(:monit).with_name('tinc-myvpn') }
42
+ end
43
+
39
44
  describe service('unicorn') do
40
45
  it { should be_monitored_by(:god) }
41
46
  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: 2.29.2
4
+ version: 2.30.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-09 00:00:00.000000000 Z
11
+ date: 2016-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -124,6 +124,7 @@ files:
124
124
  - lib/serverspec/matcher/be_executable.rb
125
125
  - lib/serverspec/matcher/be_installed.rb
126
126
  - lib/serverspec/matcher/be_listening.rb
127
+ - lib/serverspec/matcher/be_monitored_by.rb
127
128
  - lib/serverspec/matcher/be_mounted.rb
128
129
  - lib/serverspec/matcher/be_permissive.rb
129
130
  - lib/serverspec/matcher/be_reachable.rb