luna-rspec-formatters 3.7.4 → 3.8.0

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: 7b06cc00b22f36b040080f5639de2cb4c10250a9
4
- data.tar.gz: c58850048f4e7c74a37234ddf10fe4d4f0569c88
3
+ metadata.gz: f5a7b1fa2708300106589ded4c79827d8fd3e027
4
+ data.tar.gz: 8fe82bcf28934a27da8c594fd81829f3ed55bc0b
5
5
  SHA512:
6
- metadata.gz: 0d8199f1fcef313a35c9ccba35381ae073767a4bbc5e186cd85af6612989001c67af1f03af98b85c9b80692c6f369fc3a33e1ea990709abbaddc69139bb427f7
7
- data.tar.gz: ddff27856640f609d14222b44562feccd4a304ed3d070e873b601d9221e24e79a727c5eb1d150ff8bf92c04893755fb803e9feed1ded8676aacf2c52500983af
6
+ metadata.gz: 3510edf993ae5e26997c91c7263352f8d96b03bbce1b81acb78365b21c0647a7de1502618a5bf0ae9bf349c0fb4ea934200526a76f4ef35bfb27b7ae021c05df
7
+ data.tar.gz: cd4cb3124fa25ecc7a9625cbbe39a96f66c8e63d802312e5f72087bb1dfc484327eab0aedc508ea31598b2105cf23427660b2e530d87f49c8fd6e6d148908b9e
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # ----------------------------------------------------------------------------
2
2
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
3
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
4
  # Encoding: utf-8
5
5
  # ----------------------------------------------------------------------------
6
6
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2016 Jordon Bedwell
1
+ Copyright (c) 2015-2017 Jordon Bedwell
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the "Software"),
@@ -1,8 +1,6 @@
1
- # ----------------------------------------------------------------------------
2
1
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
3
  # Encoding: utf-8
5
- # ----------------------------------------------------------------------------
6
4
 
7
5
  require "luna/rspec/formatters/emoji"
8
6
 
@@ -21,10 +19,9 @@ module Luna
21
19
  ]
22
20
  end
23
21
 
24
- # --------------------------------------------------------------------
22
+ # --
25
23
  # Passed.
26
- # --------------------------------------------------------------------
27
-
24
+ # --
28
25
  def example_passed(_)
29
26
  newline_or_addup
30
27
  output.print " ".freeze, success_color(
@@ -32,10 +29,9 @@ module Luna
32
29
  )
33
30
  end
34
31
 
35
- # --------------------------------------------------------------------
32
+ # --
36
33
  # Failed.
37
- # --------------------------------------------------------------------
38
-
34
+ # --
39
35
  def example_failed(_)
40
36
  newline_or_addup
41
37
  output.print " ".freeze, failure_color(
@@ -43,10 +39,9 @@ module Luna
43
39
  )
44
40
  end
45
41
 
46
- # --------------------------------------------------------------------
42
+ # --
47
43
  # Pending.
48
- # --------------------------------------------------------------------
49
-
44
+ # --
50
45
  def example_pending(_)
51
46
  newline_or_addup
52
47
  output.print " ".freeze, pending_color(
@@ -1,8 +1,6 @@
1
- # ----------------------------------------------------------------------------
2
1
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
3
  # Encoding: utf-8
5
- # ----------------------------------------------------------------------------
6
4
 
7
5
  require "luna/rspec/formatters/emoji"
8
6
 
@@ -23,10 +21,9 @@ module Luna
23
21
  ]
24
22
  end
25
23
 
26
- # --------------------------------------------------------------------
24
+ # --
27
25
  # Passed.
28
- # --------------------------------------------------------------------
29
-
26
+ # --
30
27
  def example_passed(_)
31
28
  newline_or_addup
32
29
  output.print " ".freeze, success_color(
@@ -34,10 +31,9 @@ module Luna
34
31
  )
35
32
  end
36
33
 
37
- # --------------------------------------------------------------------
34
+ # --
38
35
  # Failed.
39
- # --------------------------------------------------------------------
40
-
36
+ # --
41
37
  def example_failed(_)
42
38
  newline_or_addup
43
39
  output.print " ".freeze, failure_color(
@@ -45,10 +41,9 @@ module Luna
45
41
  )
46
42
  end
47
43
 
48
- # --------------------------------------------------------------------
44
+ # --
49
45
  # Pending.
