serverspec 0.1.3 → 0.1.4

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.
@@ -1,8 +1,8 @@
1
1
  RSpec::Matchers.define :be_running do
2
- match do |actual|
3
- ret = ssh_exec(commands.check_running(actual))
4
- if ret[:exit_code] == 1
5
- ret = ssh_exec(commands.check_process(actual))
2
+ match do |process|
3
+ ret = ssh_exec(commands.check_running(process))
4
+ if ret[:exit_code] == 1 || ret[:stdout] =~ /stopped/
5
+ ret = ssh_exec(commands.check_process(process))
6
6
  end
7
7
  ret[:exit_code] == 0
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -32,6 +32,15 @@ shared_examples_for 'support be_running matcher' do |valid_service|
32
32
  describe 'this-is-invalid-daemon' do
33
33
  it { should_not be_running }
34
34
  end
35
+
36
+ describe valid_service do
37
+ before :all do
38
+ RSpec.configure do |c|
39
+ c.stdout = "#{valid_service} is stopped\r\n"
40
+ end
41
+ end
42
+ it { should be_running }
43
+ end
35
44
  end
36
45
  end
37
46
 
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.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: