serverspec 2.28.0 → 2.29.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1db17cecc7c750c354f720930fa66610cb9d0568
4
- data.tar.gz: b348abe2ecda5705cf5ed9ccdc5e02cf18f4297a
3
+ metadata.gz: b5dbcdde2a597094da01d9a52381e04d6968710c
4
+ data.tar.gz: da28c1a7fed332ff7c166c90f75f05cad01e94a1
5
5
  SHA512:
6
- metadata.gz: 032c4a130bb9663420fcc22511a39db94942d89c023aa002a28c5a8e8b2df6517cc69fc5924aef563371bea15032b9fec7e6ae6e4e97335a183179b046408170
7
- data.tar.gz: 07ff02c9b6e6e410c2bb8125880c5f4a21b8efe8117948c13f0ea6774d36c0cecd40c84f2f3db03e76505f48bd4e3ae134ec67411bde173486499550aab1f55d
6
+ metadata.gz: e9d83c03e913c7e3c22a6655278ba0dc92eaa09c25cb4c08713059fdd5e7f0902f7896b838ec817dc91d990ad4ad50787191bf03680efd23959aee332e785fec
7
+ data.tar.gz: 6531d6f1ee05d1d65b70943c32ac007a0d366370503df2c185e925b92ccf180d596ec41b5900b344852e856b38a9d6284c60123f4477bbb30229e31b309b3941
@@ -113,6 +113,10 @@ module Serverspec::Type
113
113
  @content
114
114
  end
115
115
 
116
+ def group
117
+ @runner.get_file_owner_group(@name).stdout.strip
118
+ end
119
+
116
120
  def version?(version)
117
121
  @runner.check_file_has_version(@name, version)
118
122
  end
@@ -121,11 +125,19 @@ module Serverspec::Type
121
125
  @runner.get_file_link_target(@name).stdout.strip
122
126
  end
123
127
 
128
+ def mode
129
+ @runner.get_file_mode(@name).stdout.strip
130
+ end
131
+
124
132
  def mtime
125
133
  d = @runner.get_file_mtime(@name).stdout.strip
126
134
  DateTime.strptime(d, '%s').new_offset(DateTime.now.offset)
127
135
  end
128
136
 
137
+ def owner
138
+ @runner.get_file_owner_user(@name).stdout.strip
139
+ end
140
+
129
141
  def size
130
142
  @runner.get_file_size(@name).stdout.strip.to_i
131
143
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.28.0"
2
+ VERSION = "2.29.0"
3
3
  end
@@ -319,6 +319,11 @@ describe file('invalid-file') do
319
319
  its(:sha256sum) { should_not eq 'INVALIDSHA256CHECKSUM' }
320
320
  end
321
321
 
322
+ describe file('/etc/passwd') do
323
+ let(:stdout) { "root\r\n" }
324
+ its(:group) { should eq 'root' }
325
+ end
326
+
322
327
  describe file('/etc/passwd') do
323
328
  let(:stdout) {<<EOF
324
329
  root:x:0:0:root:/root:/bin/bash
@@ -342,11 +347,21 @@ describe file('/etc/pam.d/system-auth') do
342
347
  its(:link_target) { should eq '/etc/pam.dsystem-auth-ac' }
343
348
  end
344
349
 
350
+ describe file('/etc/passwd') do
351
+ let(:stdout) { "644\r\n" }
352
+ its(:mode) { should eq '644' }
353
+ end
354
+
345
355
  describe file('/etc/passwd') do
346
356
  let(:stdout) { Time.now.to_i.to_s }
347
357
  its(:mtime) { should > DateTime.now - 1 }
348
358
  end
349
359
 
360
+ describe file('/etc/passwd') do
361
+ let(:stdout) { "root\r\n" }
362
+ its(:owner) { should eq 'root' }
363
+ end
364
+
350
365
  describe file('/etc/passwod') do
351
366
  let(:stdout) { 100.to_s }
352
367
  its(:size) { should > 0 }
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.28.0
4
+ version: 2.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-07 00:00:00.000000000 Z
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec