minitag 0.6.2 → 0.7.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 +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.rubocop.yml +1 -0
- data/Gemfile +1 -1
- data/lib/minitag/context.rb +1 -1
- data/lib/minitag/minitest_tag.rb +16 -1
- data/lib/minitag/version.rb +1 -1
- data/lib/minitag.rb +7 -0
- data/lib/minitest/minitag_plugin.rb +6 -0
- data/minitag.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3646bf309682ea51b369657ae95ffd834ce56fcb1c90c95ee431bcca34c559cb
|
|
4
|
+
data.tar.gz: 908854e7069bd036e32f5abedacff5ecf2f0978e06f3ebfa8f0e9a34af37b978
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9899ffdd7c90f07dc1e0eaa0cdd006aaa041b7b8b3143376c5f21c209d2a7610709ce6cf274447d1806c2ae2781ed5f853a65b1e86474bc9204f897c1440e09
|
|
7
|
+
data.tar.gz: faa93a0697581e1121c2407eb6210e2903903179b1ac588860b62ac26a44ce32703843fe7053a55a43dece599e70b7c7a30ed5a54a4d5ffc1c9e2436051ae9e5
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -6,12 +6,12 @@ jobs:
|
|
|
6
6
|
runs-on: ubuntu-latest
|
|
7
7
|
strategy:
|
|
8
8
|
matrix:
|
|
9
|
-
ruby: [ '2.6', '2.7' ]
|
|
9
|
+
ruby: [ '2.5', '2.6', '2.7' ]
|
|
10
10
|
name: Ruby ${{ matrix.ruby }}
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
13
|
- name: Set up Ruby ${{ matrix.ruby }}
|
|
14
|
-
uses:
|
|
14
|
+
uses: ruby/setup-ruby@v1
|
|
15
15
|
with:
|
|
16
16
|
ruby-version: ${{ matrix.ruby }}
|
|
17
17
|
- name: Cache gems
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/lib/minitag/context.rb
CHANGED
data/lib/minitag/minitest_tag.rb
CHANGED
|
@@ -36,6 +36,21 @@ module Minitag
|
|
|
36
36
|
Minitag.register_for_extension(self)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
def run_one_method(klass, method_name, reporter) # rubocop:disable Metrics/AbcSize
|
|
40
|
+
return super if !Minitag.skip_filtered? || Minitag.context.no_filters? ||
|
|
41
|
+
Minitag.context.match?(namespace: to_s, name: method_name)
|
|
42
|
+
|
|
43
|
+
# Skip this test
|
|
44
|
+
test = klass.new(method_name)
|
|
45
|
+
test.time = 0
|
|
46
|
+
skip = Minitest::Skip.new('This test did not match filters')
|
|
47
|
+
source = test.method(method_name).source_location
|
|
48
|
+
skip.set_backtrace(["#{source[0]}:#{source[1]}"])
|
|
49
|
+
test.failures << skip
|
|
50
|
+
reporter.prerecord(self, method_name)
|
|
51
|
+
reporter.record(Minitest::Result.from(test))
|
|
52
|
+
end
|
|
53
|
+
|
|
39
54
|
# Decides which methods to run based on an Array of test names provided by
|
|
40
55
|
# the superclass and the tags defined within test classes.
|
|
41
56
|
#
|
|
@@ -46,7 +61,7 @@ module Minitag
|
|
|
46
61
|
# @return [Array] the list of test names that should run.
|
|
47
62
|
def runnable_methods
|
|
48
63
|
methods = super.dup
|
|
49
|
-
return methods if Minitag.context.no_filters?
|
|
64
|
+
return methods if Minitag.skip_filtered? || Minitag.context.no_filters?
|
|
50
65
|
|
|
51
66
|
methods.select do |runnable_method|
|
|
52
67
|
Minitag.context.match?(namespace: to_s, name: runnable_method)
|
data/lib/minitag/version.rb
CHANGED
data/lib/minitag.rb
CHANGED
|
@@ -12,6 +12,8 @@ require 'minitag/tag_extension'
|
|
|
12
12
|
# to Minitest::Test
|
|
13
13
|
module Minitag
|
|
14
14
|
class << self
|
|
15
|
+
attr_writer :skip_filtered
|
|
16
|
+
|
|
15
17
|
# Registry of classes that requires extension by Minitag::TagExtension.
|
|
16
18
|
def extension_registry
|
|
17
19
|
@extension_registry ||= ExtensionRegistry.new
|
|
@@ -41,5 +43,10 @@ module Minitag
|
|
|
41
43
|
def pending_tags=(tags)
|
|
42
44
|
@pending_tags = Array(tags)
|
|
43
45
|
end
|
|
46
|
+
|
|
47
|
+
# Whether to skip (true) or hide (false) filtered tests.
|
|
48
|
+
def skip_filtered?
|
|
49
|
+
@skip_filtered || false
|
|
50
|
+
end
|
|
44
51
|
end
|
|
45
52
|
end
|
|
@@ -10,11 +10,17 @@ module Minitest
|
|
|
10
10
|
options[:tags] ||= []
|
|
11
11
|
options[:tags] << tag.to_s.strip.downcase
|
|
12
12
|
end
|
|
13
|
+
|
|
14
|
+
opts.on '--skip-filtered' do
|
|
15
|
+
options[:skip_filtered] = true
|
|
16
|
+
end
|
|
13
17
|
end
|
|
14
18
|
|
|
15
19
|
def self.plugin_minitag_init(options)
|
|
16
20
|
Array(options[:tags]).each do |tag|
|
|
17
21
|
Minitag.add_filter(tag)
|
|
18
22
|
end
|
|
23
|
+
|
|
24
|
+
Minitag.skip_filtered = options.fetch(:skip_filtered, false)
|
|
19
25
|
end
|
|
20
26
|
end
|
data/minitag.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: minitag
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bernardo de Araujo
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-05-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -66,7 +66,7 @@ dependencies:
|
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '5.0'
|
|
69
|
-
description:
|
|
69
|
+
description:
|
|
70
70
|
email:
|
|
71
71
|
- bernardo.amc@gmail.com
|
|
72
72
|
executables: []
|
|
@@ -97,7 +97,7 @@ homepage: https://github.com/bernardoamc/minitag
|
|
|
97
97
|
licenses:
|
|
98
98
|
- MIT
|
|
99
99
|
metadata: {}
|
|
100
|
-
post_install_message:
|
|
100
|
+
post_install_message:
|
|
101
101
|
rdoc_options: []
|
|
102
102
|
require_paths:
|
|
103
103
|
- lib
|
|
@@ -105,15 +105,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
105
105
|
requirements:
|
|
106
106
|
- - ">="
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: 2.
|
|
108
|
+
version: 2.5.0
|
|
109
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
requirements:
|
|
111
111
|
- - ">="
|
|
112
112
|
- !ruby/object:Gem::Version
|
|
113
113
|
version: '0'
|
|
114
114
|
requirements: []
|
|
115
|
-
rubygems_version: 3.
|
|
116
|
-
signing_key:
|
|
115
|
+
rubygems_version: 3.4.10
|
|
116
|
+
signing_key:
|
|
117
117
|
specification_version: 4
|
|
118
118
|
summary: Provides the ability to tag your minitest tests.
|
|
119
119
|
test_files: []
|