minitest-speed 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +8 -1
- data/lib/minitest/speed.rb +10 -8
- data/test/test_minitest_speed.rb +46 -10
- data.tar.gz.sig +0 -0
- metadata +35 -33
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3428b035fe42f03dfdfa5ec731cbabeb3586b3beaa87c208103099fd80df7c03
|
4
|
+
data.tar.gz: 163aa55c499a09d57e200ea967bb7076a7006b77436c7e144eaf67f8030c18ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ab919c364c0feb38fafe73914a7fa32197aba01f2ca1d8a641afa2520fa0d13845d9e7af03c461754779b3dd8046f3b2bf8e3b97788042acc629541aa982f47
|
7
|
+
data.tar.gz: 53c1500e724d35152999bdae591d3c044f4d6e94675dacedc8c04c55a41910bd0180dd0355faaf8517a6f2f737f6e1c12658479f952c3753d478b9a0eab1fadc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
data/lib/minitest/speed.rb
CHANGED
@@ -7,7 +7,7 @@ module Minitest; end # :nodoc:
|
|
7
7
|
# maximum thresholds and crank it down over time.
|
8
8
|
|
9
9
|
module Minitest::Speed
|
10
|
-
VERSION = "1.0.
|
10
|
+
VERSION = "1.0.2" # :nodoc:
|
11
11
|
|
12
12
|
##
|
13
13
|
# Maximum setup time to pass a speed test. Default to 1.0 second.
|
@@ -27,13 +27,13 @@ module Minitest::Speed
|
|
27
27
|
def before_setup # :nodoc:
|
28
28
|
super
|
29
29
|
|
30
|
-
@setup_t0 =
|
30
|
+
@setup_t0 = Minitest.clock_time
|
31
31
|
end
|
32
32
|
|
33
33
|
def after_setup # :nodoc:
|
34
|
-
delta =
|
34
|
+
delta = Minitest.clock_time - @setup_t0
|
35
35
|
|
36
|
-
@test_t0 =
|
36
|
+
@test_t0 = Minitest.clock_time
|
37
37
|
|
38
38
|
assert_operator delta, :<=, @@max_setup_time
|
39
39
|
|
@@ -43,16 +43,18 @@ module Minitest::Speed
|
|
43
43
|
def before_teardown # :nodoc:
|
44
44
|
super
|
45
45
|
|
46
|
-
@teardown_t0 =
|
46
|
+
@teardown_t0 = Minitest.clock_time
|
47
47
|
|
48
|
-
delta =
|
49
|
-
|
48
|
+
delta = Minitest.clock_time - @test_t0
|
49
|
+
|
50
|
+
assert_operator delta, :<=, @@max_test_time
|
50
51
|
end
|
51
52
|
|
52
53
|
def after_teardown # :nodoc:
|
53
|
-
delta =
|
54
|
+
delta = Minitest.clock_time - @teardown_t0
|
54
55
|
|
55
56
|
assert_operator delta, :<=, @@max_teardown_time
|
57
|
+
|
56
58
|
super
|
57
59
|
end
|
58
60
|
end
|
data/test/test_minitest_speed.rb
CHANGED
@@ -6,9 +6,9 @@ module TestMinitest; end
|
|
6
6
|
class SpeedTest < Minitest::Test
|
7
7
|
include Minitest::Speed
|
8
8
|
|
9
|
-
@@max_setup_time = 0.
|
10
|
-
@@max_test_time = 0.
|
11
|
-
@@max_teardown_time = 0.
|
9
|
+
@@max_setup_time = 0.005
|
10
|
+
@@max_test_time = 0.015
|
11
|
+
@@max_teardown_time = 0.025
|
12
12
|
|
13
13
|
def self.go(&b)
|
14
14
|
Class.new(SpeedTest, &b).new(:test_something).run
|
@@ -16,14 +16,30 @@ class SpeedTest < Minitest::Test
|
|
16
16
|
end
|
17
17
|
|
18
18
|
class TestMinitest::TestSpeed < Minitest::Test
|
19
|
-
def
|
19
|
+
def assert_slow(&b)
|
20
20
|
refute_predicate SpeedTest.go(&b), :passed?
|
21
21
|
end
|
22
22
|
|
23
|
+
def assert_fast(&b)
|
24
|
+
assert_predicate SpeedTest.go(&b), :passed?
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_fast_setup
|
28
|
+
assert_fast do
|
29
|
+
def setup
|
30
|
+
sleep 0.001
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_something
|
34
|
+
assert true
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
23
39
|
def test_slow_setup
|
24
|
-
|
40
|
+
assert_slow do
|
25
41
|
def setup
|
26
|
-
sleep 0.
|
42
|
+
sleep 0.01
|
27
43
|
end
|
28
44
|
|
29
45
|
def test_something
|
@@ -32,18 +48,38 @@ class TestMinitest::TestSpeed < Minitest::Test
|
|
32
48
|
end
|
33
49
|
end
|
34
50
|
|
51
|
+
def test_fast_test
|
52
|
+
assert_fast do
|
53
|
+
def test_something
|
54
|
+
sleep 0.01
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
35
59
|
def test_slow_test
|
36
|
-
|
60
|
+
assert_slow do
|
61
|
+
def test_something
|
62
|
+
sleep 0.02
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_fast_teardown
|
68
|
+
assert_fast do
|
69
|
+
def teardown
|
70
|
+
sleep 0.01
|
71
|
+
end
|
72
|
+
|
37
73
|
def test_something
|
38
|
-
|
74
|
+
assert true
|
39
75
|
end
|
40
76
|
end
|
41
77
|
end
|
42
78
|
|
43
79
|
def test_slow_teardown
|
44
|
-
|
80
|
+
assert_slow do
|
45
81
|
def teardown
|
46
|
-
sleep 0.
|
82
|
+
sleep 0.03
|
47
83
|
end
|
48
84
|
|
49
85
|
def test_something
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-speed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain:
|
11
10
|
- |
|
12
11
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
12
|
+
MIIDPjCCAiagAwIBAgIBCTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
|
14
13
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
15
|
-
|
14
|
+
GRYDY29tMB4XDTI1MDEwNjIzMjcwMVoXDTI2MDEwNjIzMjcwMVowRTETMBEGA1UE
|
16
15
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
17
16
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
18
17
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -20,66 +19,71 @@ cert_chain:
|
|
20
19
|
oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
|
21
20
|
GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
|
22
21
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
23
|
-
gBEfoTEGr7Zii72cx+
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
fO6tdKQc/5RfA8oQEkg8hrxA5PQSz4TOFJGLpFvIapEk6tMruQ0bHgkhr9auXg==
|
22
|
+
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
23
|
+
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
|
24
|
+
AQAC0WQJcPOWPFwkojhzweilRVjTJ19UiLhiBTw3C1wJO3LVdBkWDmnnhAmKuX4D
|
25
|
+
r7vjQvESlABGIPdutI1Yl7mrHQzTkfLfXvNN6MT0nLChPyIYauT6SZZxubwJrUfA
|
26
|
+
7R0c2CJTIboZ0XaGpLsXqHEF1c29H7TV1QvVuqKAN2mCjh4N82QVn+ZKtys28AwT
|
27
|
+
6GfQX2fqLoi4KSc7xIzHKaNzqxeOICmJofk9w5VZ2rRN6yes8jvFYwz9HR41wdj8
|
28
|
+
bwfinv7Yp5fA6AysuZLhCykyfDuZVRrUp0Vb68YCKsLjJly/Theak+euNTxvHsB+
|
29
|
+
al9oSgPPHICMEX65qvLywitx
|
32
30
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
31
|
+
date: 2025-01-06 00:00:00.000000000 Z
|
34
32
|
dependencies:
|
35
33
|
- !ruby/object:Gem::Dependency
|
36
34
|
name: minitest
|
37
35
|
requirement: !ruby/object:Gem::Requirement
|
38
36
|
requirements:
|
39
|
-
- -
|
37
|
+
- - ">"
|
40
38
|
- !ruby/object:Gem::Version
|
41
39
|
version: '5'
|
42
|
-
- - <
|
40
|
+
- - "<"
|
43
41
|
- !ruby/object:Gem::Version
|
44
42
|
version: '7'
|
45
43
|
type: :runtime
|
46
44
|
prerelease: false
|
47
45
|
version_requirements: !ruby/object:Gem::Requirement
|
48
46
|
requirements:
|
49
|
-
- -
|
47
|
+
- - ">"
|
50
48
|
- !ruby/object:Gem::Version
|
51
49
|
version: '5'
|
52
|
-
- - <
|
50
|
+
- - "<"
|
53
51
|
- !ruby/object:Gem::Version
|
54
52
|
version: '7'
|
55
53
|
- !ruby/object:Gem::Dependency
|
56
54
|
name: rdoc
|
57
55
|
requirement: !ruby/object:Gem::Requirement
|
58
56
|
requirements:
|
59
|
-
- -
|
57
|
+
- - ">="
|
60
58
|
- !ruby/object:Gem::Version
|
61
59
|
version: '4.0'
|
60
|
+
- - "<"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '7'
|
62
63
|
type: :development
|
63
64
|
prerelease: false
|
64
65
|
version_requirements: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- -
|
67
|
+
- - ">="
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '4.0'
|
70
|
+
- - "<"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '7'
|
69
73
|
- !ruby/object:Gem::Dependency
|
70
74
|
name: hoe
|
71
75
|
requirement: !ruby/object:Gem::Requirement
|
72
76
|
requirements:
|
73
|
-
- - ~>
|
77
|
+
- - "~>"
|
74
78
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
79
|
+
version: '4.2'
|
76
80
|
type: :development
|
77
81
|
prerelease: false
|
78
82
|
version_requirements: !ruby/object:Gem::Requirement
|
79
83
|
requirements:
|
80
|
-
- - ~>
|
84
|
+
- - "~>"
|
81
85
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
86
|
+
version: '4.2'
|
83
87
|
description: |-
|
84
88
|
minitest-speed adds test hooks to verify the time it takes to run the
|
85
89
|
setup, body, and teardown phases of each test. If the time of any
|
@@ -94,7 +98,7 @@ extra_rdoc_files:
|
|
94
98
|
- Manifest.txt
|
95
99
|
- README.rdoc
|
96
100
|
files:
|
97
|
-
- .autotest
|
101
|
+
- ".autotest"
|
98
102
|
- History.rdoc
|
99
103
|
- Manifest.txt
|
100
104
|
- README.rdoc
|
@@ -104,27 +108,25 @@ files:
|
|
104
108
|
homepage: https://github.com/seattlerb/minitest-speed
|
105
109
|
licenses:
|
106
110
|
- MIT
|
107
|
-
metadata:
|
108
|
-
|
111
|
+
metadata:
|
112
|
+
homepage_uri: https://github.com/seattlerb/minitest-speed
|
109
113
|
rdoc_options:
|
110
|
-
- --main
|
114
|
+
- "--main"
|
111
115
|
- README.rdoc
|
112
116
|
require_paths:
|
113
117
|
- lib
|
114
118
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
119
|
requirements:
|
116
|
-
- -
|
120
|
+
- - ">="
|
117
121
|
- !ruby/object:Gem::Version
|
118
122
|
version: '0'
|
119
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
124
|
requirements:
|
121
|
-
- -
|
125
|
+
- - ">="
|
122
126
|
- !ruby/object:Gem::Version
|
123
127
|
version: '0'
|
124
128
|
requirements: []
|
125
|
-
|
126
|
-
rubygems_version: 2.4.5
|
127
|
-
signing_key:
|
129
|
+
rubygems_version: 3.6.2
|
128
130
|
specification_version: 4
|
129
131
|
summary: minitest-speed adds test hooks to verify the time it takes to run the setup,
|
130
132
|
body, and teardown phases of each test
|
metadata.gz.sig
CHANGED
Binary file
|