serverspec 2.0.0.beta4 → 2.0.0.beta5
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 +4 -4
- data/lib/serverspec.rb +16 -30
- data/lib/serverspec/helper/type.rb +1 -1
- data/lib/serverspec/type/ppa.rb +13 -0
- data/lib/serverspec/version.rb +1 -1
- data/serverspec.gemspec +1 -1
- data/spec/unit/command_spec.rb +10 -10
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64b36a55510e28dba398ec529d17c58bd6d5d209
|
4
|
+
data.tar.gz: cc5a71e21b65c51ad8b09dd15b80727c02d4d149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 087b2a6bfc2d5f6f6df8fb81302ad0dbf9ae4d7dcf13619cfffda53106beeb36859caae13d1ee60f36d8c65118941d47c13e218f16f5fc56257885e965eed091
|
7
|
+
data.tar.gz: f167bc461d6fb27e4404f0015cdc7b38182e9710c120fd904c4e011520244af2487641671897b448093748f9802567380943f480094788f04f2e1208d3ec5feb
|
data/lib/serverspec.rb
CHANGED
@@ -10,38 +10,24 @@ require 'serverspec/subject'
|
|
10
10
|
require 'serverspec/commands/base'
|
11
11
|
require 'rspec/core/formatters/base_formatter'
|
12
12
|
|
13
|
-
module RSpec
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
exception_class_name
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
if shared_group = find_shared_group(example)
|
27
|
-
dump_shared_failure_info(shared_group)
|
28
|
-
end
|
13
|
+
module RSpec::Core::Notifications
|
14
|
+
class FailedExampleNotification < ExampleNotification
|
15
|
+
def message_lines
|
16
|
+
@lines ||=
|
17
|
+
begin
|
18
|
+
lines = ["Failure/Error: #{read_failed_line.strip}"]
|
19
|
+
lines << "#{exception_class_name}:" unless exception_class_name =~ /RSpec/
|
20
|
+
exception.message.to_s.split("\n").each do |line|
|
21
|
+
lines << " #{line}" if exception.message
|
22
|
+
lines << " #{example.metadata[:command]}"
|
23
|
+
lines << " #{example.metadata[:stdout]}" if example.metadata[:stdout]
|
24
|
+
lines << " #{example.metadata[:stderr]}" if example.metadata[:stderr]
|
29
25
|
end
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
exception = example.execution_result[:exception]
|
34
|
-
exception_class_name = exception_class_name_for(exception)
|
35
|
-
output.puts "#{long_padding}#{failure_color("Failure/Error:")} #{failure_color(read_failed_line(exception, example).strip)}"
|
36
|
-
output.puts "#{long_padding}#{failure_color(exception_class_name)}: #{failure_color(exception.message)}" unless exception_class_name =~ /RSpec/
|
37
|
-
output.puts "#{long_padding} #{failure_color(example.metadata[:command])}" if example.metadata[:command]
|
38
|
-
output.puts "#{long_padding} #{failure_color(example.metadata[:stdout])}" if example.metadata[:stdout] != ''
|
39
|
-
exception.message.to_s.split("\n").each { |line| output.puts "#{long_padding} #{failure_color(line)}" } if exception.message
|
40
|
-
|
41
|
-
if shared_group = find_shared_group(example)
|
42
|
-
dump_shared_failure_info(shared_group)
|
43
|
-
end
|
26
|
+
if shared_group
|
27
|
+
lines << "Shared Example Group: \"#{shared_group.metadata[:shared_group_name]}\"" +
|
28
|
+
" called from #{backtrace_formatter.backtrace_line(shared_group.location)}"
|
44
29
|
end
|
30
|
+
lines
|
45
31
|
end
|
46
32
|
end
|
47
33
|
end
|
@@ -4,7 +4,7 @@ module Serverspec
|
|
4
4
|
types = %w(
|
5
5
|
base cgroup command cron default_gateway file group host iis_website iis_app_pool interface
|
6
6
|
ipfilter ipnat iptables kernel_module linux_kernel_parameter lxc mail_alias
|
7
|
-
package php_config port process routing_table selinux service user yumrepo
|
7
|
+
package php_config port ppa process routing_table selinux service user yumrepo
|
8
8
|
windows_feature windows_hot_fix windows_registry_key windows_scheduled_task zfs
|
9
9
|
)
|
10
10
|
|
data/lib/serverspec/version.rb
CHANGED
data/serverspec.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "net-ssh"
|
22
|
-
spec.add_runtime_dependency "rspec", "~> 3.0.0
|
22
|
+
spec.add_runtime_dependency "rspec", "~> 3.0.0"
|
23
23
|
spec.add_runtime_dependency "rspec-its"
|
24
24
|
spec.add_runtime_dependency "highline"
|
25
25
|
spec.add_runtime_dependency "specinfra", "~> 2.0.0.beta2"
|
data/spec/unit/command_spec.rb
CHANGED
@@ -50,32 +50,32 @@ describe Serverspec::Type::Command do
|
|
50
50
|
|
51
51
|
describe '#return_stdout?' do
|
52
52
|
it 'matches against a string, stripping whitespace' do
|
53
|
-
expect(subject.return_stdout? 'banana').to
|
54
|
-
expect(subject.return_stdout? 'pancake').to
|
53
|
+
expect(subject.return_stdout? 'banana').to be_truthy
|
54
|
+
expect(subject.return_stdout? 'pancake').to be_falsey
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'matches against a regex' do
|
58
|
-
expect(subject.return_stdout? /anan/).to
|
59
|
-
expect(subject.return_stdout? /^anan/).to
|
58
|
+
expect(subject.return_stdout? /anan/).to be_truthy
|
59
|
+
expect(subject.return_stdout? /^anan/).to be_falsey
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
63
|
describe '#return_stderr?' do
|
64
64
|
it 'matches against a string, stripping whitespace' do
|
65
|
-
expect(subject.return_stderr? 'split').to
|
66
|
-
expect(subject.return_stderr? 'pancake').to
|
65
|
+
expect(subject.return_stderr? 'split').to be_truthy
|
66
|
+
expect(subject.return_stderr? 'pancake').to be_falsey
|
67
67
|
end
|
68
68
|
|
69
69
|
it 'matches against a regex' do
|
70
|
-
expect(subject.return_stderr? /pli/).to
|
71
|
-
expect(subject.return_stderr? /^pli/).to
|
70
|
+
expect(subject.return_stderr? /pli/).to be_truthy
|
71
|
+
expect(subject.return_stderr? /^pli/).to be_falsey
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
75
|
describe '#return_stderr?' do
|
76
76
|
it 'matches against an integer' do
|
77
|
-
expect(subject.return_exit_status? 42).to
|
78
|
-
expect(subject.return_exit_status? 43).to
|
77
|
+
expect(subject.return_exit_status? 42).to be_truthy
|
78
|
+
expect(subject.return_exit_status? 43).to be_falsey
|
79
79
|
end
|
80
80
|
end
|
81
81
|
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.0.0.
|
4
|
+
version: 2.0.0.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05
|
11
|
+
date: 2014-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0.0
|
33
|
+
version: 3.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0.0
|
40
|
+
version: 3.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec-its
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -203,6 +203,7 @@ files:
|
|
203
203
|
- lib/serverspec/type/package.rb
|
204
204
|
- lib/serverspec/type/php_config.rb
|
205
205
|
- lib/serverspec/type/port.rb
|
206
|
+
- lib/serverspec/type/ppa.rb
|
206
207
|
- lib/serverspec/type/process.rb
|
207
208
|
- lib/serverspec/type/routing_table.rb
|
208
209
|
- lib/serverspec/type/selinux.rb
|