minitest-test_profile 0.1.0 → 0.2.0
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +4 -2
- data/Rakefile +1 -0
- data/lib/minitest/test_profile/reporter.rb +8 -2
- data/lib/minitest/test_profile/version.rb +1 -1
- data/lib/minitest/test_profile_plugin.rb +1 -3
- data/minitest-test_profile.gemspec +1 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780eefda0cc73a3eba83927ca54d102020c4a3d9
|
4
|
+
data.tar.gz: 5145f57252649655f6dfee5e6794596c17f090ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c145958cbe61bfe5027900386f51b1e51c0c8b088edc31c15741c693c9ccadbdc2b94730b7d647add5b1677c5a27a570695f816a3e7a0bf99cfc71de91a9de8
|
7
|
+
data.tar.gz: 68b815f156faff1e883a28ad2427a59874d809e39d5fa3dfc4de72a7619c604561a784380195091362711612917cbcd496490d6809a244c1e4c974c00a907c4b
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -4,6 +4,8 @@ Show slow test as rspec profile options.
|
|
4
4
|
|
5
5
|
[](https://travis-ci.org/y-yagi/minitest-test_profile)
|
6
6
|
[](http://badge.fury.io/rb/minitest-test_profile)
|
7
|
+
[](https://codeclimate.com/github/y-yagi/minitest-test_profile)
|
8
|
+
[](https://coveralls.io/github/y-yagi/minitest-test_profile?branch=master)
|
7
9
|
|
8
10
|
## Installation
|
9
11
|
|
@@ -34,7 +36,7 @@ Options can be specified to `use!` method. Can specify options are as follows:
|
|
34
36
|
|
35
37
|
```ruby
|
36
38
|
Minitest::TestProfile.use!(
|
37
|
-
count:
|
39
|
+
count: 3 # The number of tests to be displayed. The default is 10.
|
38
40
|
)
|
39
41
|
```
|
40
42
|
|
@@ -66,7 +68,7 @@ PlaceIntegrationTest#test_create_place_that_regist_by_form
|
|
66
68
|
|
67
69
|
## Contributing
|
68
70
|
|
69
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/y-yagi/minitest-test_profile.
|
71
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/y-yagi/minitest-test_profile. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
70
72
|
|
71
73
|
|
72
74
|
## License
|
data/Rakefile
CHANGED
@@ -6,15 +6,17 @@ module Minitest
|
|
6
6
|
def initialize(io = $stdout, options = {})
|
7
7
|
super(io, options)
|
8
8
|
@test_results = []
|
9
|
-
@count = options[:count]
|
9
|
+
@count = options[:count]
|
10
10
|
@calculated_total_time = nil
|
11
11
|
end
|
12
12
|
|
13
13
|
def report
|
14
|
+
return unless Minitest::TestProfile.use?
|
14
15
|
display_aggregated_results
|
15
16
|
end
|
16
17
|
|
17
18
|
def record(result)
|
19
|
+
return unless Minitest::TestProfile.use?
|
18
20
|
@test_results << result
|
19
21
|
end
|
20
22
|
|
@@ -33,7 +35,7 @@ module Minitest
|
|
33
35
|
|
34
36
|
def aggregate_slow_tests!
|
35
37
|
@test_results.sort! { |a, b| b.time <=> a.time }
|
36
|
-
@test_results = @test_results.take(
|
38
|
+
@test_results = @test_results.take(count)
|
37
39
|
end
|
38
40
|
|
39
41
|
def slow_tests_total_time
|
@@ -43,6 +45,10 @@ module Minitest
|
|
43
45
|
def ratio
|
44
46
|
(slow_tests_total_time / @calculated_total_time) * 100
|
45
47
|
end
|
48
|
+
|
49
|
+
def count
|
50
|
+
@count || Minitest::TestProfile.count
|
51
|
+
end
|
46
52
|
end
|
47
53
|
end
|
48
54
|
end
|
@@ -3,8 +3,6 @@ require "minitest/test_profile/reporter"
|
|
3
3
|
|
4
4
|
module Minitest
|
5
5
|
def self.plugin_test_profile_init(opts)
|
6
|
-
|
7
|
-
self.reporter << Minitest::TestProfile::Reporter.new($stdout, { count: Minitest::TestProfile.count })
|
8
|
-
end
|
6
|
+
self.reporter << Minitest::TestProfile::Reporter.new($stdout, { count: Minitest::TestProfile.count })
|
9
7
|
end
|
10
8
|
end
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "minitest"
|
22
|
+
spec.add_dependency "coveralls"
|
22
23
|
spec.add_development_dependency "bundler", "~> 1.10"
|
23
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
25
|
spec.add_development_dependency "pry"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-test_profile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Yaginuma
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: coveralls
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,6 +89,7 @@ extra_rdoc_files: []
|
|
75
89
|
files:
|
76
90
|
- ".gitignore"
|
77
91
|
- ".travis.yml"
|
92
|
+
- CHANGELOG.md
|
78
93
|
- CODE_OF_CONDUCT.md
|
79
94
|
- Gemfile
|
80
95
|
- LICENSE.txt
|
@@ -112,3 +127,4 @@ signing_key:
|
|
112
127
|
specification_version: 4
|
113
128
|
summary: Show slow test as rspec profile options.
|
114
129
|
test_files: []
|
130
|
+
has_rdoc:
|