serverspec 2.0.0.beta4 → 2.0.0.beta5

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: e1809aeacf6e576b6db3d8a02fa16dc10ff1cb6e
4
- data.tar.gz: 31c07182a7d9cccda87cc495f82a0deccfd67715
3
+ metadata.gz: 64b36a55510e28dba398ec529d17c58bd6d5d209
4
+ data.tar.gz: cc5a71e21b65c51ad8b09dd15b80727c02d4d149
5
5
  SHA512:
6
- metadata.gz: 5e02326bf9b8c04328bdb8d01e4b4bdadc9b467705e46e0bc7ae340d27c4458fc097540871f3a726a77628d229e1743d248d6cb832e428b3147b425f410b853e
7
- data.tar.gz: 2dbd444b9ba8e80368832c35ca78a6f86bbc9207f0e00140cd2e90b6e950f397482df0cebc43c234e8bc3b34068a4ffa2bc682c9357f404b8836aee390de726c
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
- module Core
15
- module Formatters
16
- class BaseTextFormatter < BaseFormatter
17
- def dump_failure_info(example)
18
- exception = example.execution_result[:exception]
19
- exception_class_name = exception_class_name_for(exception)
20
- output.puts "#{long_padding}#{failure_color("Failure/Error:")} #{failure_color(read_failed_line(exception, example).strip)}"
21
- output.puts "#{long_padding}#{failure_color(exception_class_name)}: #{failure_color(exception.message)}" unless exception_class_name =~ /RSpec/
22
- output.puts "#{long_padding} #{failure_color(example.metadata[:command])}" if example.metadata[:command]
23
- output.puts "#{long_padding} #{failure_color(example.metadata[:stdout])}" if example.metadata[:stdout] != ''
24
- exception.message.to_s.split("\n").each { |line| output.puts "#{long_padding} #{failure_color(line)}" } if exception.message
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
- end
31
- class ProgressFormatter < BaseTextFormatter
32
- def dump_failure_info(example)
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
 
@@ -0,0 +1,13 @@
1
+ module Serverspec
2
+ module Type
3
+ class Ppa < Base
4
+ def exists?
5
+ backend.check_ppa(@name)
6
+ end
7
+
8
+ def enabled?
9
+ backend.check_ppa_enabled(@name)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "2.0.0.beta4"
2
+ VERSION = "2.0.0.beta5"
3
3
  end
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.rc"
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"
@@ -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 be_true
54
- expect(subject.return_stdout? 'pancake').to be_false
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 be_true
59
- expect(subject.return_stdout? /^anan/).to be_false
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 be_true
66
- expect(subject.return_stderr? 'pancake').to be_false
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 be_true
71
- expect(subject.return_stderr? /^pli/).to be_false
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 be_true
78
- expect(subject.return_exit_status? 43).to be_false
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.beta4
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-25 00:00:00.000000000 Z
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.rc
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.rc
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