serverspec 2.25.0 → 2.26.0

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: 4a03e6f60304c57dec40573257efbe513c639ed5
4
- data.tar.gz: 644b2486bd76847fee44a1c0e13849fe188f250f
3
+ metadata.gz: b1f873fb5b21dddc593ba1c5351f3f84c7580efa
4
+ data.tar.gz: 61265de50e9471e57d1c14299937454f02892a21
5
5
  SHA512:
6
- metadata.gz: 4005856472a31c0e6d62d8a1195aca2c26788f8e38628f0dab601e302a4edd45a6592ef5f647a54e257cd72dcf309f7b5cd20a80723094ac3e8f44800da8f820
7
- data.tar.gz: c9d4c593e6fba329fc7c9db09e534d817418f31e6a898b60b3ef052ea6d6a4f82069a182c3a33e9bd81e71f9aaaa3ca756a732e744509a00a6ed73acf7716ea0
6
+ metadata.gz: d8a069060fc429ac5739f347934d6da85885e169fc1089a61399630c67ac477b6d29c40f41c0cb363a41c983152b7ab471fa06c5ea19318e2137a4fb90837554
7
+ data.tar.gz: 205516008ec4c9f87f564ef140872f623a0812a8e69ee8bc25e0a21619b90640c119c67fdee4ae6c674baf347ab6d5300609122aeb066aa374271cc625bd208e
@@ -3,9 +3,10 @@ module Serverspec::Type
3
3
 
4
4
  attr_reader :name
5
5
 
6
- def initialize(name=nil)
7
- @name = name
8
- @runner = Specinfra::Runner
6
+ def initialize(name=nil, options = {})
7
+ @name = name
8
+ @options = options
9
+ @runner = Specinfra::Runner
9
10
  end
10
11
 
11
12
  def to_s
@@ -117,6 +117,10 @@ module Serverspec::Type
117
117
  @runner.check_file_has_version(@name, version)
118
118
  end
119
119
 
120
+ def link_target
121
+ @runner.get_file_link_target(@name).stdout.strip
122
+ end
123
+
120
124
  def mtime
121
125
  d = @runner.get_file_mtime(@name).stdout.strip
122
126
  DateTime.strptime(d, '%s').new_offset(DateTime.now.offset)
@@ -1,7 +1,9 @@
1
1
  module Serverspec::Type
2
2
  class PhpConfig < Base
3
3
  def value
4
- ret = @runner.run_command("php -r 'echo get_cfg_var( \"#{@name}\" );'")
4
+ extra = '';
5
+ extra = extra + "-c #{@options[:ini]}" if @options.has_key?(:ini)
6
+ ret = @runner.run_command("php #{extra} -r 'echo get_cfg_var( \"#{@name}\" );'")
5
7
  val = ret.stdout
6
8
  val = val.to_i if val.match(/^\d+$/)
7
9
  val
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.25.0"
2
+ VERSION = "2.26.0"
3
3
  end
@@ -337,6 +337,11 @@ EOF
337
337
  its(:content) { should match /root:x:0:0/ }
338
338
  end
339
339
 
340
+ describe file('/etc/pam.d/system-auth') do
341
+ let(:stdout) { "/etc/pam.dsystem-auth-ac\r\n" }
342
+ its(:link_target) { should eq '/etc/pam.dsystem-auth-ac' }
343
+ end
344
+
340
345
  describe file('/etc/passwd') do
341
346
  let(:stdout) { Time.now.to_i.to_s }
342
347
  its(:mtime) { should > DateTime.now - 1 }
@@ -31,3 +31,7 @@ describe php_config('mbstring.http_output_conv_mimetypes') do
31
31
  let(:stdout) { 'application' }
32
32
  its(:value) { should_not match /html/ }
33
33
  end
34
+ describe php_config('default_mimetype', :ini => '/etc/php5/php.ini') do
35
+ let(:stdout) { 'text/html' }
36
+ its(:value) { should eq 'text/html' }
37
+ 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.25.0
4
+ version: 2.26.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: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2015-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec