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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab98e9f2debb23b27f21435a3b2ac0102a835391accb97fd7e1bae69457f4e07
4
- data.tar.gz: 538c9bc1789dd2080b3a8f8430c116d05693eb5c2dfee3f1204fe60c67e5e80a
3
+ metadata.gz: 9aa792615d3b3d3022a0b1372c951f0f7394a184bd296f9ca760fb69d2be7b2d
4
+ data.tar.gz: ca7add04befa59ab7141cfccc41475def049d1e3e7596bfcbaeecef55e909144
5
5
  SHA512:
6
- metadata.gz: '081ad2c7553abb897271b01e30d0561255ca5ee30128aac47f4dbee4ac29fd7a0de0e1954268c9325f9476823f6ffc16321b429fc9d98b0edc3fc20e10433ca6'
7
- data.tar.gz: 372cd5e85be6c5f7c35faf779e2ab197ac8a4d218dd11b13c43c2b5be2449aa7c14d4898208cc93c5410a24b2ec4e6290171c1d67dca332d8f9325706cb2eace
6
+ metadata.gz: 62a382576471b5223651ab76083afda212b43820dad6e23cc59d095d153e85048d81d09f38f3ca4d2f57dd758316f49ccedc48afd8ad99f84aa2554886d3ec24
7
+ data.tar.gz: 2fee9e38e0cfde38bdb4a71c806cee5c2395c5794aa4f3e46cfc863a8b634ee299163046693d671fc759e733b97d2fdd6b30d31ab370d77c36b549842c1a1e60
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitag (0.3.3)
4
+ minitag (0.4.0)
5
5
  minitest (~> 5.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Gem Version](https://badge.fury.io/rb/minitag.svg)](https://badge.fury.io/rb/minitag)
1
+ [![Gem Version](https://badge.fury.io/rb/minitag.svg)](https://badge.fury.io/rb/minitag) [![](https://github.com/bernardoamc/minitag/workflows/continuous-integration/badge.svg)](https://github.com/bernardoamc/minitag/actions?query=workflow%3Acontinuous-integration)
2
2
 
3
3
  # Minitag
4
4
 
@@ -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
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'set'
4
3
  require_relative './tag_registry'
5
4
 
6
5
  module Minitag
@@ -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 Minitest::Test.
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)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'set'
4
-
5
3
  module Minitag
6
4
  # Stores tags associated with a test name, which belongs to a namespace.
7
5
  # The namespace is usually the class which the test belongs to.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Minitag
4
- VERSION = '0.3.3'
4
+ VERSION = '0.4.0'
5
5
  end
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.3.3
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-12 00:00:00.000000000 Z
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