minitest-speed 1.0.0 → 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: 2eec3a82a928a83e3f6b6a876d0271d1b6ab8c74
4
- data.tar.gz: 3cdd11b5845af70c73cb3690dc103bc635e90527
2
+ SHA256:
3
+ metadata.gz: 3428b035fe42f03dfdfa5ec731cbabeb3586b3beaa87c208103099fd80df7c03
4
+ data.tar.gz: 163aa55c499a09d57e200ea967bb7076a7006b77436c7e144eaf67f8030c18ac
5
5
  SHA512:
6
- metadata.gz: 7f13124880d1d34161720ffee5d5dad972da747acc8c84ce6747515221ba255ad90a21e2ed604cc846051551436f8a36abb5c7a0229768f2b9f04bc4dde7b16e
7
- data.tar.gz: cf0d6fedf3e8d1b32fa7b62510af324b61a1b5eb59fce0ee6ae461f9d7ca2fcceef54d5cc1783c58eb40b77cb76d87d364311db7e978c7656e392b883cf1463c
6
+ metadata.gz: 6ab919c364c0feb38fafe73914a7fa32197aba01f2ca1d8a641afa2520fa0d13845d9e7af03c461754779b3dd8046f3b2bf8e3b97788042acc629541aa982f47
7
+ data.tar.gz: 53c1500e724d35152999bdae591d3c044f4d6e94675dacedc8c04c55a41910bd0180dd0355faaf8517a6f2f737f6e1c12658479f952c3753d478b9a0eab1fadc
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,6 +1,19 @@
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
+
9
+ === 1.0.1 / 2016-10-09
10
+
11
+ * 1 bug fix:
12
+
13
+ * Fixed dependency on minitest.
14
+
1
15
  === 1.0.0 / 2016-04-23
2
16
 
3
17
  * 1 major enhancement
4
18
 
5
19
  * Birthday!
6
-
data/README.rdoc CHANGED
@@ -25,7 +25,7 @@ variables to set the maximum thresholds and crank it down over time.
25
25
  @@max_teardown_time = 0.01
26
26
  end
27
27
 
28
- class MyTest << SpeedTest
28
+ class MyTest < SpeedTest
29
29
  # ...
30
30
  end
31
31
 
data/Rakefile CHANGED
@@ -7,24 +7,12 @@ Hoe.plugin :isolate
7
7
  Hoe.plugin :seattlerb
8
8
  Hoe.plugin :rdoc
9
9
 
10
- # Hoe.plugin :compiler
11
- # Hoe.plugin :doofus
12
- # Hoe.plugin :email
13
- # Hoe.plugin :gem_prelude_sucks
14
- # Hoe.plugin :history
15
- # Hoe.plugin :inline
16
- # Hoe.plugin :isolate
17
- # Hoe.plugin :minitest
18
- # Hoe.plugin :perforce
19
- # Hoe.plugin :racc
20
- # Hoe.plugin :rcov
21
- # Hoe.plugin :rdoc
22
- # Hoe.plugin :seattlerb
23
-
24
10
  Hoe.spec "minitest-speed" do
25
11
  developer "Ryan Davis", "ryand-ruby@zenspider.com"
26
12
 
27
13
  license "MIT"
14
+
15
+ dependency "minitest", ["> 5", "< 7"]
28
16
  end
29
17
 
30
18
  # vim: syntax=ruby
@@ -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.0" # :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.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
- MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
12
+ MIIDPjCCAiagAwIBAgIBCTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
13
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTE1MDkxOTIwNTEyMloXDTE2MDkxODIwNTEyMlowRTETMBEGA1UE
14
+ GRYDY29tMB4XDTI1MDEwNjIzMjcwMVoXDTI2MDEwNjIzMjcwMVowRTETMBEGA1UE
16
15
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
16
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
17
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -21,44 +20,70 @@ cert_chain:
21
20
  GiadM9GHRaDiaxuX0cIUBj19T01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E-----
32
- date: 2016-04-23 00:00:00.000000000 Z
31
+ date: 2025-01-06 00:00:00.000000000 Z
33
32
  dependencies:
33
+ - !ruby/object:Gem::Dependency
34
+ name: minitest
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">"
38
+ - !ruby/object:Gem::Version
39
+ version: '5'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '7'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">"
48
+ - !ruby/object:Gem::Version
49
+ version: '5'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '7'
34
53
  - !ruby/object:Gem::Dependency
35
54
  name: rdoc
36
55
  requirement: !ruby/object:Gem::Requirement
37
56
  requirements:
38
- - - ~>
57
+ - - ">="
39
58
  - !ruby/object:Gem::Version
40
59
  version: '4.0'
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '7'
41
63
  type: :development
42
64
  prerelease: false
43
65
  version_requirements: !ruby/object:Gem::Requirement
44
66
  requirements:
45
- - - ~>
67
+ - - ">="
46
68
  - !ruby/object:Gem::Version
47
69
  version: '4.0'
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '7'
48
73
  - !ruby/object:Gem::Dependency
49
74
  name: hoe
50
75
  requirement: !ruby/object:Gem::Requirement
51
76
  requirements:
52
- - - ~>
77
+ - - "~>"
53
78
  - !ruby/object:Gem::Version
54
- version: '3.15'
79
+ version: '4.2'
55
80
  type: :development
56
81
  prerelease: false
57
82
  version_requirements: !ruby/object:Gem::Requirement
58
83
  requirements:
59
- - - ~>
84
+ - - "~>"
60
85
  - !ruby/object:Gem::Version
61
- version: '3.15'
86
+ version: '4.2'
62
87
  description: |-
63
88
  minitest-speed adds test hooks to verify the time it takes to run the
64
89
  setup, body, and teardown phases of each test. If the time of any
@@ -73,7 +98,7 @@ extra_rdoc_files:
73
98
  - Manifest.txt
74
99
  - README.rdoc
75
100
  files:
76
- - .autotest
101
+ - ".autotest"
77
102
  - History.rdoc
78
103
  - Manifest.txt
79
104
  - README.rdoc
@@ -83,27 +108,25 @@ files:
83
108
  homepage: https://github.com/seattlerb/minitest-speed
84
109
  licenses:
85
110
  - MIT
86
- metadata: {}
87
- post_install_message:
111
+ metadata:
112
+ homepage_uri: https://github.com/seattlerb/minitest-speed
88
113
  rdoc_options:
89
- - --main
114
+ - "--main"
90
115
  - README.rdoc
91
116
  require_paths:
92
117
  - lib
93
118
  required_ruby_version: !ruby/object:Gem::Requirement
94
119
  requirements:
95
- - - '>='
120
+ - - ">="
96
121
  - !ruby/object:Gem::Version
97
122
  version: '0'
98
123
  required_rubygems_version: !ruby/object:Gem::Requirement
99
124
  requirements:
100
- - - '>='
125
+ - - ">="
101
126
  - !ruby/object:Gem::Version
102
127
  version: '0'
103
128
  requirements: []
104
- rubyforge_project:
105
- rubygems_version: 2.4.5
106
- signing_key:
129
+ rubygems_version: 3.6.2
107
130
  specification_version: 4
108
131
  summary: minitest-speed adds test hooks to verify the time it takes to run the setup,
109
132
  body, and teardown phases of each test
metadata.gz.sig CHANGED
Binary file