prettybacon 0.0.1 → 0.0.2

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: 19d7a5280fdbac6cbe678cd81a8821f4dcb722af
4
- data.tar.gz: 24857e7d54a066de358835230bc52a65cc64b5f5
3
+ metadata.gz: 60f5ba1c56f645b3641d35f842cc723eda252ff7
4
+ data.tar.gz: 2bf8061e4006edda05ed8076c9f11c4110e4dbd5
5
5
  SHA512:
6
- metadata.gz: 09161aa6927b1710aa37f5a81fdc640c00848c90bdfb3761bbe1ab69603f705221e5ad353f75c420d0b01a11f56051d4cf9965d4cf84fdba118ee5ea0d503340
7
- data.tar.gz: 3a89df33d9f5d67f33da568d58bb591f0fbd69c62a465fb13ed9865bbd2409812d774b34a3a49942dcf48e61ad3d6461c871227b53dfa2cb8a116e45c4121fda
6
+ metadata.gz: 089750b8fb5489abee6329600449caa7b45554a0e3170a16618920a12de5b8e250ab4de34acd9717420d82b1e12a55f6ad5040f12926169f59d073837cb6e9f7
7
+ data.tar.gz: 6e9347c4df15a690961922cdae2dad86a33189fef9772e62fe1ab7ec46d02cd86f353130dc86791929e64fb9e53771cf414d4e5ad0bd29ff3fa4f0ee6b161be1
@@ -47,7 +47,7 @@ module Bacon
47
47
  if elapsed_time <= 1
48
48
  elapsed_time_string = ''
49
49
  elsif elapsed_time >= 1000
50
- elapsed_time_string = "(#{elapsed_time/1000} s)"
50
+ elapsed_time_string = "(#{'%.1f' % (elapsed_time/1000.0)} s)"
51
51
  else
52
52
  elapsed_time_string = "(#{elapsed_time} ms)"
53
53
  end
@@ -64,8 +64,13 @@ module Bacon
64
64
  unless Counter[:disabled].zero?
65
65
  puts PrettyBacon.color(:yellow, "#{Counter[:disabled]} disabled specifications\n")
66
66
  end
67
- puts "%d specifications (%d requirements), %d failures, %d errors" %
67
+ result = "%d specifications (%d requirements), %d failures, %d errors" %
68
68
  Counter.values_at(:specifications, :requirements, :failed, :errors)
69
+ if Counter[:failed].zero? && Counter[:errors].zero?
70
+ puts PrettyBacon.color(:green, result)
71
+ else
72
+ puts PrettyBacon.color(:red, result)
73
+ end
69
74
  end
70
75
 
71
76
  #:nodoc:
@@ -11,6 +11,7 @@ module Bacon
11
11
  print indicator
12
12
  @indicators||=''
13
13
  @indicators << indicator
14
+ @last_spec_name = name
14
15
  yield
15
16
  end
16
17
 
@@ -24,15 +25,18 @@ module Bacon
24
25
  # After the first failure or error all the other requirements are skipped.
25
26
  #
26
27
  def handle_requirement(description, disabled = false)
27
- if @first_error
28
+ if @skip_the_rest
28
29
  indicator = PrettyBacon.color(nil, '_')
29
30
  else
30
31
  error = yield
31
32
  if !error.empty?
32
- @first_error = true
33
- m = error[0..0]
34
- c = (m == "E" ? :red : :yellow)
35
- indicator = PrettyBacon.color(c, m)
33
+ @skip_the_rest = true
34
+ message = error[0..0]
35
+ color = (message == "E" ? :red : :yellow)
36
+ indicator = PrettyBacon.color(color, message)
37
+ spec_message = @last_spec_name
38
+ desc_message = PrettyBacon.color(color, description)
39
+ @failing_rquirement = "#{spec_message}: #{desc_message}"
36
40
  elsif disabled
37
41
  indicator = "D"
38
42
  else
@@ -45,6 +49,9 @@ module Bacon
45
49
  end
46
50
 
47
51
  def handle_summary
52
+ puts "\n\n"
53
+ puts @failing_rquirement
54
+
48
55
  first_error = ''
49
56
  error_count = 0
50
57
  ErrorLog.lines.each do |s|
@@ -60,7 +67,7 @@ module Bacon
60
67
  end
61
68
  result = "%d specifications (%d requirements), %d failures, %d errors" %
62
69
  Counter.values_at(:specifications, :requirements, :failed, :errors)
63
- if Counter[:failed].zero?
70
+ if Counter[:failed].zero? && Counter[:errors].zero?
64
71
  puts PrettyBacon.color(:green, result)
65
72
  else
66
73
  puts PrettyBacon.color(:red, result)
@@ -1,3 +1,3 @@
1
1
  module PrettyBacon
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prettybacon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio A. Pelosin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-09 00:00:00.000000000 Z
11
+ date: 2014-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bacon
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Prettifies Bacon output.
@@ -59,7 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
62
+ - ".gitignore"
63
63
  - Gemfile
64
64
  - LICENSE.txt
65
65
  - PrettyBacon.gemspec
@@ -80,17 +80,17 @@ require_paths:
80
80
  - lib
81
81
  required_ruby_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.0.3
93
+ rubygems_version: 2.2.2
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Prettifies Bacon output.