50
- # --------------------------------------------------------------------
51
-
46
+ # --
52
47
  def example_pending(_)
53
48
  newline_or_addup
54
49
  output.print " ".freeze, pending_color(
@@ -1,9 +1,8 @@
1
- # ----------------------------------------------------------------------------
2
1
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
3
  # Encoding: utf-8
5
- # ----------------------------------------------------------------------------
6
4
 
5
+ require "io/console"
7
6
  require "rspec/core/formatters/base_text_formatter"
8
7
  require "luna/rspec/formatters/profile"
9
8
  require "rspec/version"
@@ -16,43 +15,40 @@ module Luna
16
15
 
17
16
  [:success, :failure, :pending].each do |m|
18
17
  define_method "#{m}_color" do |v|
19
- defined?(super) ? super(v) : Object::RSpec::Core::Formatters::ConsoleCodes.wrap(v, m)
18
+ return super(v) if defined?(super)
19
+ Object::RSpec::Core::Formatters::ConsoleCodes.wrap(v, m)
20
20
  end
21
21
  end
22
22
 
23
- # --------------------------------------------------------------------
23
+ # --
24
24
  # Note: If the terminal is too small we just let it go.
25
25
  # The total columns we allow.
26
- # --------------------------------------------------------------------
27
-
26
+ # --
28
27
  def allowed_cols
29
28
  @cols ||= begin
30
29
  (val = IO.console.winsize.last / 4) >= 24 ? val.floor : Float::INFINITY
31
30
  end
32
31
  end
33
32
 
34
- # --------------------------------------------------------------------
33
+ # --
35
34
  # Start.
36
- # --------------------------------------------------------------------
37
-
35
+ # --
38
36
  def start(_)
39
37
  @lines = 0
40
38
  output.puts
41
39
  end
42
40
 
43
- # --------------------------------------------------------------------
41
+ # --
44
42
  # End.
45
- # --------------------------------------------------------------------
46
-
43
+ # --
47
44
  def start_dump(_)
48
45
  output.puts
49
46
  end
50
47
 
51
- # --------------------------------------------------------------------
48
+ # --
52
49
  # Determine if we should start a new line or keep on pushing out.
53
50
  # Note: if the terminal is too small we just let it go.
54
- # --------------------------------------------------------------------
55
-
51
+ # --
56
52
  private
57
53
  def newline_or_addup
58
54
  return @lines+= 1 unless @lines == allowed_cols
@@ -1,8 +1,6 @@
1
- # ----------------------------------------------------------------------------
2
1
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
3
  # Encoding: utf-8
5
- # ----------------------------------------------------------------------------
6
4
 
7
5
  require "rspec/core/formatters/base_text_formatter"
8
6
  require "luna/rspec/formatters/profile"
@@ -26,8 +24,7 @@ module Luna
26
24
  ]
27
25
  end
28
26
 
29
- # --------------------------------------------------------------------
30
-
27
+ # --
31
28
  [:success, :failure, :pending].each do |m|
32
29
  define_method "#{m}_color" do |v|
