minitest-focus 1.3.1 → 1.4.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
2
  SHA256:
3
- metadata.gz: 34dbd2617058d83323bc7e66b0fc842b4bc7d3bcdbc89a53c5338d0a0c2ac50c
4
- data.tar.gz: bd8aa9bef1a614ae2620f45ecf85b6dcdfe8858a93b846c31af4f4d8b32d59e8
3
+ metadata.gz: a8205d96cee68f29a319ec0ee22e979ca1ec258e7cc28fdd9462921a39731c1a
4
+ data.tar.gz: 636e1401fa03e03508b7af754e6b0bf00131974481a920ab9674ea0e01e30666
5
5
  SHA512:
6
- metadata.gz: 45f19c7c909942e9ce71dce0f734f316dcfd98d5b8cc64088454611d4aa1055dd7547be06ea7c000db44b314477d5104c2bf79155a687a9d545e903fd100b705
7
- data.tar.gz: 4cc6a394a4f36d153bafe5b83753f2a90c045621b592964eb5c706eb72700166e04c05076fa59de9f4b4a8cb58e6eaa0265feda76682dcd596a71ec4e308af6b
6
+ metadata.gz: 4ddc8573f114482ff32fba5bd7a5521d63479e610ca803a9fedbe1855b92e56715b19e39a782432f6220e53530d652e728342922935fb177ed70d9e3f95e4cdf
7
+ data.tar.gz: 746729444cce678da87831cd1683987fe53b794c882ba6c726f9a5212401bd61b798169984d7cc61a1a40a931692e3d2c72001c6d1d66afa30812b7a157f1113
checksums.yaml.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.4.0 / 2023-07-11
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added --no-focus flag to disable focus and allow --name args to override.
6
+
1
7
  === 1.3.1 / 2021-05-26
2
8
 
3
9
  * 1 bug fix:
data/README.txt CHANGED
@@ -7,7 +7,7 @@ rdoc :: http://docs.seattlerb.org/minitest-focus
7
7
 
8
8
  Allows you to focus on a few tests with ease without having to use
9
9
  command-line arguments. Good for tools like guard that don't have
10
- enough brains to understand test output. Cf. ZenTest's autotest (an
10
+ enough brains to understand test output. Cf. minitest-autotest (an
11
11
  example of a test runner with strong testing logic).
12
12
 
13
13
  Inspired by https://github.com/seattlerb/minitest/issues/213
@@ -16,13 +16,15 @@ Inspired by https://github.com/seattlerb/minitest/issues/213
16
16
 
17
17
  * `focus` class method allows you to specify that the next test
18
18
  defined should be run.
19
+ * Use --no-focus to temporarily disable or override with --name
20
+ arguments.
19
21
 
20
22
  == SYNOPSIS:
21
23
 
22
24
  require "minitest/autorun"
23
25
  require "minitest/focus"
24
26
 
25
- class MyTest < MiniTest::Unit::TestCase
27
+ class MyTest < Minitest::Test
26
28
  def test_unrelated; ...; end # will NOT run
27
29
 
28
30
  focus def test_method2; ...; end # will run (direct--preferred)
@@ -2,7 +2,7 @@ require "minitest/test"
2
2
 
3
3
  class Minitest::Test # :nodoc:
4
4
  class Focus # :nodoc:
5
- VERSION = "1.3.1" # :nodoc:
5
+ VERSION = "1.4.0" # :nodoc:
6
6
  end
7
7
 
8
8
  @@filtered_names = [] # :nodoc:
@@ -1,18 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Minitest
4
- def self.plugin_focus_options(_opts, options)
4
+ def self.plugin_focus_options opts, options
5
+ opts.on "--no-focus", "Disable `focus` calls in tests." do |n|
6
+ @nofocus = true
7
+ end
8
+ end
9
+
10
+ def self.plugin_focus_init options # :nodoc:
5
11
  return unless Minitest::Test.respond_to? :filtered_names
6
12
  return if Minitest::Test.filtered_names.empty?
7
13
 
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
14
+ if options[:filter] then
15
+ order = %w[ `focus` --name ]
16
+ a, b = @nofocus ? order : order.reverse
17
+ extra = " Use --no-focus to override." unless @nofocus
18
+ warn "Ignoring #{a} filters in favor of #{b} filters.#{extra}"
19
+ warn ""
12
20
  end
13
21
 
14
- re = "/^(#{Regexp.union(Minitest::Test.filtered_names).source})$/"
22
+ return if @nofocus
15
23
 
24
+ re = "/^(#{Regexp.union(Minitest::Test.filtered_names).source})$/"
16
25
  options[:filter] = re
17
26
  end
18
27
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-focus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBBTANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBBzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTIwMTIyMjIwMzgzMFoXDTIxMTIyMjIwMzgzMFowRTETMBEGA1UE
15
+ GRYDY29tMB4XDTIzMDEwMTA3NTExN1oXDTI0MDEwMTA3NTExN1owRTETMBEGA1UE
16
16
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
17
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
18
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -22,14 +22,14 @@ cert_chain:
22
22
  qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
23
  gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
24
  HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
25
- AQAE3XRm1YZcCVjAJy5yMZvTOFrS7B2SYErc+0QwmKYbHztTTDY2m5Bii+jhpuxh
26
- H+ETcU1z8TUKLpsBUP4kUpIRowkVN1p/jKapV8T3Rbwq+VuYFe+GMKsf8wGZSecG
27
- oMQ8DzzauZfbvhe2kDg7G9BBPU0wLQlY25rDcCy9bLnD7R0UK3ONqpwvsI5I7x5X
28
- ZIMXR0a9/DG+55mawwdGzCQobDKiSNLK89KK7OcNTALKU0DfgdTkktdgKchzKHqZ
29
- d/AHw/kcnU6iuMUoJEcGiJd4gVCTn1l3cDcIvxakGslCA88Jubw0Sqatan0TnC9g
30
- KToW560QIey7SPfHWduzFJnV
25
+ AQAkg3y+PBnBAPWdxxITm5sPHqdWQgSyCpRA20o4LTuWr8BWhSXBkfQNa7cY6fOn
26
+ xyM34VPzBFbExv6XOGDfOMFBVaYTHuN9peC/5/umL7kLl+nflXzL2QA7K6LYj5Bg
27
+ sM574Onr0dZDM6Vn69bzQ7rBIFDfK/OhlPzqKZad4nsdcsVH8ODCiT+ATMIZyz5K
28
+ WCnNtqlyiWXI8tdTpahDgcUwfcN/oN7v4K8iU5IbLJX6HQ5DKgmKjfb6XyMth16k
29
+ ROfWo9Uyp8ba/j9eVG14KkYRaLydAY1MNQk2yd3R5CGfeOpD1kttxjoypoUJ2dOG
30
+ nsNBRuQJ1UfiCG97a6DNm+Fr
31
31
  -----END CERTIFICATE-----
32
- date: 2021-05-26 00:00:00.000000000 Z
32
+ date: 2023-07-12 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: minitest
@@ -77,18 +77,18 @@ dependencies:
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '3.22'
80
+ version: '4.0'
81
81
  type: :development
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '3.22'
87
+ version: '4.0'
88
88
  description: |-
89
89
  Allows you to focus on a few tests with ease without having to use
90
90
  command-line arguments. Good for tools like guard that don't have
91
- enough brains to understand test output. Cf. ZenTest's autotest (an
91
+ enough brains to understand test output. Cf. minitest-autotest (an
92
92
  example of a test runner with strong testing logic).
93
93
 
94
94
  Inspired by https://github.com/seattlerb/minitest/issues/213
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.2.16
134
+ rubygems_version: 3.4.10
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Allows you to focus on a few tests with ease without having to use command-line
metadata.gz.sig CHANGED
Binary file