rspec_overview 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/LICENSE +21 -0
- data/README.md +8 -6
- data/lib/rspec_overview/formatter.rb +19 -14
- data/lib/rspec_overview/version.rb +1 -1
- data/rspec_overview.gemspec +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf40c3329b0d98739b0e00a6a202bb23d9b5c205
|
4
|
+
data.tar.gz: e34c2e84a63d87523a889ba3fa2ad13d8b5cb542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71f0ab02f6846a6a0ca731ace4b7d90ab0e6ffb6b4f2d26914399b736cbb7fff7307317732b13275af9281c5284a702261660c18cc7ab770fcd71437040208c9
|
7
|
+
data.tar.gz: bf7efbaf8b0408422fab6844252aced0686c48d5b81b0b7f1db5472c4dffbdaa5841c05b7d49968d4002508c4886968b6caff5d09d5ff87875b6637fda4484a6
|
data/Gemfile.lock
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Oliver Peate
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/odlp/rspec_overview.svg?branch=master)](https://travis-ci.org/odlp/rspec_overview)
|
4
4
|
|
5
|
-
Take `RspecOverview::Formatter` a spin when you're new to a project
|
5
|
+
Take `RspecOverview::Formatter` a spin when you're new to a project and need an
|
6
6
|
overview:
|
7
7
|
|
8
8
|
- How are the tests structured?
|
@@ -11,7 +11,7 @@ overview:
|
|
11
11
|
|
12
12
|
## Usage
|
13
13
|
|
14
|
-
|
14
|
+
Add the gem to your `Gemfile` and run `bundle`:
|
15
15
|
|
16
16
|
```ruby
|
17
17
|
group :test do
|
@@ -19,8 +19,8 @@ group :test do
|
|
19
19
|
end
|
20
20
|
```
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
You can use the overview formatter standalone, or mix & match with other
|
23
|
+
formatters:
|
24
24
|
|
25
25
|
```sh
|
26
26
|
# With the progress formatter:
|
@@ -47,7 +47,8 @@ Randomized with seed 40301
|
|
47
47
|
Finished in 19.36 seconds (files took 3.99 seconds to load)
|
48
48
|
363 examples, 0 failures
|
49
49
|
|
50
|
-
|
50
|
+
+---------------------+---------------+--------------+-------------------------+
|
51
|
+
| Summary by Type or Subfolder |
|
51
52
|
+---------------------+---------------+--------------+-------------------------+
|
52
53
|
| Type or Subfolder | Example count | Duration (s) | Average per example (s) |
|
53
54
|
+---------------------+---------------+--------------+-------------------------+
|
@@ -63,7 +64,8 @@ Summary by Type or Subfolder
|
|
63
64
|
| ./spec/dashboards | 9 | 0.01684 | 0.00187 |
|
64
65
|
+---------------------+---------------+--------------+-------------------------+
|
65
66
|
|
66
|
-
|
67
|
+
+-------------------------------------------------------------+---------------+--------------+-------------------------+
|
68
|
+
| Summary by File |
|
67
69
|
+-------------------------------------------------------------+---------------+--------------+-------------------------+
|
68
70
|
| File | Example count | Duration (s) | Average per example (s) |
|
69
71
|
+-------------------------------------------------------------+---------------+--------------+-------------------------+
|
@@ -37,21 +37,15 @@ module RspecOverview
|
|
37
37
|
data[identifier].duration_raw += example.execution_result.run_time
|
38
38
|
end
|
39
39
|
|
40
|
+
title = "Summary by #{column_name}"
|
41
|
+
|
40
42
|
headings = [
|
41
43
|
column_name, "Example count", "Duration (s)", "Average per example (s)"
|
42
44
|
]
|
43
45
|
|
44
|
-
rows = values_in_descending_duration(data).map
|
45
|
-
[
|
46
|
-
row.identifier,
|
47
|
-
row.example_count,
|
48
|
-
helpers.format_seconds(row.duration_raw),
|
49
|
-
helpers.format_seconds(row.avg_duration),
|
50
|
-
]
|
51
|
-
end
|
46
|
+
rows = values_in_descending_duration(data).map(&method(:as_table_row))
|
52
47
|
|
53
|
-
|
54
|
-
print_table(headings: headings, rows: rows)
|
48
|
+
print_table(title: title, headings: headings, rows: rows)
|
55
49
|
end
|
56
50
|
|
57
51
|
def type_or_subfolder(example)
|
@@ -62,12 +56,23 @@ module RspecOverview
|
|
62
56
|
data.values.sort_by(&:duration_raw).reverse_each
|
63
57
|
end
|
64
58
|
|
65
|
-
def
|
66
|
-
|
59
|
+
def as_table_row(row)
|
60
|
+
[
|
61
|
+
row.identifier,
|
62
|
+
row.example_count,
|
63
|
+
format_seconds(row.duration_raw),
|
64
|
+
format_seconds(row.avg_duration),
|
65
|
+
]
|
66
|
+
end
|
67
|
+
|
68
|
+
def format_seconds(duration)
|
69
|
+
RSpec::Core::Formatters::Helpers.format_seconds(duration)
|
67
70
|
end
|
68
71
|
|
69
|
-
def print_table(headings:, rows:)
|
70
|
-
|
72
|
+
def print_table(title:, headings:, rows:)
|
73
|
+
table = Terminal::Table.new(title: title, headings: headings, rows: rows)
|
74
|
+
output.puts "\n"
|
75
|
+
output.puts table
|
71
76
|
end
|
72
77
|
end
|
73
78
|
end
|
data/rspec_overview.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.version = RspecOverview::VERSION
|
8
8
|
spec.authors = ["Oli Peate"]
|
9
9
|
spec.email = ["oliverp@gmail.com"]
|
10
|
+
spec.license = "MIT"
|
10
11
|
|
11
12
|
spec.summary = "See an overview of your RSpec test suite"
|
12
13
|
spec.homepage = "https://github.com/odlp/rspec_overview"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_overview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oli Peate
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- ".travis.yml"
|
108
108
|
- Gemfile
|
109
109
|
- Gemfile.lock
|
110
|
+
- LICENSE
|
110
111
|
- README.md
|
111
112
|
- Rakefile
|
112
113
|
- bin/console
|
@@ -117,7 +118,8 @@ files:
|
|
117
118
|
- lib/rspec_overview/version.rb
|
118
119
|
- rspec_overview.gemspec
|
119
120
|
homepage: https://github.com/odlp/rspec_overview
|
120
|
-
licenses:
|
121
|
+
licenses:
|
122
|
+
- MIT
|
121
123
|
metadata: {}
|
122
124
|
post_install_message:
|
123
125
|
rdoc_options: []
|