minitag 0.3.3 → 0.4.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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/minitag.rb +2 -0
- data/lib/minitag/context.rb +0 -1
- data/lib/minitag/minitest_tag.rb +23 -0
- data/lib/minitag/tag_extension.rb +1 -17
- data/lib/minitag/tag_registry.rb +0 -2
- data/lib/minitag/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9aa792615d3b3d3022a0b1372c951f0f7394a184bd296f9ca760fb69d2be7b2d
|
|
4
|
+
data.tar.gz: ca7add04befa59ab7141cfccc41475def049d1e3e7596bfcbaeecef55e909144
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62a382576471b5223651ab76083afda212b43820dad6e23cc59d095d153e85048d81d09f38f3ca4d2f57dd758316f49ccedc48afd8ad99f84aa2554886d3ec24
|
|
7
|
+
data.tar.gz: 2fee9e38e0cfde38bdb4a71c806cee5c2395c5794aa4f3e46cfc863a8b634ee299163046693d671fc759e733b97d2fdd6b30d31ab370d77c36b549842c1a1e60
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://badge.fury.io/rb/minitag)
|
|
1
|
+
[](https://badge.fury.io/rb/minitag) [](https://github.com/bernardoamc/minitag/actions?query=workflow%3Acontinuous-integration)
|
|
2
2
|
|
|
3
3
|
# Minitag
|
|
4
4
|
|
data/lib/minitag.rb
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'set'
|
|
3
4
|
require 'minitest'
|
|
4
5
|
require 'minitag/version'
|
|
5
6
|
require 'minitag/context'
|
|
7
|
+
require 'minitag/minitest_tag'
|
|
6
8
|
require 'minitag/tag_extension'
|
|
7
9
|
|
|
8
10
|
# Namespace for classes or modules providing tagging functionality
|
data/lib/minitag/context.rb
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Minitag
|
|
4
|
+
# Module used to extend Minitest::Test with the tag method.
|
|
5
|
+
module MinitestTag
|
|
6
|
+
# Add tags to be associated with the next test definition and extends the
|
|
7
|
+
# class from which the tag method is being used with Minitag::TagExtension.
|
|
8
|
+
#
|
|
9
|
+
# It is important to notice that tags associated with a test have no concept
|
|
10
|
+
# of being inclusive or exclusive. This distinction is only valid for tag
|
|
11
|
+
# filters.
|
|
12
|
+
#
|
|
13
|
+
# @param [Array] tags the list of tags to be associated with a test case.
|
|
14
|
+
#
|
|
15
|
+
# @return [void]
|
|
16
|
+
def tag(*tags)
|
|
17
|
+
Minitag.pending_tags = tags.map { |tag| tag.to_s.strip.downcase }
|
|
18
|
+
singleton_class.prepend(Minitag::TagExtension)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
Minitest::Test.singleton_class.prepend(Minitag::MinitestTag)
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Minitag
|
|
4
|
-
# Module used to extend
|
|
4
|
+
# Module used to extend classes that rely on tags.
|
|
5
5
|
# It has the following responsibilities:
|
|
6
|
-
# - Introduce the tag functionality
|
|
7
6
|
# - Associate tags with tests
|
|
8
7
|
# - Filter tests based on the specified tags
|
|
9
8
|
module TagExtension
|
|
10
|
-
# Add tags to be associated with the next test definition.
|
|
11
|
-
#
|
|
12
|
-
# It is important to notice that tags associated with a test have no concept
|
|
13
|
-
# of being inclusive or exclusive. This distinction is only valid for tag
|
|
14
|
-
# filters.
|
|
15
|
-
#
|
|
16
|
-
# @param [Array] tags the list of tags to be associated with a test case.
|
|
17
|
-
#
|
|
18
|
-
# @return [void]
|
|
19
|
-
def tag(*tags)
|
|
20
|
-
Minitag.pending_tags = tags.map { |tag| tag.to_s.strip.downcase }
|
|
21
|
-
end
|
|
22
|
-
|
|
23
9
|
define_method(:method_added) do |name|
|
|
24
10
|
if name[/\Atest_/]
|
|
25
11
|
Minitag.context.add_tags(
|
|
@@ -40,5 +26,3 @@ module Minitag
|
|
|
40
26
|
end
|
|
41
27
|
end
|
|
42
28
|
end
|
|
43
|
-
|
|
44
|
-
Minitest::Test.singleton_class.prepend(Minitag::TagExtension)
|
data/lib/minitag/tag_registry.rb
CHANGED
data/lib/minitag/version.rb
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.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bernardo de Araujo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-07-
|
|
11
|
+
date: 2020-07-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -86,6 +86,7 @@ files:
|
|
|
86
86
|
- bin/setup
|
|
87
87
|
- lib/minitag.rb
|
|
88
88
|
- lib/minitag/context.rb
|
|
89
|
+
- lib/minitag/minitest_tag.rb
|
|
89
90
|
- lib/minitag/tag_extension.rb
|
|
90
91
|
- lib/minitag/tag_registry.rb
|
|
91
92
|
- lib/minitag/version.rb
|