serverspec 2.41.8 → 2.42.2

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
- SHA256:
3
- metadata.gz: 4f3d5527eda493bdf34653a61474e2eaafdc521fd4c978df82a1ea5348feb2f6
4
- data.tar.gz: 4fde21a2764cb3b8e12cc5fed6fea704bf9df36e6f01ee01277689d1b3a9e1b6
2
+ SHA1:
3
+ metadata.gz: c156dac47ae252c7876fed18522aa9c196b049c7
4
+ data.tar.gz: b9e362ca6c5007250f147561f5aec4cbfd76885b
5
5
  SHA512:
6
- metadata.gz: 688850b6eaf69dfa056281f4059bcb33db6198893e569d53cea4cd1abfb3eb5037f06a2fae1f32572ebe6f50c82b1b3ddb1586d5bab6733a8509573725a88e2f
7
- data.tar.gz: 8ac6e6ff5efd43b4a77a516a4c2c4892eda6d2ab0580fc3f2e4ef6a87ef8e64bf65325305fd64b430c4978a9fa6779451e71fe24f0b26b0a1995337fbfa713eb
6
+ metadata.gz: 302deda1271e22b0fc451bf7200c4dd8c6bc13626ecafefce5e324ce5c2186c1cefde07d89291def7ec876bb57b08718677eff32c57782f4f0296567faefae77
7
+ data.tar.gz: 9016eced88bd4a9302460c2dbe319f156f48b9b744db8d0542f4e7a89b5def248d48dc34633af84b29e6adb404d628cfce476558e3b6ecc6b7eb4ee8c1a14d92
data/appveyor.yml CHANGED
@@ -60,7 +60,7 @@ install:
60
60
 
61
61
  build_script:
62
62
  - set SSL_CERT_FILE=C:/ruby24-x64/ssl/cert.pem
63
- - ruby -rfileutils -e 'FileUtils.rm_r(File.join(Gem.dir, "cache", "bundler")) if Dir.exists?(File.join(Gem.dir, "cache", "bundler"))'
63
+ - ruby -rfileutils -e 'FileUtils.rm_r(File.join(Gem.dir, "cache", "bundler")) if Dir.exist?(File.join(Gem.dir, "cache", "bundler"))'
64
64
  - bundle install --jobs 3 --retry 3
65
65
  - net user
66
66
  - net localgroup
@@ -127,7 +127,7 @@ describe port(80) do
127
127
  end
128
128
  EOF
129
129
 
130
- if File.exists? "spec/#{@hostname}/sample_spec.rb"
130
+ if File.exist? "spec/#{@hostname}/sample_spec.rb"
131
131
  old_content = File.read("spec/#{@hostname}/sample_spec.rb")
132
132
  if old_content != content
133
133
  $stderr.puts "!! spec/#{@hostname}/sample_spec.rb already exists and differs from template"
@@ -141,7 +141,7 @@ EOF
141
141
  end
142
142
 
143
143
  def self.safe_mkdir(dir)
144
- if File.exists? dir
144
+ if File.exist? dir
145
145
  unless File.directory? dir
146
146
  $stderr.puts "!! #{dir} already exists and is not a directory"
147
147
  end
@@ -153,7 +153,7 @@ EOF
153
153
 
154
154
  def self.safe_create_spec_helper
155
155
  content = ERB.new(spec_helper_template, nil, '-').result(binding)
156
- if File.exists? 'spec/spec_helper.rb'
156
+ if File.exist? 'spec/spec_helper.rb'
157
157
  old_content = File.read('spec/spec_helper.rb')
158
158
  if old_content != content
159
159
  $stderr.puts "!! spec/spec_helper.rb already exists and differs from template"
@@ -196,7 +196,7 @@ namespace :spec do
196
196
  end
197
197
  end
198
198
  EOF
199
- if File.exists? 'Rakefile'
199
+ if File.exist? 'Rakefile'
200
200
  old_content = File.read('Rakefile')
201
201
  if old_content != content
202
202
  $stderr.puts '!! Rakefile already exists and differs from template'
@@ -212,7 +212,7 @@ end
212
212
  def self.find_vagrantfile
213
213
  Pathname.new(Dir.pwd).ascend do |dir|
214
214
  path = File.expand_path('Vagrantfile', dir)
215
- return path if File.exists?(path)
215
+ return path if File.exist?(path)
216
216
  end
217
217
  nil
218
218
  end
@@ -334,7 +334,7 @@ EOF
334
334
  --color
335
335
  --format documentation
336
336
  EOF
337
- if File.exists? '.rspec'
337
+ if File.exist? '.rspec'
338
338
  old_content = File.read('.rspec')
339
339
  if old_content != content
340
340
  $stderr.puts '!! .rspec already exists and differs from template'
@@ -121,7 +121,13 @@ module Serverspec::Type
121
121
  end
122
122
 
123
123
  def content_as_yaml
124
- @content_as_yaml = YAML.load(content) if @content_as_yaml.nil?
124
+ if @content_as_yaml.nil?
125
+ @content_as_yaml = if YAML.respond_to?(:unsafe_load)
126
+ YAML.unsafe_load(content)
127
+ else
128
+ YAML.load(content)
129
+ end
130
+ end
125
131
  @content_as_yaml
126
132
  end
127
133
 
@@ -4,6 +4,10 @@ module Serverspec::Type
4
4
  @runner.check_group_exists(@name)
5
5
  end
6
6
 
7
+ def gid
8
+ @runner.get_group_gid(@name).stdout.to_i
9
+ end
10
+
7
11
  def has_gid?(gid)
8
12
  @runner.check_group_has_gid(@name, gid)
9
13
  end
@@ -12,6 +12,10 @@ module Serverspec::Type
12
12
  @runner.check_user_belongs_to_primary_group(@name, group)
13
13
  end
14
14
 
15
+ def uid
16
+ @runner.get_user_uid(@name).stdout.to_i
17
+ end
18
+
15
19
  def has_uid?(uid)
16
20
  @runner.check_user_has_uid(@name, uid)
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.41.8"
2
+ VERSION = "2.42.2"
3
3
  end
data/serverspec.gemspec CHANGED
@@ -22,6 +22,11 @@ Gem::Specification.new do |spec|
22
22
  spec.add_runtime_dependency "rspec-its"
23
23
  spec.add_runtime_dependency "multi_json"
24
24
  spec.add_runtime_dependency "specinfra", "~> 2.72"
25
- spec.add_development_dependency("json", "~> 1.8") if RUBY_VERSION < "1.9"
26
- spec.add_development_dependency "rake", "~> 10.1.1"
25
+
26
+ if RUBY_VERSION < "1.9"
27
+ spec.add_development_dependency "json", "~> 1.8"
28
+ spec.add_development_dependency "rake", "~> 10.1.1"
29
+ else
30
+ spec.add_development_dependency "rake"
31
+ end
27
32
  end
@@ -369,18 +369,22 @@ describe file('example.yml') do
369
369
  let(:stdout) {<<EOF
370
370
  ---
371
371
  yaml:
372
- title: 'this is a yaml'
372
+ title: &anchor 'this is a yaml'
373
373
  array:
374
374
  -
375
375
  title: 'array 1'
376
376
  -
377
377
  title: 'array 2'
378
+ date: 2023-02-03
379
+ Reuse anchor: *anchor
378
380
  EOF
379
381
  }
380
382
 
381
383
  its(:content_as_yaml) { should include('yaml') }
382
384
  its(:content_as_yaml) { should include('yaml' => include('title' => 'this is a yaml')) }
383
385
  its(:content_as_yaml) { should include('yaml' => include('array' => include('title' => 'array 2'))) }
386
+ its(:content_as_yaml) { should include('yaml' => include('date' => Date.new(2023, 2, 3))) }
387
+ its(:content_as_yaml) { should include('yaml' => include('Reuse anchor' => 'this is a yaml')) }
384
388
  end
385
389
 
386
390
 
@@ -9,3 +9,8 @@ end
9
9
  describe group('root') do
10
10
  it { should have_gid 0 }
11
11
  end
12
+
13
+ describe group('root') do
14
+ its(:gid) { should == 0 }
15
+ its(:gid) { should < 10 }
16
+ end
@@ -18,6 +18,11 @@ describe user('root') do
18
18
  it { should have_uid 0 }
19
19
  end
20
20
 
21
+ describe user('root') do
22
+ its(:uid) { should == 0 }
23
+ its(:uid) { should < 10 }
24
+ end
25
+
21
26
  describe user('root') do
22
27
  it { should have_login_shell '/bin/bash' }
23
28
  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.41.8
4
+ version: 2.42.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-24 00:00:00.000000000 Z
11
+ date: 2023-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 10.1.1
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 10.1.1
82
+ version: '0'
83
83
  description: RSpec tests for your servers configured by Puppet, Chef, Itamae or anything
84
84
  else
85
85
  email:
@@ -321,7 +321,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  - !ruby/object:Gem::Version
322
322
  version: '0'
323
323
  requirements: []
324
- rubygems_version: 3.1.2
324
+ rubyforge_project:
325
+ rubygems_version: 2.5.1
325
326
  signing_key:
326
327
  specification_version: 4
327
328
  summary: RSpec tests for your servers configured by Puppet, Chef, Itamae or anything