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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8d5602f0d650efd86b71dab5ab2c63df82040a0f
4
- data.tar.gz: 15d624414639de4cbaf2191d38d36c36dfa5aa3d
2
+ SHA256:
3
+ metadata.gz: 3428b035fe42f03dfdfa5ec731cbabeb3586b3beaa87c208103099fd80df7c03
4
+ data.tar.gz: 163aa55c499a09d57e200ea967bb7076a7006b77436c7e144eaf67f8030c18ac
5
5
  SHA512:
6
- metadata.gz: 2f0bdabbfbe2cfc73ef78321949dc3b23122a7d02f88efa3dfc2bf2708bc228d51b19502fbd29e9c0af20dc2ac4a7b729d4c194423ab88345755392445ed98bd
7
- data.tar.gz: ac90054eccc056b3481a5dbeeb7b2275f738a5e0ae9b99766cd9fc4b9599a42aac7593e0c989679e29a5e85a887ad05864b21e22717dbb8b634f6990870e3802
6
+ metadata.gz: 6ab919c364c0feb38fafe73914a7fa32197aba01f2ca1d8a641afa2520fa0d13845d9e7af03c461754779b3dd8046f3b2bf8e3b97788042acc629541aa982f47
7
+ data.tar.gz: 53c1500e724d35152999bdae591d3c044f4d6e94675dacedc8c04c55a41910bd0180dd0355faaf8517a6f2f737f6e1c12658479f952c3753d478b9a0eab1fadc
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,11 @@
1
+ === 1.0.2 / 2025-01-06
2
+
3
+ NINE YEARS!
4
+
5
+ * 1 bug fix:
6
+
7
+ * Fixed bug in max test time assertion.
8
+
1
9
  === 1.0.1 / 2016-10-09
2
10
 
3
11
  * 1 bug fix:
@@ -9,4 +17,3 @@
9
17
  * 1 major enhancement
10
18
 
11
19
  * Birthday!
12
-
@@ -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.1" # :nodoc:
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 = Time.now
30
+ @setup_t0 = Minitest.clock_time
31
31
  end
32
32
 
33
33
  def after_setup # :nodoc:
34
- delta = Time.now - @setup_t0
34
+ delta = Minitest.clock_time - @setup_t0
35
35
 
36
- @test_t0 = Time.now
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 = Time.now
46
+ @teardown_t0 = Minitest.clock_time
47
47
 
48
- delta = Time.now - @test_t0
49
- assert_operator delta, :<=, @@max_teardown_time
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 = Time.now - @teardown_t0
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
@@ -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.01
10
- @@max_test_time = 0.01
11
- @@max_teardown_time = 0.01
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 assert_test_speed(&b)
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
- assert_test_speed do
40
+ assert_slow do
25
41
  def setup
26
- sleep 0.1
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
- assert_test_speed do
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
- sleep 0.1
74
+ assert true
39
75
  end
40
76
  end
41
77
  end
42
78
 
43
79
  def test_slow_teardown
44
- assert_test_speed do
80
+ assert_slow do
45
81
  def teardown
46
- sleep 0.1
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.1
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
- MIIDijCCAnKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
12
+ MIIDPjCCAiagAwIBAgIBCTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
13
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJ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ZLOAeEy+axH
30
- E4oJcnPkJAr0rw504JGtlZtONZQblwmRJOIdXzolaE3NRGUzGVOUSptZppAKiavY
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: 2016-10-09 00:00:00.000000000 Z
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: '3.15'
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: '3.15'
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
- post_install_message:
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
- rubyforge_project:
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