serverspec 0.6.25 → 0.6.26

Sign up to get free protection for your applications and to get access to all the features.
data/lib/serverspec.rb CHANGED
@@ -50,22 +50,6 @@ RSpec.configure do |c|
50
50
  end
51
51
 
52
52
  module RSpec
53
- module Matchers
54
- module DSL
55
- class Matcher
56
- def failure_message_for_should(&block)
57
- message = "#{example.metadata[:command]}\n"
58
- message += "#{example.metadata[:stdout]}"
59
- message
60
- end
61
- def failure_message_for_should_not(&block)
62
- message = "#{example.metadata[:command]}\n"
63
- message += "#{example.metadata[:stdout]}"
64
- message
65
- end
66
- end
67
- end
68
- end
69
53
  module Core
70
54
  module Formatters
71
55
  class BaseTextFormatter < BaseFormatter
@@ -68,11 +68,6 @@ module Serverspec
68
68
  ret[:exit_status] == 0
69
69
  end
70
70
 
71
- def check_running_under_supervisor(process)
72
- ret = run_command(commands.check_running_under_supervisor(process))
73
- ret[:exit_status] == 0 && ret[:stdout] =~ /RUNNING/
74
- end
75
-
76
71
  def check_running_under_upstart(process)
77
72
  ret = run_command(commands.check_running_under_upstart(process))
78
73
  ret[:exit_status] == 0 && ret[:stdout] =~ /running/
@@ -87,7 +87,7 @@ module Serverspec
87
87
  end
88
88
 
89
89
  def check_running_under_supervisor(service)
90
- "supervisorctl status #{escape(service)}"
90
+ "supervisorctl status #{escape(service)} | grep RUNNING"
91
91
  end
92
92
 
93
93
  def check_running_under_upstart(service)
@@ -9,7 +9,7 @@ module Serverspec
9
9
  if under
10
10
  check_method = "check_running_under_#{under}".to_sym
11
11
 
12
- unless backend.respond_to?(check_method)
12
+ unless commands.respond_to?(check_method)
13
13
  raise ArgumentError.new("`be_running` matcher doesn't support #{under}")
14
14
  end
15
15
 
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.6.25"
2
+ VERSION = "0.6.26"
3
3
  end
@@ -33,15 +33,9 @@ describe service('sshd') do
33
33
  end
34
34
 
35
35
  describe service('sshd') do
36
- let(:stdout) { "sshd RUNNING\r\n" }
37
36
  it { should be_running.under('supervisor') }
38
37
  end
39
38
 
40
- describe service('sshd') do
41
- let(:stdout) { "sshd STOPPED\r\n" }
42
- it { should_not be_running.under('supervisor') }
43
- end
44
-
45
39
  describe service('invalid-daemon') do
46
40
  it { should_not be_running.under('supervisor') }
47
41
  end
@@ -35,15 +35,9 @@ describe service('sshd') do
35
35
  end
36
36
 
37
37
  describe service('sshd') do
38
- let(:stdout) { "sshd RUNNING\r\n" }
39
38
  it { should be_running.under('supervisor') }
40
39
  end
41
40
 
42
- describe service('sshd') do
43
- let(:stdout) { "sshd STOPPED\r\n" }
44
- it { should_not be_running.under('supervisor') }
45
- end
46
-
47
41
  describe service('invalid-daemon') do
48
42
  it { should_not be_running.under('supervisor') }
49
43
  end
@@ -35,15 +35,9 @@ describe service('sshd') do
35
35
  end
36
36
 
37
37
  describe service('sshd') do
38
- let(:stdout) { "sshd RUNNING\r\n" }
39
38
  it { should be_running.under('supervisor') }
40
39
  end
41
40
 
42
- describe service('sshd') do
43
- let(:stdout) { "sshd STOPPED\r\n" }
44
- it { should_not be_running.under('supervisor') }
45
- end
46
-
47
41
  describe service('invalid-daemon') do
48
42
  it { should_not be_running.under('supervisor') }
49
43
  end
@@ -35,15 +35,9 @@ describe service('sshd') do
35
35
  end
36
36
 
37
37
  describe service('sshd') do
38
- let(:stdout) { "sshd RUNNING\r\n" }
39
38
  it { should be_running.under('supervisor') }
40
39
  end
41
40
 
42
- describe service('sshd') do
43
- let(:stdout) { "sshd STOPPED\r\n" }
44
- it { should_not be_running.under('supervisor') }
45
- end
46
-
47
41
  describe service('invalid-daemon') do
48
42
  it { should_not be_running.under('supervisor') }
49
43
  end
@@ -35,15 +35,9 @@ describe service('sshd') do
35
35
  end
36
36
 
37
37
  describe service('sshd') do
38
- let(:stdout) { "sshd RUNNING\r\n" }
39
38
  it { should be_running.under('supervisor') }
40
39
  end
41
40
 
42
- describe service('sshd') do
43
- let(:stdout) { "sshd STOPPED\r\n" }
44
- it { should_not be_running.under('supervisor') }
45
- end
46
-
47
41
  describe service('invalid-daemon') do
48
42
  it { should_not be_running.under('supervisor') }
49
43
  end
@@ -35,15 +35,9 @@ describe service('sshd') do
35
35
  end
36
36
 
37
37
  describe service('sshd') do
38
- let(:stdout) { "sshd RUNNING\r\n" }
39
38
  it { should be_running.under('supervisor') }
40
39
  end
41
40
 
42
- describe service('sshd') do
43
- let(:stdout) { "sshd STOPPED\r\n" }
44
- it { should_not be_running.under('supervisor') }
45
- end
46
-
47
41
  describe service('invalid-daemon') do
48
42
  it { should_not be_running.under('supervisor') }
49
43
  end
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: 0.6.25
4
+ version: 0.6.26
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-06 00:00:00.000000000 Z
12
+ date: 2013-07-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh