serverspec 2.0.0.beta10 → 2.0.0.beta11

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: 2255417730cf4c48dfb89e8f01fe44da49481cd7
4
- data.tar.gz: 7986406330d3a62cafce615b7d8dbedf855189d3
3
+ metadata.gz: 7e957c06e8e32ed7498f082132a63e9e88c4969c
4
+ data.tar.gz: 2b2e8cc776df290e1524ea011f0a31edeac132e1
5
5
  SHA512:
6
- metadata.gz: 4d2bf5e4cff1c49b37ba3840bf4eea20ffba32cd92fa72e3b8468b7e087009d5c633b6f9e40644b0d4a74153b1fc1b1562b0b9bab5936f4b75b5cc26647f6dc4
7
- data.tar.gz: 7750404e08fe787eb0c88391df8a744183dcc9989166405f740dd63457ba7cd3995904c281dfffb59957706e264bc260024015880208d02c5a7c0210d117fb07
6
+ metadata.gz: c483c85441a7f4ccfa65f5918726f32a186f7da2e436b7846d1232cce9378511354ac49721e63b109e3202503bd82f7503ecd0f85fdc94c982602277a2d84846
7
+ data.tar.gz: 59d94690c51f5552efbb093d3f0e4d5ec219bc0380845510d998f2cfde037c543de9ffa625508b09c65ddcb4ef299a331e8ae6a4a4c73338d422685bc9866b8e
@@ -23,6 +23,7 @@ require 'serverspec/matchers/be_running'
23
23
 
24
24
  # user
25
25
  require 'serverspec/matchers/belong_to_group'
26
+ require 'serverspec/matchers/belong_to_primary_group'
26
27
 
27
28
  require 'serverspec/matchers/return_exit_status'
28
29
  require 'serverspec/matchers/return_stdout'
@@ -0,0 +1,5 @@
1
+ RSpec::Matchers.define :belong_to_primary_group do |group|
2
+ match do |user|
3
+ user.belongs_to_primary_group?(group)
4
+ end
5
+ end
@@ -39,6 +39,7 @@ module Serverspec
39
39
  safe_create_spec
40
40
  safe_create_spec_helper
41
41
  safe_create_rakefile
42
+ safe_create_dotrspec
42
43
  end
43
44
 
44
45
  def self.ask_os_type
@@ -285,9 +286,18 @@ options[:user] ||= Etc.getlogin
285
286
 
286
287
  set :host, options[:host_name] || host
287
288
  set :ssh_options, options
289
+
290
+ # Disable sudo
291
+ # set :disable_sudo, true
288
292
  <%- end -%>
289
293
  <%- end -%>
290
294
 
295
+ # Set environment variables
296
+ # set :env, 'LANG' => 'C', 'LC_MESSAGES' => 'C'
297
+
298
+ # Set PATH
299
+ # set :path, '/sbin:/usr/local/sbin:$PATH'
300
+
291
301
  <% if @backend_type == 'WinRM'-%>
292
302
  user = <username>
293
303
  pass = <password>
@@ -299,5 +309,24 @@ c.winrm.set_timeout 300 # 5 minutes max timeout for any operation
299
309
  EOF
300
310
  template
301
311
  end
312
+
313
+ def self.safe_create_dotrspec
314
+ content = <<-'EOF'
315
+ --color
316
+ --format documentation
317
+ EOF
318
+ if File.exists? '.rspec'
319
+ old_content = File.read('.rspec')
320
+ if old_content != content
321
+ $stderr.puts '!! .rspec already exists and differs from template'
322
+ end
323
+ else
324
+ File.open('.rspec', 'w') do |f|
325
+ f.puts content
326
+ end
327
+ puts ' + .rspec'
328
+ end
329
+ end
330
+
302
331
  end
303
332
  end
@@ -9,6 +9,10 @@ module Serverspec
9
9
  @runner.check_user_is_belonging_to_group(@name, group)
10
10
  end
11
11
 
12
+ def belongs_to_primary_group?(group)
13
+ backend.check_belonging_primary_group(@name, group)
14
+ end
15
+
12
16
  def has_uid?(uid)
13
17
  @runner.check_user_has_uid(@name, uid)
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.0.0.beta10"
2
+ VERSION = "2.0.0.beta11"
3
3
  end
data/serverspec.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency "rspec", "~> 3.0.0"
22
22
  spec.add_runtime_dependency "rspec-its"
23
- spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta8"
23
+ spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta10"
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "rake", "~> 10.1.1"
26
26
  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.0.0.beta10
4
+ version: 2.0.0.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0.beta8
47
+ version: 2.0.0.beta10
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.0.0.beta8
54
+ version: 2.0.0.beta10
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +115,7 @@ files:
115
115
  - lib/serverspec/matchers/be_running.rb
116
116
  - lib/serverspec/matchers/be_writable.rb
117
117
  - lib/serverspec/matchers/belong_to_group.rb
118
+ - lib/serverspec/matchers/belong_to_primary_group.rb
118
119
  - lib/serverspec/matchers/contain.rb
119
120
  - lib/serverspec/matchers/have_entry.rb
120
121
  - lib/serverspec/matchers/have_rule.rb