serverspec 2.36.0 → 2.36.1

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: e3689402c5d03f438cdb273aa1300f49604319e6
4
- data.tar.gz: 8cc6ee4a4bb5fda653cfeccfed3e53c4f5459470
3
+ metadata.gz: a293a1d69fe4accf6d9e711d2cf87eea5fd71884
4
+ data.tar.gz: 63abf7e1a41a7cb12aed1979c322bd0d1458e44f
5
5
  SHA512:
6
- metadata.gz: 63b56de0b976a48f57563fca617bc74e5ec0176458ee36cb4c7d02f26f0382b404965e0bfcd8935e3efc26907b89a0ef65782971599f6530e30e4d270b21a006
7
- data.tar.gz: b7aaafc17b9ea01c96907cc0cc3a0e0015bdf096822e8ddf170d8af7b94e828546445a3d6e60f5568efeb2a9f013742b2fdaad4bd5bfea1ccfc65a29efd5965f
6
+ metadata.gz: 561a5a3a9761cd871fcee288043dfb35407189becaeb555397d55a6e159b4db1c1cde655f7f0a4440c3af75429897c1e253f16cdfd6e18593bbb71de2a24c3c6
7
+ data.tar.gz: 9e458574b493b93a411dbcac6662e9899744abf749e2c20f032a50e83bcd9acb4c64cb0f76c5bc00f28016f44e47d9abb7fb7837becabbee43aa65ae57bfb63d
data/.gitignore CHANGED
@@ -24,3 +24,5 @@ Vagrantfile
24
24
  vendor/
25
25
  .DS_Store
26
26
  Gemfile.local
27
+ upstream.sh
28
+
data/README.md CHANGED
@@ -6,6 +6,16 @@ You can see the details of serverspec on [serverspec.org](http://serverspec.org/
6
6
 
7
7
  ----
8
8
 
9
+ ## Running the gem's tests
10
+
11
+ Use
12
+
13
+ ```bundle exec rake```
14
+
15
+ (Using ```rspec``` alone will not work).
16
+
17
+
18
+
9
19
  ## Maintenance policy of Serverspec/Specinfra
10
20
 
11
21
  * The person who found a bug should fix the bug by themself.
data/Rakefile CHANGED
@@ -6,6 +6,7 @@ rescue LoadError
6
6
  end
7
7
 
8
8
  if defined?(RSpec)
9
+ task :default => 'spec:all'
9
10
  task :spec => 'spec:all'
10
11
 
11
12
  namespace :spec do
@@ -1,9 +1,9 @@
1
- require 'json'
1
+ require 'multi_json'
2
2
 
3
3
  module Serverspec::Type
4
4
  class JsonFile < File
5
5
  def content
6
- JSON.parse(super)
6
+ MultiJson.load(super)
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.36.0"
2
+ VERSION = "2.36.1"
3
3
  end
@@ -15,11 +15,7 @@ describe file('/tmp') do
15
15
  end
16
16
 
17
17
  describe file('/etc/passwd') do
18
- it 'be_mode is not implemented' do
19
- expect {
20
- should be_mode 644
21
- }.to raise_exception
22
- end
18
+ it { should be_mode 644 }
23
19
  end
24
20
 
25
21
  describe file('/etc/passwd') do
@@ -413,6 +413,6 @@ describe file('/etc/passwd') do
413
413
  it 'be_immutable is not implemented in base class' do
414
414
  expect {
415
415
  should be_immutable
416
- }.to raise_exception
416
+ }.to raise_error(/is not implemented in Specinfra/)
417
417
  end
418
418
  end
@@ -27,7 +27,7 @@ describe service('sshd') do
27
27
  it {
28
28
  expect {
29
29
  should be_running.under('not implemented')
30
- }.to raise_exception
30
+ }.to raise_error(/is not implemented in Specinfra/)
31
31
  }
32
32
  end
33
33
 
@@ -49,6 +49,6 @@ describe service('sshd') do
49
49
  it {
50
50
  expect {
51
51
  should be_monitored_by('not implemented')
52
- }.to raise_exception
52
+ }.to raise_error(NotImplementedError)
53
53
  }
54
54
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'spec_helper'
3
- require 'json'
3
+ require 'multi_json'
4
4
 
5
5
  property[:os] = nil
6
6
  set :os, {:family => 'linux'}
@@ -21,7 +21,7 @@ end
21
21
 
22
22
  describe docker_container('restarting') do
23
23
  let(:stdout) do
