maxitest 5.6.0 → 5.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +5 -0
- data/lib/maxitest/autorun.rb +1 -1
- data/lib/maxitest/interrupt.rb +41 -0
- data/lib/maxitest/version.rb +1 -1
- metadata +5 -5
- data/lib/maxitest/trap.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d101ca4626dab43e42c73800d34678620f68eaf702c093d70a16dd2dabac306d
|
4
|
+
data.tar.gz: bc5b5547620a044c9a8cc7eee87cf5411a822418a6e61949056ac3acec2a095a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 878e6e0b75f59f8aaa187d5c953cd0f4aa0f3942022fbea271e9277f57d36b6b4624f6e010c4c8e3079bef993d282630142dc50ca9d295b5aed9b0d06cc621bc
|
7
|
+
data.tar.gz: 9bce01fea6fb55cbf2c35bd7c4cd44c6826dc4502313cf493750ffa21b06335f84736d007a90c713c7a76ef9e188d05f839098456dc153ca4b9480f2212a4b4a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -81,6 +81,11 @@ output = capture_stdout { puts 1 }
|
|
81
81
|
_(output).must_equal "1\n"
|
82
82
|
```
|
83
83
|
|
84
|
+
### minitest-reporters
|
85
|
+
|
86
|
+
If [PR](https://github.com/minitest-reporters/minitest-reporters/pull/357) is not resolved,
|
87
|
+
disable Interrupt handling with `ENV["MAXITEST_NO_INTERRUPT"] = "true"` to avoid "stack level too deep" errors.
|
88
|
+
|
84
89
|
Development
|
85
90
|
===========
|
86
91
|
- everything vendored into 1 gem to avoid dependency madness
|
data/lib/maxitest/autorun.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# - show current backtrace when interrupting a stuck test with Ctrl+c
|
4
|
+
# - skip remaining tests
|
5
|
+
|
6
|
+
module Maxitest
|
7
|
+
Interrupted = Class.new(StandardError)
|
8
|
+
class << self
|
9
|
+
attr_accessor :interrupted
|
10
|
+
end
|
11
|
+
|
12
|
+
module InterruptHandler
|
13
|
+
# capture interrupt and treat it as a regular error so we get a backtrace
|
14
|
+
def capture_exceptions(&block)
|
15
|
+
super(&block)
|
16
|
+
rescue Interrupt => e
|
17
|
+
Maxitest.interrupted = true
|
18
|
+
failures << Minitest::UnexpectedError.new(e)
|
19
|
+
end
|
20
|
+
|
21
|
+
# skip remaining tests if we were interrupted
|
22
|
+
def run
|
23
|
+
if Maxitest.interrupted
|
24
|
+
# produce a real error so we do not crash in -v mode
|
25
|
+
failures <<
|
26
|
+
begin
|
27
|
+
raise Minitest::Skip, 'Maxitest::Interrupted'
|
28
|
+
rescue Minitest::Skip
|
29
|
+
$!
|
30
|
+
end
|
31
|
+
result = Minitest::Result.from(self)
|
32
|
+
result.time = 0
|
33
|
+
result
|
34
|
+
else
|
35
|
+
super()
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
Minitest::Test.prepend(Maxitest::InterruptHandler)
|
data/lib/maxitest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maxitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 5.14.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 5.
|
22
|
+
version: 5.26.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 5.14.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 5.
|
32
|
+
version: 5.26.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rake
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/maxitest/helpers.rb
|
76
76
|
- lib/maxitest/hook_all.rb
|
77
77
|
- lib/maxitest/implicit_subject.rb
|
78
|
+
- lib/maxitest/interrupt.rb
|
78
79
|
- lib/maxitest/let_all.rb
|
79
80
|
- lib/maxitest/let_bang.rb
|
80
81
|
- lib/maxitest/pending.rb
|
@@ -82,7 +83,6 @@ files:
|
|
82
83
|
- lib/maxitest/static_class_order.rb
|
83
84
|
- lib/maxitest/threads.rb
|
84
85
|
- lib/maxitest/timeout.rb
|
85
|
-
- lib/maxitest/trap.rb
|
86
86
|
- lib/maxitest/vendor/around.rb
|
87
87
|
- lib/maxitest/vendor/line.rb
|
88
88
|
- lib/maxitest/vendor/line_describe.rb
|
data/lib/maxitest/trap.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Maxitest
|
4
|
-
Interrupted = Class.new(StandardError)
|
5
|
-
class << self
|
6
|
-
attr_accessor :interrupted
|
7
|
-
end
|
8
|
-
|
9
|
-
module InterruptHandler
|
10
|
-
def capture_exceptions(&block)
|
11
|
-
super(&block)
|
12
|
-
rescue Interrupt => e
|
13
|
-
Maxitest.interrupted = true
|
14
|
-
failures << Minitest::UnexpectedError.new(e)
|
15
|
-
end
|
16
|
-
|
17
|
-
def run
|
18
|
-
if Maxitest.interrupted
|
19
|
-
skip = begin
|
20
|
-
raise Minitest::Skip, 'Maxitest::Interrupted'
|
21
|
-
rescue Minitest::Skip => e
|
22
|
-
e
|
23
|
-
end
|
24
|
-
self.failures = [skip]
|
25
|
-
defined?(Minitest::Result) ? Minitest::Result.from(self) : self
|
26
|
-
else
|
27
|
-
super()
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
Minitest::Test.prepend(Maxitest::InterruptHandler)
|