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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: affae077a376d9f03c66b1fd655a5e9ddb27b617
4
- data.tar.gz: 0e5dc79ab7498e49e94fcd76f84b4892da35f71b
2
+ SHA256:
3
+ metadata.gz: 02ef4d061c7ec25262a03a7f9fbf1735dac5de7900fb2b6c89875a0d3a2cf132
4
+ data.tar.gz: 47ccce99a3448307744eaa70fddf565efbbff22484016814a4ebb77e9c75ced7
5
5
  SHA512:
6
- metadata.gz: ba70266e07e1840bfe3ea5c383c7c0c389d2c9835e596f787c0d57e2a40a01e0b64a57f8a3d263faba6c7b5354402b4fb751cefae087380894f0f1aa3308fcff
7
- data.tar.gz: 3516c16bc732573d7dbdb1c0a9df45d76ca59e57d06bf647ab571559fa07d636644494952321978832265010152d1157d982c4af5d1bebe07ddd6c303e6635cc
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.0.0
3
- - 2.1.0
4
- - 2.2.0
5
- - jruby-1.7.21
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 tests
19
+ - bundle exec rake test
data/Appraisals CHANGED
@@ -1,9 +1,9 @@
1
1
  appraise "minitest4" do
2
- gem 'minitest', '4.7.5'
2
+ gem 'minitest', '~> 4'
3
3
  end
4
4
 
5
5
  appraise "minitest5" do
6
- gem 'minitest'
6
+ gem 'minitest', '~> 5'
7
7
  end
8
8
 
9
9
  appraise "test_unit_gem" do
data/Gemfile.lock CHANGED
@@ -1,72 +1,59 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- m (1.5.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.0.13)
12
- i18n (~> 0.6, >= 0.6.9)
13
- minitest (~> 4.2)
14
- multi_json (~> 1.3)
15
- thread_safe (~> 0.1)
16
- tzinfo (~> 0.3.37)
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.0.1)
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.1.1)
24
- coveralls (0.8.1)
25
- json (~> 1.8)
26
- rest-client (>= 1.6.8, < 2)
27
- simplecov (~> 0.10.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 (~> 0.19.1)
30
- docile (1.1.5)
31
- domain_name (0.5.24)
32
- unf (>= 0.0.5, < 1.0.0)
33
- http-cookie (1.0.2)
34
- domain_name (~> 0.5)
35
- i18n (0.7.0)
36
- json (1.8.2)
37
- json (1.8.2-java)
38
- method_source (0.8.2)
39
- mime-types (2.5)
40
- minitest (4.7.5)
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.10.0)
55
- docile (~> 1.1.0)
56
- json (~> 1.8)
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.0)
59
- term-ansicolor (1.3.0)
47
+ simplecov-html (0.10.2)
48
+ sync (0.5.0)
49
+ term-ansicolor (1.7.1)
60
50
  tins (~> 1.0)
61
- thor (0.19.1)
62
- thread_safe (0.3.5)
63
- thread_safe (0.3.5-java)
64
- tins (1.5.1)
65
- tzinfo (0.3.44)
66
- unf (0.1.4)
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
- 1.12.5
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
- - [![Gem Version](https://badge.fury.io/rb/m.svg)](https://rubygems.org/gems/m)
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 TEST=test/minitest_5_test.rb
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
@@ -2,7 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "coveralls", :require => false, :group => :coverage
6
- gem "minitest", "4.7.5"
5
+ gem "coveralls", require: false
6
+ gem "benchmark-ips"
7
+ gem "allocation_stats"
8
+ gem "minitest", "~> 4"
7
9
 
8
- gemspec :path => "../"
10
+ gemspec path: "../"
@@ -1,85 +1,73 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- m (1.4.2)
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.2)
12
- i18n (~> 0.6, >= 0.6.4)
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
- appraisal (0.5.2)
17
+ allocation_stats (0.1.5)
18
+ appraisal (2.4.1)
18
19
  bundler
19
20
  rake
20
- atomic (1.1.14)
21
- atomic (1.1.14-java)
22
- coveralls (0.8.1)
23
- json (~> 1.8)
24
- rest-client (>= 1.6.8, < 2)
25
- simplecov (~> 0.10.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 (~> 0.19.1)
28
- docile (1.1.5)
29
- domain_name (0.5.24)
30
- unf (>= 0.0.5, < 1.0.0)
31
- http-cookie (1.0.2)
32
- domain_name (~> 0.5)
33
- i18n (0.6.9)
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.8.4)
40
- mustache (1.0.2)
41
- netrc (0.10.3)
42
- rake (10.1.1)
43
- rdiscount (2.1.8)
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.10.0)
53
- docile (~> 1.1.0)
54
- json (~> 1.8)
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.0)
57
- term-ansicolor (1.3.0)
48
+ simplecov-html (0.10.2)
49
+ sync (0.5.0)
50
+ term-ansicolor (1.7.1)
58
51
  tins (~> 1.0)
59
- thor (0.19.1)
60
- thread_safe (0.1.3)
61
- atomic
62
- thread_safe (0.1.3-java)
63
- atomic
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 (= 4.7.5)
68
+ minitest (~> 4)
81
69
  rdiscount
82
70
  rocco
83
71
 
84
72
  BUNDLED WITH
