minitest-focus 1.0.0 → 1.1.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 +7 -0
- checksums.yaml.gz.sig +1 -0
- data.tar.gz.sig +0 -0
- data/History.txt +7 -0
- data/Manifest.txt +2 -0
- data/Rakefile +3 -1
- data/lib/minitest/focus.rb +6 -31
- data/lib/minitest/focus4.rb +26 -0
- data/lib/minitest/focus5.rb +37 -0
- data/test/minitest/test_focus.rb +4 -2
- metadata +80 -91
- metadata.gz.sig +2 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d1f0124e972e82828260d1d43b715a95898efa7f
|
4
|
+
data.tar.gz: 56597a02024c19fcefc4bcf07aec0639a65d23c4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7cc420c75d806196f12b066a787edb14f0592d76c67626849bed8838ebeb448a88668787be4f3211edc471a54dd2632e96c794b527d4f57321e61668a48205ac
|
7
|
+
data.tar.gz: ca299f64dbfa72cc1d1cb85d5d5350a31ae583fc5d176f9f3bdd716290b56bf4e4d23620962667d06cf7fbbe7fe5acd3c8b4620841328ffaf403b0b57340fa46
|
checksums.yaml.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -6,11 +6,13 @@ require "hoe"
|
|
6
6
|
Hoe.plugin :isolate
|
7
7
|
Hoe.plugin :seattlerb
|
8
8
|
|
9
|
+
Hoe.add_include_dirs "../../minitest/dev/lib"
|
10
|
+
|
9
11
|
Hoe.spec "minitest-focus" do
|
10
12
|
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
11
13
|
license "MIT"
|
12
14
|
|
13
|
-
dependency "minitest", "
|
15
|
+
dependency "minitest", [">= 4", "< 6"]
|
14
16
|
end
|
15
17
|
|
16
18
|
# vim: syntax=ruby
|
data/lib/minitest/focus.rb
CHANGED
@@ -1,32 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
##
|
9
|
-
# Focus on the next test defined. Cumulative. Equivalent to
|
10
|
-
# running with command line arg: -n /test_name|.../
|
11
|
-
#
|
12
|
-
# class MyTest < MiniTest::Unit::TestCase
|
13
|
-
# ...
|
14
|
-
# focus
|
15
|
-
# def test_pass; ... end # this one will run
|
16
|
-
# ...
|
17
|
-
# end
|
18
|
-
|
19
|
-
def self.focus
|
20
|
-
opts = MiniTest::Unit.runner.options
|
21
|
-
meta = class << self; self; end
|
22
|
-
|
23
|
-
opts[:names] ||= []
|
24
|
-
|
25
|
-
meta.send :define_method, :method_added do |name|
|
26
|
-
opts[:names] << name.to_s
|
27
|
-
opts[:filter] = "/^(#{opts[:names].join "|"})$/"
|
28
|
-
|
29
|
-
meta.send :remove_method, :method_added
|
30
|
-
end
|
31
|
-
end
|
1
|
+
begin
|
2
|
+
require "minitest/test"
|
3
|
+
require "minitest/focus5.rb"
|
4
|
+
rescue LoadError
|
5
|
+
require "minitest/unit"
|
6
|
+
require "minitest/focus4.rb"
|
32
7
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class MiniTest::Unit::TestCase # :nodoc:
|
2
|
+
##
|
3
|
+
# Focus on the next test defined. Cumulative. Equivalent to
|
4
|
+
# running with command line arg: -n /test_name|.../
|
5
|
+
#
|
6
|
+
# class MyTest < MiniTest::Unit::TestCase
|
7
|
+
# ...
|
8
|
+
# focus
|
9
|
+
# def test_pass; ... end # this one will run
|
10
|
+
# ...
|
11
|
+
# end
|
12
|
+
|
13
|
+
def self.focus
|
14
|
+
opts = MiniTest::Unit.runner.options
|
15
|
+
meta = class << self; self; end
|
16
|
+
|
17
|
+
opts[:names] ||= []
|
18
|
+
|
19
|
+
meta.send :define_method, :method_added do |name|
|
20
|
+
opts[:names] << name.to_s
|
21
|
+
opts[:filter] = "/^(#{opts[:names].join "|"})$/"
|
22
|
+
|
23
|
+
meta.send :remove_method, :method_added
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class Minitest::Test # :nodoc:
|
2
|
+
class Focus # :nodoc:
|
3
|
+
VERSION = "1.1.0" # :nodoc:
|
4
|
+
end
|
5
|
+
|
6
|
+
@@filtered_names = [] # :nodoc:
|
7
|
+
|
8
|
+
##
|
9
|
+
# Focus on the next test defined. Cumulative. Equivalent to
|
10
|
+
# running with command line arg: -n /test_name|.../
|
11
|
+
#
|
12
|
+
# class MyTest < MiniTest::Unit::TestCase
|
13
|
+
# ...
|
14
|
+
# focus
|
15
|
+
# def test_pass; ... end # this one will run
|
16
|
+
# ...
|
17
|
+
# end
|
18
|
+
|
19
|
+
def self.focus
|
20
|
+
meta = class << self; self; end
|
21
|
+
|
22
|
+
meta.send :define_method, :method_added do |name|
|
23
|
+
@@filtered_names << "#{self}##{name}"
|
24
|
+
filter = "/^(#{@@filtered_names.join "|"})$/"
|
25
|
+
|
26
|
+
index = ARGV.index("-n")
|
27
|
+
unless index then
|
28
|
+
index = ARGV.size
|
29
|
+
ARGV << "-n"
|
30
|
+
end
|
31
|
+
|
32
|
+
ARGV[index + 1] = filter
|
33
|
+
|
34
|
+
meta.send :remove_method, :method_added
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/test/minitest/test_focus.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
require "minitest/autorun"
|
2
2
|
require "minitest/focus"
|
3
3
|
|
4
|
-
|
4
|
+
test_cls = defined?(Minitest::Test) ? Minitest::Test : MiniTest::Unit::TestCase
|
5
|
+
|
6
|
+
class MyTest1 < test_cls
|
5
7
|
def test_fail; flunk; end
|
6
8
|
focus; def test_method; pass; end
|
7
9
|
def test_method_edgecase; flunk; end
|
8
10
|
end
|
9
11
|
|
10
|
-
describe
|
12
|
+
describe "MyTest2" do
|
11
13
|
it "is ignored" do flunk end
|
12
14
|
focus; it "does something" do pass end
|
13
15
|
it "bombs" do flunk end
|
metadata
CHANGED
@@ -1,24 +1,18 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-focus
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Ryan Davis
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
|
-
cert_chain:
|
10
|
+
cert_chain:
|
17
11
|
- |
|
18
12
|
-----BEGIN CERTIFICATE-----
|
19
|
-
|
13
|
+
MIIDPjCCAiagAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
20
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
21
|
-
|
15
|
+
GRYDY29tMB4XDTEzMDkxNjIzMDQxMloXDTE0MDkxNjIzMDQxMlowRTETMBEGA1UE
|
22
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
23
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
24
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -28,120 +22,115 @@ cert_chain:
|
|
28
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
29
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
30
24
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
25
|
+
AQCFZ7JTzoy1gcG4d8A6dmOJy7ygtO5MFpRIz8HuKCF5566nOvpy7aHhDDzFmQuu
|
26
|
+
FX3zDU6ghx5cQIueDhf2SGOncyBmmJRRYawm3wI0o1MeN6LZJ/3cRaOTjSFy6+S6
|
27
|
+
zqDmHBp8fVA2TGJtO0BLNkbGVrBJjh0UPmSoGzWlRhEVnYC33TpDAbNA+u39UrQI
|
28
|
+
ynwhNN7YbnmSR7+JU2cUjBFv2iPBO+TGuWC+9L2zn3NHjuc6tnmSYipA9y8Hv+As
|
29
|
+
Y4evBVezr3SjXz08vPqRO5YRdO3zfeMT8gBjRqZjWJGMZ2lD4XNfrs7eky74CyZw
|
30
|
+
xx3n58i0lQkBE1EpKE0lFu/y
|
37
31
|
-----END CERTIFICATE-----
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
- !ruby/object:Gem::Dependency
|
32
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
33
|
+
dependencies:
|
34
|
+
- !ruby/object:Gem::Dependency
|
42
35
|
name: minitest
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
- 4
|
52
|
-
- 4
|
53
|
-
version: "4.4"
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4'
|
41
|
+
- - <
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '6'
|
54
44
|
type: :runtime
|
55
|
-
version_requirements: *id001
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: rdoc
|
58
45
|
prerelease: false
|
59
|
-
|
60
|
-
|
61
|
-
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '4'
|
51
|
+
- - <
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '6'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rdoc
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
62
58
|
- - ~>
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
|
65
|
-
segments:
|
66
|
-
- 3
|
67
|
-
- 10
|
68
|
-
version: "3.10"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '4.0'
|
69
61
|
type: :development
|
70
|
-
version_requirements: *id002
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: hoe
|
73
62
|
prerelease: false
|
74
|
-
|
75
|
-
|
76
|
-
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '4.0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: hoe
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
77
72
|
- - ~>
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
segments:
|
81
|
-
- 3
|
82
|
-
- 4
|
83
|
-
version: "3.4"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.7'
|
84
75
|
type: :development
|
85
|
-
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ~>
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '3.7'
|
86
82
|
description: |-
|
87
83
|
Allows you to focus on a few tests with ease without having to use
|
88
84
|
command-line arguments. Good for tools like guard that don't have
|
89
85
|
enough brains to understand test output. Cf. ZenTest's autotest (an
|
90
86
|
example of a test runner with strong testing logic).
|
91
|
-
|
87
|
+
|
92
88
|
Inspired by https://github.com/seattlerb/minitest/issues/213
|
93
|
-
email:
|
89
|
+
email:
|
94
90
|
- ryand-ruby@zenspider.com
|
95
91
|
executables: []
|
96
|
-
|
97
92
|
extensions: []
|
98
|
-
|
99
|
-
extra_rdoc_files:
|
93
|
+
extra_rdoc_files:
|
100
94
|
- History.txt
|
101
95
|
- Manifest.txt
|
102
96
|
- README.txt
|
103
|
-
files:
|
97
|
+
files:
|
104
98
|
- .autotest
|
105
99
|
- History.txt
|
106
100
|
- Manifest.txt
|
107
101
|
- README.txt
|
108
102
|
- Rakefile
|
109
103
|
- lib/minitest/focus.rb
|
104
|
+
- lib/minitest/focus4.rb
|
105
|
+
- lib/minitest/focus5.rb
|
110
106
|
- test/minitest/test_focus.rb
|
111
107
|
- .gemtest
|
112
108
|
homepage: https://github.com/seattlerb/minitest-focus
|
113
|
-
licenses:
|
109
|
+
licenses:
|
114
110
|
- MIT
|
111
|
+
metadata: {}
|
115
112
|
post_install_message:
|
116
|
-
rdoc_options:
|
113
|
+
rdoc_options:
|
117
114
|
- --main
|
118
115
|
- README.txt
|
119
|
-
require_paths:
|
116
|
+
require_paths:
|
120
117
|
- lib
|
121
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
none: false
|
132
|
-
requirements:
|
133
|
-
- - ">="
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
hash: 3
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
version: "0"
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - '>='
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
139
128
|
requirements: []
|
140
|
-
|
141
129
|
rubyforge_project: minitest-focus
|
142
|
-
rubygems_version: 1.
|
130
|
+
rubygems_version: 2.1.10
|
143
131
|
signing_key:
|
144
|
-
specification_version:
|
145
|
-
summary: Allows you to focus on a few tests with ease without having to use command-line
|
146
|
-
|
132
|
+
specification_version: 4
|
133
|
+
summary: Allows you to focus on a few tests with ease without having to use command-line
|
134
|
+
arguments
|
135
|
+
test_files:
|
147
136
|
- test/minitest/test_focus.rb
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
�?Տ�7-��f0�Pl�D��]���MYp�l��'3OS����q��%3���P�9����Th���a�θ#��6����b�^4(��٥3U���Vϭo��1�Tq�Y��
|
2
|
+
��+!O��bо^Mh��?�S٪O���}�|
|