minitest-focus 1.0.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c42c6ba3ea527eeb7756c50f08f6f123acdfbbe5f00ee68e7543fec395512554
4
+ data.tar.gz: aa656bdcf5ae92d25558e9822387491a1fcca43f89297d060a52716eea6fd4e5
5
+ SHA512:
6
+ metadata.gz: 45532069fcd74b655e5fa65721f3e2f3793b513c8da19c8b8ff7eaeca593b36f1293d6cc345ddaf21ecae2b8ecabdd6988caec6b21b3b89e4b784809e6c0fbcb
7
+ data.tar.gz: 5fc346666e60b5eba021293f05110c4332bc81a41b68ee6a09cdcb492925b8585b03fcf97dd1a6c8ffa79a2fd1bab853ebb77ee7218b4c0945667fe5c7319dfa
@@ -0,0 +1 @@
1
+ �Z��e�p ���p[�AٿN3�\r�Ȼ���9É3�B�`�[��j\��dGm�V�D�VȢz��\��"3�t�c9" #��ps���~�b�M)0O�/��Z89z��Q*�#��#�V`i+�a��-����uekG�;̍^sIgm�Y�`W�Zu��csɱ|��7W���kdt�fk���R/�a�n���' �'I�9���E<��6���y����1�݀�<mĊA��� 3Ni�Iܘ�x�Ӏk
data.tar.gz.sig CHANGED
@@ -1,3 +1 @@
1
- J?��V7R����6J5��� �� �䬶CQx �\�^9w�\�q����6�e��q�&-l�Y
2
- 2zM8Yd��T�{r��سn��y���c-$���^h�n k��i��9���
3
- ���r*yp�k��7��6�*�2,�sC��
1
+ 3�[� ���e�)f;v���-�w�6��J��%&��ƈ��(qZ��0vN 30�h����{��\A)S�q �3};~�@��"\q�>�f)9���k�� �V=.�v���-�{+3��K���=azb��?ƾ��YK���wP�]��X��˦��~�?����xxH���d�����MG�q�SM�:%|�ۇ�-c�6�X[Ŷ\(��h�6��#h��|�z?�oI�KH灞,Č���k�X����*�l(ʐ�!Va���
@@ -1,6 +1,36 @@
1
+ === 1.2.1 / 2020-06-14
2
+
3
+ * 1 bug fix:
4
+
5
+ * Prevent a crash if the gem is installed but never required. (dazuma)
6
+
7
+ === 1.2.0 / 2020-05-15
8
+
9
+ * 1 major enhancement:
10
+
11
+ * Converted to a minitest plugin. (jbourassa)
12
+
13
+ === 1.1.2 / 2015-07-25
14
+
15
+ * 1 bug fix:
16
+
17
+ * Fixed focus handling when run under Rake's rake_test_loader.rb.
18
+
19
+ === 1.1.1 / 2015-03-12
20
+
21
+ * 1 minor enhancement:
22
+
23
+ * Escape method names in filter regexp. (ddiachkov)
24
+
25
+ === 1.1.0 / 2013-11-07
26
+
27
+ * 1 major enhancement:
28
+
29
+ * Minitest 5 compatibility.
30
+ * Still works on minitest 4.
31
+
1
32
  === 1.0.0 / 2013-01-07
2
33
 
3
34
  * 1 major enhancement
4
35
 
5
36
  * Birthday!
6
-
@@ -4,4 +4,7 @@ Manifest.txt
4
4
  README.txt
5
5
  Rakefile
6
6
  lib/minitest/focus.rb
7
+ lib/minitest/focus4.rb
8
+ lib/minitest/focus5.rb
9
+ lib/minitest/focus_plugin.rb
7
10
  test/minitest/test_focus.rb
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", "~> 4.4"
15
+ dependency "minitest", [">= 4", "< 6"]
14
16
  end
15
17
 
16
18
  # vim: syntax=ruby
@@ -1,32 +1,7 @@
1
- require "minitest/unit"
2
-
3
- class MiniTest::Unit::TestCase # :nodoc:
4
- class Focus # :nodoc:
5
- VERSION = "1.0.0" # :nodoc:
6
- end
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] = "/^(#{Regexp.union(opts[:names]).source})$/"
22
+
23
+ meta.send :remove_method, :method_added
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,36 @@
1
+ class Minitest::Test # :nodoc:
2
+ class Focus # :nodoc:
3
+ VERSION = "1.2.1" # :nodoc:
4
+ end
5
+
6
+ @@filtered_names = [] # :nodoc:
7
+
8
+ def self.add_to_filter name
9
+ @@filtered_names << "#{self}##{name}"
10
+ end
11
+
12
+ def self.filtered_names
13
+ @@filtered_names
14
+ end
15
+
16
+ ##
17
+ # Focus on the next test defined. Cumulative. Equivalent to
18
+ # running with command line arg: -n /test_name|.../
19
+ #
20
+ # class MyTest < MiniTest::Unit::TestCase
21
+ # ...
22
+ # focus
23
+ # def test_pass; ... end # this one will run
24
+ # ...
25
+ # end
26
+
27
+ def self.focus
28
+ meta = class << self; self; end
29
+
30
+ meta.send :define_method, :method_added do |name|
31
+ add_to_filter name
32
+
33
+ meta.send :remove_method, :method_added
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Minitest
4
+ def self.plugin_focus_options(_opts, options)
5
+ return unless Minitest::Test.respond_to? :filtered_names
6
+ return if Minitest::Test.filtered_names.empty?
7
+
8
+ index = ARGV.index { |arg| arg =~ /^-n/ || arg =~ /^--name/ }
9
+ if index
10
+ warn 'Ignoring -n / --name, using `focus` filters instead'
11
+ ARGV.delete_at index
12
+ end
13
+
14
+ options[:filter] = "/^(#{Regexp.union(Minitest::Test.filtered_names).source})$/"
15
+ end
16
+ end
@@ -1,14 +1,17 @@
1
1
  require "minitest/autorun"
2
2
  require "minitest/focus"
3
3
 
4
- class MyTest < MiniTest::Unit::TestCase
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 MyTest do
11
- it "is ignored" do flunk end
12
- focus; it "does something" do pass end
13
- it "bombs" do flunk end
12
+ describe "MyTest2" do
13
+ it "is ignored" do flunk end
14
+ focus; it "does something" do pass end
15
+ it "bombs" do flunk end
16
+ focus; it "has non-word ['chars'" do pass end # Will raise invalid RegExp unless correctly escaped
14
17
  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
- hash: 23
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 0
10
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.1
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
- MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBBDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
20
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
21
- GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
15
+ GRYDY29tMB4XDTE5MTIxMzAwMDIwNFoXDTIwMTIxMjAwMDIwNFowRTETMBEGA1UE
22
16
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
23
17
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
24
18
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -27,121 +21,121 @@ cert_chain:
27
21
  GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
28
22
  qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
29
23
  gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
30
- HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
31
- AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
32
- vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
33
- w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
34
- l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
35
- n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
36
- FBHgymkyj/AOSqKRIpXPhjC6
24
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
25
+ AQCkkcHqAa6IKLYGl93rn78J3L+LnqyxaA059n4IGMHWN5bv9KBQnIjOrpLadtYZ
26
+ vhWkunWDKdfVapBEq5+T4HzqnsEXC3aCv6JEKJY6Zw7iSzl0M8hozuzRr+w46wvT
27
+ fV2yTN6QTVxqbMsJJyjosks4ZdQYov2zdvQpt1HsLi+Qmckmg8SPZsd+T8uiiBCf
28
+ b+1ORSM5eEfBQenPXy83LZcoQz8i6zVB4aAfTGGdhxjoMGUEmSZ6xpkOzmnGa9QK
29
+ m5x9IDiApM+vCELNwDXXGNFEnQBBK+wAe4Pek8o1V1TTOxL1kGPewVOitX1p3xoN
30
+ h7iEjga8iM1LbZUfiISZ+WrB
37
31
  -----END CERTIFICATE-----
38
-
39
- date: 2013-01-08 00:00:00 Z
40
- dependencies:
41
- - !ruby/object:Gem::Dependency
32
+ date: 2020-06-14 00:00:00.000000000 Z
33
+ dependencies:
34
+ - !ruby/object:Gem::Dependency
42
35
  name: minitest
43
- prerelease: false
44
- requirement: &id001 !ruby/object:Gem::Requirement
45
- none: false
46
- requirements:
47
- - - ~>
48
- - !ruby/object:Gem::Version
49
- hash: 19
50
- segments:
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
- requirement: &id002 !ruby/object:Gem::Requirement
60
- none: false
61
- requirements:
62
- - - ~>
63
- - !ruby/object:Gem::Version
64
- hash: 19
65
- segments:
66
- - 3
67
- - 10
68
- version: "3.10"
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:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '4.0'
61
+ - - "<"
62
+ - !ruby/object:Gem::Version
63
+ version: '7'
69
64
  type: :development
70
- version_requirements: *id002
71
- - !ruby/object:Gem::Dependency
72
- name: hoe
73
65
  prerelease: false
74
- requirement: &id003 !ruby/object:Gem::Requirement
75
- none: false
76
- requirements:
77
- - - ~>
78
- - !ruby/object:Gem::Version
79
- hash: 15
80
- segments:
81
- - 3
82
- - 4
83
- version: "3.4"
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '4.0'
71
+ - - "<"
72
+ - !ruby/object:Gem::Version
73
+ version: '7'
74
+ - !ruby/object:Gem::Dependency
75
+ name: hoe
76
+ requirement: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '3.22'
84
81
  type: :development
85
- version_requirements: *id003
82
+ prerelease: false
83
+ version_requirements: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '3.22'
86
88
  description: |-
87
89
  Allows you to focus on a few tests with ease without having to use
88
90
  command-line arguments. Good for tools like guard that don't have
89
91
  enough brains to understand test output. Cf. ZenTest's autotest (an
90
92
  example of a test runner with strong testing logic).
91
-
93
+
92
94
  Inspired by https://github.com/seattlerb/minitest/issues/213
93
- email:
95
+ email:
94
96
  - ryand-ruby@zenspider.com
95
97
  executables: []
96
-
97
98
  extensions: []
98
-
99
- extra_rdoc_files:
99
+ extra_rdoc_files:
100
100
  - History.txt
101
101
  - Manifest.txt
102
102
  - README.txt
103
- files:
104
- - .autotest
103
+ files:
104
+ - ".autotest"
105
105
  - History.txt
106
106
  - Manifest.txt
107
107
  - README.txt
108
108
  - Rakefile
109
109
  - lib/minitest/focus.rb
110
+ - lib/minitest/focus4.rb
111
+ - lib/minitest/focus5.rb
112
+ - lib/minitest/focus_plugin.rb
110
113
  - test/minitest/test_focus.rb
111
- - .gemtest
112
114
  homepage: https://github.com/seattlerb/minitest-focus
113
- licenses:
115
+ licenses:
114
116
  - MIT
117
+ metadata:
118
+ homepage_uri: https://github.com/seattlerb/minitest-focus
115
119
  post_install_message:
116
- rdoc_options:
117
- - --main
120
+ rdoc_options:
121
+ - "--main"
118
122
  - README.txt
119
- require_paths:
123
+ require_paths:
120
124
  - lib
121
- required_ruby_version: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
124
127
  - - ">="
125
- - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 0
129
- version: "0"
130
- required_rubygems_version: !ruby/object:Gem::Requirement
131
- none: false
132
- requirements:
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
133
132
  - - ">="
134
- - !ruby/object:Gem::Version
135
- hash: 3
136
- segments:
137
- - 0
138
- version: "0"
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
139
135
  requirements: []
140
-
141
- rubyforge_project: minitest-focus
142
- rubygems_version: 1.8.24
136
+ rubygems_version: 3.0.3
143
137
  signing_key:
144
- specification_version: 3
145
- summary: Allows you to focus on a few tests with ease without having to use command-line arguments
146
- test_files:
147
- - test/minitest/test_focus.rb
138
+ specification_version: 4
139
+ summary: Allows you to focus on a few tests with ease without having to use command-line
140
+ arguments
141
+ test_files: []
metadata.gz.sig CHANGED
Binary file
data/.gemtest DELETED
File without changes