24
- attrs = JSON.parse(inspect_container)
24
+ attrs = MultiJson.load(inspect_container)
25
25
  attrs.first['State']['Restarting'] = true
26
26
  attrs.to_json
27
27
  end
@@ -308,6 +308,6 @@ describe file('/etc/passwd') do
308
308
  it 'be_immutable is not implemented in base class' do
309
309
  expect {
310
310
  should be_immutable
311
- }.to raise_exception
311
+ }.to raise_error(/is not implemented in Specinfra/)
312
312
  end
313
313
  end
@@ -39,7 +39,7 @@ end
39
39
  describe file('/some/file') do
40
40
  it "should raise error if trying to check access by 'owner' or 'group' or 'others'" do
41
41
  ['owner', 'group', 'others'].each do |access|
42
- expect { should be_readable.by(access) }.to raise_error
42
+ expect { should be_readable.by(access) }.to raise_error(RuntimeError)
43
43
  end
44
44
  end
45
45
  end
@@ -59,7 +59,7 @@ end
59
59
  describe file('/some/file') do
60
60
  it "should raise error if trying to check access by 'owner' or 'group' or 'others'" do
61
61
  ['owner', 'group', 'others'].each do |access|
62
- expect { should be_writable.by(access) }.to raise_error
62
+ expect { should be_writable.by(access) }.to raise_error(RuntimeError)
63
63
  end
64
64
  end
65
65
  end
@@ -79,7 +79,7 @@ end
79
79
  describe file('/some/file') do
80
80
  it "should raise error if trying to check access by 'owner' or 'group' or 'others'" do
81
81
  ['owner', 'group', 'others'].each do |access|
82
- expect { should be_executable.by(access) }.to raise_error
82
+ expect { should be_executable.by(access) }.to raise_error(RuntimeError)
83
83
  end
84
84
  end
85
85
  end
@@ -97,17 +97,24 @@ describe file('/some/file') do
97
97
  end
98
98
 
99
99
  describe file('/some/test/file') do
100
- it "should raise error if command is not supported" do
100
+ it "should raise error if command is not implemented" do
101
101
  {
102
102
  :be_socket => [],
103
103
  :be_mode => 644,
104
104
  :be_grouped_into => 'root',
105
105
  :be_linked_to => '/some/other/file',
106
- :be_mounted => [],
106
+ :be_mounted => []
107
+ }.each do |method, args|
108
+ expect { should self.send(method, *args) }.to raise_error(NotImplementedError)
109
+ end
110
+ end
111
+
112
+ it "should raise error if command is not defined" do
113
+ {
107
114
  :match_md5checksum => '35435ea447c19f0ea5ef971837ab9ced',
108
115
  :match_sha256checksum => '0c3feee1353a8459f8c7d84885e6bc602ef853751ffdbce3e3b6dfa1d345fc7a'
109
116
  }.each do |method, args|
110
- expect { should self.send(method, *args) }.to raise_exception
117
+ expect { should self.send(method, *args) }.to raise_error(NoMethodError)
111
118
  end
112
119
  end
113
120
  end
@@ -17,7 +17,7 @@ describe group('test.group') do
17
17
  {
18
18
  :have_gid => [nil],
19
19
  }.each do |method, args|
20
- expect { should self.send(method, *args) }.to raise_exception
20
+ expect { should self.send(method, *args) }.to raise_error(NotImplementedError)
21
21
  end
22
22
  end
23
23
  end
@@ -22,9 +22,9 @@ end
22
22
 
23
23
  describe service('Test service') do
24
24
  it "should raise error if trying to check service process controller" do
25
- expect { should be_running.under('supervisor') }.to raise_error
25
+ expect { should be_running.under('supervisor') }.to raise_error(NotImplementedError)
26
26
  end
27
27
  it "should raise error if trying to check service monitoring" do
28
- expect { should_not be_monitored_by('monit') }.to raise_error
28
+ expect { should_not be_monitored_by('monit') }.to raise_error(NotImplementedError)
29
29
  end
30
30
  end
@@ -27,7 +27,7 @@ describe user('test.user') do
27
27
  :have_login_shell => [nil],
28
28
  :have_authorized_key => [nil],
29
29
  }.each do |method, args|
30
- expect { should self.send(method, *args) }.to raise_exception
30
+ expect { should self.send(method, *args) }.to raise_error(NotImplementedError)
31
31
  end
32
32
  end
33
33
  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.36.0
4
+ version: 2.36.1
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-05-20 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec