serverspec 2.0.0.beta17 → 2.0.0.beta18

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: 873dab8b4bb7288f62a1999e0e1d545b822b7746
4
- data.tar.gz: f30d9f80fc651c0ed80fd4abbec0a59418ee6e35
3
+ metadata.gz: 57528c35adf6105e153b7dbe26c0a1db093a7b6a
4
+ data.tar.gz: d3ede874674a3ca5a4abb4d830aa7c64f90014ea
5
5
  SHA512:
6
- metadata.gz: 4f4a49792ab4facfa84f282090f0d6762f6de74f2c3611f99f0d92b5ef3aacebb49b9ba82b311cb2f407a3706cd208e1d8e3f9e3bc8f33e964de29fa2389fc2a
7
- data.tar.gz: bf85e074cffb9c5d281db1fba3f983b0b02d75d75c7b5e65b07571b1b6c5db5fcafd92310071895714c3158797642029254c41f7a2b7ddc325b90031c0ff55cb
6
+ metadata.gz: d8546b8a206c0fb3d516f77dc9b73a29e0ede2b532b40bdb544820776d8fbe17439192a02628a95b78b3b626658e53bc2c3e16b9d7c2203bb194aee55289bf07
7
+ data.tar.gz: b8ead4874e92c031eab156534eb309a301ac4e9b999d35b2e7062d01c650c7e8e0c5408693367edfdb6599fb34f2fb9e66a758d8923b192fcbac8bcb0bd2bbc7
@@ -4,8 +4,6 @@ require 'serverspec/matcher/contain'
4
4
  require 'serverspec/matcher/be_readable'
5
5
  require 'serverspec/matcher/be_writable'
6
6
  require 'serverspec/matcher/be_executable'
7
- require 'serverspec/matcher/match_md5checksum'
8
- require 'serverspec/matcher/match_sha256checksum'
9
7
 
10
8
  # port
11
9
  require 'serverspec/matcher/be_listening'
@@ -77,16 +77,12 @@ module Serverspec
77
77
  @runner.check_file_is_immutable(@name)
78
78
  end
79
79
 
80
- def match_checksum(checksum)
81
- @runner.check_file_has_checksum(@name, checksum)
80
+ def md5sum
81
+ @runner.get_file_md5sum(@name).stdout.strip
82
82
  end
83
83
 
84
- def match_md5checksum(md5sum)
85
- @runner.check_file_has_md5checksum(@name, md5sum)
86
- end
87
-
88
- def match_sha256checksum(sha256sum)
89
- @runner.check_file_has_sha256checksum(@name, sha256sum)
84
+ def sha256sum
85
+ @runner.get_file_sha256sum(@name).stdout.strip
90
86
  end
91
87
 
92
88
  def content
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.0.0.beta17"
2
+ VERSION = "2.0.0.beta18"
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.beta29"
23
+ spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta30"
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "rake", "~> 10.1.1"
26
26
  end
@@ -335,19 +335,21 @@ describe file('/etc/invalid-mount') do
335
335
  end
336
336
 
337
337
  describe file('/etc/services') do
338
- it { should match_md5checksum '35435ea447c19f0ea5ef971837ab9ced' }
338
+ let(:stdout) { "35435ea447c19f0ea5ef971837ab9ced\n" }
339
+ its(:md5sum) { should eq '35435ea447c19f0ea5ef971837ab9ced' }
339
340
  end
340
341
 
341
342
  describe file('invalid-file') do
342
- it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
343
+ its(:md5sum) { should_not eq 'INVALIDMD5CHECKSUM' }
343
344
  end
344
345
 
345
346
  describe file('/etc/services') do
346
- it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
347
+ let(:stdout) {"0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
348
+ its(:sha256sum) { should eq '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
347
349
  end
348
350
 
349
351
  describe file('invalid-file') do
350
- it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
352
+ its(:sha256sum) { should_not eq 'INVALIDSHA256CHECKSUM' }
351
353
  end
352
354
 
353
355
  describe file('/etc/passwd') do
@@ -15,11 +15,13 @@ describe file('/tmp') do
15
15
  end
16
16
 
17
17
  describe file('/etc/services') do
18
- it { should match_md5checksum '35435ea447c19f0ea5ef971837ab9ced' }
18
+ let(:stdout) { "35435ea447c19f0ea5ef971837ab9ced\n" }
19
+ its(:md5sum) { should eq '35435ea447c19f0ea5ef971837ab9ced' }
19
20
  end
20
21
 
21
22
  describe file('/etc/services') do
22
- it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
23
+ let(:stdout) {"0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
24
+ its(:sha256sum) { should eq '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
23
25
  end
24
26
 
25
27
  describe file('/etc/pam.d/system-auth') do
@@ -154,17 +154,11 @@ describe file('/etc/invalid-mount') do
154
154
  end
155
155
 
156
156
  describe file('/etc/services') do
157
- it { should match_md5checksum '35435ea447c19f0ea5ef971837ab9ced' }
158
- end
159
-
160
- describe file('invalid-file') do
161
- it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
157
+ let(:stdout) { "35435ea447c19f0ea5ef971837ab9ced\n" }
158
+ its(:md5sum) { should eq '35435ea447c19f0ea5ef971837ab9ced' }
162
159
  end
163
160
 
164
161
  describe file('/etc/services') do
165
- it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
166
- end
167
-
168
- describe file('invalid-file') do
169
- it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
162
+ let(:stdout) {"0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
163
+ its(:sha256sum) { should eq '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
170
164
  end
@@ -335,19 +335,13 @@ describe file('/etc/invalid-mount') do
335
335
  end
336
336
 
337
337
  describe file('/etc/services') do
338
- it { should match_md5checksum '35435ea447c19f0ea5ef971837ab9ced' }
339
- end
340
-
341
- describe file('invalid-file') do
342
- it { should_not match_md5checksum 'INVALIDMD5CHECKSUM' }
338
+ let(:stdout) { "35435ea447c19f0ea5ef971837ab9ced\n" }
339
+ its(:md5sum) { should eq '35435ea447c19f0ea5ef971837ab9ced' }
343
340
  end
344
341
 
345
342
  describe file('/etc/services') do
346
- it { should match_sha256checksum '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
347
- end
348
-
349
- describe file('invalid-file') do
350
- it { should_not match_sha256checksum 'INVALIDSHA256CHECKSUM' }
343
+ let(:stdout) {"0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a" }
344
+ its(:md5sum) { should eq '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a' }
351
345
  end
352
346
 
353
347
  describe file('/etc/passwd') do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta17
4
+ version: 2.0.0.beta18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0.beta29
47
+ version: 2.0.0.beta30
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.beta29
54
+ version: 2.0.0.beta30
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -122,8 +122,6 @@ files:
122
122
  - lib/serverspec/matcher/have_site_application.rb
123
123
  - lib/serverspec/matcher/have_site_bindings.rb
124
124
  - lib/serverspec/matcher/have_virtual_dir.rb
125
- - lib/serverspec/matcher/match_md5checksum.rb
126
- - lib/serverspec/matcher/match_sha256checksum.rb
127
125
  - lib/serverspec/matcher/return_exit_status.rb
128
126
  - lib/serverspec/matcher/return_stderr.rb
129
127
  - lib/serverspec/matcher/return_stdout.rb
@@ -1,5 +0,0 @@
1
- RSpec::Matchers.define :match_md5checksum do |pattern|
2
- match do |file|
3
- file.match_md5checksum(pattern)
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- RSpec::Matchers.define :match_sha256checksum do |pattern|
2
- match do |file|
3
- file.match_sha256checksum(pattern)
4
- end
5
- end