serverspec 0.14.2 → 0.14.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  RSpec::Matchers.define :be_running do
2
- match do |process|
2
+ match do |subject|
3
3
  if subject.class.name == 'Serverspec::Type::Service'
4
- process.running?(@under)
4
+ subject.running?(@under)
5
5
  else
6
- process.running?
6
+ subject.running?
7
7
  end
8
8
  end
9
9
 
@@ -7,13 +7,24 @@ module Serverspec
7
7
  not pid.empty?
8
8
  end
9
9
 
10
+ def user
11
+ get_column("user")
12
+ end
13
+
14
+ def group
15
+ get_column("group")
16
+ end
17
+
10
18
  def method_missing(meth)
11
- ret = backend.run_command(commands.get_process(@name, :format => "#{meth.to_s}="))
19
+ get_column(meth.to_s)
20
+ end
21
+
22
+ def get_column(keyword)
23
+ ret = backend.run_command(commands.get_process(@name, :format => "#{keyword}="))
12
24
  val = ret[:stdout].strip
13
25
  val = val.to_i if val.match(/^\d+$/)
14
26
  val
15
27
  end
16
-
17
28
  end
18
29
  end
19
30
  end
@@ -5,7 +5,7 @@ module Serverspec
5
5
  backend.check_enabled(@name, level)
6
6
  end
7
7
 
8
- def running?(under=nil)
8
+ def running?(under)
9
9
  if under
10
10
  check_method = "check_running_under_#{under}".to_sym
11
11
 
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.14.2"
2
+ VERSION = "0.14.3"
3
3
  end
@@ -14,6 +14,18 @@ describe process("memcached") do
14
14
  its(:command) { should eq "ps -C memcached -o args= | head -1" }
15
15
  end
16
16
 
17
+ describe process("memcached") do
18
+ let(:stdout) { "nobody\n" }
19
+ its(:user) { should eq "nobody" }
20
+ its(:command) { should eq "ps -C memcached -o user= | head -1" }
21
+ end
22
+
23
+ describe process("memcached") do
24
+ let(:stdout) { "nobody\n" }
25
+ its(:group) { should eq "nobody" }
26
+ its(:command) { should eq "ps -C memcached -o group= | head -1" }
27
+ end
28
+
17
29
  describe process("memcached") do
18
30
  context "when running" do
19
31
  let(:stdout) { " 1407\n" }
metadata CHANGED
@@ -1,107 +1,122 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
- version: !ruby/object:Gem::Version
4
- version: 0.14.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 33
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 14
9
+ - 3
10
+ version: 0.14.3
5
11
  platform: ruby
6
- authors:
12
+ authors:
7
13
  - Gosuke Miyashita
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
- date: 2013-12-28 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2014-01-12 00:00:00 +09:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
14
22
  name: net-ssh
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
23
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: 2.13.0
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
34
33
  type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rspec
35
37
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 59
44
+ segments:
45
+ - 2
46
+ - 13
47
+ - 0
40
48
  version: 2.13.0
41
- - !ruby/object:Gem::Dependency
42
- name: highline
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
49
  type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: highline
49
53
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: specinfra
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: 0.1.0
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
61
+ - 0
62
+ version: "0"
62
63
  type: :runtime
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: specinfra
63
67
  prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ hash: 27
74
+ segments:
75
+ - 0
76
+ - 1
77
+ - 0
68
78
  version: 0.1.0
69
- - !ruby/object:Gem::Dependency
79
+ type: :runtime
80
+ version_requirements: *id004
81
+ - !ruby/object:Gem::Dependency
70
82
  name: bundler
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- version: '1.3'
76
- type: :development
77
83
  prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
84
+ requirement: &id005 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
80
87
  - - ~>
81
- - !ruby/object:Gem::Version
82
- version: '1.3'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '>='
88
- - !ruby/object:Gem::Version
89
- version: '0'
88
+ - !ruby/object:Gem::Version
89
+ hash: 9
90
+ segments:
91
+ - 1
92
+ - 3
93
+ version: "1.3"
90
94
  type: :development
95
+ version_requirements: *id005
96
+ - !ruby/object:Gem::Dependency
97
+ name: rake
91
98
  prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
99
+ requirement: &id006 !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ hash: 3
105
+ segments:
106
+ - 0
107
+ version: "0"
108
+ type: :development
109
+ version_requirements: *id006
97
110
  description: RSpec tests for your servers configured by Puppet, Chef or anything else
98
- email:
111
+ email:
99
112
  - gosukenator@gmail.com
100
- executables:
113
+ executables:
101
114
  - serverspec-init
102
115
  extensions: []
116
+
103
117
  extra_rdoc_files: []
104
- files:
118
+
119
+ files:
105
120
  - .gitignore
106
121
  - .travis.yml
107
122
  - Gemfile
@@ -356,31 +371,41 @@ files:
356
371
  - spec/windows/service_spec.rb
357
372
  - spec/windows/user_spec.rb
358
373
  - spec/windows/windows_registry_key_spec.rb
374
+ has_rdoc: true
359
375
  homepage: http://serverspec.org/
360
- licenses:
376
+ licenses:
361
377
  - MIT
362
- metadata: {}
363
378
  post_install_message:
364
379
  rdoc_options: []
365
- require_paths:
380
+
381
+ require_paths:
366
382
  - lib
367
- required_ruby_version: !ruby/object:Gem::Requirement
368
- requirements:
369
- - - '>='
370
- - !ruby/object:Gem::Version
371
- version: '0'
372
- required_rubygems_version: !ruby/object:Gem::Requirement
373
- requirements:
374
- - - '>='
375
- - !ruby/object:Gem::Version
376
- version: '0'
383
+ required_ruby_version: !ruby/object:Gem::Requirement
384
+ none: false
385
+ requirements:
386
+ - - ">="
387
+ - !ruby/object:Gem::Version
388
+ hash: 3
389
+ segments:
390
+ - 0
391
+ version: "0"
392
+ required_rubygems_version: !ruby/object:Gem::Requirement
393
+ none: false
394
+ requirements:
395
+ - - ">="
396
+ - !ruby/object:Gem::Version
397
+ hash: 3
398
+ segments:
399
+ - 0
400
+ version: "0"
377
401
  requirements: []
402
+
378
403
  rubyforge_project:
379
- rubygems_version: 2.0.3
404
+ rubygems_version: 1.6.2
380
405
  signing_key:
381
- specification_version: 4
406
+ specification_version: 3
382
407
  summary: RSpec tests for your servers configured by Puppet, Chef or anything else
383
- test_files:
408
+ test_files:
384
409
  - spec/aix/command_spec.rb
385
410
  - spec/aix/cron_spec.rb
386
411
  - spec/aix/default_gateway_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: c90fc3f0bcde5c3ada4b94a21950cd971c8e3939
4
- data.tar.gz: df1a2e65f97baa3b5fd3c22a13cc4404dc78a447
5
- SHA512:
6
- metadata.gz: 4e8efed26f385a46514b2220b60f7b7ef8e1b3427cb1ed5a85c757778e7212ffb1a0d34afa7964c56f76f421c5f52fa8ca3601cc6ea96e21acd819f32d809685
7
- data.tar.gz: 50806643521a7d072337f2228f90b081483bb5059620a20560eb0563e968e968fc680560c59abc1584183be1fd47b3d1576a9f12fe77951d7b06052d55474a82