m 1.5.1 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +13 -8
- data/Appraisals +2 -2
- data/Gemfile.lock +38 -51
- data/README.md +30 -25
- data/gemfiles/minitest4.gemfile +5 -3
- data/gemfiles/minitest4.gemfile.lock +39 -51
- data/gemfiles/minitest5.gemfile +5 -3
- data/gemfiles/minitest5.gemfile.lock +44 -46
- data/gemfiles/test_unit_gem.gemfile +4 -2
- data/gemfiles/test_unit_gem.gemfile.lock +44 -53
- data/lib/m/executor.rb +1 -1
- data/lib/m/frameworks.rb +6 -2
- data/lib/m/parser.rb +11 -4
- data/lib/m/testable.rb +2 -1
- data/lib/m/version.rb +1 -1
- data/test/active_support_test.rb +17 -17
- data/test/everything_test.rb +4 -4
- data/test/examples/active_support_example_test.rb +1 -0
- data/test/examples/active_support_unescaped_example_test.rb +1 -0
- data/test/examples/minitest_example_test.rb +36 -0
- data/test/examples/multiple_example_test.rb +1 -0
- data/test/multiple_test.rb +3 -3
- data/test/options_test.rb +29 -7
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 02ef4d061c7ec25262a03a7f9fbf1735dac5de7900fb2b6c89875a0d3a2cf132
|
4
|
+
data.tar.gz: 47ccce99a3448307744eaa70fddf565efbbff22484016814a4ebb77e9c75ced7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13b26f2e2d72629ca1a0ab7b1eeae409b872f53f71d03620e0ce7f6c60d975b5c7a8d6091003f3ec9c5604e3f7a270ab0df3bafc547036c8c7d4abfc26015c29
|
7
|
+
data.tar.gz: b3b74f7252d34d49abc46c4056a8224f50e8bf3a072393a0a33a8a5dbf3d2ff78c43f8035f28b76b34270339d4f9c4c923c567ecd4f6991cbe149ecddcd562ea
|
data/.travis.yml
CHANGED
@@ -1,14 +1,19 @@
|
|
1
|
+
language: ruby
|
1
2
|
rvm:
|
2
|
-
- 2.
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
-
|
3
|
+
- 2.4
|
4
|
+
- 2.5
|
5
|
+
- 2.6
|
6
|
+
- 2.7
|
7
|
+
- 3.0
|
8
|
+
- jruby-9.2
|
6
9
|
before_install:
|
10
|
+
- yes | gem update --system --force
|
7
11
|
- gem install bundler
|
12
|
+
gemfile:
|
13
|
+
- gemfiles/minitest4.gemfile
|
14
|
+
- gemfiles/minitest5.gemfile
|
15
|
+
- gemfiles/test_unit_gem.gemfile
|
8
16
|
install:
|
9
17
|
- bundle install
|
10
|
-
- bundle --gemfile=gemfiles/minitest5.gemfile
|
11
|
-
- bundle --gemfile=gemfiles/minitest4.gemfile
|
12
|
-
- bundle --gemfile=gemfiles/test_unit_gem.gemfile
|
13
18
|
script:
|
14
|
-
- bundle exec rake
|
19
|
+
- bundle exec rake test
|
data/Appraisals
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,72 +1,59 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
m (1.
|
4
|
+
m (1.6.0)
|
5
5
|
method_source (>= 0.6.7)
|
6
6
|
rake (>= 0.9.2.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (4.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
activesupport (6.1.4.1)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 1.6, < 2)
|
14
|
+
minitest (>= 5.1)
|
15
|
+
tzinfo (~> 2.0)
|
16
|
+
zeitwerk (~> 2.3)
|
17
17
|
allocation_stats (0.1.5)
|
18
|
-
appraisal (2.
|
19
|
-
activesupport (>= 3.2.21)
|
18
|
+
appraisal (2.4.1)
|
20
19
|
bundler
|
21
20
|
rake
|
22
21
|
thor (>= 0.14.0)
|
23
|
-
benchmark-ips (2.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
simplecov (~> 0.
|
22
|
+
benchmark-ips (2.9.1)
|
23
|
+
concurrent-ruby (1.1.9)
|
24
|
+
coveralls (0.8.23)
|
25
|
+
json (>= 1.8, < 3)
|
26
|
+
simplecov (~> 0.16.1)
|
28
27
|
term-ansicolor (~> 1.3)
|
29
|
-
thor (
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
multi_json (1.11.0)
|
42
|
-
mustache (1.0.2)
|
43
|
-
netrc (0.10.3)
|
44
|
-
rake (10.4.2)
|
45
|
-
rdiscount (2.1.8)
|
46
|
-
redcarpet (3.3.2)
|
47
|
-
rest-client (1.8.0)
|
48
|
-
http-cookie (>= 1.0.2, < 2.0)
|
49
|
-
mime-types (>= 1.16, < 3.0)
|
50
|
-
netrc (~> 0.7)
|
28
|
+
thor (>= 0.19.4, < 2.0)
|
29
|
+
tins (~> 1.6)
|
30
|
+
docile (1.4.0)
|
31
|
+
i18n (1.8.10)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
json (2.5.1)
|
34
|
+
method_source (1.0.0)
|
35
|
+
minitest (5.14.4)
|
36
|
+
mustache (1.1.1)
|
37
|
+
rake (13.0.6)
|
38
|
+
rdiscount (2.2.0.2)
|
39
|
+
redcarpet (3.5.1)
|
51
40
|
rocco (0.8.2)
|
52
41
|
mustache
|
53
42
|
redcarpet
|
54
|
-
simplecov (0.
|
55
|
-
docile (~> 1.1
|
56
|
-
json (
|
43
|
+
simplecov (0.16.1)
|
44
|
+
docile (~> 1.1)
|
45
|
+
json (>= 1.8, < 3)
|
57
46
|
simplecov-html (~> 0.10.0)
|
58
|
-
simplecov-html (0.10.
|
59
|
-
|
47
|
+
simplecov-html (0.10.2)
|
48
|
+
sync (0.5.0)
|
49
|
+
term-ansicolor (1.7.1)
|
60
50
|
tins (~> 1.0)
|
61
|
-
thor (
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
unf_ext
|
68
|
-
unf (0.1.4-java)
|
69
|
-
unf_ext (0.0.7.1)
|
51
|
+
thor (1.1.0)
|
52
|
+
tins (1.29.1)
|
53
|
+
sync
|
54
|
+
tzinfo (2.0.4)
|
55
|
+
concurrent-ruby (~> 1.0)
|
56
|
+
zeitwerk (2.4.2)
|
70
57
|
|
71
58
|
PLATFORMS
|
72
59
|
java
|
@@ -83,4 +70,4 @@ DEPENDENCIES
|
|
83
70
|
rocco
|
84
71
|
|
85
72
|
BUNDLED WITH
|
86
|
-
|
73
|
+
2.2.26
|
data/README.md
CHANGED
@@ -1,27 +1,11 @@
|
|
1
1
|
M.RB
|
2
|
-
----
|
3
|
-
|
4
|
-
`m` stands for metal, a better test/unit test runner that can run tests by line number.
|
5
2
|
|
6
|
-
|
7
|
-
_________________________/\\\\____________/\\\\_________________________________
|
8
|
-
_________________________\/\\\\\\________/\\\\\\________________________________
|
9
|
-
__________________________\/\\\//\\\____/\\\//\\\_______________________________
|
10
|
-
___________________________\/\\\\///\\\/\\\/_\/\\\______________________________
|
11
|
-
____________________________\/\\\__\///\\\/___\/\\\_____________________________
|
12
|
-
_____________________________\/\\\____\///_____\/\\\____________________________
|
13
|
-
______________________________\/\\\_____________\/\\\___________________________
|
14
|
-
_______________________________\/\\\_____________\/\\\__________________________
|
15
|
-
________________________________\///______________\///__________________________
|
16
|
-
________________________________________________________________________________
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/m.svg)](https://rubygems.org/gems/m) [![Code Climate](https://codeclimate.com/github/qrush/m.svg)](https://codeclimate.com/github/qrush/m) [![Build Status](https://travis-ci.org/qrush/m.svg?branch=master)](https://travis-ci.org/qrush/m) [![Coverage Status](https://coveralls.io/repos/qrush/m/badge.svg?branch=master)](https://coveralls.io/r/qrush/m)
|
17
4
|
|
18
5
|
|
19
|
-
|
20
|
-
- [![Code Climate](https://codeclimate.com/github/qrush/m.svg)](https://codeclimate.com/github/qrush/m)
|
21
|
-
- [![Build Status](https://travis-ci.org/qrush/m.svg)](https://travis-ci.org/qrush/m)
|
22
|
-
- [![Dependency Status](https://gemnasium.com/qrush/m.svg)](https://gemnasium.com/qrush/m)
|
23
|
-
- [![Coverage Status](https://coveralls.io/repos/qrush/m/badge.svg?branch=master)](https://coveralls.io/r/qrush/m)
|
6
|
+
----
|
24
7
|
|
8
|
+
`m` stands for metal, a better test/unit and minitest test runner that can run tests by line number.
|
25
9
|
|
26
10
|
INSTALL
|
27
11
|
=======
|
@@ -50,7 +34,7 @@ Gem::Specification.new do |gem|
|
|
50
34
|
end
|
51
35
|
```
|
52
36
|
|
53
|
-
m works on Ruby 2.0+ only.
|
37
|
+
m works on Ruby 2.0+ only and support is only provided for [versions currently maintained by the community](https://www.ruby-lang.org/en/downloads/branches/).
|
54
38
|
|
55
39
|
|
56
40
|
USAGE
|
@@ -126,6 +110,19 @@ If you want to run all the tests in a directory as well as its subdirectories, u
|
|
126
110
|
|
127
111
|
156 tests, 303 assertions, 0 failures, 0 errors, 13 skips
|
128
112
|
|
113
|
+
If you need to pass some option down to the actual runner, that is also supported:
|
114
|
+
|
115
|
+
$ m test/models -- --seed 1234
|
116
|
+
Run options: --seed 1234
|
117
|
+
|
118
|
+
..
|
119
|
+
|
120
|
+
Finished in 3.459902s, 45.0880 runs/s, 87.5747 assertions/s.
|
121
|
+
|
122
|
+
156 tests, 303 assertions, 0 failures, 0 errors, 13 skips
|
123
|
+
|
124
|
+
Ensure that you use the `--` before the options, otherwise you'll get an invalid option error. Also, these extra option should always be the last argument.
|
125
|
+
|
129
126
|
|
130
127
|
SUPPORT
|
131
128
|
=======
|
@@ -135,11 +132,23 @@ SUPPORT
|
|
135
132
|
- Test::Unit
|
136
133
|
- ActiveSupport::TestCase
|
137
134
|
- MiniTest::Unit::TestCase
|
135
|
+
- Minitest
|
138
136
|
|
139
137
|
|
140
138
|
CONTRIBUTING
|
141
139
|
============
|
142
140
|
|
141
|
+
## Setup
|
142
|
+
|
143
|
+
This project uses [Appraisal](https://github.com/thoughtbot/appraisal) to test against different versions of dependencies.
|
144
|
+
|
145
|
+
To install all scenarios (appraisals):
|
146
|
+
|
147
|
+
bundle install
|
148
|
+
bundle exec appraisal install
|
149
|
+
|
150
|
+
## Testing
|
151
|
+
|
143
152
|
You can run all the tests with:
|
144
153
|
|
145
154
|
bundle exec rake tests
|
@@ -150,11 +159,7 @@ You can also run tests selectively. For minitest 4 run:
|
|
150
159
|
|
151
160
|
and the ones for minitest 5 with:
|
152
161
|
|
153
|
-
appraisal minitest5 rake test
|
154
|
-
|
155
|
-
In the case of minitest 5, we have to specify the test to run, because running
|
156
|
-
the whole suite will fail due to incompatibilities with ruby (at least until
|
157
|
-
2.1.1).
|
162
|
+
appraisal minitest5 rake test
|
158
163
|
|
159
164
|
|
160
165
|
LICENSE
|
data/gemfiles/minitest4.gemfile
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "coveralls", :
|
6
|
-
gem "
|
5
|
+
gem "coveralls", require: false
|
6
|
+
gem "benchmark-ips"
|
7
|
+
gem "allocation_stats"
|
8
|
+
gem "minitest", "~> 4"
|
7
9
|
|
8
|
-
gemspec :
|
10
|
+
gemspec path: "../"
|
@@ -1,85 +1,73 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: ..
|
3
3
|
specs:
|
4
|
-
m (1.
|
4
|
+
m (1.5.1)
|
5
5
|
method_source (>= 0.6.7)
|
6
6
|
rake (>= 0.9.2.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (4.0.
|
12
|
-
i18n (~> 0.6, >= 0.6.
|
11
|
+
activesupport (4.0.13)
|
12
|
+
i18n (~> 0.6, >= 0.6.9)
|
13
13
|
minitest (~> 4.2)
|
14
14
|
multi_json (~> 1.3)
|
15
15
|
thread_safe (~> 0.1)
|
16
16
|
tzinfo (~> 0.3.37)
|
17
|
-
|
17
|
+
allocation_stats (0.1.5)
|
18
|
+
appraisal (2.4.1)
|
18
19
|
bundler
|
19
20
|
rake
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
simplecov (~> 0.
|
21
|
+
thor (>= 0.14.0)
|
22
|
+
benchmark-ips (2.9.1)
|
23
|
+
concurrent-ruby (1.1.9)
|
24
|
+
coveralls (0.8.23)
|
25
|
+
json (>= 1.8, < 3)
|
26
|
+
simplecov (~> 0.16.1)
|
26
27
|
term-ansicolor (~> 1.3)
|
27
|
-
thor (
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
json (1.8.2)
|
35
|
-
json (1.8.2-java)
|
36
|
-
method_source (0.8.2)
|
37
|
-
mime-types (2.5)
|
28
|
+
thor (>= 0.19.4, < 2.0)
|
29
|
+
tins (~> 1.6)
|
30
|
+
docile (1.4.0)
|
31
|
+
i18n (0.9.5)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
json (2.5.1)
|
34
|
+
method_source (1.0.0)
|
38
35
|
minitest (4.7.5)
|
39
|
-
multi_json (1.
|
40
|
-
mustache (1.
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
redcarpet (3.3.2)
|
45
|
-
rest-client (1.8.0)
|
46
|
-
http-cookie (>= 1.0.2, < 2.0)
|
47
|
-
mime-types (>= 1.16, < 3.0)
|
48
|
-
netrc (~> 0.7)
|
36
|
+
multi_json (1.15.0)
|
37
|
+
mustache (1.1.1)
|
38
|
+
rake (13.0.6)
|
39
|
+
rdiscount (2.2.0.2)
|
40
|
+
redcarpet (3.5.1)
|
49
41
|
rocco (0.8.2)
|
50
42
|
mustache
|
51
43
|
redcarpet
|
52
|
-
simplecov (0.
|
53
|
-
docile (~> 1.1
|
54
|
-
json (
|
44
|
+
simplecov (0.16.1)
|
45
|
+
docile (~> 1.1)
|
46
|
+
json (>= 1.8, < 3)
|
55
47
|
simplecov-html (~> 0.10.0)
|
56
|
-
simplecov-html (0.10.
|
57
|
-
|
48
|
+
simplecov-html (0.10.2)
|
49
|
+
sync (0.5.0)
|
50
|
+
term-ansicolor (1.7.1)
|
58
51
|
tins (~> 1.0)
|
59
|
-
thor (
|
60
|
-
thread_safe (0.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
tins (1.5.1)
|
65
|
-
tzinfo (0.3.38)
|
66
|
-
unf (0.1.4)
|
67
|
-
unf_ext
|
68
|
-
unf (0.1.4-java)
|
69
|
-
unf_ext (0.0.7.1)
|
52
|
+
thor (1.1.0)
|
53
|
+
thread_safe (0.3.6)
|
54
|
+
tins (1.29.1)
|
55
|
+
sync
|
56
|
+
tzinfo (0.3.60)
|
70
57
|
|
71
58
|
PLATFORMS
|
72
|
-
java
|
73
59
|
ruby
|
74
60
|
|
75
61
|
DEPENDENCIES
|
76
62
|
activesupport
|
63
|
+
allocation_stats
|
77
64
|
appraisal
|
65
|
+
benchmark-ips
|
78
66
|
coveralls
|
79
67
|
m!
|
80
|
-
minitest (
|
68
|
+
minitest (~> 4)
|
81
69
|
rdiscount
|
82
70
|
rocco
|
83
71
|
|
84
72
|
BUNDLED WITH
|
85
|
-
|
73
|
+
2.2.26
|
data/gemfiles/minitest5.gemfile
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "coveralls", :
|
6
|
-
gem "
|
5
|
+
gem "coveralls", require: false
|
6
|
+
gem "benchmark-ips"
|
7
|
+
gem "allocation_stats"
|
8
|
+
gem "minitest", "~> 5"
|
7
9
|
|
8
|
-
gemspec :
|
10
|
+
gemspec path: "../"
|
@@ -1,75 +1,73 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: ..
|
3
3
|
specs:
|
4
|
-
m (1.
|
4
|
+
m (1.5.1)
|
5
5
|
method_source (>= 0.6.7)
|
6
6
|
rake (>= 0.9.2.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
activesupport (6.1.4.1)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 1.6, < 2)
|
14
|
+
minitest (>= 5.1)
|
15
|
+
tzinfo (~> 2.0)
|
16
|
+
zeitwerk (~> 2.3)
|
17
|
+
allocation_stats (0.1.5)
|
18
|
+
appraisal (2.4.1)
|
15
19
|
bundler
|
16
20
|
rake
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
thor (>= 0.14.0)
|
22
|
+
benchmark-ips (2.9.1)
|
23
|
+
concurrent-ruby (1.1.9)
|
24
|
+
coveralls (0.8.23)
|
25
|
+
json (>= 1.8, < 3)
|
26
|
+
simplecov (~> 0.16.1)
|
21
27
|
term-ansicolor (~> 1.3)
|
22
|
-
thor (
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
multi_json (1.8.4)
|
35
|
-
mustache (1.0.2)
|
36
|
-
netrc (0.10.3)
|
37
|
-
rake (10.1.1)
|
38
|
-
rdiscount (2.1.8)
|
39
|
-
redcarpet (3.3.2)
|
40
|
-
rest-client (1.8.0)
|
41
|
-
http-cookie (>= 1.0.2, < 2.0)
|
42
|
-
mime-types (>= 1.16, < 3.0)
|
43
|
-
netrc (~> 0.7)
|
28
|
+
thor (>= 0.19.4, < 2.0)
|
29
|
+
tins (~> 1.6)
|
30
|
+
docile (1.4.0)
|
31
|
+
i18n (1.8.10)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
json (2.5.1)
|
34
|
+
method_source (1.0.0)
|
35
|
+
minitest (5.14.4)
|
36
|
+
mustache (1.1.1)
|
37
|
+
rake (13.0.6)
|
38
|
+
rdiscount (2.2.0.2)
|
39
|
+
redcarpet (3.5.1)
|
44
40
|
rocco (0.8.2)
|
45
41
|
mustache
|
46
42
|
redcarpet
|
47
|
-
simplecov (0.
|
48
|
-
docile (~> 1.1
|
49
|
-
json (
|
43
|
+
simplecov (0.16.1)
|
44
|
+
docile (~> 1.1)
|
45
|
+
json (>= 1.8, < 3)
|
50
46
|
simplecov-html (~> 0.10.0)
|
51
|
-
simplecov-html (0.10.
|
52
|
-
|
47
|
+
simplecov-html (0.10.2)
|
48
|
+
sync (0.5.0)
|
49
|
+
term-ansicolor (1.7.1)
|
53
50
|
tins (~> 1.0)
|
54
|
-
thor (
|
55
|
-
tins (1.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
thor (1.1.0)
|
52
|
+
tins (1.29.1)
|
53
|
+
sync
|
54
|
+
tzinfo (2.0.4)
|
55
|
+
concurrent-ruby (~> 1.0)
|
56
|
+
zeitwerk (2.4.2)
|
60
57
|
|
61
58
|
PLATFORMS
|
62
|
-
java
|
63
59
|
ruby
|
64
60
|
|
65
61
|
DEPENDENCIES
|
66
62
|
activesupport
|
63
|
+
allocation_stats
|
67
64
|
appraisal
|
65
|
+
benchmark-ips
|
68
66
|
coveralls
|
69
67
|
m!
|
70
|
-
minitest
|
68
|
+
minitest (~> 5)
|
71
69
|
rdiscount
|
72
70
|
rocco
|
73
71
|
|
74
72
|
BUNDLED WITH
|
75
|
-
|
73
|
+
2.2.26
|
@@ -1,80 +1,71 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: ..
|
3
3
|
specs:
|
4
|
-
m (1.
|
4
|
+
m (1.5.1)
|
5
5
|
method_source (>= 0.6.7)
|
6
6
|
rake (>= 0.9.2.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (4.
|
12
|
-
|
13
|
-
|
14
|
-
minitest (
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
activesupport (6.1.4.1)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 1.6, < 2)
|
14
|
+
minitest (>= 5.1)
|
15
|
+
tzinfo (~> 2.0)
|
16
|
+
zeitwerk (~> 2.3)
|
17
|
+
allocation_stats (0.1.5)
|
18
|
+
appraisal (2.4.1)
|
18
19
|
bundler
|
19
20
|
rake
|
20
21
|
thor (>= 0.14.0)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
benchmark-ips (2.9.1)
|
23
|
+
concurrent-ruby (1.1.9)
|
24
|
+
coveralls (0.8.23)
|
25
|
+
json (>= 1.8, < 3)
|
26
|
+
simplecov (~> 0.16.1)
|
25
27
|
term-ansicolor (~> 1.3)
|
26
|
-
thor (
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
netrc (0.10.3)
|
40
|
-
power_assert (0.2.4)
|
41
|
-
rake (10.4.2)
|
42
|
-
rdiscount (2.1.8)
|
43
|
-
redcarpet (3.3.2)
|
44
|
-
rest-client (1.8.0)
|
45
|
-
http-cookie (>= 1.0.2, < 2.0)
|
46
|
-
mime-types (>= 1.16, < 3.0)
|
47
|
-
netrc (~> 0.7)
|
28
|
+
thor (>= 0.19.4, < 2.0)
|
29
|
+
tins (~> 1.6)
|
30
|
+
docile (1.4.0)
|
31
|
+
i18n (1.8.10)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
json (2.5.1)
|
34
|
+
method_source (1.0.0)
|
35
|
+
minitest (5.14.4)
|
36
|
+
mustache (1.1.1)
|
37
|
+
power_assert (2.0.1)
|
38
|
+
rake (13.0.6)
|
39
|
+
rdiscount (2.2.0.2)
|
40
|
+
redcarpet (3.5.1)
|
48
41
|
rocco (0.8.2)
|
49
42
|
mustache
|
50
43
|
redcarpet
|
51
|
-
simplecov (0.
|
52
|
-
docile (~> 1.1
|
53
|
-
json (
|
44
|
+
simplecov (0.16.1)
|
45
|
+
docile (~> 1.1)
|
46
|
+
json (>= 1.8, < 3)
|
54
47
|
simplecov-html (~> 0.10.0)
|
55
|
-
simplecov-html (0.10.
|
56
|
-
|
48
|
+
simplecov-html (0.10.2)
|
49
|
+
sync (0.5.0)
|
50
|
+
term-ansicolor (1.7.1)
|
57
51
|
tins (~> 1.0)
|
58
|
-
test-unit (3.
|
52
|
+
test-unit (3.4.4)
|
59
53
|
power_assert
|
60
|
-
thor (
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
unf (0.1.4)
|
67
|
-
unf_ext
|
68
|
-
unf (0.1.4-java)
|
69
|
-
unf_ext (0.0.7.1)
|
54
|
+
thor (1.1.0)
|
55
|
+
tins (1.29.1)
|
56
|
+
sync
|
57
|
+
tzinfo (2.0.4)
|
58
|
+
concurrent-ruby (~> 1.0)
|
59
|
+
zeitwerk (2.4.2)
|
70
60
|
|
71
61
|
PLATFORMS
|
72
|
-
java
|
73
62
|
ruby
|
74
63
|
|
75
64
|
DEPENDENCIES
|
76
65
|
activesupport
|
66
|
+
allocation_stats
|
77
67
|
appraisal
|
68
|
+
benchmark-ips
|
78
69
|
coveralls
|
79
70
|
m!
|
80
71
|
rdiscount
|
@@ -82,4 +73,4 @@ DEPENDENCIES
|
|
82
73
|
test-unit
|
83
74
|
|
84
75
|
BUNDLED WITH
|
85
|
-
|
76
|
+
2.2.26
|
data/lib/m/executor.rb
CHANGED
@@ -23,7 +23,7 @@ module M
|
|
23
23
|
test_arguments = ["-n", "/^(#{test_names})$/"]
|
24
24
|
|
25
25
|
# directly run the tests from here and exit with the status of the tests passing or failing
|
26
|
-
runner.run(test_arguments)
|
26
|
+
runner.run(test_arguments + testable.passthrough_options)
|
27
27
|
elsif tests.size > 0
|
28
28
|
# Otherwise we found no tests on this line, so you need to pick one.
|
29
29
|
message = "No tests found on line #{testable.lines.join(', ')}. Valid tests to run:\n\n"
|
data/lib/m/frameworks.rb
CHANGED
@@ -30,12 +30,16 @@ module M
|
|
30
30
|
self.class.test_unit?
|
31
31
|
end
|
32
32
|
|
33
|
+
def self.minitest_version_major
|
34
|
+
defined?(Minitest) ? Minitest::Unit::VERSION.slice(/\d+/) : nil
|
35
|
+
end
|
36
|
+
|
33
37
|
def self.minitest5?
|
34
|
-
|
38
|
+
minitest_version_major == "5"
|
35
39
|
end
|
36
40
|
|
37
41
|
def self.minitest4?
|
38
|
-
|
42
|
+
minitest_version_major == "4"
|
39
43
|
end
|
40
44
|
|
41
45
|
def self.test_unit?
|
data/lib/m/parser.rb
CHANGED
@@ -15,10 +15,17 @@ module M
|
|
15
15
|
else
|
16
16
|
parse_options! argv
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
if argv.first.start_with?("--")
|
19
|
+
exec "rake test #{argv.join}"
|
20
|
+
exit 0
|
21
|
+
else
|
22
|
+
# Parse out ARGV, it should be coming in in a format like `test/test_file.rb:9:19`
|
23
|
+
parsed = argv.shift.split(':')
|
24
|
+
testable.file = parsed.shift
|
25
|
+
testable.lines = parsed if testable.lines.none?
|
26
|
+
# Anything else on ARGV will be passed along to the runner
|
27
|
+
testable.passthrough_options = argv
|
28
|
+
end
|
22
29
|
|
23
30
|
# If this file is a directory, not a file, run the tests inside of this directory
|
24
31
|
if Dir.exist?(testable.file)
|
data/lib/m/testable.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
module M
|
2
2
|
class Testable
|
3
|
-
attr_accessor :file, :recursive
|
3
|
+
attr_accessor :file, :recursive, :passthrough_options
|
4
4
|
attr_reader :lines
|
5
5
|
|
6
6
|
def initialize(file = "", lines = [], recursive = false)
|
7
7
|
@file = file
|
8
8
|
@recursive = recursive
|
9
|
+
@passthrough_options = []
|
9
10
|
self.lines = lines
|
10
11
|
end
|
11
12
|
|
data/lib/m/version.rb
CHANGED
data/test/active_support_test.rb
CHANGED
@@ -2,28 +2,28 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class ActiveSupportTest < MTest
|
4
4
|
def test_run_simple_test_by_line_number
|
5
|
-
output = m('examples/active_support_example_test.rb:
|
6
|
-
assert_output(/1 tests, 1 assertions/, output)
|
5
|
+
output = m('examples/active_support_example_test.rb:12')
|
6
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_runs_entire_test_without_line_number
|
10
10
|
output = m('examples/active_support_example_test.rb')
|
11
|
-
assert_output(/4 tests/, output)
|
11
|
+
assert_output(/4 (runs|tests)/, output)
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_run_inside_of_test
|
15
|
-
output = m('examples/active_support_example_test.rb:
|
16
|
-
assert_output(/1 tests, 1 assertions/, output)
|
15
|
+
output = m('examples/active_support_example_test.rb:13')
|
16
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_run_on_end_of_test
|
20
|
-
output = m('examples/active_support_example_test.rb:
|
21
|
-
assert_output(/1 tests, 1 assertions/, output)
|
20
|
+
output = m('examples/active_support_example_test.rb:14')
|
21
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_run_inside_big_test
|
25
|
-
output = m('examples/active_support_example_test.rb:
|
26
|
-
assert_output(/1 tests, 3 assertions/, output)
|
25
|
+
output = m('examples/active_support_example_test.rb:18')
|
26
|
+
assert_output(/1 (runs|tests), 3 assertions/, output)
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_run_on_blank_line_orders_tests_by_line_number
|
@@ -33,21 +33,21 @@ class ActiveSupportTest < MTest
|
|
33
33
|
expected = <<-EOF
|
34
34
|
No tests found on line 2. Valid tests to run:
|
35
35
|
|
36
|
-
test_normal: m examples/active_support_example_test.rb:
|
37
|
-
test_carrot: m examples/active_support_example_test.rb:
|
38
|
-
test_daikon: m examples/active_support_example_test.rb:
|
39
|
-
test_eggplant_fig: m examples/active_support_example_test.rb:
|
36
|
+
test_normal: m examples/active_support_example_test.rb:8
|
37
|
+
test_carrot: m examples/active_support_example_test.rb:12
|
38
|
+
test_daikon: m examples/active_support_example_test.rb:16
|
39
|
+
test_eggplant_fig: m examples/active_support_example_test.rb:22
|
40
40
|
EOF
|
41
41
|
assert_equal expected.strip, output
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_run_on_test_with_spaces
|
45
|
-
output = m('examples/active_support_example_test.rb:
|
46
|
-
assert_output(/1 tests, 1 assertions/, output)
|
45
|
+
output = m('examples/active_support_example_test.rb:22')
|
46
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
47
47
|
end
|
48
48
|
|
49
49
|
def test_run_on_test_with_unescaped_regular_express_characters
|
50
|
-
output = m('examples/active_support_unescaped_example_test.rb:
|
51
|
-
assert_output(/1 tests, 1 assertions/, output)
|
50
|
+
output = m('examples/active_support_unescaped_example_test.rb:8')
|
51
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
52
52
|
end
|
53
53
|
end
|
data/test/everything_test.rb
CHANGED
@@ -3,7 +3,7 @@ require 'test_helper'
|
|
3
3
|
class EverythingTest < MTest
|
4
4
|
def test_runs_entire_test_suite_with_no_arguments
|
5
5
|
output = m('')
|
6
|
-
assert_output(/12 tests/, output)
|
6
|
+
assert_output(/12 (runs|tests)/, output)
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_missing_file_gives_a_decent_error_message
|
@@ -19,15 +19,15 @@ class EverythingTest < MTest
|
|
19
19
|
|
20
20
|
def test_running_tests_within_a_subdirectory
|
21
21
|
output = m('examples/subdir')
|
22
|
-
assert_output(/3 tests/, output)
|
22
|
+
assert_output(/3 (runs|tests)/, output)
|
23
23
|
|
24
24
|
output = m('examples')
|
25
|
-
assert_output(/12 tests/, output)
|
25
|
+
assert_output(/12 (runs|tests)/, output)
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_running_tests_with_failures_within_a_subdirectory
|
29
29
|
output = m('examples/subdir_with_failures')
|
30
|
-
assert_output_for_failed_execution(/1 tests, 1 assertions, 1 failures/, output)
|
30
|
+
assert_output_for_failed_execution(/1 (runs|tests), 1 assertions, 1 failures/, output)
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_blank_file_is_quieter
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'minitest/unit'
|
2
|
+
|
3
|
+
class Meme
|
4
|
+
def i_can_has_cheezburger?
|
5
|
+
"OHAI!"
|
6
|
+
end
|
7
|
+
|
8
|
+
def will_it_blend?
|
9
|
+
"YES!"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Test = M::Frameworks.minitest4? ? MiniTest::Unit::TestCase : Minitest::Test
|
14
|
+
|
15
|
+
class TestMeme < Test
|
16
|
+
def setup
|
17
|
+
@meme = Meme.new
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_that_kitty_can_eat
|
21
|
+
assert_equal "OHAI!", @meme.i_can_has_cheezburger?
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_that_it_will_not_blend
|
25
|
+
refute_match(/^maybe/i, @meme.will_it_blend?)
|
26
|
+
refute_match(/^no/i, @meme.will_it_blend?)
|
27
|
+
refute_match(/^lolz/i, @meme.will_it_blend?)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_that_kitty_can_eat_two_time
|
31
|
+
assert_equal "OHAI!", @meme.i_can_has_cheezburger?
|
32
|
+
assert_equal "OHAI!", @meme.i_can_has_cheezburger?
|
33
|
+
end
|
34
|
+
|
35
|
+
Minitest.after_run { p "ran after run block" } if Minitest.respond_to?(:after_run)
|
36
|
+
end
|
data/test/multiple_test.rb
CHANGED
@@ -3,16 +3,16 @@ require 'test_helper'
|
|
3
3
|
class MultipleTest < MTest
|
4
4
|
def test_run_simple_test_by_line_number
|
5
5
|
output = m('examples/multiple_example_test.rb:11')
|
6
|
-
assert_output(/1 tests, 1 assertions/, output)
|
6
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_runs_entire_test_without_line_number
|
10
10
|
output = m('examples/multiple_example_test.rb')
|
11
|
-
assert_output(/4 tests/, output)
|
11
|
+
assert_output(/4 (runs|tests)/, output)
|
12
12
|
end
|
13
13
|
|
14
14
|
def test_runs_all_tests_on_given_line_number
|
15
15
|
output = m('examples/multiple_example_test.rb:6')
|
16
|
-
assert_output(/3 tests/, output)
|
16
|
+
assert_output(/3 (runs|tests)/, output)
|
17
17
|
end
|
18
18
|
end
|
data/test/options_test.rb
CHANGED
@@ -17,27 +17,49 @@ class OptionsTest < MTest
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_short_line_option
|
20
|
-
output = m('-l20 examples/
|
21
|
-
assert_output(/1 tests, 1 assertions/, output)
|
20
|
+
output = m('-l20 examples/minitest_example_test.rb')
|
21
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_long_line_option
|
25
|
-
output = m('--line 20 examples/
|
26
|
-
assert_output(/1 tests, 1 assertions/, output)
|
25
|
+
output = m('--line 20 examples/minitest_example_test.rb')
|
26
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_line_option_has_precedence_over_colon_format
|
30
|
-
output = m('--line 20 examples/
|
31
|
-
assert_output(/1 tests, 1 assertions/, output)
|
30
|
+
output = m('--line 20 examples/minitest_example_test.rb:2')
|
31
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_recursive_option
|
35
35
|
output = m('-r examples/subdir')
|
36
|
-
assert_output(/5 tests/, output)
|
36
|
+
assert_output(/5 (runs|tests)/, output)
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_recursive_option_without_directory_arg_fails
|
40
40
|
output = m('-r')
|
41
41
|
assert_match(/OptionParser::MissingArgument/, output)
|
42
42
|
end
|
43
|
+
|
44
|
+
def test_passthrough_options
|
45
|
+
output = m('-- --verbose')
|
46
|
+
assert_output(/0 errors/, output)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_passthrough_options_name_with_file
|
50
|
+
output = m('examples/minitest_example_test.rb -- --name /test_that_it_will_not_blend/')
|
51
|
+
assert_output(/1 (runs|tests)/, output)
|
52
|
+
assert_output(/0 failures/, output)
|
53
|
+
assert_output(/0 errors/, output)
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_passthrough_options_with_file
|
57
|
+
output = m('examples/minitest_example_test.rb -- --verbose')
|
58
|
+
assert_output(/3 (runs|tests), 9 assertions/, output)
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_passthrough_options_with_file_and_other_options
|
62
|
+
output = m('--line 20 examples/minitest_example_test.rb -- --verbose')
|
63
|
+
assert_output(/1 (runs|tests), 1 assertions/, output)
|
64
|
+
end
|
43
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Quaranto
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- test/examples/empty_example_test.rb
|
149
149
|
- test/examples/minitest_4_example_test.rb
|
150
150
|
- test/examples/minitest_5_example_test.rb
|
151
|
+
- test/examples/minitest_example_test.rb
|
151
152
|
- test/examples/multiple_example_test.rb
|
152
153
|
- test/examples/subdir/a_test.rb
|
153
154
|
- test/examples/subdir/another_subdir/d_test.rb
|
@@ -166,7 +167,7 @@ files:
|
|
166
167
|
homepage: https://github.com/qrush/m
|
167
168
|
licenses: []
|
168
169
|
metadata: {}
|
169
|
-
post_install_message:
|
170
|
+
post_install_message:
|
170
171
|
rdoc_options: []
|
171
172
|
require_paths:
|
172
173
|
- lib
|
@@ -181,9 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
182
|
- !ruby/object:Gem::Version
|
182
183
|
version: '0'
|
183
184
|
requirements: []
|
184
|
-
|
185
|
-
|
186
|
-
signing_key:
|
185
|
+
rubygems_version: 3.2.27
|
186
|
+
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Run test/unit tests by line number. Metal!
|
189
189
|
test_files:
|
@@ -198,6 +198,7 @@ test_files:
|
|
198
198
|
- test/examples/empty_example_test.rb
|
199
199
|
- test/examples/minitest_4_example_test.rb
|
200
200
|
- test/examples/minitest_5_example_test.rb
|
201
|
+
- test/examples/minitest_example_test.rb
|
201
202
|
- test/examples/multiple_example_test.rb
|
202
203
|
- test/examples/subdir/a_test.rb
|
203
204
|
- test/examples/subdir/another_subdir/d_test.rb
|