85
- 1.11.2
73
+ 2.2.26
@@ -2,7 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "coveralls", :require => false, :group => :coverage
6
- gem "minitest"
5
+ gem "coveralls", require: false
6
+ gem "benchmark-ips"
7
+ gem "allocation_stats"
8
+ gem "minitest", "~> 5"
7
9
 
8
- gemspec :path => "../"
10
+ gemspec path: "../"
@@ -1,75 +1,73 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- m (1.4.2)
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 (3.2.16)
12
- i18n (~> 0.6, >= 0.6.4)
13
- multi_json (~> 1.0)
14
- appraisal (0.5.2)
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
- coveralls (0.8.1)
18
- json (~> 1.8)
19
- rest-client (>= 1.6.8, < 2)
20
- simplecov (~> 0.10.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)
21
27
  term-ansicolor (~> 1.3)
22
- thor (~> 0.19.1)
23
- docile (1.1.5)
24
- domain_name (0.5.24)
25
- unf (>= 0.0.5, < 1.0.0)
26
- http-cookie (1.0.2)
27
- domain_name (~> 0.5)
28
- i18n (0.6.9)
29
- json (1.8.2)
30
- json (1.8.2-java)
31
- method_source (0.8.2)
32
- mime-types (2.5)
33
- minitest (5.3.1)
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.10.0)
48
- docile (~> 1.1.0)
49
- json (~> 1.8)
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.0)
52
- term-ansicolor (1.3.0)
47
+ simplecov-html (0.10.2)
48
+ sync (0.5.0)
49
+ term-ansicolor (1.7.1)
53
50
  tins (~> 1.0)
54
- thor (0.19.1)
55
- tins (1.5.1)
56
- unf (0.1.4)
57
- unf_ext
58
- unf (0.1.4-java)
59
- 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)
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
- 1.11.2
73
+ 2.2.26
@@ -2,7 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "coveralls", :require => false, :group => :coverage
5
+ gem "coveralls", require: false
6
+ gem "benchmark-ips"
7
+ gem "allocation_stats"
6
8
  gem "test-unit"
7
9
 
8
- gemspec :path => "../"
10
+ gemspec path: "../"
@@ -1,80 +1,71 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- m (1.4.2)
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.2.3)
12
- i18n (~> 0.7)
13
- json (~> 1.7, >= 1.7.7)
14
- minitest (~> 5.1)
15
- thread_safe (~> 0.3, >= 0.3.4)
16
- tzinfo (~> 1.1)
17
- appraisal (2.0.2)
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
- coveralls (0.8.2)
22
- json (~> 1.8)
23
- rest-client (>= 1.6.8, < 2)
24
- simplecov (~> 0.10.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)
25
27
  term-ansicolor (~> 1.3)
26
- thor (~> 0.19.1)
27
- docile (1.1.5)
28
- domain_name (0.5.24)
29
- unf (>= 0.0.5, < 1.0.0)
30
- http-cookie (1.0.2)
31
- domain_name (~> 0.5)
32
- i18n (0.7.0)
33
- json (1.8.3)
34
- json (1.8.3-java)
35
- method_source (0.8.2)
36
- mime-types (2.6.1)
37
- minitest (5.7.0)
38
- mustache (1.0.2)
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.10.0)
52
- docile (~> 1.1.0)
53
- json (~> 1.8)
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.0)
56
- term-ansicolor (1.3.2)
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.1.2)
52
+ test-unit (3.4.4)
59
53
  power_assert
60
- thor (0.19.1)
61
- thread_safe (0.3.5)
62
- thread_safe (0.3.5-java)
63
- tins (1.5.4)
64
- tzinfo (1.2.2)
65
- thread_safe (~> 0.1)
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
- 1.11.2
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
- defined?(Minitest) && Minitest::Unit::VERSION.start_with?("5")
38
+ minitest_version_major == "5"
35
39
  end
36
40
 
37
41
  def self.minitest4?
38
- defined?(MiniTest)
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
- # Parse out ARGV, it should be coming in in a format like `test/test_file.rb:9:19`
19
- parsed = argv.first.split(':')
20
- testable.file = parsed.shift
21
- testable.lines = parsed if testable.lines.none?
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
@@ -1,3 +1,3 @@
1
1
  module M
2
- VERSION = "1.5.1"
2
+ VERSION = "1.6.0"
3
3
  end
@@ -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:11')
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:12')
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:13')
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:17')
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:7
37
- test_carrot: m examples/active_support_example_test.rb:11
38
- test_daikon: m examples/active_support_example_test.rb:15
39
- test_eggplant_fig: m examples/active_support_example_test.rb:21
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:21')
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:7')
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
@@ -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
@@ -1,3 +1,4 @@
1
+ require 'active_support'
1
2
  require 'active_support/test_case'
2
3
 
3
4
  class ActiveSupportExampleTest < ActiveSupport::TestCase
@@ -1,3 +1,4 @@
1
+ require 'active_support'
1
2
  require 'active_support/test_case'
2
3
 
3
4
  class ActiveSupportExampleTest < ActiveSupport::TestCase
@@ -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
@@ -1,3 +1,4 @@
1
+ require 'active_support'
1
2
  require 'active_support/test_case'
2
3
 
3
4
  class MultipleExampleTest < ActiveSupport::TestCase
@@ -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/minitest_4_example_test.rb')
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/minitest_4_example_test.rb')
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/minitest_4_example_test.rb:2')
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.5.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: 2017-05-22 00:00:00.000000000 Z
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
- rubyforge_project:
185
- rubygems_version: 2.4.8
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