33
30
  defined?(super) ? super(v) : ::RSpec::Core::Formatters::ConsoleCodes.wrap(
@@ -36,26 +33,23 @@ module Luna
36
33
  end
37
34
  end
38
35
 
39
- # --------------------------------------------------------------------
36
+ # --
40
37
  # Start.
41
- # --------------------------------------------------------------------
42
-
38
+ # --
43
39
  def start(_)
44
40
  output.puts
45
41
  end
46
42
 
47
- # --------------------------------------------------------------------
43
+ # --
48
44
  # End.
49
- # --------------------------------------------------------------------
50
-
45
+ # --
51
46
  def start_dump(_)
52
47
  output.puts
53
48
  end
54
49
 
55
- # --------------------------------------------------------------------
50
+ # --
56
51
  # Passed.
57
- # --------------------------------------------------------------------
58
-
52
+ # --
59
53
  def example_passed(struct)
60
54
  output.print "\s"
61
55
  print_description(
@@ -63,10 +57,9 @@ module Luna
63
57
  )
64
58
  end
65
59
 
66
- # --------------------------------------------------------------------
60
+ # --
67
61
  # Failed.
68
- # --------------------------------------------------------------------
69
-
62
+ # --
70
63
  def example_failed(struct)
71
64
  output.print "\s"
72
65
  print_description(
@@ -74,10 +67,9 @@ module Luna
74
67
  )
75
68
  end
76
69
 
77
- # --------------------------------------------------------------------
70
+ # --
78
71
  # Pending.
79
- # --------------------------------------------------------------------
80
-
72
+ # --
81
73
  def example_pending(struct)
82
74
  output.print "\s"
83
75
  print_description(
@@ -85,19 +77,17 @@ module Luna
85
77
  )
86
78
  end
87
79
 
88
- # --------------------------------------------------------------------
80
+ # --
89
81
  # Pull.
90
- # --------------------------------------------------------------------
91
-
82
+ # --
92
83
  def get_example(struct)
93
84
  return struct unless struct.respond_to?(:example)
94
85
  struct.example
95
86
  end
96
87
 
97
- # --------------------------------------------------------------------
88
+ # --
98
89
  # Description.
99
- # --------------------------------------------------------------------
100
-
90
+ # --
101
91
  def print_description(example, type)
102
92
  output.print send(
103
93
  :"#{type}_color", " " + example.full_description + "\n"
@@ -1,8 +1,6 @@
1
- # ----------------------------------------------------------------------------
2
1
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
3
  # Encoding: utf-8
5
- # ----------------------------------------------------------------------------
6
4
 
7
5
  require "luna/rspec/formatters/emoji"
8
6
 
@@ -21,10 +19,9 @@ module Luna
21
19
  ]
22
20
  end
23
21
 
24
- # --------------------------------------------------------------------
22
+ # --
25
23
  # Passed.
26
- # --------------------------------------------------------------------
27
-
24
+ # --
28
25
  def example_passed(_)
29
26
  newline_or_addup
30
27
  output.print " ".freeze, success_color(
@@ -32,10 +29,9 @@ module Luna
32
29
  )
33
30
  end
34
31
 
35
- # --------------------------------------------------------------------
32
+ # --
36
33
  # Failed.
37
- # --------------------------------------------------------------------
38
-
34
+ # --
39
35
  def example_failed(_)
40
36
  newline_or_addup
41
37
  output.print " ".freeze, failure_color(
@@ -43,10 +39,9 @@ module Luna
43
39
  )
44
40
  end
45
41
 
46
- # --------------------------------------------------------------------
42
+ # --
47
43
  # Pending.
48
- # --------------------------------------------------------------------
49
-
44
+ # --
50
45
  def example_pending(_)
51
46
  newline_or_addup
52
47
  output.print " ".freeze, pending_color(
@@ -1,8 +1,6 @@
1
- # ----------------------------------------------------------------------------
2
1
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
3
  # Encoding: utf-8
5
- # ----------------------------------------------------------------------------
6
4
 
7
5
  module Luna
8
6
  module RSpec
@@ -13,18 +11,17 @@ module Luna
13
11
  GROUPS_HEADER = "\nTop %{size} slowest example groups:"
14
12
  EXAMPLES = " %{location} \u2910 %{seconds}"
15
13
 
16
- # --------------------------------------------------------------------
14
+ # --
17
15
  # Help.
18
- # --------------------------------------------------------------------
16
+ # --
19
17
 
20
18
  def helpers
21
19
  ::RSpec::Core::Formatters::Helpers
22
20
  end
23
21
 
24
- # --------------------------------------------------------------------
22
+ # --
25
23
  # Profile.
26
- # --------------------------------------------------------------------
27
-
24
+ # --
28
25
  def dump_profile(profile)
29
26
  dump_profile_slowest_examples(profile)
30
27
  dump_profile_slowest_example_groups(
@@ -32,10 +29,9 @@ module Luna
32
29
  )
33
30
  end
34
31
 
35
- # --------------------------------------------------------------------
32
+ # --
36
33
  # Slow examples.
37
- # --------------------------------------------------------------------
38
-
34
+ # --
39
35
  private
40
36
  def dump_profile_slowest_examples(profile)
41
37
  examples_header(profile)
@@ -52,10 +48,9 @@ module Luna
52
48
  end
53
49
  end
54
50
 
55
- # --------------------------------------------------------------------
51
+ # --
56
52
  # Slowest example groups.
57
- # --------------------------------------------------------------------
58
-
53
+ # --
59
54
  private
60
55
  def dump_profile_slowest_example_groups(profile)
61
56
  groups_header(profile)
@@ -73,10 +68,9 @@ module Luna
73
68
  end
74
69
  end
75
70
 
76
- # --------------------------------------------------------------------
71
+ # --
77
72
  # Headers group.
78
- # --------------------------------------------------------------------
79
-
73
+ # --
80
74
  private
81
75
  def groups_header(profile)
82
76
  @output.puts GROUPS_HEADER % {
@@ -84,10 +78,9 @@ module Luna
84
78
  }
85
79
  end
86
80
 
87
- # --------------------------------------------------------------------
81
+ # --
88
82
  # Header example.
89
- # --------------------------------------------------------------------
90
-
83
+ # --
91
84
  private
92
85
  def examples_header(profile)
93
86
  @output.puts EXAMPLES_HEADER % {
@@ -97,8 +90,7 @@ module Luna
97
90
  }
98
91
  end
99
92
 
100
- # --------------------------------------------------------------------
101
-
93
+ # --
102
94
  private
103
95
  def color_blue(str)
104
96
  Object::RSpec::Core::Formatters::ConsoleCodes.wrap(
@@ -106,8 +98,7 @@ module Luna
106
98
  )
107
99
  end
108
100
 
109
- # --------------------------------------------------------------------
110
-
101
+ # --
111
102
  private
112
103
  def strip_relative(path)
113
104
  path.gsub(
@@ -115,8 +106,7 @@ module Luna
115
106
  )
116
107
  end
117
108
 
118
- # --------------------------------------------------------------------
119
-
109
+ # --
120
110
  private
121
111
  def format_caller(caller_info)
122
112
  color_blue strip_relative(::RSpec.configuration.backtrace_formatter.backtrace_line(
@@ -1,5 +1,5 @@
1
1
  # Frozen-string-literal: true
2
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
3
3
  # Encoding: utf-8
4
4
 
5
5
  require "luna/rspec/formatters/emoji"
@@ -19,10 +19,9 @@ module Luna
19
19
  ]
20
20
  end
21
21
 
22
- # --------------------------------------------------------------------
22
+ # --
23
23
  # Passed.
24
- # --------------------------------------------------------------------
25
-
24
+ # --
26
25
  def example_passed(_)
27
26
  newline_or_addup
28
27
  output.print " ".freeze, success_color(
@@ -30,10 +29,9 @@ module Luna
30
29
  )
31
30
  end
32
31
 
33
- # --------------------------------------------------------------------
32
+ # --
34
33
  # Failed.
35
- # --------------------------------------------------------------------
36
-
34
+ # --
37
35
  def example_failed(_)
38
36
  newline_or_addup
39
37
  output.print " ".freeze, failure_color(
@@ -41,10 +39,9 @@ module Luna
41
39
  )
42
40
  end
43
41
 
44
- # --------------------------------------------------------------------
42
+ # --
45
43
  # Pending.
46
- # --------------------------------------------------------------------
47
-
44
+ # --
48
45
  def example_pending(_)
49
46
  newline_or_addup
50
47
  output.print " ".freeze, pending_color(
@@ -1,13 +1,11 @@
1
- # ----------------------------------------------------------------------------
2
1
  # Frozen-string-literal: true
3
- # Copyright: 2015 - 2016 Jordon Bedwell - MIT License
2
+ # Copyright: 2015 - 2017 Jordon Bedwell - MIT License
4
3
  # Encoding: utf-8
5
- # ----------------------------------------------------------------------------
6
4
 
7
5
  module Luna
8
6
  module Rspec
9
7
  module Formatters
10
- VERSION = "3.7.4"
8
+ VERSION = "3.8.0"
11
9
  end
12
10
  end
13
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luna-rspec-formatters
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.4
4
+ version: 3.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordon Bedwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-19 00:00:00.000000000 Z
11
+ date: 2017-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -30,6 +30,20 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: io-console
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.4'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.4'
33
47
  description: RSpec formatters that are dedicated to Luna.
34
48
  email:
35
49
  - jordon@envygeeks.io
@@ -68,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
82
  version: '0'
69
83
  requirements: []
70
84
  rubyforge_project:
71
- rubygems_version: 2.6.2
85
+ rubygems_version: 2.5.2
72
86
  signing_key:
73
87
  specification_version: 4
74
88
  summary: RSpec formatters dedicated to Luna.