minitag 0.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
- data/.gitignore +8 -0
- data/.rubocop.yml +13 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +43 -0
- data/LICENSE.txt +21 -0
- data/README.md +84 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/minitag.rb +34 -0
- data/lib/minitag/tag.rb +30 -0
- data/lib/minitag/tag_extension.rb +42 -0
- data/lib/minitag/tag_mapper.rb +26 -0
- data/lib/minitag/tag_matcher.rb +43 -0
- data/lib/minitag/version.rb +5 -0
- data/lib/minitest/minitag_plugin.rb +20 -0
- data/minitag.gemspec +31 -0
- metadata +118 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 76f72fc7c148e87021a776dea6655c3a676be7878e2fd595f436244d3bf7a998
|
|
4
|
+
data.tar.gz: aeea971c7ccab5fe5761e80c9d867b191b954e28693f7ceeedcd6f7d2154036a
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e8d68e32988f3a13a2252b0578cf21efd6630befe8563a21869aa00c58abb63deb7d46d598fb9e6d6740b84b9be9e13214aafd8e1c2f05995ffdca766a380bc2
|
|
7
|
+
data.tar.gz: 527b5dcad48e756611bc662a587197ebd3bb257532b34b056c13f47deb2f6d9d4ec19b782c7812adc80cdd088f7e437f27d6066af6d4063ce3ed90fd5b6b00a6
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at bernardo.amc@gmail.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
minitag (0.1.0)
|
|
5
|
+
minitest (~> 5.0)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
ast (2.4.1)
|
|
11
|
+
minitest (5.14.1)
|
|
12
|
+
parallel (1.19.2)
|
|
13
|
+
parser (2.7.1.4)
|
|
14
|
+
ast (~> 2.4.1)
|
|
15
|
+
rainbow (3.0.0)
|
|
16
|
+
rake (13.0.1)
|
|
17
|
+
regexp_parser (1.7.1)
|
|
18
|
+
rexml (3.2.4)
|
|
19
|
+
rubocop (0.87.1)
|
|
20
|
+
parallel (~> 1.10)
|
|
21
|
+
parser (>= 2.7.1.1)
|
|
22
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
23
|
+
regexp_parser (>= 1.7)
|
|
24
|
+
rexml
|
|
25
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
|
26
|
+
ruby-progressbar (~> 1.7)
|
|
27
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
28
|
+
rubocop-ast (0.1.0)
|
|
29
|
+
parser (>= 2.7.0.1)
|
|
30
|
+
ruby-progressbar (1.10.1)
|
|
31
|
+
unicode-display_width (1.7.0)
|
|
32
|
+
|
|
33
|
+
PLATFORMS
|
|
34
|
+
ruby
|
|
35
|
+
|
|
36
|
+
DEPENDENCIES
|
|
37
|
+
bundler (~> 1.17)
|
|
38
|
+
minitag!
|
|
39
|
+
rake (>= 12.3.3)
|
|
40
|
+
rubocop (~> 0.87.1)
|
|
41
|
+
|
|
42
|
+
BUNDLED WITH
|
|
43
|
+
1.17.2
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Bernardo Chaves
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Minitag
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/bernardoamc/minitag)
|
|
4
|
+
|
|
5
|
+
A simple gem that allow developers to tag their minitest tests and run tests
|
|
6
|
+
based on these tags.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
Add this line to your application's Gemfile:
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
gem 'minitag'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or install it yourself as:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
$ gem install minitag
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Setup
|
|
25
|
+
|
|
26
|
+
Require `minitag` in our `test_helper.rb`:
|
|
27
|
+
|
|
28
|
+
`require 'minitag'`
|
|
29
|
+
|
|
30
|
+
### Adding tags
|
|
31
|
+
|
|
32
|
+
We can tag specific tests with one or more tags.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
```rb
|
|
36
|
+
class MyTest < Minitest::Test
|
|
37
|
+
tag 'my_tag', 'another_tag'
|
|
38
|
+
test '#hello minitag' do
|
|
39
|
+
# ...
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Running tests
|
|
45
|
+
|
|
46
|
+
We can now run our test suite with specific tags:
|
|
47
|
+
|
|
48
|
+
`$ bundle exec rake test --tag 'my_tag'`
|
|
49
|
+
|
|
50
|
+
### Extra
|
|
51
|
+
|
|
52
|
+
Tags can be:
|
|
53
|
+
1. `inclusive`
|
|
54
|
+
2. `exclusive` with the `~` prefix:
|
|
55
|
+
|
|
56
|
+
### Examples
|
|
57
|
+
```rb
|
|
58
|
+
# Only run tests that are tagged with 'unit'
|
|
59
|
+
$ bundle exec rake test --tag 'unit'
|
|
60
|
+
|
|
61
|
+
# Only run tests that are NOT tagged with 'unit'
|
|
62
|
+
$ bundle exec rake test --tag '~unit'
|
|
63
|
+
|
|
64
|
+
# Only run tests that are tagged with 'unit' and are NOT 'parallel'
|
|
65
|
+
$ bundle exec rake test --tag 'unit' --tag '~parallel'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
71
|
+
|
|
72
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bernardoamc/minitag. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
81
|
+
|
|
82
|
+
## Code of Conduct
|
|
83
|
+
|
|
84
|
+
Everyone interacting in the Minitag project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bernardoamc/minitag/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'bundler/setup'
|
|
5
|
+
require 'minitag'
|
|
6
|
+
|
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
+
|
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
+
# require "pry"
|
|
12
|
+
# Pry.start
|
|
13
|
+
|
|
14
|
+
require 'irb'
|
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/minitag.rb
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'minitest'
|
|
4
|
+
require 'minitag/version'
|
|
5
|
+
require 'minitag/tag'
|
|
6
|
+
require 'minitag/tag_mapper'
|
|
7
|
+
require 'minitag/tag_matcher'
|
|
8
|
+
require 'minitag/tag_extension'
|
|
9
|
+
|
|
10
|
+
# Namespace for classes or modules providing tagging functionality
|
|
11
|
+
# to Minitest::Test
|
|
12
|
+
module Minitag
|
|
13
|
+
class << self
|
|
14
|
+
def execution_tags
|
|
15
|
+
@execution_tags ||= []
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def add_execution_tag(tag)
|
|
19
|
+
execution_tags << Tag.new(tag)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def pending_tags
|
|
23
|
+
@pending_tags || []
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def pending_tags=(tags)
|
|
27
|
+
@pending_tags = Array(tags)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def tag_mapping
|
|
31
|
+
@tag_mapping ||= Minitag::TagMapper.new
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/lib/minitag/tag.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Minitag
|
|
4
|
+
# Represents a tag in our system.
|
|
5
|
+
# Provides helper methods to identify the type of a tag, which can
|
|
6
|
+
# only one of the following:
|
|
7
|
+
# - inclusive
|
|
8
|
+
# - exclusive (name with ~ as a prefix)
|
|
9
|
+
class Tag
|
|
10
|
+
attr_reader :name
|
|
11
|
+
|
|
12
|
+
def initialize(name)
|
|
13
|
+
@name = name.to_s
|
|
14
|
+
@exclusive = false
|
|
15
|
+
|
|
16
|
+
return unless @name.start_with?('~')
|
|
17
|
+
|
|
18
|
+
@name = @name[1..-1]
|
|
19
|
+
@exclusive = true
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def exclusive?
|
|
23
|
+
@exclusive
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def inclusive?
|
|
27
|
+
!exclusive?
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Minitag
|
|
4
|
+
# Module used to extend Minitest::Test.
|
|
5
|
+
# It has the following responsibilities:
|
|
6
|
+
# - Introduce the tag functionality
|
|
7
|
+
# - Associate tags with tests
|
|
8
|
+
# - Filter tests based on the specified tags
|
|
9
|
+
module TagExtension
|
|
10
|
+
def tag(*tags)
|
|
11
|
+
Minitag.pending_tags = tags
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
define_method(:method_added) do |name|
|
|
15
|
+
if name[/\Atest_/]
|
|
16
|
+
Minitag.pending_tags.each do |pending_tag|
|
|
17
|
+
Minitag.tag_mapping.add(context: self, name: name, tag: pending_tag)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Minitag.pending_tags = []
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def runnable_methods
|
|
25
|
+
methods = super.dup
|
|
26
|
+
return methods if Minitag.execution_tags.empty? || methods.empty?
|
|
27
|
+
|
|
28
|
+
execution_tags = Minitag.execution_tags
|
|
29
|
+
inclusive_tags = execution_tags.select(&:inclusive?).map(&:name)
|
|
30
|
+
exclusive_tags = execution_tags.select(&:exclusive?).map(&:name)
|
|
31
|
+
|
|
32
|
+
methods.select do |runnable_method|
|
|
33
|
+
runnable_method_tags = Minitag.tag_mapping.fetch(context: self, name: runnable_method).map(&:name)
|
|
34
|
+
|
|
35
|
+
Minitag::TagMatcher.inclusive_match?(inclusive_tags, runnable_method_tags) &&
|
|
36
|
+
Minitag::TagMatcher.exclusive_match?(exclusive_tags, runnable_method_tags)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
Minitest::Test.singleton_class.prepend(Minitag::TagExtension)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Minitag
|
|
4
|
+
# Stores the mapping between a test name and its existing tags.
|
|
5
|
+
class TagMapper
|
|
6
|
+
attr_reader :repository
|
|
7
|
+
|
|
8
|
+
def initialize
|
|
9
|
+
@repository = Hash.new { |h, k| h[k] = [] }
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def add(context:, name:, tag:)
|
|
13
|
+
@repository[key(context, name)] << Minitag::Tag.new(tag)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def fetch(context:, name:)
|
|
17
|
+
@repository[key(context, name)]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def key(context, name)
|
|
23
|
+
"#{context}_#{name}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Minitag
|
|
4
|
+
# Introduce different match? methods based on the type of the chosen tags.
|
|
5
|
+
class TagMatcher
|
|
6
|
+
# Detects if any of the desired tags match any of the existing ones.
|
|
7
|
+
#
|
|
8
|
+
# @param [Array] desired_tags the tags specified by `--tag`.
|
|
9
|
+
# @param [Array] existing_tags the tags specified by the `tag` method.
|
|
10
|
+
#
|
|
11
|
+
# Invariants:
|
|
12
|
+
# - Always returns true when no desired tags are specified.
|
|
13
|
+
# - Always returns false when desired tags are specified but there are
|
|
14
|
+
# no existing tags.
|
|
15
|
+
#
|
|
16
|
+
# return [boolean] whether there was a match or not.
|
|
17
|
+
def self.inclusive_match?(desired_tags, existing_tags)
|
|
18
|
+
return true if desired_tags.empty?
|
|
19
|
+
return false if desired_tags.any? && existing_tags.empty?
|
|
20
|
+
|
|
21
|
+
(desired_tags & existing_tags).any?
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Detects if there are no matches between any of the desired tags
|
|
25
|
+
# and existing ones.
|
|
26
|
+
#
|
|
27
|
+
# @param desired_tags [Array] tags specified by `--tag`.
|
|
28
|
+
# @param existing_tags [Array] tags specified by the `tag` method.
|
|
29
|
+
#
|
|
30
|
+
# Invariants:
|
|
31
|
+
# - Always returns true when no desired tags are specified.
|
|
32
|
+
# - Always returns true when desired tags are specified but there are
|
|
33
|
+
# no existing tags.
|
|
34
|
+
#
|
|
35
|
+
# return [boolean] whether there was no match or not.
|
|
36
|
+
def self.exclusive_match?(desired_tags, existing_tags)
|
|
37
|
+
return true if desired_tags.empty?
|
|
38
|
+
return true if desired_tags.any? && existing_tags.empty?
|
|
39
|
+
|
|
40
|
+
(desired_tags & existing_tags).none?
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'minitag'
|
|
4
|
+
|
|
5
|
+
# Plugin extension to allow developers to run their tests while specifying
|
|
6
|
+
# the `--tag` or `-t` options.
|
|
7
|
+
module Minitest
|
|
8
|
+
def self.plugin_minitag_options(opts, options)
|
|
9
|
+
opts.on '-t', '--tag TAG' do |tag|
|
|
10
|
+
options[:tags] ||= []
|
|
11
|
+
options[:tags] << tag
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.plugin_minitag_init(options)
|
|
16
|
+
Array(options[:tags]).each do |tag|
|
|
17
|
+
Minitag.add_execution_tag(tag.to_s.strip)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/minitag.gemspec
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
require 'minitag/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |spec|
|
|
8
|
+
spec.name = 'minitag'
|
|
9
|
+
spec.version = Minitag::VERSION
|
|
10
|
+
spec.authors = ['Bernardo de Araujo']
|
|
11
|
+
spec.email = ['bernardo.amc@gmail.com']
|
|
12
|
+
|
|
13
|
+
spec.summary = 'Provides the ability to tag your minitest tests.'
|
|
14
|
+
spec.homepage = 'https://github.com/bernardoamc/minitag'
|
|
15
|
+
spec.license = 'MIT'
|
|
16
|
+
|
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
21
|
+
end
|
|
22
|
+
spec.bindir = 'exe'
|
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
24
|
+
spec.require_paths = ['lib']
|
|
25
|
+
|
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
|
27
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
|
28
|
+
spec.add_development_dependency 'rubocop', '~> 0.87.1'
|
|
29
|
+
|
|
30
|
+
spec.add_dependency 'minitest', '~> 5.0'
|
|
31
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: minitag
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Bernardo de Araujo
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2020-07-11 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.17'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.17'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 12.3.3
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 12.3.3
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rubocop
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 0.87.1
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 0.87.1
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: minitest
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '5.0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '5.0'
|
|
69
|
+
description:
|
|
70
|
+
email:
|
|
71
|
+
- bernardo.amc@gmail.com
|
|
72
|
+
executables: []
|
|
73
|
+
extensions: []
|
|
74
|
+
extra_rdoc_files: []
|
|
75
|
+
files:
|
|
76
|
+
- ".gitignore"
|
|
77
|
+
- ".rubocop.yml"
|
|
78
|
+
- ".travis.yml"
|
|
79
|
+
- CODE_OF_CONDUCT.md
|
|
80
|
+
- Gemfile
|
|
81
|
+
- Gemfile.lock
|
|
82
|
+
- LICENSE.txt
|
|
83
|
+
- README.md
|
|
84
|
+
- Rakefile
|
|
85
|
+
- bin/console
|
|
86
|
+
- bin/setup
|
|
87
|
+
- lib/minitag.rb
|
|
88
|
+
- lib/minitag/tag.rb
|
|
89
|
+
- lib/minitag/tag_extension.rb
|
|
90
|
+
- lib/minitag/tag_mapper.rb
|
|
91
|
+
- lib/minitag/tag_matcher.rb
|
|
92
|
+
- lib/minitag/version.rb
|
|
93
|
+
- lib/minitest/minitag_plugin.rb
|
|
94
|
+
- minitag.gemspec
|
|
95
|
+
homepage: https://github.com/bernardoamc/minitag
|
|
96
|
+
licenses:
|
|
97
|
+
- MIT
|
|
98
|
+
metadata: {}
|
|
99
|
+
post_install_message:
|
|
100
|
+
rdoc_options: []
|
|
101
|
+
require_paths:
|
|
102
|
+
- lib
|
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
- - ">="
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: '0'
|
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
|
+
requirements:
|
|
110
|
+
- - ">="
|
|
111
|
+
- !ruby/object:Gem::Version
|
|
112
|
+
version: '0'
|
|
113
|
+
requirements: []
|
|
114
|
+
rubygems_version: 3.0.3
|
|
115
|
+
signing_key:
|
|
116
|
+
specification_version: 4
|
|
117
|
+
summary: Provides the ability to tag your minitest tests.
|
|
118
|
+
test_files: []
|