rspec-loop 0.1.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f52b2514234359848401c2976cef3d777b18c1b70ec118f7b387e426e53b1dee
4
- data.tar.gz: e9fc70a1f959ae43b49273245fb8f06f5f9020aa6180a2b1506e5962dc1f4fca
3
+ metadata.gz: 7402c8cc78a45ea9a4a4ed83b0338ac274ea7bee23dc514af032f7908dd65d76
4
+ data.tar.gz: e106267104f781f31be4c6fec4f3c468eef429516a2dea81cdb4cdede7861d8a
5
5
  SHA512:
6
- metadata.gz: c062752f126102aea062b3938ef9609348034366382fd0cf5c7800f671ca09a7f7f9edf5139a38ebca66608d5d48548b5fa8586bbdea11f91d363210b84c0521
7
- data.tar.gz: 83d38c03a5d02a50325bd3fff343f2ad92f0e684e0340972d623a7790384732d7f7bdf63a06deb96b1cfdd0f3216e48d339332dbcceb1bbac89a4926495c30ea
6
+ metadata.gz: 49c399fba4ea6e1e967c7ccec2d344caf8b69cfd6e55b671797ca09fc75b3154962bdc565c4e2cafe794cadc4f1e7c7827599026b07f8673a337d9b2b7838ee4
7
+ data.tar.gz: 39eaa277af6c9f5fcff453628d51b0fc3f029ebd017b536c0ac9310e195bc3ae2e17080bf2fd3257481d26b628d3402ab3dae2f286da31a129b87c557cf4cf47
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2025-07-21
4
+
5
+ - Fix error when attempting to show summary of pending examples' exceptions with rspec-core < 3.13
6
+
7
+ ## [0.2.0] - 2025-07-18
8
+
9
+ - Display each failure iteration in rspec summary.
10
+
3
11
  ## [0.1.0] - 2025-07-10
4
12
 
5
13
  - Initial release
data/Rakefile CHANGED
@@ -3,7 +3,9 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
5
 
6
- RSpec::Core::RakeTask.new(:spec)
6
+ RSpec::Core::RakeTask.new(:spec) do |t|
7
+ t.pattern = "spec/rspec/**/*_spec.rb"
8
+ end
7
9
 
8
10
  require "rubocop/rake_task"
9
11
 
@@ -12,8 +14,17 @@ RuboCop::RakeTask.new
12
14
  task default: %i[spec rubocop]
13
15
 
14
16
  namespace :spec do
15
- desc "Run specs in a loop"
17
+ desc "Run specs with the rspec-loop formatter"
16
18
  RSpec::Core::RakeTask.new(:loop) do |t|
19
+ t.pattern = "spec/rspec/**/*_spec.rb"
17
20
  t.rspec_opts = "--format RSpec::Loop::Formatter"
18
21
  end
22
+
23
+ namespace :formatter do
24
+ desc "Run example specs to demonstrate formatter"
25
+ RSpec::Core::RakeTask.new(:example) do |t|
26
+ t.pattern = "spec/example/**/*_spec.rb"
27
+ t.rspec_opts = "--format RSpec::Loop::Formatter"
28
+ end
29
+ end
19
30
  end
@@ -91,7 +91,8 @@ module RSpec
91
91
  end
92
92
 
93
93
  def dump_pending(notification)
94
- return if RSpec.configuration.pending_failure_output == :skip
94
+ return if RSpec.configuration.respond_to?(:pending_failure_output) &&
95
+ RSpec.configuration.pending_failure_output == :skip
95
96
  return if notification.pending_notifications.empty?
96
97
 
97
98
  formatted = "\nPending: (Failures listed here are expected and do not affect your suite's status)\n".dup
@@ -99,7 +100,7 @@ module RSpec
99
100
  pending_examples.each_with_index do |pending, index|
100
101
  formatted << pending.fully_formatted(index.next)
101
102
  end
102
- puts formatted
103
+ output.puts formatted
103
104
  end
104
105
 
105
106
  def dump_failures(notification)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  class Loop
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
data/lib/rspec/loop.rb CHANGED
@@ -54,7 +54,7 @@ module RSpec
54
54
  @procsy.reporter.notify(:example_iteration_finished, RSpec::Core::Notifications::ExampleNotification.for(@procsy))
55
55
  end
56
56
 
57
- @procsy.exception = loop_results.map(&:exception).compact.first
57
+ @procsy.exception = summarize_exceptions(loop_results)
58
58
  pending_message = loop_results.map(&:pending_message).compact.first
59
59
 
60
60
  @procsy.execution_result.status = (@procsy.exception && :failed) || (pending_message && :pending) || :passed
@@ -64,6 +64,15 @@ module RSpec
64
64
  @procsy.execution_result.finished_at = loop_results.last.finished_at
65
65
  @procsy.execution_result.run_time = @procsy.execution_result.finished_at - @procsy.execution_result.started_at
66
66
  end
67
+
68
+ private
69
+
70
+ def summarize_exceptions(results)
71
+ exceptions = results.map(&:exception).compact
72
+ return exceptions&.first if exceptions.count <= 1
73
+
74
+ RSpec::Core::MultipleExceptionError.new(*exceptions)
75
+ end
67
76
  end
68
77
  end
69
78
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-loop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kcboschert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-11 00:00:00.000000000 Z
11
+ date: 2025-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 3.10.0
75
+ version: 3.13.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.10.0
82
+ version: 3.13.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -109,13 +109,9 @@ files:
109
109
  - README.md
110
110
  - Rakefile
111
111
  - gemfiles/rspec_3.10.gemfile
112
- - gemfiles/rspec_3.10.gemfile.lock
113
112
  - gemfiles/rspec_3.11.gemfile
114
- - gemfiles/rspec_3.11.gemfile.lock
115
113
  - gemfiles/rspec_3.12.gemfile
116
- - gemfiles/rspec_3.12.gemfile.lock
117
114
  - gemfiles/rspec_3.13.gemfile
118
- - gemfiles/rspec_3.13.gemfile.lock
119
115
  - lib/rspec/core/example.rb
120
116
  - lib/rspec/loop.rb
121
117
  - lib/rspec/loop/formatter.rb
@@ -1,83 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- rspec-loop (0.1.0)
5
- rspec-core (~> 3.10)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- appraisal (2.5.0)
11
- bundler
12
- rake
13
- thor (>= 0.14.0)
14
- ast (2.4.3)
15
- byebug (12.0.0)
16
- coderay (1.1.3)
17
- diff-lcs (1.6.2)
18
- json (2.12.2)
19
- language_server-protocol (3.17.0.5)
20
- lint_roller (1.1.0)
21
- method_source (1.1.0)
22
- parallel (1.27.0)
23
- parser (3.3.8.0)
24
- ast (~> 2.4.1)
25
- racc
26
- prism (1.4.0)
27
- pry (0.15.2)
28
- coderay (~> 1.1)
29
- method_source (~> 1.0)
30
- pry-byebug (3.11.0)
31
- byebug (~> 12.0)
32
- pry (>= 0.13, < 0.16)
33
- racc (1.8.1)
34
- rainbow (3.1.1)
35
- rake (13.3.0)
36
- regexp_parser (2.10.0)
37
- rspec (3.10.0)
38
- rspec-core (~> 3.10.0)
39
- rspec-expectations (~> 3.10.0)
40
- rspec-mocks (~> 3.10.0)
41
- rspec-core (3.10.2)
42
- rspec-support (~> 3.10.0)
43
- rspec-expectations (3.10.2)
44
- diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.10.0)
46
- rspec-mocks (3.10.3)
47
- diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.10.0)
49
- rspec-support (3.10.3)
50
- rubocop (1.78.0)
51
- json (~> 2.3)
52
- language_server-protocol (~> 3.17.0.2)
53
- lint_roller (~> 1.1.0)
54
- parallel (~> 1.10)
55
- parser (>= 3.3.0.2)
56
- rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 2.9.3, < 3.0)
58
- rubocop-ast (>= 1.45.1, < 2.0)
59
- ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 2.4.0, < 4.0)
61
- rubocop-ast (1.45.1)
62
- parser (>= 3.3.7.2)
63
- prism (~> 1.4)
64
- ruby-progressbar (1.13.0)
65
- thor (1.3.2)
66
- unicode-display_width (3.1.4)
67
- unicode-emoji (~> 4.0, >= 4.0.4)
68
- unicode-emoji (4.0.4)
69
-
70
- PLATFORMS
71
- ruby
72
- x86_64-linux
73
-
74
- DEPENDENCIES
75
- appraisal
76
- pry-byebug
77
- rake (~> 13.0)
78
- rspec (~> 3.10.0)
79
- rspec-loop!
80
- rubocop (~> 1.21)
81
-
82
- BUNDLED WITH
83
- 2.6.7
@@ -1,83 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- rspec-loop (0.1.0)
5
- rspec-core (~> 3.10)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- appraisal (2.5.0)
11
- bundler
12
- rake
13
- thor (>= 0.14.0)
14
- ast (2.4.3)
15
- byebug (12.0.0)
16
- coderay (1.1.3)
17
- diff-lcs (1.6.2)
18
- json (2.12.2)
19
- language_server-protocol (3.17.0.5)
20
- lint_roller (1.1.0)
21
- method_source (1.1.0)
22
- parallel (1.27.0)
23
- parser (3.3.8.0)
24
- ast (~> 2.4.1)
25
- racc
26
- prism (1.4.0)
27
- pry (0.15.2)
28
- coderay (~> 1.1)
29
- method_source (~> 1.0)
30
- pry-byebug (3.11.0)
31
- byebug (~> 12.0)
32
- pry (>= 0.13, < 0.16)
33
- racc (1.8.1)
34
- rainbow (3.1.1)
35
- rake (13.3.0)
36
- regexp_parser (2.10.0)
37
- rspec (3.11.0)
38
- rspec-core (~> 3.11.0)
39
- rspec-expectations (~> 3.11.0)
40
- rspec-mocks (~> 3.11.0)
41
- rspec-core (3.11.0)
42
- rspec-support (~> 3.11.0)
43
- rspec-expectations (3.11.1)
44
- diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.11.0)
46
- rspec-mocks (3.11.2)
47
- diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.11.0)
49
- rspec-support (3.11.1)
50
- rubocop (1.78.0)
51
- json (~> 2.3)
52
- language_server-protocol (~> 3.17.0.2)
53
- lint_roller (~> 1.1.0)
54
- parallel (~> 1.10)
55
- parser (>= 3.3.0.2)
56
- rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 2.9.3, < 3.0)
58
- rubocop-ast (>= 1.45.1, < 2.0)
59
- ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 2.4.0, < 4.0)
61
- rubocop-ast (1.45.1)
62
- parser (>= 3.3.7.2)
63
- prism (~> 1.4)
64
- ruby-progressbar (1.13.0)
65
- thor (1.3.2)
66
- unicode-display_width (3.1.4)
67
- unicode-emoji (~> 4.0, >= 4.0.4)
68
- unicode-emoji (4.0.4)
69
-
70
- PLATFORMS
71
- ruby
72
- x86_64-linux
73
-
74
- DEPENDENCIES
75
- appraisal
76
- pry-byebug
77
- rake (~> 13.0)
78
- rspec (~> 3.11.0)
79
- rspec-loop!
80
- rubocop (~> 1.21)
81
-
82
- BUNDLED WITH
83
- 2.6.7
@@ -1,83 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- rspec-loop (0.1.0)
5
- rspec-core (~> 3.10)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- appraisal (2.5.0)
11
- bundler
12
- rake
13
- thor (>= 0.14.0)
14
- ast (2.4.3)
15
- byebug (12.0.0)
16
- coderay (1.1.3)
17
- diff-lcs (1.6.2)
18
- json (2.12.2)
19
- language_server-protocol (3.17.0.5)
20
- lint_roller (1.1.0)
21
- method_source (1.1.0)
22
- parallel (1.27.0)
23
- parser (3.3.8.0)
24
- ast (~> 2.4.1)
25
- racc
26
- prism (1.4.0)
27
- pry (0.15.2)
28
- coderay (~> 1.1)
29
- method_source (~> 1.0)
30
- pry-byebug (3.11.0)
31
- byebug (~> 12.0)
32
- pry (>= 0.13, < 0.16)
33
- racc (1.8.1)
34
- rainbow (3.1.1)
35
- rake (13.3.0)
36
- regexp_parser (2.10.0)
37
- rspec (3.12.0)
38
- rspec-core (~> 3.12.0)
39
- rspec-expectations (~> 3.12.0)
40
- rspec-mocks (~> 3.12.0)
41
- rspec-core (3.12.3)
42
- rspec-support (~> 3.12.0)
43
- rspec-expectations (3.12.4)
44
- diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.12.0)
46
- rspec-mocks (3.12.7)
47
- diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.12.0)
49
- rspec-support (3.12.2)
50
- rubocop (1.78.0)
51
- json (~> 2.3)
52
- language_server-protocol (~> 3.17.0.2)
53
- lint_roller (~> 1.1.0)
54
- parallel (~> 1.10)
55
- parser (>= 3.3.0.2)
56
- rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 2.9.3, < 3.0)
58
- rubocop-ast (>= 1.45.1, < 2.0)
59
- ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 2.4.0, < 4.0)
61
- rubocop-ast (1.45.1)
62
- parser (>= 3.3.7.2)
63
- prism (~> 1.4)
64
- ruby-progressbar (1.13.0)
65
- thor (1.3.2)
66
- unicode-display_width (3.1.4)
67
- unicode-emoji (~> 4.0, >= 4.0.4)
68
- unicode-emoji (4.0.4)
69
-
70
- PLATFORMS
71
- ruby
72
- x86_64-linux
73
-
74
- DEPENDENCIES
75
- appraisal
76
- pry-byebug
77
- rake (~> 13.0)
78
- rspec (~> 3.12.0)
79
- rspec-loop!
80
- rubocop (~> 1.21)
81
-
82
- BUNDLED WITH
83
- 2.6.7
@@ -1,83 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- rspec-loop (0.1.0)
5
- rspec-core (~> 3.10)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- appraisal (2.5.0)
11
- bundler
12
- rake
13
- thor (>= 0.14.0)
14
- ast (2.4.3)
15
- byebug (12.0.0)
16
- coderay (1.1.3)
17
- diff-lcs (1.6.2)
18
- json (2.12.2)
19
- language_server-protocol (3.17.0.5)
20
- lint_roller (1.1.0)
21
- method_source (1.1.0)
22
- parallel (1.27.0)
23
- parser (3.3.8.0)
24
- ast (~> 2.4.1)
25
- racc
26
- prism (1.4.0)
27
- pry (0.15.2)
28
- coderay (~> 1.1)
29
- method_source (~> 1.0)
30
- pry-byebug (3.11.0)
31
- byebug (~> 12.0)
32
- pry (>= 0.13, < 0.16)
33
- racc (1.8.1)
34
- rainbow (3.1.1)
35
- rake (13.3.0)
36
- regexp_parser (2.10.0)
37
- rspec (3.13.1)
38
- rspec-core (~> 3.13.0)
39
- rspec-expectations (~> 3.13.0)
40
- rspec-mocks (~> 3.13.0)
41
- rspec-core (3.13.5)
42
- rspec-support (~> 3.13.0)
43
- rspec-expectations (3.13.5)
44
- diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.13.0)
46
- rspec-mocks (3.13.5)
47
- diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.13.0)
49
- rspec-support (3.13.4)
50
- rubocop (1.78.0)
51
- json (~> 2.3)
52
- language_server-protocol (~> 3.17.0.2)
53
- lint_roller (~> 1.1.0)
54
- parallel (~> 1.10)
55
- parser (>= 3.3.0.2)
56
- rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 2.9.3, < 3.0)
58
- rubocop-ast (>= 1.45.1, < 2.0)
59
- ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 2.4.0, < 4.0)
61
- rubocop-ast (1.45.1)
62
- parser (>= 3.3.7.2)
63
- prism (~> 1.4)
64
- ruby-progressbar (1.13.0)
65
- thor (1.3.2)
66
- unicode-display_width (3.1.4)
67
- unicode-emoji (~> 4.0, >= 4.0.4)
68
- unicode-emoji (4.0.4)
69
-
70
- PLATFORMS
71
- ruby
72
- x86_64-linux
73
-
74
- DEPENDENCIES
75
- appraisal
76
- pry-byebug
77
- rake (~> 13.0)
78
- rspec (~> 3.13.0)
79
- rspec-loop!
80
- rubocop (~> 1.21)
81
-
82
- BUNDLED WITH
83
- 2.6.7